// 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_f32_2d;
struct futhark_f32_2d *futhark_new_f32_2d(struct futhark_context *ctx, const
                                          float *data, int64_t dim0,
                                          int64_t dim1);
struct futhark_f32_2d *futhark_new_raw_f32_2d(struct futhark_context *ctx, const
                                              CUdeviceptr data, int64_t offset,
                                              int64_t dim0, int64_t dim1);
int futhark_free_f32_2d(struct futhark_context *ctx,
                        struct futhark_f32_2d *arr);
int futhark_values_f32_2d(struct futhark_context *ctx,
                          struct futhark_f32_2d *arr, float *data);
CUdeviceptr futhark_values_raw_f32_2d(struct futhark_context *ctx,
                                      struct futhark_f32_2d *arr);
const int64_t *futhark_shape_f32_2d(struct futhark_context *ctx,
                                    struct futhark_f32_2d *arr);

// Opaque values


// Entry points
int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f32_2d **out0, const
                       struct futhark_f32_2d *in0, const int64_t in1, const
                       int64_t in2, const int64_t in3, const int64_t in4, const
                       int64_t in5);

// 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_80228[1];
static int32_t mainzicounter_mem_realtype_80303[10240];
static int32_t mainzicounter_mem_realtype_80337[10240];
static int32_t mainziid_counter_mem_realtype_80367[1];
static int32_t mainzicounter_mem_realtype_80449[10240];
static int32_t mainzicounter_mem_realtype_80500[10240];
static int32_t mainziid_counter_mem_realtype_80536[1];
static int32_t mainzicounter_mem_realtype_80624[10240];
static int32_t mainzicounter_mem_realtype_80689[10240];
static int32_t mainziid_counter_mem_realtype_80715[1];
static int32_t mainziid_counter_mem_realtype_80771[1];
static int32_t mainziid_counter_mem_realtype_80836[1];
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_f32zireplicate_78275(int32_t num_elems_78272,\n                                                      float val_78273, __global\n                                              ",
            "        unsigned char *mem_78271)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_78275;\n    int32_t replicate_ltid_78276;\n    int32_t replicate_gid_78277;\n    \n    replicate_gtid_78275 = get_global_id(0);\n    replicate_ltid_78276 = get_local_id(0);\n    replicate_gid_78277 = get_group_id(0);\n    \n    int64_t slice_78281 = num_elems_78272;\n    int64_t rep_i_78280 = sext_i32_i64(replicate_gtid_78275);\n    int64_t remnant_78282 = sext_i32_i64(replicate_gtid_78275) - rep_i_78280;\n    \n    if (slt64(replicate_gtid_78275, num_elems_78272)) {\n        ((__global float *) mem_78271)[rep_i_78280] = val_78273;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_78439(int32_t num_elems_78436,\n                                                      int64_t val_78437,\n                                                      __global\n                                                      unsigned char *mem_78435)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_78439;\n    int32_t replicate_ltid_78440;\n    int32_t replicate_gid_78441;\n    \n    replicate_gtid_78439 = get_global_id(0);\n    replicate_ltid_78440 = get_local_id(0);\n    replicate_gid_78441 = get_group_id(0);\n    \n    int64_t slice_78445 = num_elems_78436;\n    int64_t rep_i_78444 = sext_i32_i64(replicate_gtid_78439);\n    int64_t remnant_78446 = sext_i32_i64(replicate_gtid_78439) - rep_i_78444;\n    \n    if (slt64(replicate_gtid_78439, num_elems_78436)) {\n        ((__global int64_t *) mem_78435)[rep_i_78444] = val_78437;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i8zireplicate_78334(int32_t num_elems_78331,\n                                                     int8_t val_78332, __global\n                                                     unsigned char *mem_78330)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const ",
            "int block_dim2 = 2;\n    int32_t replicate_gtid_78334;\n    int32_t replicate_ltid_78335;\n    int32_t replicate_gid_78336;\n    \n    replicate_gtid_78334 = get_global_id(0);\n    replicate_ltid_78335 = get_local_id(0);\n    replicate_gid_78336 = get_group_id(0);\n    \n    int64_t slice_78340 = num_elems_78331;\n    int64_t rep_i_78339 = sext_i32_i64(replicate_gtid_78334);\n    int64_t remnant_78341 = sext_i32_i64(replicate_gtid_78334) - rep_i_78339;\n    \n    if (slt64(replicate_gtid_78334, num_elems_78331)) {\n        ((__global int8_t *) mem_78330)[rep_i_78339] = val_78332;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f32(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_4",
            "2 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t x_index_31 = get_global_id_0_37;\n    int32_t y_index_32 = get_group_id_1_41 * 32 + get_local_id_1_39;\n    float 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                           float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                              index_in_35)];\n                ((__local float *) 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                           float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                             33 + get_local_id_1_39 + j_43 *\n                                             8)];\n                ((__global float *) 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_f32_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, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t x_index_31 = get_group_id_0_40 * 16 * mulx_7 + get_local_id_0_38 +\n            srem32(get_local_id_1_39, mulx_7) * 16;\n    int32_t y_index_32 = get_group_id_1_41 * 16 + squot32(get_local_id_1_39,\n                                         ",
            "                 mulx_7);\n    float 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 float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n        ((__local float *) 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 float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                             17 + get_local_id_1_39)];\n        ((__global float *) 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_f32_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                                              unsign",
            "ed 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, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t x_index_31 = get_group_id_0_40 * 16 + squot32(get_local_id_0_38,\n                                                          muly_8);\n    int32_t y_index_32 = get_group_id_1_41 * 16 * muly_8 + get_local_id_1_39 +\n            srem32(get_local_id_0_38, muly_8) * 16;\n    float 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 float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n        ((__local float *) 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 (s",
            "lt32(x_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        val_44 = ((__local float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                             17 + get_local_id_1_39)];\n        ((__global float *) 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_f32_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    float val_44;\n    int32_t odata_offset_33 = squot32(destoffset_1, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    int32_t index_out_36 = x_index_31 * y_elems_6 + y_index_32;\n    \n    if (slt32(get_global_id_0_37, x_elems_5 * y_elems_6 * num_arrays_4)) {\n        val_44 = ((__global float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n        ((__global float *) 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 mainzisegmap_66881(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t jump_65348, int64_t n_m_65352,\n                                 int64_t i_65358, unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits,\n                                 float i64_res_65370, int64_t num_groups_66877,\n                                 int64_t num_threads_78201, __global\n                                 unsigned char *mem_76983, __global\n                                 unsigned char *mem_77077, __global\n                                 unsigned char *color_78129, __global\n                                 unsigned char *color_78130, __global\n                                 unsigned char *color_78131, __global\n                                 unsigned char *color_78132, __global\n                                 unsigned char *color_78133)\n{\n    bool x_65359",
            " = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_66876 (mainzisegmap_group_sizze_66697)\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_78287;\n    int32_t local_tid_78288;\n    int64_t group_sizze_78291;\n    int32_t wave_sizze_78290;\n    int32_t group_tid_78289;\n    \n    global_tid_78287 = get_global_id(0);\n    local_tid_78288 = get_local_id(0);\n    group_sizze_78291 = get_local_size(0);\n    wave_sizze_78290 = LOCKSTEP_WIDTH;\n    group_tid_78289 = get_group_id(0);\n    \n    int32_t phys_tid_66881 = global_tid_78287;\n    int32_t phys_group_id_78292;\n    \n    phys_group_id_78292 = get_group_id(0);\n    for (int32_t i_78293 = 0; i_78293 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343, segmap_group_sizze_66876)) -\n                   phys_group_id_78292, sext_i64_i32(num_groups_66877));\n         i_78293++) {\n        int32_t virt_group_id_78294 = phys_group_id_78292 + i_78293 *\n                sext_i64_i32(num_groups_66877);\n        int64_t global_tid_78295 = sext_i32_i64(virt_group_id_78294) *\n                segmap_group_sizze_66876 + sext_i32_i64(local_tid_78288);\n        int64_t slice_78296 = m_65343;\n        int64_t gtid_66880 = global_tid_78295;\n        int64_t remnant_78297 = global_tid_78295 - gtid_66880;\n        \n        if (slt64(gtid_66880, m_65343)) {\n            int64_t discard_76791;\n            int64_t scanacc_76787 = (int64_t) 0;\n            \n            for (int64_t i_76789 = 0; i_76789 < n_65344; i_76789++) {\n                float x_66887;\n                \n                x_66887 = ((__global float *) mem_76983)[i_76789 * m_65343 +\n                                                         gtid_66",
            "880];\n                \n                bool isnan_res_66888;\n                \n                isnan_res_66888 = futrts_isnan32(x_66887);\n                \n                bool defunc_0_p_res_66889 = !isnan_res_66888;\n                int64_t defunc_0_f_res_66890 =\n                        btoi_bool_i64(defunc_0_p_res_66889);\n                int64_t defunc_1_op_res_66886 = add64(defunc_0_f_res_66890,\n                                                      scanacc_76787);\n                \n                ((__global int64_t *) color_78131)[phys_tid_66881 + i_76789 *\n                                                   num_threads_78201] =\n                    defunc_1_op_res_66886;\n                \n                int64_t scanacc_tmp_78298 = defunc_1_op_res_66886;\n                \n                scanacc_76787 = scanacc_tmp_78298;\n            }\n            discard_76791 = scanacc_76787;\n            \n            int64_t last_res_66891;\n            \n            last_res_66891 = ((__global int64_t *) color_78131)[phys_tid_66881 +\n                                                                i_65358 *\n                                                                num_threads_78201];\n            for (int64_t i_78300 = 0; i_78300 < n_65344; i_78300++) {\n                ((__global float *) color_78133)[phys_tid_66881 + i_78300 *\n                                                 num_threads_78201] = 0.0F;\n            }\n            for (int64_t i_78301 = 0; i_78301 < n_65344; i_78301++) {\n                ((__global int64_t *) color_78132)[phys_tid_66881 + i_78301 *\n                                                   num_threads_78201] =\n                    (int64_t) -1;\n            }\n            for (int64_t write_iter_76792 = 0; write_iter_76792 < n_65344;\n                 write_iter_76792++) {\n                float write_iv_76795;\n                \n                write_iv_76795 = ((__global\n                                   float *) mem_76983)[write_iter_76792 *\n                   ",
            "                                    m_65343 + gtid_66880];\n                \n                bool isnan_res_66899;\n                \n                isnan_res_66899 = futrts_isnan32(write_iv_76795);\n                \n                bool defunc_0_p_res_66900 = !isnan_res_66899;\n                int64_t defunc_1_f_res_66901;\n                \n                if (defunc_0_p_res_66900) {\n                    int64_t write_iv_76796;\n                    \n                    write_iv_76796 = ((__global\n                                       int64_t *) color_78131)[phys_tid_66881 +\n                                                               write_iter_76792 *\n                                                               num_threads_78201];\n                    \n                    int64_t defunc_1_f_res_t_res_66902 = sub64(write_iv_76796,\n                                                               (int64_t) 1);\n                    \n                    defunc_1_f_res_66901 = defunc_1_f_res_t_res_66902;\n                } else {\n                    defunc_1_f_res_66901 = (int64_t) -1;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_66901) &&\n                    slt64(defunc_1_f_res_66901, n_65344)) {\n                    ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                       defunc_1_f_res_66901 *\n                                                       num_threads_78201] =\n                        write_iter_76792;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_66901) &&\n                    slt64(defunc_1_f_res_66901, n_65344)) {\n                    for (int64_t i_78304 = 0; i_78304 < (int64_t) 1;\n                         i_78304++) {\n                        float tmp_78305;\n                        \n                        tmp_78305 = ((__global float *) mem_76983)[m_65343 *\n                                                                   write_iter_76792 +\n                    ",
            "                                               gtid_66880 +\n                                                                   i_78304 *\n                                                                   m_65343];\n                        ((__global float *) color_78133)[phys_tid_66881 +\n                                                         num_threads_78201 *\n                                                         defunc_1_f_res_66901 +\n                                                         i_78304 *\n                                                         num_threads_78201] =\n                            tmp_78305;\n                    }\n                }\n            }\n            for (int64_t i_76802 = 0; i_76802 < n_65344; i_76802++) {\n                int64_t x_66904;\n                \n                x_66904 = ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                             i_76802 *\n                                                             num_threads_78201];\n                \n                int64_t defunc_0_f_res_66905 = add64((int64_t) 1, x_66904);\n                \n                ((__global int64_t *) color_78131)[phys_tid_66881 + i_76802 *\n                                                   num_threads_78201] =\n                    defunc_0_f_res_66905;\n            }\n            \n            int64_t min_arg_66906 = sub64(last_res_66891, (int64_t) 1);\n            int64_t min_arg_66907 = sub64(last_res_66891, min_res_65364);\n            int64_t min_res_66908 = smin64(q_65346, last_res_66891);\n            float i64_res_66909 = sitofp_i64_f32(last_res_66891);\n            float x_66910 = i64_res_65370 - i64_res_66909;\n            float max_arg_66911 = x_66910 / 2.0F;\n            float max_res_66912 = fmax32(0.0F, max_arg_66911);\n            \n            for (int64_t i_76806 = 0; i_76806 < q_65346; i_76806++) {\n                bool cond_66915 = sle64(last_res_66891, i_76806);\n                float defunc_0_f_res",
            "_66916;\n                \n                if (cond_66915) {\n                    defunc_0_f_res_66916 = 0.0F;\n                } else {\n                    defunc_0_f_res_66916 = 1.0F;\n                }\n                ((__global float *) color_78130)[phys_tid_66881 + i_76806 *\n                                                 num_threads_78201] =\n                    defunc_0_f_res_66916;\n            }\n            for (int64_t i_76810 = 0; i_76810 < n_m_65352; i_76810++) {\n                int64_t min_arg_66919 = mul64(jump_65348, i_76810);\n                int64_t min_res_66920 = smin64(i_65358, min_arg_66919);\n                int64_t defunc_0_g_res_66921 = add64((int64_t) 1,\n                                                     min_res_66920);\n                bool init_idx_66922;\n                int64_t init_idx_66923;\n                int64_t init_idx_66924;\n                bool loop_while_66925;\n                int64_t low_66926;\n                int64_t high_66927;\n                \n                loop_while_66925 = x_65359;\n                low_66926 = (int64_t) 0;\n                high_66927 = i_65358;\n                while (loop_while_66925) {\n                    int64_t x_66928 = add64(low_66926, high_66927);\n                    int64_t mid_66929 = sdiv64(x_66928, (int64_t) 2);\n                    bool x_66930 = sle64((int64_t) 0, mid_66929);\n                    bool y_66931 = slt64(mid_66929, n_65344);\n                    bool bounds_check_66932 = x_66930 && y_66931;\n                    bool index_certs_66933;\n                    \n                    if (!bounds_check_66932) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          0) == -1) {\n                                global_failure_args[0] = (int64_t) mid_66929;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n     ",
            "                       local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t mid_id_66934;\n                    \n                    mid_id_66934 = ((__global\n                                     int64_t *) color_78131)[phys_tid_66881 +\n                                                             mid_66929 *\n                                                             num_threads_78201];\n                    \n                    bool cond_66935 = slt64(mid_id_66934, (int64_t) 0);\n                    int64_t mid_idx_66936;\n                    \n                    if (cond_66935) {\n                        mid_idx_66936 = (int64_t) 9223372036854775807;\n                    } else {\n                        mid_idx_66936 = mid_id_66934;\n                    }\n                    \n                    bool cond_66937 = sle64(defunc_0_g_res_66921,\n                                            mid_idx_66936);\n                    int64_t loopres_66938;\n                    int64_t loopres_66939;\n                    \n                    if (cond_66937) {\n                        int64_t loopres_t_res_66940 = sub64(mid_66929,\n                                                            (int64_t) 1);\n                        \n                        loopres_66938 = low_66926;\n                        loopres_66939 = loopres_t_res_66940;\n                    } else {\n                        int64_t loopres_f_res_66941 = add64((int64_t) 1,\n                                                            mid_66929);\n                        \n                        loopres_66938 = loopres_f_res_66941;\n                        loopres_66939 = high_66927;\n                    }\n                    \n                    bool loop_cond_66942 = sle64(loopres_66938, loopres_66939);\n                    bool loop_while_tmp_78309 = loop_cond_66942;\n                    int64_t low_tmp_78310 = loopres_66938;",
            "\n                    int64_t high_tmp_78311 = loopres_66939;\n                    \n                    loop_while_66925 = loop_while_tmp_78309;\n                    low_66926 = low_tmp_78310;\n                    high_66927 = high_tmp_78311;\n                }\n                init_idx_66922 = loop_while_66925;\n                init_idx_66923 = low_66926;\n                init_idx_66924 = high_66927;\n                \n                bool idx_66943;\n                int64_t idx_66944;\n                int64_t idx_66945;\n                int64_t idx_66946;\n                bool loop_while_66947;\n                int64_t l_idx_66948;\n                int64_t r_idx_66949;\n                int64_t span_66950;\n                \n                loop_while_66947 = loop_cond_65369;\n                l_idx_66948 = init_idx_66923;\n                r_idx_66949 = init_idx_66923;\n                span_66950 = (int64_t) 1;\n                while (loop_while_66947) {\n                    int64_t max_arg_66951 = sub64(l_idx_66948, (int64_t) 1);\n                    int64_t max_res_66952 = smax64((int64_t) 0, max_arg_66951);\n                    int64_t min_arg_66953 = add64((int64_t) 1, r_idx_66949);\n                    int64_t min_res_66954 = smin64(min_arg_66906,\n                                                   min_arg_66953);\n                    bool x_66955 = sle64((int64_t) 0, max_res_66952);\n                    bool y_66956 = slt64(max_res_66952, n_65344);\n                    bool bounds_check_66957 = x_66955 && y_66956;\n                    bool index_certs_66958;\n                    \n                    if (!bounds_check_66957) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          1) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) max_res_66952;\n                                global_failure_args[1] = (int64_t) n_65344;\n     ",
            "                           ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_66959;\n                    \n                    x_66959 = ((__global\n                                int64_t *) color_78131)[phys_tid_66881 +\n                                                        max_res_66952 *\n                                                        num_threads_78201];\n                    \n                    int64_t abs_arg_66960 = sub64(x_66959,\n                                                  defunc_0_g_res_66921);\n                    int64_t abs_res_66961 = abs64(abs_arg_66960);\n                    bool x_66962 = sle64((int64_t) 0, min_res_66954);\n                    bool y_66963 = slt64(min_res_66954, n_65344);\n                    bool bounds_check_66964 = x_66962 && y_66963;\n                    bool index_certs_66965;\n                    \n                    if (!bounds_check_66964) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          2) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) min_res_66954;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_66966;\n                    \n                    x_66966 = ((__global\n                                int64_t *) color_78131)[phys_tid_66881 +\n                                                        min_res_66954 *\n                                                        num_threads_78201];\n              ",
            "      \n                    int64_t abs_arg_66967 = sub64(x_66966,\n                                                  defunc_0_g_res_66921);\n                    int64_t abs_res_66968 = abs64(abs_arg_66967);\n                    bool cond_66969 = max_res_66952 == l_idx_66948;\n                    int64_t loopres_66970;\n                    int64_t loopres_66971;\n                    int64_t loopres_66972;\n                    \n                    if (cond_66969) {\n                        loopres_66970 = l_idx_66948;\n                        loopres_66971 = r_idx_66949;\n                        loopres_66972 = min_res_65364;\n                    } else {\n                        bool cond_66973 = slt64(abs_res_66961, abs_res_66968);\n                        bool cond_f_res_66974 = min_res_66954 == r_idx_66949;\n                        bool x_66975 = !cond_66973;\n                        bool y_66976 = cond_f_res_66974 && x_66975;\n                        bool cond_66977 = cond_66973 || y_66976;\n                        int64_t loopres_f_res_66978;\n                        \n                        if (cond_66977) {\n                            loopres_f_res_66978 = max_res_66952;\n                        } else {\n                            loopres_f_res_66978 = l_idx_66948;\n                        }\n                        \n                        int64_t loopres_f_res_66979;\n                        \n                        if (cond_66977) {\n                            loopres_f_res_66979 = r_idx_66949;\n                        } else {\n                            loopres_f_res_66979 = min_res_66954;\n                        }\n                        \n                        int64_t loopres_f_res_66980;\n                        \n                        if (cond_66977) {\n                            int64_t loopres_f_res_t_res_66981 =\n                                    add64((int64_t) 1, span_66950);\n                            \n                            loopres_f_res_66980 = loopres_f_re",
            "s_t_res_66981;\n                        } else {\n                            int64_t loopres_f_res_f_res_66982 =\n                                    add64((int64_t) 1, span_66950);\n                            \n                            loopres_f_res_66980 = loopres_f_res_f_res_66982;\n                        }\n                        loopres_66970 = loopres_f_res_66978;\n                        loopres_66971 = loopres_f_res_66979;\n                        loopres_66972 = loopres_f_res_66980;\n                    }\n                    \n                    bool loop_cond_66983 = slt64(loopres_66972, min_res_65364);\n                    bool loop_while_tmp_78312 = loop_cond_66983;\n                    int64_t l_idx_tmp_78313 = loopres_66970;\n                    int64_t r_idx_tmp_78314 = loopres_66971;\n                    int64_t span_tmp_78315 = loopres_66972;\n                    \n                    loop_while_66947 = loop_while_tmp_78312;\n                    l_idx_66948 = l_idx_tmp_78313;\n                    r_idx_66949 = r_idx_tmp_78314;\n                    span_66950 = span_tmp_78315;\n                }\n                idx_66943 = loop_while_66947;\n                idx_66944 = l_idx_66948;\n                idx_66945 = r_idx_66949;\n                idx_66946 = span_66950;\n                \n                int64_t min_res_66984 = smin64(min_arg_66907, idx_66944);\n                int64_t max_res_66985 = smax64((int64_t) 0, min_res_66984);\n                int64_t x_66986 = add64(min_res_66908, max_res_66985);\n                int64_t r_66987 = sub64(x_66986, (int64_t) 1);\n                bool x_66988 = sle64((int64_t) 0, r_66987);\n                bool y_66989 = slt64(r_66987, n_65344);\n                bool bounds_check_66990 = x_66988 && y_66989;\n                bool index_certs_66991;\n                \n                if (!bounds_check_66990) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 3) ==\n                            -1) {\n ",
            "                           global_failure_args[0] = (int64_t) r_66987;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_66992;\n                \n                x_66992 = ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                             r_66987 *\n                                                             num_threads_78201];\n                \n                int64_t abs_arg_66993 = sub64(x_66992, min_res_66920);\n                int64_t abs_res_66994 = abs64(abs_arg_66993);\n                bool x_66995 = sle64((int64_t) 0, max_res_66985);\n                bool y_66996 = slt64(max_res_66985, n_65344);\n                bool bounds_check_66997 = x_66995 && y_66996;\n                bool index_certs_66998;\n                \n                if (!bounds_check_66997) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_66985;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_66999;\n                \n                x_66999 = ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                             max_res_66985 *\n                                                             num_threads_78201];\n                \n                int64_t abs_arg_67000 = sub64(x_66999, min_res_66920);\n                int64_t abs_res_67001 = abs64(abs_arg_67000);\n                int64",
            "_t max_res_67002 = smax64(abs_res_66994, abs_res_67001);\n                float defunc_0_f_res_67003 = sitofp_i64_f32(max_res_67002);\n                float defunc_1_f_res_67004 = max_res_66912 +\n                      defunc_0_f_res_67003;\n                float defunc_2_reduce_res_67005;\n                float redout_76812 = 0.0F;\n                \n                for (int64_t i_76813 = 0; i_76813 < q_65346; i_76813++) {\n                    float x_67010;\n                    \n                    x_67010 = ((__global float *) color_78130)[phys_tid_66881 +\n                                                               i_76813 *\n                                                               num_threads_78201];\n                    \n                    bool cond_67011 = sle64(last_res_66891, i_76813);\n                    int64_t defunc_0_f_res_67012;\n                    \n                    if (cond_67011) {\n                        defunc_0_f_res_67012 = (int64_t) 0;\n                    } else {\n                        int64_t i_67013 = add64(max_res_66985, i_76813);\n                        int64_t defunc_0_add_arg_67014;\n                        \n                        defunc_0_add_arg_67014 = ((__global\n                                                   int64_t *) color_78132)[phys_tid_66881 +\n                                                                           i_67013 *\n                                                                           num_threads_78201];\n                        \n                        int64_t defunc_1_add_res_67015 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_67014);\n                        \n                        defunc_0_f_res_67012 = defunc_1_add_res_67015;\n                    }\n                    \n                    int64_t binop_p_67016 = sub64(defunc_0_f_res_67012,\n                                                  min_res_66920);\n                    float defunc_0_f_res_67017",
            " = sitofp_i64_f32(binop_p_67016);\n                    float abs_res_67018 = (float) fabs(defunc_0_f_res_67017);\n                    float tmp1_67019 = abs_res_67018 / defunc_1_f_res_67004;\n                    float x_67020 = tmp1_67019 * tmp1_67019;\n                    float y_67021 = tmp1_67019 * x_67020;\n                    float tmp2_67022 = 1.0F - y_67021;\n                    float x_67023 = tmp2_67022 * tmp2_67022;\n                    float tmp3_67024 = tmp2_67022 * x_67023;\n                    float w_j_67025 = x_67010 * tmp3_67024;\n                    float defunc_1_op_res_67008 = w_j_67025 + redout_76812;\n                    float redout_tmp_78316 = defunc_1_op_res_67008;\n                    \n                    redout_76812 = redout_tmp_78316;\n                }\n                defunc_2_reduce_res_67005 = redout_76812;\n                \n                float a0_67026 = 1.0F / defunc_2_reduce_res_67005;\n                float defunc_2_reduce_res_67027;\n                float redout_76814 = 0.0F;\n                \n                for (int64_t i_76815 = 0; i_76815 < q_65346; i_76815++) {\n                    float x_67032;\n                    \n                    x_67032 = ((__global float *) color_78130)[phys_tid_66881 +\n                                                               i_76815 *\n                                                               num_threads_78201];\n                    \n                    bool cond_67033 = sle64(last_res_66891, i_76815);\n                    int64_t defunc_0_f_res_67034;\n                    \n                    if (cond_67033) {\n                        defunc_0_f_res_67034 = (int64_t) 0;\n                    } else {\n                        int64_t i_67035 = add64(max_res_66985, i_76815);\n                        int64_t defunc_0_add_arg_67036;\n                        \n                        defunc_0_add_arg_67036 = ((__global\n                                                   int64_t *) color_78132)[phys_tid_66881 +\n       ",
            "                                                                    i_67035 *\n                                                                           num_threads_78201];\n                        \n                        int64_t defunc_1_add_res_67037 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_67036);\n                        \n                        defunc_0_f_res_67034 = defunc_1_add_res_67037;\n                    }\n                    \n                    int64_t binop_p_67038 = sub64(defunc_0_f_res_67034,\n                                                  min_res_66920);\n                    float defunc_0_f_res_67039 = sitofp_i64_f32(binop_p_67038);\n                    float abs_res_67040 = (float) fabs(defunc_0_f_res_67039);\n                    float tmp1_67041 = abs_res_67040 / defunc_1_f_res_67004;\n                    float x_67042 = tmp1_67041 * tmp1_67041;\n                    float y_67043 = tmp1_67041 * x_67042;\n                    float tmp2_67044 = 1.0F - y_67043;\n                    float x_67045 = tmp2_67044 * tmp2_67044;\n                    float tmp3_67046 = tmp2_67044 * x_67045;\n                    float tmp4_67047 = x_67032 * tmp3_67046;\n                    float defunc_0_f_res_67048;\n                    \n                    if (cond_67033) {\n                        defunc_0_f_res_67048 = 0.0F;\n                    } else {\n                        int64_t i_67049 = add64(max_res_66985, i_76815);\n                        float defunc_0_add_arg_67050;\n                        \n                        defunc_0_add_arg_67050 = ((__global\n                                                   float *) color_78133)[phys_tid_66881 +\n                                                                         i_67049 *\n                                                                         num_threads_78201];\n                        defunc_0_f_res_67048 = defunc_0_add_arg_67050;\n                    }\n         ",
            "           \n                    float x_67051 = a0_67026 * tmp4_67047;\n                    float defunc_9_fit_fun_res_67052 = defunc_0_f_res_67048 *\n                          x_67051;\n                    float defunc_1_op_res_67030 = defunc_9_fit_fun_res_67052 +\n                          redout_76814;\n                    float redout_tmp_78317 = defunc_1_op_res_67030;\n                    \n                    redout_76814 = redout_tmp_78317;\n                }\n                defunc_2_reduce_res_67027 = redout_76814;\n                ((__global float *) color_78129)[phys_tid_66881 + i_76810 *\n                                                 num_threads_78201] =\n                    defunc_2_reduce_res_67027;\n            }\n            for (int64_t i_78318 = 0; i_78318 < n_m_65352; i_78318++) {\n                float tmp_78319;\n                \n                tmp_78319 = ((__global float *) color_78129)[phys_tid_66881 +\n                                                             i_78318 *\n                                                             num_threads_78201];\n                ((__global float *) mem_77077)[gtid_66880 + i_78318 * m_65343] =\n                    tmp_78319;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_66876\n}\n__kernel void mainzisegmap_67903(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77082, __global\n                                 unsigned char *mem_77086, __global\n                                 unsigned char *mem_77090)\n{\n    #define segmap_group_sizze_67897 (mainzisegmap_group_sizze_67738)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_7",
            "8447;\n    int32_t local_tid_78448;\n    int64_t group_sizze_78451;\n    int32_t wave_sizze_78450;\n    int32_t group_tid_78449;\n    \n    global_tid_78447 = get_global_id(0);\n    local_tid_78448 = get_local_id(0);\n    group_sizze_78451 = get_local_size(0);\n    wave_sizze_78450 = LOCKSTEP_WIDTH;\n    group_tid_78449 = get_group_id(0);\n    \n    int32_t phys_tid_67903 = global_tid_78447;\n    int64_t global_tid_78452 = sext_i32_i64(group_tid_78449) *\n            segmap_group_sizze_67897 + sext_i32_i64(local_tid_78448);\n    int64_t slice_78453 = n_65344;\n    int64_t slice_78454 = m_65343 * slice_78453;\n    int64_t gtid_67901 = squot64(global_tid_78452, slice_78453);\n    int64_t remnant_78455 = global_tid_78452 - gtid_67901 * slice_78453;\n    int64_t gtid_67902 = remnant_78455;\n    int64_t remnant_78456 = remnant_78455 - gtid_67902;\n    \n    if (slt64(gtid_67901, m_65343) && slt64(gtid_67902, n_65344)) {\n        float x_67904;\n        \n        x_67904 = ((__global float *) Y_mem_76976)[gtid_67901 * n_65344 +\n                                                   gtid_67902];\n        \n        bool isnan_res_67907;\n        \n        isnan_res_67907 = futrts_isnan32(x_67904);\n        \n        bool defunc_0_p_res_67908 = !isnan_res_67907;\n        int64_t defunc_1_f_res_67909;\n        \n        if (defunc_0_p_res_67908) {\n            int64_t x_67905;\n            \n            x_67905 = ((__global int64_t *) mem_77082)[gtid_67901 * n_65344 +\n                                                       gtid_67902];\n            \n            int64_t defunc_1_f_res_t_res_67910 = sub64(x_67905, (int64_t) 1);\n            \n            defunc_1_f_res_67909 = defunc_1_f_res_t_res_67910;\n        } else {\n            defunc_1_f_res_67909 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_67901) && slt64(gtid_67901, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_67909) &&\n             slt64(defunc_1_f_res_67909, n_65344))) {\n            ((__global int64_t *) mem_77090)[gtid_67901 * ",
            "n_65344 +\n                                             defunc_1_f_res_67909] = gtid_67902;\n        }\n        if ((sle64((int64_t) 0, gtid_67901) && slt64(gtid_67901, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_67909) &&\n             slt64(defunc_1_f_res_67909, n_65344))) {\n            ((__global float *) mem_77086)[gtid_67901 * n_65344 +\n                                           defunc_1_f_res_67909] = x_67904;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67897\n}\n__kernel void mainzisegmap_67922(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77090, __global\n                                 unsigned char *mem_77096)\n{\n    #define segmap_group_sizze_67917 (mainzisegmap_group_sizze_67712)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78457;\n    int32_t local_tid_78458;\n    int64_t group_sizze_78461;\n    int32_t wave_sizze_78460;\n    int32_t group_tid_78459;\n    \n    global_tid_78457 = get_global_id(0);\n    local_tid_78458 = get_local_id(0);\n    group_sizze_78461 = get_local_size(0);\n    wave_sizze_78460 = LOCKSTEP_WIDTH;\n    group_tid_78459 = get_group_id(0);\n    \n    int32_t phys_tid_67922 = global_tid_78457;\n    int64_t global_tid_78462 = sext_i32_i64(group_tid_78459) *\n            segmap_group_sizze_67917 + sext_i32_i64(local_tid_78458);\n    int64_t slice_78463 = n_65344;\n    int64_t slice_78464 = m_65343 * slice_78463;\n    int64_t gtid_67920 = squot64(global_tid_78462, slice_78463);\n    int64_t remnant_78465 = global_tid_78462 - gtid_67920 * slice_78463;\n    int64_t gtid_67921 = remnant_78465;\n    int64_t remnant_78466 = remnant_78465 - gtid_67921;\n    \n    if (slt64(gtid_67920, m_65343) && slt64(gtid_67921, n_65344)) {\n        int64_t x_67923;\n        \n        x_67923 = ((__global int",
            "64_t *) mem_77090)[gtid_67920 * n_65344 +\n                                                   gtid_67921];\n        \n        int64_t defunc_0_f_res_67924 = add64((int64_t) 1, x_67923);\n        \n        ((__global int64_t *) mem_77096)[gtid_67920 * n_65344 + gtid_67921] =\n            defunc_0_f_res_67924;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67917\n}\n__kernel void mainzisegmap_67934(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77082, __global\n                                 unsigned char *mem_77100, __global\n                                 unsigned char *mem_77103, __global\n                                 unsigned char *mem_77106, __global\n                                 unsigned char *mem_77109)\n{\n    #define segmap_group_sizze_67927 (mainzisegmap_group_sizze_67686)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78467;\n    int32_t local_tid_78468;\n    int64_t group_sizze_78471;\n    int32_t wave_sizze_78470;\n    int32_t group_tid_78469;\n    \n    global_tid_78467 = get_global_id(0);\n    local_tid_78468 = get_local_id(0);\n    group_sizze_78471 = get_local_size(0);\n    wave_sizze_78470 = LOCKSTEP_WIDTH;\n    group_tid_78469 = get_group_id(0);\n    \n    int32_t phys_tid_67934 = global_tid_78467;\n    int64_t global_tid_78472 = sext_i32_i64(group_tid_78469) *\n            segmap_group_sizze_67927 + sext_i32_i64(local_tid_78468);\n    int64_t slice_78473 = m_65343;\n    int64_t gtid_67933 = global_tid_78472;\n    int64_t remnant_78474 = global_tid_78472 - gtid_67933;\n    \n    if (slt64(gtid_67933, m_65343)) {\n        int64_t last_res_67935;\n        \n        last_res_67935 = (",
            "(__global int64_t *) mem_77082)[gtid_67933 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_67936 = sub64(last_res_67935, (int64_t) 1);\n        int64_t min_arg_67937 = sub64(last_res_67935, min_res_65364);\n        int64_t min_res_67938 = smin64(q_65346, last_res_67935);\n        float i64_res_67939 = sitofp_i64_f32(last_res_67935);\n        float x_67940 = i64_res_65370 - i64_res_67939;\n        float max_arg_67941 = x_67940 / 2.0F;\n        float max_res_67942 = fmax32(0.0F, max_arg_67941);\n        \n        ((__global int64_t *) mem_77100)[gtid_67933] = min_arg_67936;\n        ((__global int64_t *) mem_77103)[gtid_67933] = min_arg_67937;\n        ((__global int64_t *) mem_77106)[gtid_67933] = min_res_67938;\n        ((__global float *) mem_77109)[gtid_67933] = max_res_67942;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67927\n}\n__kernel void mainzisegmap_67954(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77082, __global\n                                 unsigned char *mem_77114)\n{\n    #define segmap_group_sizze_67949 (mainzisegmap_group_sizze_67661)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78475;\n    int32_t local_tid_78476;\n    int64_t group_sizze_78479;\n    int32_t wave_sizze_78478;\n    int32_t group_tid_78477;\n    \n    global_tid_78475 = get_global_id(0);\n    local_tid_78476 = get_local_id(0);\n    group_sizze_78479 = get_local_size(0);\n    wave_sizze_78478 = LOCKSTEP_WIDTH;\n    group_tid_78477 = get_group_id(0);\n    \n    int32_t phys_tid_67954 = global_tid_78475;\n    int64_t global_tid_78480 = sext_i32_i64(group_tid_78477) *\n            segmap_group_sizze_67949 + sext_i32_i64(local_",
            "tid_78476);\n    int64_t slice_78481 = q_65346;\n    int64_t slice_78482 = m_65343 * slice_78481;\n    int64_t gtid_67952 = squot64(global_tid_78480, slice_78481);\n    int64_t remnant_78483 = global_tid_78480 - gtid_67952 * slice_78481;\n    int64_t gtid_67953 = remnant_78483;\n    int64_t remnant_78484 = remnant_78483 - gtid_67953;\n    \n    if (slt64(gtid_67952, m_65343) && slt64(gtid_67953, q_65346)) {\n        int64_t last_res_67955;\n        \n        last_res_67955 = ((__global int64_t *) mem_77082)[gtid_67952 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_67957 = sle64(last_res_67955, gtid_67953);\n        float defunc_0_f_res_67958;\n        \n        if (cond_67957) {\n            defunc_0_f_res_67958 = 0.0F;\n        } else {\n            defunc_0_f_res_67958 = 1.0F;\n        }\n        ((__global float *) mem_77114)[gtid_67952 * q_65346 + gtid_67953] =\n            defunc_0_f_res_67958;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67949\n}\n__kernel void mainzisegmap_68125(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits, __global\n                                 unsigned char *mem_77090, __global\n                                 unsigned char *mem_77096, __global\n                                 unsigned char *mem_77100, __global\n                                 unsigned char *mem_77103, __global\n                                 unsigned char *mem_77106, __global\n                                 unsigned char *mem_77109, __global\n                      ",
            "           unsigned char *mem_77166, __global\n                                 unsigned char *mem_77170, __global\n                                 unsigned char *mem_77174)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_68118 (mainzisegmap_group_sizze_67347)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78519;\n    int32_t local_tid_78520;\n    int64_t group_sizze_78523;\n    int32_t wave_sizze_78522;\n    int32_t group_tid_78521;\n    \n    global_tid_78519 = get_global_id(0);\n    local_tid_78520 = get_local_id(0);\n    group_sizze_78523 = get_local_size(0);\n    wave_sizze_78522 = LOCKSTEP_WIDTH;\n    group_tid_78521 = get_group_id(0);\n    \n    int32_t phys_tid_68125 = global_tid_78519;\n    int64_t global_tid_78524 = sext_i32_i64(group_tid_78521) *\n            segmap_group_sizze_68118 + sext_i32_i64(local_tid_78520);\n    int64_t slice_78525 = n_m_65352;\n    int64_t slice_78526 = m_65343 * slice_78525;\n    int64_t gtid_68123 = squot64(global_tid_78524, slice_78525);\n    int64_t remnant_78527 = global_tid_78524 - gtid_68123 * slice_78525;\n    int64_t gtid_68124 = remnant_78527;\n    int64_t remnant_78528 = remnant_78527 - gtid_68124;\n    \n    if (slt64(gtid_68123, m_65343) && slt64(gtid_68124, n_m_65352)) {\n        int64_t min_arg_68128;\n        \n        min_arg_68128 = ((__global int64_t *) mem_77100)[gtid_68123];\n        \n        int64_t min_arg_68129;\n        \n        min_arg_68129 = ((__global int64_t *) mem_77103)[gtid_68123];\n        \n        int64_t min_res_68130;\n        \n        min_res_68130 = ((__global int64_t *) mem_77106)[gtid_68123];\n        \n        float max_res_68131;\n        \n        max_res_68131 = ((__global float *) mem_77109)[gtid_68123];\n        \n        int64_t min_arg_68133 = mul64(jump_65348, gtid_68124);\n        int64_t min_res_68134 = smin64(i_65358,",
            " min_arg_68133);\n        int64_t defunc_0_g_res_68135 = add64((int64_t) 1, min_res_68134);\n        bool init_idx_68136;\n        int64_t init_idx_68137;\n        int64_t init_idx_68138;\n        bool loop_while_68139;\n        int64_t low_68140;\n        int64_t high_68141;\n        \n        loop_while_68139 = x_65359;\n        low_68140 = (int64_t) 0;\n        high_68141 = i_65358;\n        while (loop_while_68139) {\n            int64_t x_68142 = add64(low_68140, high_68141);\n            int64_t mid_68143 = sdiv64(x_68142, (int64_t) 2);\n            bool x_68144 = sle64((int64_t) 0, mid_68143);\n            bool y_68145 = slt64(mid_68143, n_65344);\n            bool bounds_check_68146 = x_68144 && y_68145;\n            bool index_certs_68147;\n            \n            if (!bounds_check_68146) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 10) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_68143;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_68148;\n            \n            mid_id_68148 = ((__global int64_t *) mem_77096)[gtid_68123 *\n                                                            n_65344 +\n                                                            mid_68143];\n            \n            bool cond_68149 = slt64(mid_id_68148, (int64_t) 0);\n            int64_t mid_idx_68150;\n            \n            if (cond_68149) {\n                mid_idx_68150 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_68150 = mid_id_68148;\n            }\n            \n            bool cond_68151 = sle64(defunc_0_g_res_68135, mid_idx_68150);\n            int64_t loopres_68152;\n            int64_t loopres_68153;\n            \n            if (cond_68151) {\n                int64_t loopres_t_res_68154 = sub64(mid_68143,",
            " (int64_t) 1);\n                \n                loopres_68152 = low_68140;\n                loopres_68153 = loopres_t_res_68154;\n            } else {\n                int64_t loopres_f_res_68155 = add64((int64_t) 1, mid_68143);\n                \n                loopres_68152 = loopres_f_res_68155;\n                loopres_68153 = high_68141;\n            }\n            \n            bool loop_cond_68156 = sle64(loopres_68152, loopres_68153);\n            bool loop_while_tmp_78529 = loop_cond_68156;\n            int64_t low_tmp_78530 = loopres_68152;\n            int64_t high_tmp_78531 = loopres_68153;\n            \n            loop_while_68139 = loop_while_tmp_78529;\n            low_68140 = low_tmp_78530;\n            high_68141 = high_tmp_78531;\n        }\n        init_idx_68136 = loop_while_68139;\n        init_idx_68137 = low_68140;\n        init_idx_68138 = high_68141;\n        \n        bool idx_68157;\n        int64_t idx_68158;\n        int64_t idx_68159;\n        int64_t idx_68160;\n        bool loop_while_68161;\n        int64_t l_idx_68162;\n        int64_t r_idx_68163;\n        int64_t span_68164;\n        \n        loop_while_68161 = loop_cond_65369;\n        l_idx_68162 = init_idx_68137;\n        r_idx_68163 = init_idx_68137;\n        span_68164 = (int64_t) 1;\n        while (loop_while_68161) {\n            int64_t max_arg_68165 = sub64(l_idx_68162, (int64_t) 1);\n            int64_t max_res_68166 = smax64((int64_t) 0, max_arg_68165);\n            int64_t min_arg_68167 = add64((int64_t) 1, r_idx_68163);\n            int64_t min_res_68168 = smin64(min_arg_68128, min_arg_68167);\n            bool x_68169 = sle64((int64_t) 0, max_res_68166);\n            bool y_68170 = slt64(max_res_68166, n_65344);\n            bool bounds_check_68171 = x_68169 && y_68170;\n            bool index_certs_68172;\n            \n            if (!bounds_check_68171) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 11) ==\n                        -1) {\n                        g",
            "lobal_failure_args[0] = (int64_t) max_res_68166;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_68173;\n            \n            x_68173 = ((__global int64_t *) mem_77096)[gtid_68123 * n_65344 +\n                                                       max_res_68166];\n            \n            int64_t abs_arg_68174 = sub64(x_68173, defunc_0_g_res_68135);\n            int64_t abs_res_68175 = abs64(abs_arg_68174);\n            bool x_68176 = sle64((int64_t) 0, min_res_68168);\n            bool y_68177 = slt64(min_res_68168, n_65344);\n            bool bounds_check_68178 = x_68176 && y_68177;\n            bool index_certs_68179;\n            \n            if (!bounds_check_68178) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_68168;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_68180;\n            \n            x_68180 = ((__global int64_t *) mem_77096)[gtid_68123 * n_65344 +\n                                                       min_res_68168];\n            \n            int64_t abs_arg_68181 = sub64(x_68180, defunc_0_g_res_68135);\n            int64_t abs_res_68182 = abs64(abs_arg_68181);\n            bool cond_68183 = max_res_68166 == l_idx_68162;\n            int64_t loopres_68184;\n            int64_t loopres_68185;\n            int64_t loopres_68186;\n            \n            if (cond_68183) {\n                loopres_68184 = l_idx_68162;\n                loopres_68185 = r_idx_68163;\n                loopres_68186 = min_res_65364;\n            } else {\n                bool cond_68187 = slt64(abs_res_68175, abs_res_68182);",
            "\n                bool cond_f_res_68188 = min_res_68168 == r_idx_68163;\n                bool x_68189 = !cond_68187;\n                bool y_68190 = cond_f_res_68188 && x_68189;\n                bool cond_68191 = cond_68187 || y_68190;\n                int64_t loopres_f_res_68192;\n                \n                if (cond_68191) {\n                    loopres_f_res_68192 = max_res_68166;\n                } else {\n                    loopres_f_res_68192 = l_idx_68162;\n                }\n                \n                int64_t loopres_f_res_68193;\n                \n                if (cond_68191) {\n                    loopres_f_res_68193 = r_idx_68163;\n                } else {\n                    loopres_f_res_68193 = min_res_68168;\n                }\n                \n                int64_t loopres_f_res_68194;\n                \n                if (cond_68191) {\n                    int64_t loopres_f_res_t_res_68195 = add64((int64_t) 1,\n                                                              span_68164);\n                    \n                    loopres_f_res_68194 = loopres_f_res_t_res_68195;\n                } else {\n                    int64_t loopres_f_res_f_res_68196 = add64((int64_t) 1,\n                                                              span_68164);\n                    \n                    loopres_f_res_68194 = loopres_f_res_f_res_68196;\n                }\n                loopres_68184 = loopres_f_res_68192;\n                loopres_68185 = loopres_f_res_68193;\n                loopres_68186 = loopres_f_res_68194;\n            }\n            \n            bool loop_cond_68197 = slt64(loopres_68186, min_res_65364);\n            bool loop_while_tmp_78532 = loop_cond_68197;\n            int64_t l_idx_tmp_78533 = loopres_68184;\n            int64_t r_idx_tmp_78534 = loopres_68185;\n            int64_t span_tmp_78535 = loopres_68186;\n            \n            loop_while_68161 = loop_while_tmp_78532;\n            l_idx_68162 = l_idx_tmp_78533;\n            r_idx_68163 = r_idx",
            "_tmp_78534;\n            span_68164 = span_tmp_78535;\n        }\n        idx_68157 = loop_while_68161;\n        idx_68158 = l_idx_68162;\n        idx_68159 = r_idx_68163;\n        idx_68160 = span_68164;\n        \n        int64_t min_res_68198 = smin64(min_arg_68129, idx_68158);\n        int64_t max_res_68199 = smax64((int64_t) 0, min_res_68198);\n        int64_t x_68200 = add64(min_res_68130, max_res_68199);\n        int64_t r_68201 = sub64(x_68200, (int64_t) 1);\n        bool x_68202 = sle64((int64_t) 0, r_68201);\n        bool y_68203 = slt64(r_68201, n_65344);\n        bool bounds_check_68204 = x_68202 && y_68203;\n        bool index_certs_68205;\n        \n        if (!bounds_check_68204) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 13) == -1) {\n                    global_failure_args[0] = (int64_t) r_68201;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_68206;\n        \n        x_68206 = ((__global int64_t *) mem_77090)[gtid_68123 * n_65344 +\n                                                   r_68201];\n        \n        int64_t abs_arg_68207 = sub64(x_68206, min_res_68134);\n        int64_t abs_res_68208 = abs64(abs_arg_68207);\n        bool x_68209 = sle64((int64_t) 0, max_res_68199);\n        bool y_68210 = slt64(max_res_68199, n_65344);\n        bool bounds_check_68211 = x_68209 && y_68210;\n        bool index_certs_68212;\n        \n        if (!bounds_check_68211) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 14) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_68199;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_68213;\n        \n        x_68213 = ((__global int64_t *) mem_77090)[gtid_68123 * n_65344 +\n                       ",
            "                            max_res_68199];\n        \n        int64_t abs_arg_68214 = sub64(x_68213, min_res_68134);\n        int64_t abs_res_68215 = abs64(abs_arg_68214);\n        int64_t max_res_68216 = smax64(abs_res_68208, abs_res_68215);\n        float defunc_0_f_res_68217 = sitofp_i64_f32(max_res_68216);\n        float defunc_1_f_res_68218 = max_res_68131 + defunc_0_f_res_68217;\n        \n        ((__global int64_t *) mem_77166)[gtid_68123 * n_m_65352 + gtid_68124] =\n            min_res_68134;\n        ((__global int64_t *) mem_77170)[gtid_68123 * n_m_65352 + gtid_68124] =\n            max_res_68199;\n        ((__global float *) mem_77174)[gtid_68123 * n_m_65352 + gtid_68124] =\n            defunc_1_f_res_68218;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_68118\n}\n__kernel void mainzisegmap_68266(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_m_65352, __global\n                                 unsigned char *mem_77179, __global\n                                 unsigned char *mem_77184)\n{\n    #define segmap_group_sizze_68261 (mainzisegmap_group_sizze_67289)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78608;\n    int32_t local_tid_78609;\n    int64_t group_sizze_78612;\n    int32_t wave_sizze_78611;\n    int32_t group_tid_78610;\n    \n    global_tid_78608 = get_global_id(0);\n    local_tid_78609 = get_local_id(0);\n    group_sizze_78612 = get_local_size(0);\n    wave_sizze_78611 = LOCKSTEP_WIDTH;\n    group_tid_78610 = get_group_id(0);\n    \n    int32_t phys_tid_68266 = global_tid_78608;\n    int64_t global_tid_78613 = sext_i32_i64(group_tid_78610) *\n            segmap_group_sizze_68261 + sext_i32_i64(local_tid_78609);\n    int64_t slice_78614 = n_m_65352;\n    int64_t slice_78615 = m_65343 * slice_78614;\n    int64_t gtid_68264 = squot64(global_tid_78613, slice_78614);\n    int64_t remnant_78616 = ",
            "global_tid_78613 - gtid_68264 * slice_78614;\n    int64_t gtid_68265 = remnant_78616;\n    int64_t remnant_78617 = remnant_78616 - gtid_68265;\n    \n    if (slt64(gtid_68264, m_65343) && slt64(gtid_68265, n_m_65352)) {\n        float defunc_2_reduce_res_68267;\n        \n        defunc_2_reduce_res_68267 = ((__global float *) mem_77179)[gtid_68264 *\n                                                                   n_m_65352 +\n                                                                   gtid_68265];\n        \n        float a0_68268 = 1.0F / defunc_2_reduce_res_68267;\n        \n        ((__global float *) mem_77184)[gtid_68264 * n_m_65352 + gtid_68265] =\n            a0_68268;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_68261\n}\n__kernel void mainzisegmap_68538(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t jump_65348, int64_t n_m_65352,\n                                 int64_t i_65358, unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits,\n                                 float i64_res_65370, int64_t num_groups_68533,\n                                 int64_t num_threads_78217, __global\n                                 unsigned char *mem_77199, __global\n                                 unsigned char *mem_77308, __global\n                                 unsigned char *mem_77311, __global\n                                 unsigned char *color_78142, __global\n                                 unsigned char *color_78143, __global\n                                 unsigned char *color_78144, __global\n                                 unsigned char *color_78145, __global\n                                 unsigned char *color_78146,",
            " __global\n                                 unsigned char *color_78147)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_68532 (mainzisegmap_group_sizze_68324)\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_78696;\n    int32_t local_tid_78697;\n    int64_t group_sizze_78700;\n    int32_t wave_sizze_78699;\n    int32_t group_tid_78698;\n    \n    global_tid_78696 = get_global_id(0);\n    local_tid_78697 = get_local_id(0);\n    group_sizze_78700 = get_local_size(0);\n    wave_sizze_78699 = LOCKSTEP_WIDTH;\n    group_tid_78698 = get_group_id(0);\n    \n    int32_t phys_tid_68538 = global_tid_78696;\n    int32_t phys_group_id_78701;\n    \n    phys_group_id_78701 = get_group_id(0);\n    for (int32_t i_78702 = 0; i_78702 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343, segmap_group_sizze_68532)) -\n                   phys_group_id_78701, sext_i64_i32(num_groups_68533));\n         i_78702++) {\n        int32_t virt_group_id_78703 = phys_group_id_78701 + i_78702 *\n                sext_i64_i32(num_groups_68533);\n        int64_t global_tid_78704 = sext_i32_i64(virt_group_id_78703) *\n                segmap_group_sizze_68532 + sext_i32_i64(local_tid_78697);\n        int64_t slice_78705 = m_65343;\n        int64_t gtid_68537 = global_tid_78704;\n        int64_t remnant_78706 = global_tid_78704 - gtid_68537;\n        \n        if (slt64(gtid_68537, m_65343)) {\n            int64_t discard_76827;\n            int64_t scanacc_76823 = (int64_t) 0;\n            \n            for (int64_t i_76825 = 0; i_76825 < n_65344; i_76825++) {\n                float x_68544;\n                \n                x_68544 = ((__global float *) mem_77",
            "199)[i_76825 * m_65343 +\n                                                         gtid_68537];\n                \n                bool isnan_res_68545;\n                \n                isnan_res_68545 = futrts_isnan32(x_68544);\n                \n                bool defunc_0_p_res_68546 = !isnan_res_68545;\n                int64_t defunc_0_f_res_68547 =\n                        btoi_bool_i64(defunc_0_p_res_68546);\n                int64_t defunc_1_op_res_68543 = add64(defunc_0_f_res_68547,\n                                                      scanacc_76823);\n                \n                ((__global int64_t *) color_78145)[phys_tid_68538 + i_76825 *\n                                                   num_threads_78217] =\n                    defunc_1_op_res_68543;\n                \n                int64_t scanacc_tmp_78707 = defunc_1_op_res_68543;\n                \n                scanacc_76823 = scanacc_tmp_78707;\n            }\n            discard_76827 = scanacc_76823;\n            \n            int64_t last_res_68548;\n            \n            last_res_68548 = ((__global int64_t *) color_78145)[phys_tid_68538 +\n                                                                i_65358 *\n                                                                num_threads_78217];\n            for (int64_t i_78709 = 0; i_78709 < n_65344; i_78709++) {\n                ((__global float *) color_78147)[phys_tid_68538 + i_78709 *\n                                                 num_threads_78217] = 0.0F;\n            }\n            for (int64_t i_78710 = 0; i_78710 < n_65344; i_78710++) {\n                ((__global int64_t *) color_78146)[phys_tid_68538 + i_78710 *\n                                                   num_threads_78217] =\n                    (int64_t) -1;\n            }\n            for (int64_t write_iter_76828 = 0; write_iter_76828 < n_65344;\n                 write_iter_76828++) {\n                float write_iv_76831;\n                \n                write_iv_76831 = ((__global\n    ",
            "                               float *) mem_77199)[write_iter_76828 *\n                                                       m_65343 + gtid_68537];\n                \n                bool isnan_res_68556;\n                \n                isnan_res_68556 = futrts_isnan32(write_iv_76831);\n                \n                bool defunc_0_p_res_68557 = !isnan_res_68556;\n                int64_t defunc_1_f_res_68558;\n                \n                if (defunc_0_p_res_68557) {\n                    int64_t write_iv_76832;\n                    \n                    write_iv_76832 = ((__global\n                                       int64_t *) color_78145)[phys_tid_68538 +\n                                                               write_iter_76828 *\n                                                               num_threads_78217];\n                    \n                    int64_t defunc_1_f_res_t_res_68559 = sub64(write_iv_76832,\n                                                               (int64_t) 1);\n                    \n                    defunc_1_f_res_68558 = defunc_1_f_res_t_res_68559;\n                } else {\n                    defunc_1_f_res_68558 = (int64_t) -1;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_68558) &&\n                    slt64(defunc_1_f_res_68558, n_65344)) {\n                    ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                       defunc_1_f_res_68558 *\n                                                       num_threads_78217] =\n                        write_iter_76828;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_68558) &&\n                    slt64(defunc_1_f_res_68558, n_65344)) {\n                    for (int64_t i_78713 = 0; i_78713 < (int64_t) 1;\n                         i_78713++) {\n                        float tmp_78714;\n                        \n                        tmp_78714 = ((__global float *) mem_77199)[m_65343 *\n                 ",
            "                                                  write_iter_76828 +\n                                                                   gtid_68537 +\n                                                                   i_78713 *\n                                                                   m_65343];\n                        ((__global float *) color_78147)[phys_tid_68538 +\n                                                         num_threads_78217 *\n                                                         defunc_1_f_res_68558 +\n                                                         i_78713 *\n                                                         num_threads_78217] =\n                            tmp_78714;\n                    }\n                }\n            }\n            for (int64_t i_76838 = 0; i_76838 < n_65344; i_76838++) {\n                int64_t x_68561;\n                \n                x_68561 = ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                             i_76838 *\n                                                             num_threads_78217];\n                \n                int64_t defunc_0_f_res_68562 = add64((int64_t) 1, x_68561);\n                \n                ((__global int64_t *) color_78145)[phys_tid_68538 + i_76838 *\n                                                   num_threads_78217] =\n                    defunc_0_f_res_68562;\n            }\n            \n            int64_t min_arg_68563 = sub64(last_res_68548, (int64_t) 1);\n            int64_t min_arg_68564 = sub64(last_res_68548, min_res_65364);\n            int64_t min_res_68565 = smin64(q_65346, last_res_68548);\n            float i64_res_68566 = sitofp_i64_f32(last_res_68548);\n            float x_68567 = i64_res_65370 - i64_res_68566;\n            float max_arg_68568 = x_68567 / 2.0F;\n            float max_res_68569 = fmax32(0.0F, max_arg_68568);\n            \n            for (int64_t i_76842 = 0; i_76842 < q_65346; i_76842++) {\n             ",
            "   bool cond_68572 = sle64(last_res_68548, i_76842);\n                float defunc_0_f_res_68573;\n                \n                if (cond_68572) {\n                    defunc_0_f_res_68573 = 0.0F;\n                } else {\n                    defunc_0_f_res_68573 = 1.0F;\n                }\n                ((__global float *) color_78144)[phys_tid_68538 + i_76842 *\n                                                 num_threads_78217] =\n                    defunc_0_f_res_68573;\n            }\n            for (int64_t i_76848 = 0; i_76848 < n_m_65352; i_76848++) {\n                int64_t min_arg_68577 = mul64(jump_65348, i_76848);\n                int64_t min_res_68578 = smin64(i_65358, min_arg_68577);\n                int64_t defunc_0_g_res_68579 = add64((int64_t) 1,\n                                                     min_res_68578);\n                bool init_idx_68580;\n                int64_t init_idx_68581;\n                int64_t init_idx_68582;\n                bool loop_while_68583;\n                int64_t low_68584;\n                int64_t high_68585;\n                \n                loop_while_68583 = x_65359;\n                low_68584 = (int64_t) 0;\n                high_68585 = i_65358;\n                while (loop_while_68583) {\n                    int64_t x_68586 = add64(low_68584, high_68585);\n                    int64_t mid_68587 = sdiv64(x_68586, (int64_t) 2);\n                    bool x_68588 = sle64((int64_t) 0, mid_68587);\n                    bool y_68589 = slt64(mid_68587, n_65344);\n                    bool bounds_check_68590 = x_68588 && y_68589;\n                    bool index_certs_68591;\n                    \n                    if (!bounds_check_68590) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          15) == -1) {\n                                global_failure_args[0] = (int64_t) mid_68587;\n                                global_failure_args[1] ",
            "= (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t mid_id_68592;\n                    \n                    mid_id_68592 = ((__global\n                                     int64_t *) color_78145)[phys_tid_68538 +\n                                                             mid_68587 *\n                                                             num_threads_78217];\n                    \n                    bool cond_68593 = slt64(mid_id_68592, (int64_t) 0);\n                    int64_t mid_idx_68594;\n                    \n                    if (cond_68593) {\n                        mid_idx_68594 = (int64_t) 9223372036854775807;\n                    } else {\n                        mid_idx_68594 = mid_id_68592;\n                    }\n                    \n                    bool cond_68595 = sle64(defunc_0_g_res_68579,\n                                            mid_idx_68594);\n                    int64_t loopres_68596;\n                    int64_t loopres_68597;\n                    \n                    if (cond_68595) {\n                        int64_t loopres_t_res_68598 = sub64(mid_68587,\n                                                            (int64_t) 1);\n                        \n                        loopres_68596 = low_68584;\n                        loopres_68597 = loopres_t_res_68598;\n                    } else {\n                        int64_t loopres_f_res_68599 = add64((int64_t) 1,\n                                                            mid_68587);\n                        \n                        loopres_68596 = loopres_f_res_68599;\n                        loopres_68597 = high_68585;\n                    }\n                    \n                    bool loop_cond_68600 = sle64(loopres_68596, loopres_68597);\n                    bool loop_whi",
            "le_tmp_78719 = loop_cond_68600;\n                    int64_t low_tmp_78720 = loopres_68596;\n                    int64_t high_tmp_78721 = loopres_68597;\n                    \n                    loop_while_68583 = loop_while_tmp_78719;\n                    low_68584 = low_tmp_78720;\n                    high_68585 = high_tmp_78721;\n                }\n                init_idx_68580 = loop_while_68583;\n                init_idx_68581 = low_68584;\n                init_idx_68582 = high_68585;\n                \n                bool idx_68601;\n                int64_t idx_68602;\n                int64_t idx_68603;\n                int64_t idx_68604;\n                bool loop_while_68605;\n                int64_t l_idx_68606;\n                int64_t r_idx_68607;\n                int64_t span_68608;\n                \n                loop_while_68605 = loop_cond_65369;\n                l_idx_68606 = init_idx_68581;\n                r_idx_68607 = init_idx_68581;\n                span_68608 = (int64_t) 1;\n                while (loop_while_68605) {\n                    int64_t max_arg_68609 = sub64(l_idx_68606, (int64_t) 1);\n                    int64_t max_res_68610 = smax64((int64_t) 0, max_arg_68609);\n                    int64_t min_arg_68611 = add64((int64_t) 1, r_idx_68607);\n                    int64_t min_res_68612 = smin64(min_arg_68563,\n                                                   min_arg_68611);\n                    bool x_68613 = sle64((int64_t) 0, max_res_68610);\n                    bool y_68614 = slt64(max_res_68610, n_65344);\n                    bool bounds_check_68615 = x_68613 && y_68614;\n                    bool index_certs_68616;\n                    \n                    if (!bounds_check_68615) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          16) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) max_r",
            "es_68610;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_68617;\n                    \n                    x_68617 = ((__global\n                                int64_t *) color_78145)[phys_tid_68538 +\n                                                        max_res_68610 *\n                                                        num_threads_78217];\n                    \n                    int64_t abs_arg_68618 = sub64(x_68617,\n                                                  defunc_0_g_res_68579);\n                    int64_t abs_res_68619 = abs64(abs_arg_68618);\n                    bool x_68620 = sle64((int64_t) 0, min_res_68612);\n                    bool y_68621 = slt64(min_res_68612, n_65344);\n                    bool bounds_check_68622 = x_68620 && y_68621;\n                    bool index_certs_68623;\n                    \n                    if (!bounds_check_68622) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          17) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) min_res_68612;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_68624;\n                    \n                    x_68624 = ((__global\n                                int64_t *) color_78145)[phys_tid_68538 +\n                                                        min_res_68612 ",
            "*\n                                                        num_threads_78217];\n                    \n                    int64_t abs_arg_68625 = sub64(x_68624,\n                                                  defunc_0_g_res_68579);\n                    int64_t abs_res_68626 = abs64(abs_arg_68625);\n                    bool cond_68627 = max_res_68610 == l_idx_68606;\n                    int64_t loopres_68628;\n                    int64_t loopres_68629;\n                    int64_t loopres_68630;\n                    \n                    if (cond_68627) {\n                        loopres_68628 = l_idx_68606;\n                        loopres_68629 = r_idx_68607;\n                        loopres_68630 = min_res_65364;\n                    } else {\n                        bool cond_68631 = slt64(abs_res_68619, abs_res_68626);\n                        bool cond_f_res_68632 = min_res_68612 == r_idx_68607;\n                        bool x_68633 = !cond_68631;\n                        bool y_68634 = cond_f_res_68632 && x_68633;\n                        bool cond_68635 = cond_68631 || y_68634;\n                        int64_t loopres_f_res_68636;\n                        \n                        if (cond_68635) {\n                            loopres_f_res_68636 = max_res_68610;\n                        } else {\n                            loopres_f_res_68636 = l_idx_68606;\n                        }\n                        \n                        int64_t loopres_f_res_68637;\n                        \n                        if (cond_68635) {\n                            loopres_f_res_68637 = r_idx_68607;\n                        } else {\n                            loopres_f_res_68637 = min_res_68612;\n                        }\n                        \n                        int64_t loopres_f_res_68638;\n                        \n                        if (cond_68635) {\n                            int64_t loopres_f_res_t_res_68639 =\n                                    add64((int64_t) 1, span_68608);",
            "\n                            \n                            loopres_f_res_68638 = loopres_f_res_t_res_68639;\n                        } else {\n                            int64_t loopres_f_res_f_res_68640 =\n                                    add64((int64_t) 1, span_68608);\n                            \n                            loopres_f_res_68638 = loopres_f_res_f_res_68640;\n                        }\n                        loopres_68628 = loopres_f_res_68636;\n                        loopres_68629 = loopres_f_res_68637;\n                        loopres_68630 = loopres_f_res_68638;\n                    }\n                    \n                    bool loop_cond_68641 = slt64(loopres_68630, min_res_65364);\n                    bool loop_while_tmp_78722 = loop_cond_68641;\n                    int64_t l_idx_tmp_78723 = loopres_68628;\n                    int64_t r_idx_tmp_78724 = loopres_68629;\n                    int64_t span_tmp_78725 = loopres_68630;\n                    \n                    loop_while_68605 = loop_while_tmp_78722;\n                    l_idx_68606 = l_idx_tmp_78723;\n                    r_idx_68607 = r_idx_tmp_78724;\n                    span_68608 = span_tmp_78725;\n                }\n                idx_68601 = loop_while_68605;\n                idx_68602 = l_idx_68606;\n                idx_68603 = r_idx_68607;\n                idx_68604 = span_68608;\n                \n                int64_t min_res_68642 = smin64(min_arg_68564, idx_68602);\n                int64_t max_res_68643 = smax64((int64_t) 0, min_res_68642);\n                int64_t x_68644 = add64(min_res_68565, max_res_68643);\n                int64_t r_68645 = sub64(x_68644, (int64_t) 1);\n                bool x_68646 = sle64((int64_t) 0, r_68645);\n                bool y_68647 = slt64(r_68645, n_65344);\n                bool bounds_check_68648 = x_68646 && y_68647;\n                bool index_certs_68649;\n                \n                if (!bounds_check_68648) {\n                    {\n                       ",
            " if (atomic_cmpxchg_i32_global(global_failure, -1, 18) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) r_68645;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_68650;\n                \n                x_68650 = ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                             r_68645 *\n                                                             num_threads_78217];\n                \n                int64_t abs_arg_68651 = sub64(x_68650, min_res_68578);\n                int64_t abs_res_68652 = abs64(abs_arg_68651);\n                bool x_68653 = sle64((int64_t) 0, max_res_68643);\n                bool y_68654 = slt64(max_res_68643, n_65344);\n                bool bounds_check_68655 = x_68653 && y_68654;\n                bool index_certs_68656;\n                \n                if (!bounds_check_68655) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 19) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_68643;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_68657;\n                \n                x_68657 = ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                             max_res_68643 *\n                                                             num_threads_78217];\n                \n                int64_t abs_arg_68658 = sub64(x_68657, min_r",
            "es_68578);\n                int64_t abs_res_68659 = abs64(abs_arg_68658);\n                int64_t max_res_68660 = smax64(abs_res_68652, abs_res_68659);\n                float defunc_0_f_res_68661 = sitofp_i64_f32(max_res_68660);\n                float defunc_1_f_res_68662 = max_res_68569 +\n                      defunc_0_f_res_68661;\n                float defunc_2_reduce_res_68663;\n                float defunc_2_reduce_res_68664;\n                float defunc_2_reduce_res_68665;\n                float redout_76851;\n                float redout_76852;\n                float redout_76853;\n                \n                redout_76851 = 0.0F;\n                redout_76852 = 0.0F;\n                redout_76853 = 0.0F;\n                for (int64_t i_76854 = 0; i_76854 < q_65346; i_76854++) {\n                    float x_68676;\n                    \n                    x_68676 = ((__global float *) color_78144)[phys_tid_68538 +\n                                                               i_76854 *\n                                                               num_threads_78217];\n                    \n                    bool cond_68677 = sle64(last_res_68548, i_76854);\n                    int64_t defunc_0_f_res_68678;\n                    \n                    if (cond_68677) {\n                        defunc_0_f_res_68678 = (int64_t) 0;\n                    } else {\n                        int64_t i_68679 = add64(max_res_68643, i_76854);\n                        int64_t defunc_0_add_arg_68680;\n                        \n                        defunc_0_add_arg_68680 = ((__global\n                                                   int64_t *) color_78146)[phys_tid_68538 +\n                                                                           i_68679 *\n                                                                           num_threads_78217];\n                        \n                        int64_t defunc_1_add_res_68681 = add64((int64_t) 1,\n                                           ",
            "                    defunc_0_add_arg_68680);\n                        \n                        defunc_0_f_res_68678 = defunc_1_add_res_68681;\n                    }\n                    \n                    int64_t binop_p_68682 = sub64(defunc_0_f_res_68678,\n                                                  min_res_68578);\n                    float defunc_0_f_res_68683 = sitofp_i64_f32(binop_p_68682);\n                    float abs_res_68684 = (float) fabs(defunc_0_f_res_68683);\n                    float tmp1_68685 = abs_res_68684 / defunc_1_f_res_68662;\n                    float x_68686 = tmp1_68685 * tmp1_68685;\n                    float y_68687 = tmp1_68685 * x_68686;\n                    float tmp2_68688 = 1.0F - y_68687;\n                    float x_68689 = tmp2_68688 * tmp2_68688;\n                    float tmp3_68690 = tmp2_68688 * x_68689;\n                    float w_j_68691 = x_68676 * tmp3_68690;\n                    float xw_j_68692 = defunc_0_f_res_68683 * w_j_68691;\n                    float x2w_j_68693 = defunc_0_f_res_68683 * xw_j_68692;\n                    float defunc_1_op_res_68668 = w_j_68691 + redout_76851;\n                    float defunc_1_op_res_68671 = xw_j_68692 + redout_76852;\n                    float defunc_1_op_res_68674 = x2w_j_68693 + redout_76853;\n                    float redout_tmp_78726 = defunc_1_op_res_68668;\n                    float redout_tmp_78727 = defunc_1_op_res_68671;\n                    float redout_tmp_78728 = defunc_1_op_res_68674;\n                    \n                    redout_76851 = redout_tmp_78726;\n                    redout_76852 = redout_tmp_78727;\n                    redout_76853 = redout_tmp_78728;\n                }\n                defunc_2_reduce_res_68663 = redout_76851;\n                defunc_2_reduce_res_68664 = redout_76852;\n                defunc_2_reduce_res_68665 = redout_76853;\n                \n                float x_68694 = defunc_2_reduce_res_68663 *\n                      defunc_2_reduce_res_68665;\n      ",
            "          float y_68695 = defunc_2_reduce_res_68664 *\n                      defunc_2_reduce_res_68664;\n                float y_68696 = x_68694 - y_68695;\n                float det1_68697 = 1.0F / y_68696;\n                float a11_68698 = defunc_2_reduce_res_68665 * det1_68697;\n                float x_68699 = 0.0F - defunc_2_reduce_res_68664;\n                float b11_68700 = det1_68697 * x_68699;\n                float c11_68701 = defunc_2_reduce_res_68663 * det1_68697;\n                float defunc_2_reduce_res_68702;\n                float defunc_2_reduce_res_68703;\n                float redout_76855;\n                float redout_76856;\n                \n                redout_76855 = 0.0F;\n                redout_76856 = 0.0F;\n                for (int64_t i_76857 = 0; i_76857 < q_65346; i_76857++) {\n                    float x_68711;\n                    \n                    x_68711 = ((__global float *) color_78144)[phys_tid_68538 +\n                                                               i_76857 *\n                                                               num_threads_78217];\n                    \n                    bool cond_68712 = sle64(last_res_68548, i_76857);\n                    int64_t defunc_0_f_res_68713;\n                    \n                    if (cond_68712) {\n                        defunc_0_f_res_68713 = (int64_t) 0;\n                    } else {\n                        int64_t i_68714 = add64(max_res_68643, i_76857);\n                        int64_t defunc_0_add_arg_68715;\n                        \n                        defunc_0_add_arg_68715 = ((__global\n                                                   int64_t *) color_78146)[phys_tid_68538 +\n                                                                           i_68714 *\n                                                                           num_threads_78217];\n                        \n                        int64_t defunc_1_add_res_68716 = add64((int64_t) 1,\n                      ",
            "                                         defunc_0_add_arg_68715);\n                        \n                        defunc_0_f_res_68713 = defunc_1_add_res_68716;\n                    }\n                    \n                    int64_t binop_p_68717 = sub64(defunc_0_f_res_68713,\n                                                  min_res_68578);\n                    float defunc_0_f_res_68718 = sitofp_i64_f32(binop_p_68717);\n                    float abs_res_68719 = (float) fabs(defunc_0_f_res_68718);\n                    float tmp1_68720 = abs_res_68719 / defunc_1_f_res_68662;\n                    float x_68721 = tmp1_68720 * tmp1_68720;\n                    float y_68722 = tmp1_68720 * x_68721;\n                    float tmp2_68723 = 1.0F - y_68722;\n                    float x_68724 = tmp2_68723 * tmp2_68723;\n                    float tmp3_68725 = tmp2_68723 * x_68724;\n                    float tmp4_68726 = x_68711 * tmp3_68725;\n                    float defunc_1_f_res_68727 = defunc_0_f_res_68718 *\n                          tmp4_68726;\n                    float defunc_0_f_res_68728;\n                    \n                    if (cond_68712) {\n                        defunc_0_f_res_68728 = 0.0F;\n                    } else {\n                        int64_t i_68729 = add64(max_res_68643, i_76857);\n                        float defunc_0_add_arg_68730;\n                        \n                        defunc_0_add_arg_68730 = ((__global\n                                                   float *) color_78147)[phys_tid_68538 +\n                                                                         i_68729 *\n                                                                         num_threads_78217];\n                        defunc_0_f_res_68728 = defunc_0_add_arg_68730;\n                    }\n                    \n                    float x_68731 = a11_68698 * tmp4_68726;\n                    float y_68732 = b11_68700 * defunc_1_f_res_68727;\n                    float x_68733 = x_68731 ",
            "+ y_68732;\n                    float defunc_9_fit_fun_res_68734 = defunc_0_f_res_68728 *\n                          x_68733;\n                    float x_68735 = b11_68700 * tmp4_68726;\n                    float y_68736 = c11_68701 * defunc_1_f_res_68727;\n                    float x_68737 = x_68735 + y_68736;\n                    float defunc_9_slope_fun_res_68738 = defunc_0_f_res_68728 *\n                          x_68737;\n                    float defunc_1_op_res_68706 = defunc_9_fit_fun_res_68734 +\n                          redout_76855;\n                    float defunc_1_op_res_68709 = defunc_9_slope_fun_res_68738 +\n                          redout_76856;\n                    float redout_tmp_78729 = defunc_1_op_res_68706;\n                    float redout_tmp_78730 = defunc_1_op_res_68709;\n                    \n                    redout_76855 = redout_tmp_78729;\n                    redout_76856 = redout_tmp_78730;\n                }\n                defunc_2_reduce_res_68702 = redout_76855;\n                defunc_2_reduce_res_68703 = redout_76856;\n                ((__global float *) color_78143)[phys_tid_68538 + i_76848 *\n                                                 num_threads_78217] =\n                    defunc_2_reduce_res_68702;\n                ((__global float *) color_78142)[phys_tid_68538 + i_76848 *\n                                                 num_threads_78217] =\n                    defunc_2_reduce_res_68703;\n            }\n            for (int64_t i_78731 = 0; i_78731 < n_m_65352; i_78731++) {\n                float tmp_78732;\n                \n                tmp_78732 = ((__global float *) color_78143)[phys_tid_68538 +\n                                                             i_78731 *\n                                                             num_threads_78217];\n                ((__global float *) mem_77308)[gtid_68537 + i_78731 * m_65343] =\n                    tmp_78732;\n            }\n            for (int64_t i_78733 = 0; i_78733 < n_m_65352; i_",
            "78733++) {\n                float tmp_78734;\n                \n                tmp_78734 = ((__global float *) color_78142)[phys_tid_68538 +\n                                                             i_78733 *\n                                                             num_threads_78217];\n                ((__global float *) mem_77311)[gtid_68537 + i_78733 * m_65343] =\n                    tmp_78734;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_68532\n}\n__kernel void mainzisegmap_69694(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77316, __global\n                                 unsigned char *mem_77320, __global\n                                 unsigned char *mem_77324)\n{\n    #define segmap_group_sizze_69688 (mainzisegmap_group_sizze_69529)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78838;\n    int32_t local_tid_78839;\n    int64_t group_sizze_78842;\n    int32_t wave_sizze_78841;\n    int32_t group_tid_78840;\n    \n    global_tid_78838 = get_global_id(0);\n    local_tid_78839 = get_local_id(0);\n    group_sizze_78842 = get_local_size(0);\n    wave_sizze_78841 = LOCKSTEP_WIDTH;\n    group_tid_78840 = get_group_id(0);\n    \n    int32_t phys_tid_69694 = global_tid_78838;\n    int64_t global_tid_78843 = sext_i32_i64(group_tid_78840) *\n            segmap_group_sizze_69688 + sext_i32_i64(local_tid_78839);\n    int64_t slice_78844 = n_65344;\n    int64_t slice_78845 = m_65343 * slice_78844;\n    int64_t gtid_69692 = squot64(global_tid_78843, slice_78844);\n    int64_t remnant_78846 = global_tid_78843 - gtid_69692 * slice_78844;\n    int64_t gtid_69693 = remnant_78846;\n    int64_t",
            " remnant_78847 = remnant_78846 - gtid_69693;\n    \n    if (slt64(gtid_69692, m_65343) && slt64(gtid_69693, n_65344)) {\n        float x_69695;\n        \n        x_69695 = ((__global float *) Y_mem_76976)[gtid_69692 * n_65344 +\n                                                   gtid_69693];\n        \n        bool isnan_res_69698;\n        \n        isnan_res_69698 = futrts_isnan32(x_69695);\n        \n        bool defunc_0_p_res_69699 = !isnan_res_69698;\n        int64_t defunc_1_f_res_69700;\n        \n        if (defunc_0_p_res_69699) {\n            int64_t x_69696;\n            \n            x_69696 = ((__global int64_t *) mem_77316)[gtid_69692 * n_65344 +\n                                                       gtid_69693];\n            \n            int64_t defunc_1_f_res_t_res_69701 = sub64(x_69696, (int64_t) 1);\n            \n            defunc_1_f_res_69700 = defunc_1_f_res_t_res_69701;\n        } else {\n            defunc_1_f_res_69700 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_69692) && slt64(gtid_69692, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_69700) &&\n             slt64(defunc_1_f_res_69700, n_65344))) {\n            ((__global int64_t *) mem_77324)[gtid_69692 * n_65344 +\n                                             defunc_1_f_res_69700] = gtid_69693;\n        }\n        if ((sle64((int64_t) 0, gtid_69692) && slt64(gtid_69692, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_69700) &&\n             slt64(defunc_1_f_res_69700, n_65344))) {\n            ((__global float *) mem_77320)[gtid_69692 * n_65344 +\n                                           defunc_1_f_res_69700] = x_69695;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69688\n}\n__kernel void mainzisegmap_69713(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77324, __global\n                                 unsigned char *mem_77330)\n{\n    #de",
            "fine segmap_group_sizze_69708 (mainzisegmap_group_sizze_69503)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78848;\n    int32_t local_tid_78849;\n    int64_t group_sizze_78852;\n    int32_t wave_sizze_78851;\n    int32_t group_tid_78850;\n    \n    global_tid_78848 = get_global_id(0);\n    local_tid_78849 = get_local_id(0);\n    group_sizze_78852 = get_local_size(0);\n    wave_sizze_78851 = LOCKSTEP_WIDTH;\n    group_tid_78850 = get_group_id(0);\n    \n    int32_t phys_tid_69713 = global_tid_78848;\n    int64_t global_tid_78853 = sext_i32_i64(group_tid_78850) *\n            segmap_group_sizze_69708 + sext_i32_i64(local_tid_78849);\n    int64_t slice_78854 = n_65344;\n    int64_t slice_78855 = m_65343 * slice_78854;\n    int64_t gtid_69711 = squot64(global_tid_78853, slice_78854);\n    int64_t remnant_78856 = global_tid_78853 - gtid_69711 * slice_78854;\n    int64_t gtid_69712 = remnant_78856;\n    int64_t remnant_78857 = remnant_78856 - gtid_69712;\n    \n    if (slt64(gtid_69711, m_65343) && slt64(gtid_69712, n_65344)) {\n        int64_t x_69714;\n        \n        x_69714 = ((__global int64_t *) mem_77324)[gtid_69711 * n_65344 +\n                                                   gtid_69712];\n        \n        int64_t defunc_0_f_res_69715 = add64((int64_t) 1, x_69714);\n        \n        ((__global int64_t *) mem_77330)[gtid_69711 * n_65344 + gtid_69712] =\n            defunc_0_f_res_69715;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69708\n}\n__kernel void mainzisegmap_69725(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77316, __global\n                                 unsigned char *mem_77334, __g",
            "lobal\n                                 unsigned char *mem_77337, __global\n                                 unsigned char *mem_77340, __global\n                                 unsigned char *mem_77343)\n{\n    #define segmap_group_sizze_69718 (mainzisegmap_group_sizze_69477)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78858;\n    int32_t local_tid_78859;\n    int64_t group_sizze_78862;\n    int32_t wave_sizze_78861;\n    int32_t group_tid_78860;\n    \n    global_tid_78858 = get_global_id(0);\n    local_tid_78859 = get_local_id(0);\n    group_sizze_78862 = get_local_size(0);\n    wave_sizze_78861 = LOCKSTEP_WIDTH;\n    group_tid_78860 = get_group_id(0);\n    \n    int32_t phys_tid_69725 = global_tid_78858;\n    int64_t global_tid_78863 = sext_i32_i64(group_tid_78860) *\n            segmap_group_sizze_69718 + sext_i32_i64(local_tid_78859);\n    int64_t slice_78864 = m_65343;\n    int64_t gtid_69724 = global_tid_78863;\n    int64_t remnant_78865 = global_tid_78863 - gtid_69724;\n    \n    if (slt64(gtid_69724, m_65343)) {\n        int64_t last_res_69726;\n        \n        last_res_69726 = ((__global int64_t *) mem_77316)[gtid_69724 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_69727 = sub64(last_res_69726, (int64_t) 1);\n        int64_t min_arg_69728 = sub64(last_res_69726, min_res_65364);\n        int64_t min_res_69729 = smin64(q_65346, last_res_69726);\n        float i64_res_69730 = sitofp_i64_f32(last_res_69726);\n        float x_69731 = i64_res_65370 - i64_res_69730;\n        float max_arg_69732 = x_69731 / 2.0F;\n        float max_res_69733 = fmax32(0.0F, max_arg_69732);\n        \n        ((__global int64_t *) mem_77334)[gtid_69724] = min_arg_69727;\n        ((__global int64_t *) mem_77337)[gtid_69724] = min_arg_69728;\n        ((__global int64_t *) mem_77340)[gtid_69724] = min_res_69729;\n        ((__g",
            "lobal float *) mem_77343)[gtid_69724] = max_res_69733;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69718\n}\n__kernel void mainzisegmap_69745(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77316, __global\n                                 unsigned char *mem_77348)\n{\n    #define segmap_group_sizze_69740 (mainzisegmap_group_sizze_69452)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78866;\n    int32_t local_tid_78867;\n    int64_t group_sizze_78870;\n    int32_t wave_sizze_78869;\n    int32_t group_tid_78868;\n    \n    global_tid_78866 = get_global_id(0);\n    local_tid_78867 = get_local_id(0);\n    group_sizze_78870 = get_local_size(0);\n    wave_sizze_78869 = LOCKSTEP_WIDTH;\n    group_tid_78868 = get_group_id(0);\n    \n    int32_t phys_tid_69745 = global_tid_78866;\n    int64_t global_tid_78871 = sext_i32_i64(group_tid_78868) *\n            segmap_group_sizze_69740 + sext_i32_i64(local_tid_78867);\n    int64_t slice_78872 = q_65346;\n    int64_t slice_78873 = m_65343 * slice_78872;\n    int64_t gtid_69743 = squot64(global_tid_78871, slice_78872);\n    int64_t remnant_78874 = global_tid_78871 - gtid_69743 * slice_78872;\n    int64_t gtid_69744 = remnant_78874;\n    int64_t remnant_78875 = remnant_78874 - gtid_69744;\n    \n    if (slt64(gtid_69743, m_65343) && slt64(gtid_69744, q_65346)) {\n        int64_t last_res_69746;\n        \n        last_res_69746 = ((__global int64_t *) mem_77316)[gtid_69743 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_69748 = sle64(last_res_69746, gtid_69744);\n        float defunc_0_f_res_69749;\n        \n        if (cond_69748) {\n            defunc_0_f_res_69749 = 0.0F;\n        } else",
            " {\n            defunc_0_f_res_69749 = 1.0F;\n        }\n        ((__global float *) mem_77348)[gtid_69743 * q_65346 + gtid_69744] =\n            defunc_0_f_res_69749;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69740\n}\n__kernel void mainzisegmap_69946(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits, __global\n                                 unsigned char *mem_77324, __global\n                                 unsigned char *mem_77330, __global\n                                 unsigned char *mem_77334, __global\n                                 unsigned char *mem_77337, __global\n                                 unsigned char *mem_77340, __global\n                                 unsigned char *mem_77343, __global\n                                 unsigned char *mem_77431, __global\n                                 unsigned char *mem_77435, __global\n                                 unsigned char *mem_77439)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_69939 (mainzisegmap_group_sizze_69101)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78930;\n    int32_t local_tid_78931;\n    int64_t group_sizze_78934;\n    int32_t wave_sizze_78933;\n    int32_t group_tid_78932;\n    \n    global_tid_78930 = get_global_id(0);\n    local_tid_78931 = get_local_id(0);\n    group_sizze_78934 = get_local_size(0);\n    wave_sizze_78933 = LOCKST",
            "EP_WIDTH;\n    group_tid_78932 = get_group_id(0);\n    \n    int32_t phys_tid_69946 = global_tid_78930;\n    int64_t global_tid_78935 = sext_i32_i64(group_tid_78932) *\n            segmap_group_sizze_69939 + sext_i32_i64(local_tid_78931);\n    int64_t slice_78936 = n_m_65352;\n    int64_t slice_78937 = m_65343 * slice_78936;\n    int64_t gtid_69944 = squot64(global_tid_78935, slice_78936);\n    int64_t remnant_78938 = global_tid_78935 - gtid_69944 * slice_78936;\n    int64_t gtid_69945 = remnant_78938;\n    int64_t remnant_78939 = remnant_78938 - gtid_69945;\n    \n    if (slt64(gtid_69944, m_65343) && slt64(gtid_69945, n_m_65352)) {\n        int64_t min_arg_69949;\n        \n        min_arg_69949 = ((__global int64_t *) mem_77334)[gtid_69944];\n        \n        int64_t min_arg_69950;\n        \n        min_arg_69950 = ((__global int64_t *) mem_77337)[gtid_69944];\n        \n        int64_t min_res_69951;\n        \n        min_res_69951 = ((__global int64_t *) mem_77340)[gtid_69944];\n        \n        float max_res_69952;\n        \n        max_res_69952 = ((__global float *) mem_77343)[gtid_69944];\n        \n        int64_t min_arg_69954 = mul64(jump_65348, gtid_69945);\n        int64_t min_res_69955 = smin64(i_65358, min_arg_69954);\n        int64_t defunc_0_g_res_69956 = add64((int64_t) 1, min_res_69955);\n        bool init_idx_69957;\n        int64_t init_idx_69958;\n        int64_t init_idx_69959;\n        bool loop_while_69960;\n        int64_t low_69961;\n        int64_t high_69962;\n        \n        loop_while_69960 = x_65359;\n        low_69961 = (int64_t) 0;\n        high_69962 = i_65358;\n        while (loop_while_69960) {\n            int64_t x_69963 = add64(low_69961, high_69962);\n            int64_t mid_69964 = sdiv64(x_69963, (int64_t) 2);\n            bool x_69965 = sle64((int64_t) 0, mid_69964);\n            bool y_69966 = slt64(mid_69964, n_65344);\n            bool bounds_check_69967 = x_69965 && y_69966;\n            bool index_certs_69968;\n            \n            if (!bounds_check_69967",
            ") {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 25) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_69964;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_69969;\n            \n            mid_id_69969 = ((__global int64_t *) mem_77330)[gtid_69944 *\n                                                            n_65344 +\n                                                            mid_69964];\n            \n            bool cond_69970 = slt64(mid_id_69969, (int64_t) 0);\n            int64_t mid_idx_69971;\n            \n            if (cond_69970) {\n                mid_idx_69971 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_69971 = mid_id_69969;\n            }\n            \n            bool cond_69972 = sle64(defunc_0_g_res_69956, mid_idx_69971);\n            int64_t loopres_69973;\n            int64_t loopres_69974;\n            \n            if (cond_69972) {\n                int64_t loopres_t_res_69975 = sub64(mid_69964, (int64_t) 1);\n                \n                loopres_69973 = low_69961;\n                loopres_69974 = loopres_t_res_69975;\n            } else {\n                int64_t loopres_f_res_69976 = add64((int64_t) 1, mid_69964);\n                \n                loopres_69973 = loopres_f_res_69976;\n                loopres_69974 = high_69962;\n            }\n            \n            bool loop_cond_69977 = sle64(loopres_69973, loopres_69974);\n            bool loop_while_tmp_78940 = loop_cond_69977;\n            int64_t low_tmp_78941 = loopres_69973;\n            int64_t high_tmp_78942 = loopres_69974;\n            \n            loop_while_69960 = loop_while_tmp_78940;\n            low_69961 = low_tmp_78941;\n            high_69962 = high_tmp_78942;\n        }\n        init_idx_69957 = loop_whil",
            "e_69960;\n        init_idx_69958 = low_69961;\n        init_idx_69959 = high_69962;\n        \n        bool idx_69978;\n        int64_t idx_69979;\n        int64_t idx_69980;\n        int64_t idx_69981;\n        bool loop_while_69982;\n        int64_t l_idx_69983;\n        int64_t r_idx_69984;\n        int64_t span_69985;\n        \n        loop_while_69982 = loop_cond_65369;\n        l_idx_69983 = init_idx_69958;\n        r_idx_69984 = init_idx_69958;\n        span_69985 = (int64_t) 1;\n        while (loop_while_69982) {\n            int64_t max_arg_69986 = sub64(l_idx_69983, (int64_t) 1);\n            int64_t max_res_69987 = smax64((int64_t) 0, max_arg_69986);\n            int64_t min_arg_69988 = add64((int64_t) 1, r_idx_69984);\n            int64_t min_res_69989 = smin64(min_arg_69949, min_arg_69988);\n            bool x_69990 = sle64((int64_t) 0, max_res_69987);\n            bool y_69991 = slt64(max_res_69987, n_65344);\n            bool bounds_check_69992 = x_69990 && y_69991;\n            bool index_certs_69993;\n            \n            if (!bounds_check_69992) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 26) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_69987;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_69994;\n            \n            x_69994 = ((__global int64_t *) mem_77330)[gtid_69944 * n_65344 +\n                                                       max_res_69987];\n            \n            int64_t abs_arg_69995 = sub64(x_69994, defunc_0_g_res_69956);\n            int64_t abs_res_69996 = abs64(abs_arg_69995);\n            bool x_69997 = sle64((int64_t) 0, min_res_69989);\n            bool y_69998 = slt64(min_res_69989, n_65344);\n            bool bounds_check_69999 = x_69997 && y_69998;\n            bool index_certs_70000;\n ",
            "           \n            if (!bounds_check_69999) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 27) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_69989;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_70001;\n            \n            x_70001 = ((__global int64_t *) mem_77330)[gtid_69944 * n_65344 +\n                                                       min_res_69989];\n            \n            int64_t abs_arg_70002 = sub64(x_70001, defunc_0_g_res_69956);\n            int64_t abs_res_70003 = abs64(abs_arg_70002);\n            bool cond_70004 = max_res_69987 == l_idx_69983;\n            int64_t loopres_70005;\n            int64_t loopres_70006;\n            int64_t loopres_70007;\n            \n            if (cond_70004) {\n                loopres_70005 = l_idx_69983;\n                loopres_70006 = r_idx_69984;\n                loopres_70007 = min_res_65364;\n            } else {\n                bool cond_70008 = slt64(abs_res_69996, abs_res_70003);\n                bool cond_f_res_70009 = min_res_69989 == r_idx_69984;\n                bool x_70010 = !cond_70008;\n                bool y_70011 = cond_f_res_70009 && x_70010;\n                bool cond_70012 = cond_70008 || y_70011;\n                int64_t loopres_f_res_70013;\n                \n                if (cond_70012) {\n                    loopres_f_res_70013 = max_res_69987;\n                } else {\n                    loopres_f_res_70013 = l_idx_69983;\n                }\n                \n                int64_t loopres_f_res_70014;\n                \n                if (cond_70012) {\n                    loopres_f_res_70014 = r_idx_69984;\n                } else {\n                    loopres_f_res_70014 = min_res_69989;\n                }\n                \n                int64",
            "_t loopres_f_res_70015;\n                \n                if (cond_70012) {\n                    int64_t loopres_f_res_t_res_70016 = add64((int64_t) 1,\n                                                              span_69985);\n                    \n                    loopres_f_res_70015 = loopres_f_res_t_res_70016;\n                } else {\n                    int64_t loopres_f_res_f_res_70017 = add64((int64_t) 1,\n                                                              span_69985);\n                    \n                    loopres_f_res_70015 = loopres_f_res_f_res_70017;\n                }\n                loopres_70005 = loopres_f_res_70013;\n                loopres_70006 = loopres_f_res_70014;\n                loopres_70007 = loopres_f_res_70015;\n            }\n            \n            bool loop_cond_70018 = slt64(loopres_70007, min_res_65364);\n            bool loop_while_tmp_78943 = loop_cond_70018;\n            int64_t l_idx_tmp_78944 = loopres_70005;\n            int64_t r_idx_tmp_78945 = loopres_70006;\n            int64_t span_tmp_78946 = loopres_70007;\n            \n            loop_while_69982 = loop_while_tmp_78943;\n            l_idx_69983 = l_idx_tmp_78944;\n            r_idx_69984 = r_idx_tmp_78945;\n            span_69985 = span_tmp_78946;\n        }\n        idx_69978 = loop_while_69982;\n        idx_69979 = l_idx_69983;\n        idx_69980 = r_idx_69984;\n        idx_69981 = span_69985;\n        \n        int64_t min_res_70019 = smin64(min_arg_69950, idx_69979);\n        int64_t max_res_70020 = smax64((int64_t) 0, min_res_70019);\n        int64_t x_70021 = add64(min_res_69951, max_res_70020);\n        int64_t r_70022 = sub64(x_70021, (int64_t) 1);\n        bool x_70023 = sle64((int64_t) 0, r_70022);\n        bool y_70024 = slt64(r_70022, n_65344);\n        bool bounds_check_70025 = x_70023 && y_70024;\n        bool index_certs_70026;\n        \n        if (!bounds_check_70025) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 28) == -1) {\n      ",
            "              global_failure_args[0] = (int64_t) r_70022;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_70027;\n        \n        x_70027 = ((__global int64_t *) mem_77324)[gtid_69944 * n_65344 +\n                                                   r_70022];\n        \n        int64_t abs_arg_70028 = sub64(x_70027, min_res_69955);\n        int64_t abs_res_70029 = abs64(abs_arg_70028);\n        bool x_70030 = sle64((int64_t) 0, max_res_70020);\n        bool y_70031 = slt64(max_res_70020, n_65344);\n        bool bounds_check_70032 = x_70030 && y_70031;\n        bool index_certs_70033;\n        \n        if (!bounds_check_70032) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 29) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_70020;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_70034;\n        \n        x_70034 = ((__global int64_t *) mem_77324)[gtid_69944 * n_65344 +\n                                                   max_res_70020];\n        \n        int64_t abs_arg_70035 = sub64(x_70034, min_res_69955);\n        int64_t abs_res_70036 = abs64(abs_arg_70035);\n        int64_t max_res_70037 = smax64(abs_res_70029, abs_res_70036);\n        float defunc_0_f_res_70038 = sitofp_i64_f32(max_res_70037);\n        float defunc_1_f_res_70039 = max_res_69952 + defunc_0_f_res_70038;\n        \n        ((__global int64_t *) mem_77431)[gtid_69944 * n_m_65352 + gtid_69945] =\n            min_res_69955;\n        ((__global int64_t *) mem_77435)[gtid_69944 * n_m_65352 + gtid_69945] =\n            max_res_70020;\n        ((__global float *) mem_77439)[gtid_69944 * n_m_65352 + gtid_69945] =\n            defunc_1_f_res_70039;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69939\n}",
            "\n__kernel void mainzisegmap_70099(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_m_65352, __global\n                                 unsigned char *mem_77444, __global\n                                 unsigned char *mem_77448, __global\n                                 unsigned char *mem_77452, __global\n                                 unsigned char *mem_77457, __global\n                                 unsigned char *mem_77461, __global\n                                 unsigned char *mem_77465)\n{\n    #define segmap_group_sizze_70092 (mainzisegmap_group_sizze_69026)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79047;\n    int32_t local_tid_79048;\n    int64_t group_sizze_79051;\n    int32_t wave_sizze_79050;\n    int32_t group_tid_79049;\n    \n    global_tid_79047 = get_global_id(0);\n    local_tid_79048 = get_local_id(0);\n    group_sizze_79051 = get_local_size(0);\n    wave_sizze_79050 = LOCKSTEP_WIDTH;\n    group_tid_79049 = get_group_id(0);\n    \n    int32_t phys_tid_70099 = global_tid_79047;\n    int64_t global_tid_79052 = sext_i32_i64(group_tid_79049) *\n            segmap_group_sizze_70092 + sext_i32_i64(local_tid_79048);\n    int64_t slice_79053 = n_m_65352;\n    int64_t slice_79054 = m_65343 * slice_79053;\n    int64_t gtid_70097 = squot64(global_tid_79052, slice_79053);\n    int64_t remnant_79055 = global_tid_79052 - gtid_70097 * slice_79053;\n    int64_t gtid_70098 = remnant_79055;\n    int64_t remnant_79056 = remnant_79055 - gtid_70098;\n    \n    if (slt64(gtid_70097, m_65343) && slt64(gtid_70098, n_m_65352)) {\n        float defunc_2_reduce_res_70100;\n        \n        defunc_2_reduce_res_70100 = ((__global float *) mem_77444)[gtid_70097 *\n                                                                   n_m_65352 +\n                                                                   gtid_70098];\n        \n   ",
            "     float defunc_2_reduce_res_70101;\n        \n        defunc_2_reduce_res_70101 = ((__global float *) mem_77448)[gtid_70097 *\n                                                                   n_m_65352 +\n                                                                   gtid_70098];\n        \n        float defunc_2_reduce_res_70102;\n        \n        defunc_2_reduce_res_70102 = ((__global float *) mem_77452)[gtid_70097 *\n                                                                   n_m_65352 +\n                                                                   gtid_70098];\n        \n        float x_70103 = defunc_2_reduce_res_70100 * defunc_2_reduce_res_70102;\n        float y_70104 = defunc_2_reduce_res_70101 * defunc_2_reduce_res_70101;\n        float y_70105 = x_70103 - y_70104;\n        float det1_70106 = 1.0F / y_70105;\n        float a11_70107 = defunc_2_reduce_res_70102 * det1_70106;\n        float x_70108 = 0.0F - defunc_2_reduce_res_70101;\n        float b11_70109 = det1_70106 * x_70108;\n        float c11_70110 = defunc_2_reduce_res_70100 * det1_70106;\n        \n        ((__global float *) mem_77457)[gtid_70097 * n_m_65352 + gtid_70098] =\n            a11_70107;\n        ((__global float *) mem_77461)[gtid_70097 * n_m_65352 + gtid_70098] =\n            b11_70109;\n        ((__global float *) mem_77465)[gtid_70097 * n_m_65352 + gtid_70098] =\n            c11_70110;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_70092\n}\n__kernel void mainzisegmap_70429(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t jump_65348, int64_t n_m_65352,\n                                 int64_t i_65358, unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_",
            "65369_bits,\n                                 float i64_res_65370, int64_t num_groups_70424,\n                                 int64_t num_threads_78234, __global\n                                 unsigned char *mem_77491, __global\n                                 unsigned char *mem_77600, __global\n                                 unsigned char *mem_77603, __global\n                                 unsigned char *color_78164, __global\n                                 unsigned char *color_78165, __global\n                                 unsigned char *color_78166, __global\n                                 unsigned char *color_78167, __global\n                                 unsigned char *color_78168, __global\n                                 unsigned char *color_78169)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_70423 (mainzisegmap_group_sizze_70183)\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_79149;\n    int32_t local_tid_79150;\n    int64_t group_sizze_79153;\n    int32_t wave_sizze_79152;\n    int32_t group_tid_79151;\n    \n    global_tid_79149 = get_global_id(0);\n    local_tid_79150 = get_local_id(0);\n    group_sizze_79153 = get_local_size(0);\n    wave_sizze_79152 = LOCKSTEP_WIDTH;\n    group_tid_79151 = get_group_id(0);\n    \n    int32_t phys_tid_70429 = global_tid_79149;\n    int32_t phys_group_id_79154;\n    \n    phys_group_id_79154 = get_group_id(0);\n    for (int32_t i_79155 = 0; i_79155 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343, segmap_group_sizze_70423)) -\n                   phys_group_id_79154, sext_i64_i32(num_groups_70424));\n         i_79155++) {\n        int32_t virt_grou",
            "p_id_79156 = phys_group_id_79154 + i_79155 *\n                sext_i64_i32(num_groups_70424);\n        int64_t global_tid_79157 = sext_i32_i64(virt_group_id_79156) *\n                segmap_group_sizze_70423 + sext_i32_i64(local_tid_79150);\n        int64_t slice_79158 = m_65343;\n        int64_t gtid_70428 = global_tid_79157;\n        int64_t remnant_79159 = global_tid_79157 - gtid_70428;\n        \n        if (slt64(gtid_70428, m_65343)) {\n            int64_t discard_76874;\n            int64_t scanacc_76870 = (int64_t) 0;\n            \n            for (int64_t i_76872 = 0; i_76872 < n_65344; i_76872++) {\n                float x_70435;\n                \n                x_70435 = ((__global float *) mem_77491)[i_76872 * m_65343 +\n                                                         gtid_70428];\n                \n                bool isnan_res_70436;\n                \n                isnan_res_70436 = futrts_isnan32(x_70435);\n                \n                bool defunc_0_p_res_70437 = !isnan_res_70436;\n                int64_t defunc_0_f_res_70438 =\n                        btoi_bool_i64(defunc_0_p_res_70437);\n                int64_t defunc_1_op_res_70434 = add64(defunc_0_f_res_70438,\n                                                      scanacc_76870);\n                \n                ((__global int64_t *) color_78167)[phys_tid_70429 + i_76872 *\n                                                   num_threads_78234] =\n                    defunc_1_op_res_70434;\n                \n                int64_t scanacc_tmp_79160 = defunc_1_op_res_70434;\n                \n                scanacc_76870 = scanacc_tmp_79160;\n            }\n            discard_76874 = scanacc_76870;\n            \n            int64_t last_res_70439;\n            \n            last_res_70439 = ((__global int64_t *) color_78167)[phys_tid_70429 +\n                                                                i_65358 *\n                                                                num_threads_78234];\n            for ",
            "(int64_t i_79162 = 0; i_79162 < n_65344; i_79162++) {\n                ((__global float *) color_78169)[phys_tid_70429 + i_79162 *\n                                                 num_threads_78234] = 0.0F;\n            }\n            for (int64_t i_79163 = 0; i_79163 < n_65344; i_79163++) {\n                ((__global int64_t *) color_78168)[phys_tid_70429 + i_79163 *\n                                                   num_threads_78234] =\n                    (int64_t) -1;\n            }\n            for (int64_t write_iter_76875 = 0; write_iter_76875 < n_65344;\n                 write_iter_76875++) {\n                float write_iv_76878;\n                \n                write_iv_76878 = ((__global\n                                   float *) mem_77491)[write_iter_76875 *\n                                                       m_65343 + gtid_70428];\n                \n                bool isnan_res_70447;\n                \n                isnan_res_70447 = futrts_isnan32(write_iv_76878);\n                \n                bool defunc_0_p_res_70448 = !isnan_res_70447;\n                int64_t defunc_1_f_res_70449;\n                \n                if (defunc_0_p_res_70448) {\n                    int64_t write_iv_76879;\n                    \n                    write_iv_76879 = ((__global\n                                       int64_t *) color_78167)[phys_tid_70429 +\n                                                               write_iter_76875 *\n                                                               num_threads_78234];\n                    \n                    int64_t defunc_1_f_res_t_res_70450 = sub64(write_iv_76879,\n                                                               (int64_t) 1);\n                    \n                    defunc_1_f_res_70449 = defunc_1_f_res_t_res_70450;\n                } else {\n                    defunc_1_f_res_70449 = (int64_t) -1;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_70449) &&\n                    slt64(defunc",
            "_1_f_res_70449, n_65344)) {\n                    ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                       defunc_1_f_res_70449 *\n                                                       num_threads_78234] =\n                        write_iter_76875;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_70449) &&\n                    slt64(defunc_1_f_res_70449, n_65344)) {\n                    for (int64_t i_79166 = 0; i_79166 < (int64_t) 1;\n                         i_79166++) {\n                        float tmp_79167;\n                        \n                        tmp_79167 = ((__global float *) mem_77491)[m_65343 *\n                                                                   write_iter_76875 +\n                                                                   gtid_70428 +\n                                                                   i_79166 *\n                                                                   m_65343];\n                        ((__global float *) color_78169)[phys_tid_70429 +\n                                                         num_threads_78234 *\n                                                         defunc_1_f_res_70449 +\n                                                         i_79166 *\n                                                         num_threads_78234] =\n                            tmp_79167;\n                    }\n                }\n            }\n            for (int64_t i_76885 = 0; i_76885 < n_65344; i_76885++) {\n                int64_t x_70452;\n                \n                x_70452 = ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                             i_76885 *\n                                                             num_threads_78234];\n                \n                int64_t defunc_0_f_res_70453 = add64((int64_t) 1, x_70452);\n                \n                ((__global int64_t *) color_78167)[phys_tid_704",
            "29 + i_76885 *\n                                                   num_threads_78234] =\n                    defunc_0_f_res_70453;\n            }\n            \n            int64_t min_arg_70454 = sub64(last_res_70439, (int64_t) 1);\n            int64_t min_arg_70455 = sub64(last_res_70439, min_res_65364);\n            int64_t min_res_70456 = smin64(q_65346, last_res_70439);\n            float i64_res_70457 = sitofp_i64_f32(last_res_70439);\n            float x_70458 = i64_res_65370 - i64_res_70457;\n            float max_arg_70459 = x_70458 / 2.0F;\n            float max_res_70460 = fmax32(0.0F, max_arg_70459);\n            \n            for (int64_t i_76889 = 0; i_76889 < q_65346; i_76889++) {\n                bool cond_70463 = sle64(last_res_70439, i_76889);\n                float defunc_0_f_res_70464;\n                \n                if (cond_70463) {\n                    defunc_0_f_res_70464 = 0.0F;\n                } else {\n                    defunc_0_f_res_70464 = 1.0F;\n                }\n                ((__global float *) color_78166)[phys_tid_70429 + i_76889 *\n                                                 num_threads_78234] =\n                    defunc_0_f_res_70464;\n            }\n            for (int64_t i_76895 = 0; i_76895 < n_m_65352; i_76895++) {\n                int64_t min_arg_70468 = mul64(jump_65348, i_76895);\n                int64_t min_res_70469 = smin64(i_65358, min_arg_70468);\n                int64_t defunc_0_g_res_70470 = add64((int64_t) 1,\n                                                     min_res_70469);\n                bool init_idx_70471;\n                int64_t init_idx_70472;\n                int64_t init_idx_70473;\n                bool loop_while_70474;\n                int64_t low_70475;\n                int64_t high_70476;\n                \n                loop_while_70474 = x_65359;\n                low_70475 = (int64_t) 0;\n                high_70476 = i_65358;\n                while (loop_while_70474) {\n                    int64_t x_70477 = add64(low",
            "_70475, high_70476);\n                    int64_t mid_70478 = sdiv64(x_70477, (int64_t) 2);\n                    bool x_70479 = sle64((int64_t) 0, mid_70478);\n                    bool y_70480 = slt64(mid_70478, n_65344);\n                    bool bounds_check_70481 = x_70479 && y_70480;\n                    bool index_certs_70482;\n                    \n                    if (!bounds_check_70481) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          30) == -1) {\n                                global_failure_args[0] = (int64_t) mid_70478;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t mid_id_70483;\n                    \n                    mid_id_70483 = ((__global\n                                     int64_t *) color_78167)[phys_tid_70429 +\n                                                             mid_70478 *\n                                                             num_threads_78234];\n                    \n                    bool cond_70484 = slt64(mid_id_70483, (int64_t) 0);\n                    int64_t mid_idx_70485;\n                    \n                    if (cond_70484) {\n                        mid_idx_70485 = (int64_t) 9223372036854775807;\n                    } else {\n                        mid_idx_70485 = mid_id_70483;\n                    }\n                    \n                    bool cond_70486 = sle64(defunc_0_g_res_70470,\n                                            mid_idx_70485);\n                    int64_t loopres_70487;\n                    int64_t loopres_70488;\n                    \n                    if (cond_70486) {\n                        int64_t loopres_t_res",
            "_70489 = sub64(mid_70478,\n                                                            (int64_t) 1);\n                        \n                        loopres_70487 = low_70475;\n                        loopres_70488 = loopres_t_res_70489;\n                    } else {\n                        int64_t loopres_f_res_70490 = add64((int64_t) 1,\n                                                            mid_70478);\n                        \n                        loopres_70487 = loopres_f_res_70490;\n                        loopres_70488 = high_70476;\n                    }\n                    \n                    bool loop_cond_70491 = sle64(loopres_70487, loopres_70488);\n                    bool loop_while_tmp_79172 = loop_cond_70491;\n                    int64_t low_tmp_79173 = loopres_70487;\n                    int64_t high_tmp_79174 = loopres_70488;\n                    \n                    loop_while_70474 = loop_while_tmp_79172;\n                    low_70475 = low_tmp_79173;\n                    high_70476 = high_tmp_79174;\n                }\n                init_idx_70471 = loop_while_70474;\n                init_idx_70472 = low_70475;\n                init_idx_70473 = high_70476;\n                \n                bool idx_70492;\n                int64_t idx_70493;\n                int64_t idx_70494;\n                int64_t idx_70495;\n                bool loop_while_70496;\n                int64_t l_idx_70497;\n                int64_t r_idx_70498;\n                int64_t span_70499;\n                \n                loop_while_70496 = loop_cond_65369;\n                l_idx_70497 = init_idx_70472;\n                r_idx_70498 = init_idx_70472;\n                span_70499 = (int64_t) 1;\n                while (loop_while_70496) {\n                    int64_t max_arg_70500 = sub64(l_idx_70497, (int64_t) 1);\n                    int64_t max_res_70501 = smax64((int64_t) 0, max_arg_70500);\n                    int64_t min_arg_70502 = add64((int64_t) 1, r_idx_70498);\n                    int64",
            "_t min_res_70503 = smin64(min_arg_70454,\n                                                   min_arg_70502);\n                    bool x_70504 = sle64((int64_t) 0, max_res_70501);\n                    bool y_70505 = slt64(max_res_70501, n_65344);\n                    bool bounds_check_70506 = x_70504 && y_70505;\n                    bool index_certs_70507;\n                    \n                    if (!bounds_check_70506) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          31) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) max_res_70501;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_70508;\n                    \n                    x_70508 = ((__global\n                                int64_t *) color_78167)[phys_tid_70429 +\n                                                        max_res_70501 *\n                                                        num_threads_78234];\n                    \n                    int64_t abs_arg_70509 = sub64(x_70508,\n                                                  defunc_0_g_res_70470);\n                    int64_t abs_res_70510 = abs64(abs_arg_70509);\n                    bool x_70511 = sle64((int64_t) 0, min_res_70503);\n                    bool y_70512 = slt64(min_res_70503, n_65344);\n                    bool bounds_check_70513 = x_70511 && y_70512;\n                    bool index_certs_70514;\n                    \n                    if (!bounds_check_70513) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                           ",
            "                               32) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) min_res_70503;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_70515;\n                    \n                    x_70515 = ((__global\n                                int64_t *) color_78167)[phys_tid_70429 +\n                                                        min_res_70503 *\n                                                        num_threads_78234];\n                    \n                    int64_t abs_arg_70516 = sub64(x_70515,\n                                                  defunc_0_g_res_70470);\n                    int64_t abs_res_70517 = abs64(abs_arg_70516);\n                    bool cond_70518 = max_res_70501 == l_idx_70497;\n                    int64_t loopres_70519;\n                    int64_t loopres_70520;\n                    int64_t loopres_70521;\n                    \n                    if (cond_70518) {\n                        loopres_70519 = l_idx_70497;\n                        loopres_70520 = r_idx_70498;\n                        loopres_70521 = min_res_65364;\n                    } else {\n                        bool cond_70522 = slt64(abs_res_70510, abs_res_70517);\n                        bool cond_f_res_70523 = min_res_70503 == r_idx_70498;\n                        bool x_70524 = !cond_70522;\n                        bool y_70525 = cond_f_res_70523 && x_70524;\n                        bool cond_70526 = cond_70522 || y_70525;\n                        int64_t loopres_f_res_70527;\n                        \n                        if (cond_70526) {\n                            loopres_f_res_70527 = max_res_70501;\n                        }",
            " else {\n                            loopres_f_res_70527 = l_idx_70497;\n                        }\n                        \n                        int64_t loopres_f_res_70528;\n                        \n                        if (cond_70526) {\n                            loopres_f_res_70528 = r_idx_70498;\n                        } else {\n                            loopres_f_res_70528 = min_res_70503;\n                        }\n                        \n                        int64_t loopres_f_res_70529;\n                        \n                        if (cond_70526) {\n                            int64_t loopres_f_res_t_res_70530 =\n                                    add64((int64_t) 1, span_70499);\n                            \n                            loopres_f_res_70529 = loopres_f_res_t_res_70530;\n                        } else {\n                            int64_t loopres_f_res_f_res_70531 =\n                                    add64((int64_t) 1, span_70499);\n                            \n                            loopres_f_res_70529 = loopres_f_res_f_res_70531;\n                        }\n                        loopres_70519 = loopres_f_res_70527;\n                        loopres_70520 = loopres_f_res_70528;\n                        loopres_70521 = loopres_f_res_70529;\n                    }\n                    \n                    bool loop_cond_70532 = slt64(loopres_70521, min_res_65364);\n                    bool loop_while_tmp_79175 = loop_cond_70532;\n                    int64_t l_idx_tmp_79176 = loopres_70519;\n                    int64_t r_idx_tmp_79177 = loopres_70520;\n                    int64_t span_tmp_79178 = loopres_70521;\n                    \n                    loop_while_70496 = loop_while_tmp_79175;\n                    l_idx_70497 = l_idx_tmp_79176;\n                    r_idx_70498 = r_idx_tmp_79177;\n                    span_70499 = span_tmp_79178;\n                }\n                idx_70492 = loop_while_70496;\n                idx_70493 = l_idx_70497;\n",
            "                idx_70494 = r_idx_70498;\n                idx_70495 = span_70499;\n                \n                int64_t min_res_70533 = smin64(min_arg_70455, idx_70493);\n                int64_t max_res_70534 = smax64((int64_t) 0, min_res_70533);\n                int64_t x_70535 = add64(min_res_70456, max_res_70534);\n                int64_t r_70536 = sub64(x_70535, (int64_t) 1);\n                bool x_70537 = sle64((int64_t) 0, r_70536);\n                bool y_70538 = slt64(r_70536, n_65344);\n                bool bounds_check_70539 = x_70537 && y_70538;\n                bool index_certs_70540;\n                \n                if (!bounds_check_70539) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) r_70536;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_70541;\n                \n                x_70541 = ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                             r_70536 *\n                                                             num_threads_78234];\n                \n                int64_t abs_arg_70542 = sub64(x_70541, min_res_70469);\n                int64_t abs_res_70543 = abs64(abs_arg_70542);\n                bool x_70544 = sle64((int64_t) 0, max_res_70534);\n                bool y_70545 = slt64(max_res_70534, n_65344);\n                bool bounds_check_70546 = x_70544 && y_70545;\n                bool index_certs_70547;\n                \n                if (!bounds_check_70546) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 34) ==\n                            -1) {\n     ",
            "                       global_failure_args[0] = (int64_t) max_res_70534;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_70548;\n                \n                x_70548 = ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                             max_res_70534 *\n                                                             num_threads_78234];\n                \n                int64_t abs_arg_70549 = sub64(x_70548, min_res_70469);\n                int64_t abs_res_70550 = abs64(abs_arg_70549);\n                int64_t max_res_70551 = smax64(abs_res_70543, abs_res_70550);\n                float defunc_0_f_res_70552 = sitofp_i64_f32(max_res_70551);\n                float defunc_1_f_res_70553 = max_res_70460 +\n                      defunc_0_f_res_70552;\n                float defunc_2_reduce_res_70554;\n                float defunc_2_reduce_res_70555;\n                float defunc_2_reduce_res_70556;\n                float defunc_2_reduce_res_70557;\n                float defunc_2_reduce_res_70558;\n                float redout_76898;\n                float redout_76899;\n                float redout_76900;\n                float redout_76901;\n                float redout_76902;\n                \n                redout_76898 = 0.0F;\n                redout_76899 = 0.0F;\n                redout_76900 = 0.0F;\n                redout_76901 = 0.0F;\n                redout_76902 = 0.0F;\n                for (int64_t i_76903 = 0; i_76903 < q_65346; i_76903++) {\n                    float x_70575;\n                    \n                    x_70575 = ((__global float *) color_78166)[phys_tid_70429 +\n                                                               i_76903 *\n                                                     ",
            "          num_threads_78234];\n                    \n                    bool cond_70576 = sle64(last_res_70439, i_76903);\n                    int64_t defunc_0_f_res_70577;\n                    \n                    if (cond_70576) {\n                        defunc_0_f_res_70577 = (int64_t) 0;\n                    } else {\n                        int64_t i_70578 = add64(max_res_70534, i_76903);\n                        int64_t defunc_0_add_arg_70579;\n                        \n                        defunc_0_add_arg_70579 = ((__global\n                                                   int64_t *) color_78168)[phys_tid_70429 +\n                                                                           i_70578 *\n                                                                           num_threads_78234];\n                        \n                        int64_t defunc_1_add_res_70580 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_70579);\n                        \n                        defunc_0_f_res_70577 = defunc_1_add_res_70580;\n                    }\n                    \n                    int64_t binop_p_70581 = sub64(defunc_0_f_res_70577,\n                                                  min_res_70469);\n                    float defunc_0_f_res_70582 = sitofp_i64_f32(binop_p_70581);\n                    float abs_res_70583 = (float) fabs(defunc_0_f_res_70582);\n                    float tmp1_70584 = abs_res_70583 / defunc_1_f_res_70553;\n                    float x_70585 = tmp1_70584 * tmp1_70584;\n                    float y_70586 = tmp1_70584 * x_70585;\n                    float tmp2_70587 = 1.0F - y_70586;\n                    float x_70588 = tmp2_70587 * tmp2_70587;\n                    float tmp3_70589 = tmp2_70587 * x_70588;\n                    float w_j_70590 = x_70575 * tmp3_70589;\n                    float xw_j_70591 = defunc_0_f_res_70582 * w_j_70590;\n                    float x2w_j_70592 = defunc_0_f_res_70582 * xw",
            "_j_70591;\n                    float x3w_j_70593 = defunc_0_f_res_70582 * x2w_j_70592;\n                    float x4w_j_70594 = defunc_0_f_res_70582 * x3w_j_70593;\n                    float defunc_1_op_res_70561 = w_j_70590 + redout_76898;\n                    float defunc_1_op_res_70564 = xw_j_70591 + redout_76899;\n                    float defunc_1_op_res_70567 = x2w_j_70592 + redout_76900;\n                    float defunc_1_op_res_70570 = x3w_j_70593 + redout_76901;\n                    float defunc_1_op_res_70573 = x4w_j_70594 + redout_76902;\n                    float redout_tmp_79179 = defunc_1_op_res_70561;\n                    float redout_tmp_79180 = defunc_1_op_res_70564;\n                    float redout_tmp_79181 = defunc_1_op_res_70567;\n                    float redout_tmp_79182 = defunc_1_op_res_70570;\n                    float redout_tmp_79183 = defunc_1_op_res_70573;\n                    \n                    redout_76898 = redout_tmp_79179;\n                    redout_76899 = redout_tmp_79180;\n                    redout_76900 = redout_tmp_79181;\n                    redout_76901 = redout_tmp_79182;\n                    redout_76902 = redout_tmp_79183;\n                }\n                defunc_2_reduce_res_70554 = redout_76898;\n                defunc_2_reduce_res_70555 = redout_76899;\n                defunc_2_reduce_res_70556 = redout_76900;\n                defunc_2_reduce_res_70557 = redout_76901;\n                defunc_2_reduce_res_70558 = redout_76902;\n                \n                float x_70595 = defunc_2_reduce_res_70556 *\n                      defunc_2_reduce_res_70558;\n                float y_70596 = defunc_2_reduce_res_70557 *\n                      defunc_2_reduce_res_70557;\n                float a12_70597 = x_70595 - y_70596;\n                float x_70598 = defunc_2_reduce_res_70556 *\n                      defunc_2_reduce_res_70557;\n                float y_70599 = defunc_2_reduce_res_70555 *\n                      defunc_2_reduce_res_70558;\n           ",
            "     float b12_70600 = x_70598 - y_70599;\n                float x_70601 = defunc_2_reduce_res_70555 *\n                      defunc_2_reduce_res_70557;\n                float y_70602 = defunc_2_reduce_res_70556 *\n                      defunc_2_reduce_res_70556;\n                float c12_70603 = x_70601 - y_70602;\n                float x_70604 = defunc_2_reduce_res_70554 *\n                      defunc_2_reduce_res_70558;\n                float b2_70605 = x_70604 - y_70602;\n                float x_70606 = defunc_2_reduce_res_70555 *\n                      defunc_2_reduce_res_70556;\n                float y_70607 = defunc_2_reduce_res_70554 *\n                      defunc_2_reduce_res_70557;\n                float c2_70608 = x_70606 - y_70607;\n                float x_70609 = defunc_2_reduce_res_70554 * a12_70597;\n                float y_70610 = defunc_2_reduce_res_70555 * b12_70600;\n                float x_70611 = x_70609 + y_70610;\n                float y_70612 = defunc_2_reduce_res_70556 * c12_70603;\n                float y_70613 = x_70611 + y_70612;\n                float det_70614 = 1.0F / y_70613;\n                float a12_70615 = a12_70597 * det_70614;\n                float b12_70616 = b12_70600 * det_70614;\n                float c12_70617 = c12_70603 * det_70614;\n                float b2_70618 = b2_70605 * det_70614;\n                float c2_70619 = c2_70608 * det_70614;\n                float defunc_2_reduce_res_70620;\n                float defunc_2_reduce_res_70621;\n                float redout_76904;\n                float redout_76905;\n                \n                redout_76904 = 0.0F;\n                redout_76905 = 0.0F;\n                for (int64_t i_76906 = 0; i_76906 < q_65346; i_76906++) {\n                    float x_70629;\n                    \n                    x_70629 = ((__global float *) color_78166)[phys_tid_70429 +\n                                                               i_76906 *\n                                                               num",
            "_threads_78234];\n                    \n                    bool cond_70630 = sle64(last_res_70439, i_76906);\n                    int64_t defunc_0_f_res_70631;\n                    \n                    if (cond_70630) {\n                        defunc_0_f_res_70631 = (int64_t) 0;\n                    } else {\n                        int64_t i_70632 = add64(max_res_70534, i_76906);\n                        int64_t defunc_0_add_arg_70633;\n                        \n                        defunc_0_add_arg_70633 = ((__global\n                                                   int64_t *) color_78168)[phys_tid_70429 +\n                                                                           i_70632 *\n                                                                           num_threads_78234];\n                        \n                        int64_t defunc_1_add_res_70634 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_70633);\n                        \n                        defunc_0_f_res_70631 = defunc_1_add_res_70634;\n                    }\n                    \n                    int64_t binop_p_70635 = sub64(defunc_0_f_res_70631,\n                                                  min_res_70469);\n                    float defunc_0_f_res_70636 = sitofp_i64_f32(binop_p_70635);\n                    float abs_res_70637 = (float) fabs(defunc_0_f_res_70636);\n                    float tmp1_70638 = abs_res_70637 / defunc_1_f_res_70553;\n                    float x_70639 = tmp1_70638 * tmp1_70638;\n                    float y_70640 = tmp1_70638 * x_70639;\n                    float tmp2_70641 = 1.0F - y_70640;\n                    float x_70642 = tmp2_70641 * tmp2_70641;\n                    float tmp3_70643 = tmp2_70641 * x_70642;\n                    float tmp4_70644 = x_70629 * tmp3_70643;\n                    float defunc_1_f_res_70645 = defunc_0_f_res_70636 *\n                          tmp4_70644;\n                    float defunc_1_f_res",
            "_70646 = defunc_0_f_res_70636 *\n                          defunc_1_f_res_70645;\n                    float defunc_0_f_res_70647;\n                    \n                    if (cond_70630) {\n                        defunc_0_f_res_70647 = 0.0F;\n                    } else {\n                        int64_t i_70648 = add64(max_res_70534, i_76906);\n                        float defunc_0_add_arg_70649;\n                        \n                        defunc_0_add_arg_70649 = ((__global\n                                                   float *) color_78169)[phys_tid_70429 +\n                                                                         i_70648 *\n                                                                         num_threads_78234];\n                        defunc_0_f_res_70647 = defunc_0_add_arg_70649;\n                    }\n                    \n                    float x_70650 = a12_70615 * tmp4_70644;\n                    float y_70651 = b12_70616 * defunc_1_f_res_70645;\n                    float x_70652 = x_70650 + y_70651;\n                    float y_70653 = c12_70617 * defunc_1_f_res_70646;\n                    float x_70654 = x_70652 + y_70653;\n                    float defunc_9_fit_fun_res_70655 = defunc_0_f_res_70647 *\n                          x_70654;\n                    float x_70656 = b12_70616 * tmp4_70644;\n                    float y_70657 = b2_70618 * defunc_1_f_res_70645;\n                    float x_70658 = x_70656 + y_70657;\n                    float y_70659 = c2_70619 * defunc_1_f_res_70646;\n                    float x_70660 = x_70658 + y_70659;\n                    float defunc_9_slope_fun_res_70661 = defunc_0_f_res_70647 *\n                          x_70660;\n                    float defunc_1_op_res_70624 = defunc_9_fit_fun_res_70655 +\n                          redout_76904;\n                    float defunc_1_op_res_70627 = defunc_9_slope_fun_res_70661 +\n                          redout_76905;\n                    float redout_tmp_79184 = defunc_1",
            "_op_res_70624;\n                    float redout_tmp_79185 = defunc_1_op_res_70627;\n                    \n                    redout_76904 = redout_tmp_79184;\n                    redout_76905 = redout_tmp_79185;\n                }\n                defunc_2_reduce_res_70620 = redout_76904;\n                defunc_2_reduce_res_70621 = redout_76905;\n                ((__global float *) color_78165)[phys_tid_70429 + i_76895 *\n                                                 num_threads_78234] =\n                    defunc_2_reduce_res_70620;\n                ((__global float *) color_78164)[phys_tid_70429 + i_76895 *\n                                                 num_threads_78234] =\n                    defunc_2_reduce_res_70621;\n            }\n            for (int64_t i_79186 = 0; i_79186 < n_m_65352; i_79186++) {\n                float tmp_79187;\n                \n                tmp_79187 = ((__global float *) color_78165)[phys_tid_70429 +\n                                                             i_79186 *\n                                                             num_threads_78234];\n                ((__global float *) mem_77600)[gtid_70428 + i_79186 * m_65343] =\n                    tmp_79187;\n            }\n            for (int64_t i_79188 = 0; i_79188 < n_m_65352; i_79188++) {\n                float tmp_79189;\n                \n                tmp_79189 = ((__global float *) color_78164)[phys_tid_70429 +\n                                                             i_79188 *\n                                                             num_threads_78234];\n                ((__global float *) mem_77603)[gtid_70428 + i_79188 * m_65343] =\n                    tmp_79189;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_70423\n}\n__kernel void mainzisegmap_71733(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                  ",
            "               unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77608, __global\n                                 unsigned char *mem_77612, __global\n                                 unsigned char *mem_77616)\n{\n    #define segmap_group_sizze_71727 (mainzisegmap_group_sizze_71568)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79293;\n    int32_t local_tid_79294;\n    int64_t group_sizze_79297;\n    int32_t wave_sizze_79296;\n    int32_t group_tid_79295;\n    \n    global_tid_79293 = get_global_id(0);\n    local_tid_79294 = get_local_id(0);\n    group_sizze_79297 = get_local_size(0);\n    wave_sizze_79296 = LOCKSTEP_WIDTH;\n    group_tid_79295 = get_group_id(0);\n    \n    int32_t phys_tid_71733 = global_tid_79293;\n    int64_t global_tid_79298 = sext_i32_i64(group_tid_79295) *\n            segmap_group_sizze_71727 + sext_i32_i64(local_tid_79294);\n    int64_t slice_79299 = n_65344;\n    int64_t slice_79300 = m_65343 * slice_79299;\n    int64_t gtid_71731 = squot64(global_tid_79298, slice_79299);\n    int64_t remnant_79301 = global_tid_79298 - gtid_71731 * slice_79299;\n    int64_t gtid_71732 = remnant_79301;\n    int64_t remnant_79302 = remnant_79301 - gtid_71732;\n    \n    if (slt64(gtid_71731, m_65343) && slt64(gtid_71732, n_65344)) {\n        float x_71734;\n        \n        x_71734 = ((__global float *) Y_mem_76976)[gtid_71731 * n_65344 +\n                                                   gtid_71732];\n        \n        bool isnan_res_71737;\n        \n        isnan_res_71737 = futrts_isnan32(x_71734);\n        \n        bool defunc_0_p_res_71738 = !isnan_res_71737;\n        int64_t defunc_1_f_res_71739;\n        \n        if (defunc_0_p_res_71738) {\n            int64_t x_71735;\n            \n            x_71735 = ((__global int64_t *) mem_77608)[gtid_71731 * n_65344 +\n                                                       gtid_7173",
            "2];\n            \n            int64_t defunc_1_f_res_t_res_71740 = sub64(x_71735, (int64_t) 1);\n            \n            defunc_1_f_res_71739 = defunc_1_f_res_t_res_71740;\n        } else {\n            defunc_1_f_res_71739 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_71731) && slt64(gtid_71731, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_71739) &&\n             slt64(defunc_1_f_res_71739, n_65344))) {\n            ((__global int64_t *) mem_77616)[gtid_71731 * n_65344 +\n                                             defunc_1_f_res_71739] = gtid_71732;\n        }\n        if ((sle64((int64_t) 0, gtid_71731) && slt64(gtid_71731, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_71739) &&\n             slt64(defunc_1_f_res_71739, n_65344))) {\n            ((__global float *) mem_77612)[gtid_71731 * n_65344 +\n                                           defunc_1_f_res_71739] = x_71734;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71727\n}\n__kernel void mainzisegmap_71752(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77616, __global\n                                 unsigned char *mem_77622)\n{\n    #define segmap_group_sizze_71747 (mainzisegmap_group_sizze_71542)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79303;\n    int32_t local_tid_79304;\n    int64_t group_sizze_79307;\n    int32_t wave_sizze_79306;\n    int32_t group_tid_79305;\n    \n    global_tid_79303 = get_global_id(0);\n    local_tid_79304 = get_local_id(0);\n    group_sizze_79307 = get_local_size(0);\n    wave_sizze_79306 = LOCKSTEP_WIDTH;\n    group_tid_79305 = get_group_id(0);\n    \n    int32_t phys_tid_71752 = global_tid_79303;\n    int64_t global_tid_79308 = sext_i32_i64(group_tid_79305) *\n            segmap_group_sizze_71",
            "747 + sext_i32_i64(local_tid_79304);\n    int64_t slice_79309 = n_65344;\n    int64_t slice_79310 = m_65343 * slice_79309;\n    int64_t gtid_71750 = squot64(global_tid_79308, slice_79309);\n    int64_t remnant_79311 = global_tid_79308 - gtid_71750 * slice_79309;\n    int64_t gtid_71751 = remnant_79311;\n    int64_t remnant_79312 = remnant_79311 - gtid_71751;\n    \n    if (slt64(gtid_71750, m_65343) && slt64(gtid_71751, n_65344)) {\n        int64_t x_71753;\n        \n        x_71753 = ((__global int64_t *) mem_77616)[gtid_71750 * n_65344 +\n                                                   gtid_71751];\n        \n        int64_t defunc_0_f_res_71754 = add64((int64_t) 1, x_71753);\n        \n        ((__global int64_t *) mem_77622)[gtid_71750 * n_65344 + gtid_71751] =\n            defunc_0_f_res_71754;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71747\n}\n__kernel void mainzisegmap_71764(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77608, __global\n                                 unsigned char *mem_77626, __global\n                                 unsigned char *mem_77629, __global\n                                 unsigned char *mem_77632, __global\n                                 unsigned char *mem_77635)\n{\n    #define segmap_group_sizze_71757 (mainzisegmap_group_sizze_71516)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79313;\n    int32_t local_tid_79314;\n    int64_t group_sizze_79317;\n    int32_t wave_sizze_79316;\n    int32_t group_tid_79315;\n    \n    global_tid_79313 = get_global_id(0);\n    local_tid_79314 = get_local_id(0);\n    group_sizze_79317 = get_local_size(0);\n    wave_sizze_7",
            "9316 = LOCKSTEP_WIDTH;\n    group_tid_79315 = get_group_id(0);\n    \n    int32_t phys_tid_71764 = global_tid_79313;\n    int64_t global_tid_79318 = sext_i32_i64(group_tid_79315) *\n            segmap_group_sizze_71757 + sext_i32_i64(local_tid_79314);\n    int64_t slice_79319 = m_65343;\n    int64_t gtid_71763 = global_tid_79318;\n    int64_t remnant_79320 = global_tid_79318 - gtid_71763;\n    \n    if (slt64(gtid_71763, m_65343)) {\n        int64_t last_res_71765;\n        \n        last_res_71765 = ((__global int64_t *) mem_77608)[gtid_71763 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_71766 = sub64(last_res_71765, (int64_t) 1);\n        int64_t min_arg_71767 = sub64(last_res_71765, min_res_65364);\n        int64_t min_res_71768 = smin64(q_65346, last_res_71765);\n        float i64_res_71769 = sitofp_i64_f32(last_res_71765);\n        float x_71770 = i64_res_65370 - i64_res_71769;\n        float max_arg_71771 = x_71770 / 2.0F;\n        float max_res_71772 = fmax32(0.0F, max_arg_71771);\n        \n        ((__global int64_t *) mem_77626)[gtid_71763] = min_arg_71766;\n        ((__global int64_t *) mem_77629)[gtid_71763] = min_arg_71767;\n        ((__global int64_t *) mem_77632)[gtid_71763] = min_res_71768;\n        ((__global float *) mem_77635)[gtid_71763] = max_res_71772;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71757\n}\n__kernel void mainzisegmap_71784(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77608, __global\n                                 unsigned char *mem_77640)\n{\n    #define segmap_group_sizze_71779 (mainzisegmap_group_sizze_71491)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79321;\n    ",
            "int32_t local_tid_79322;\n    int64_t group_sizze_79325;\n    int32_t wave_sizze_79324;\n    int32_t group_tid_79323;\n    \n    global_tid_79321 = get_global_id(0);\n    local_tid_79322 = get_local_id(0);\n    group_sizze_79325 = get_local_size(0);\n    wave_sizze_79324 = LOCKSTEP_WIDTH;\n    group_tid_79323 = get_group_id(0);\n    \n    int32_t phys_tid_71784 = global_tid_79321;\n    int64_t global_tid_79326 = sext_i32_i64(group_tid_79323) *\n            segmap_group_sizze_71779 + sext_i32_i64(local_tid_79322);\n    int64_t slice_79327 = q_65346;\n    int64_t slice_79328 = m_65343 * slice_79327;\n    int64_t gtid_71782 = squot64(global_tid_79326, slice_79327);\n    int64_t remnant_79329 = global_tid_79326 - gtid_71782 * slice_79327;\n    int64_t gtid_71783 = remnant_79329;\n    int64_t remnant_79330 = remnant_79329 - gtid_71783;\n    \n    if (slt64(gtid_71782, m_65343) && slt64(gtid_71783, q_65346)) {\n        int64_t last_res_71785;\n        \n        last_res_71785 = ((__global int64_t *) mem_77608)[gtid_71782 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_71787 = sle64(last_res_71785, gtid_71783);\n        float defunc_0_f_res_71788;\n        \n        if (cond_71787) {\n            defunc_0_f_res_71788 = 0.0F;\n        } else {\n            defunc_0_f_res_71788 = 1.0F;\n        }\n        ((__global float *) mem_77640)[gtid_71782 * q_65346 + gtid_71783] =\n            defunc_0_f_res_71788;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71779\n}\n__kernel void mainzisegmap_72017(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n              ",
            "                   unsigned char loop_cond_65369_bits, __global\n                                 unsigned char *mem_77616, __global\n                                 unsigned char *mem_77622, __global\n                                 unsigned char *mem_77626, __global\n                                 unsigned char *mem_77629, __global\n                                 unsigned char *mem_77632, __global\n                                 unsigned char *mem_77635, __global\n                                 unsigned char *mem_77747, __global\n                                 unsigned char *mem_77751, __global\n                                 unsigned char *mem_77755)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_72010 (mainzisegmap_group_sizze_71100)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79401;\n    int32_t local_tid_79402;\n    int64_t group_sizze_79405;\n    int32_t wave_sizze_79404;\n    int32_t group_tid_79403;\n    \n    global_tid_79401 = get_global_id(0);\n    local_tid_79402 = get_local_id(0);\n    group_sizze_79405 = get_local_size(0);\n    wave_sizze_79404 = LOCKSTEP_WIDTH;\n    group_tid_79403 = get_group_id(0);\n    \n    int32_t phys_tid_72017 = global_tid_79401;\n    int64_t global_tid_79406 = sext_i32_i64(group_tid_79403) *\n            segmap_group_sizze_72010 + sext_i32_i64(local_tid_79402);\n    int64_t slice_79407 = n_m_65352;\n    int64_t slice_79408 = m_65343 * slice_79407;\n    int64_t gtid_72015 = squot64(global_tid_79406, slice_79407);\n    int64_t remnant_79409 = global_tid_79406 - gtid_72015 * slice_79407;\n    int64_t gtid_72016 = remnant_79409;\n    int64_t remnant_79410 = remnant_79409 - gtid_72016;\n    \n    if (slt64(gtid_72015, m_65343) && slt64(gtid_72016, n_m_65352)) {\n        int64_t min_arg_72020;\n        \n        min_arg_72020 = ((__global int64_t *) me",
            "m_77626)[gtid_72015];\n        \n        int64_t min_arg_72021;\n        \n        min_arg_72021 = ((__global int64_t *) mem_77629)[gtid_72015];\n        \n        int64_t min_res_72022;\n        \n        min_res_72022 = ((__global int64_t *) mem_77632)[gtid_72015];\n        \n        float max_res_72023;\n        \n        max_res_72023 = ((__global float *) mem_77635)[gtid_72015];\n        \n        int64_t min_arg_72025 = mul64(jump_65348, gtid_72016);\n        int64_t min_res_72026 = smin64(i_65358, min_arg_72025);\n        int64_t defunc_0_g_res_72027 = add64((int64_t) 1, min_res_72026);\n        bool init_idx_72028;\n        int64_t init_idx_72029;\n        int64_t init_idx_72030;\n        bool loop_while_72031;\n        int64_t low_72032;\n        int64_t high_72033;\n        \n        loop_while_72031 = x_65359;\n        low_72032 = (int64_t) 0;\n        high_72033 = i_65358;\n        while (loop_while_72031) {\n            int64_t x_72034 = add64(low_72032, high_72033);\n            int64_t mid_72035 = sdiv64(x_72034, (int64_t) 2);\n            bool x_72036 = sle64((int64_t) 0, mid_72035);\n            bool y_72037 = slt64(mid_72035, n_65344);\n            bool bounds_check_72038 = x_72036 && y_72037;\n            bool index_certs_72039;\n            \n            if (!bounds_check_72038) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_72035;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_72040;\n            \n            mid_id_72040 = ((__global int64_t *) mem_77622)[gtid_72015 *\n                                                            n_65344 +\n                                                            mid_72035];\n            \n            bool cond_72041 = slt64(mid_id_72040, (int",
            "64_t) 0);\n            int64_t mid_idx_72042;\n            \n            if (cond_72041) {\n                mid_idx_72042 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_72042 = mid_id_72040;\n            }\n            \n            bool cond_72043 = sle64(defunc_0_g_res_72027, mid_idx_72042);\n            int64_t loopres_72044;\n            int64_t loopres_72045;\n            \n            if (cond_72043) {\n                int64_t loopres_t_res_72046 = sub64(mid_72035, (int64_t) 1);\n                \n                loopres_72044 = low_72032;\n                loopres_72045 = loopres_t_res_72046;\n            } else {\n                int64_t loopres_f_res_72047 = add64((int64_t) 1, mid_72035);\n                \n                loopres_72044 = loopres_f_res_72047;\n                loopres_72045 = high_72033;\n            }\n            \n            bool loop_cond_72048 = sle64(loopres_72044, loopres_72045);\n            bool loop_while_tmp_79411 = loop_cond_72048;\n            int64_t low_tmp_79412 = loopres_72044;\n            int64_t high_tmp_79413 = loopres_72045;\n            \n            loop_while_72031 = loop_while_tmp_79411;\n            low_72032 = low_tmp_79412;\n            high_72033 = high_tmp_79413;\n        }\n        init_idx_72028 = loop_while_72031;\n        init_idx_72029 = low_72032;\n        init_idx_72030 = high_72033;\n        \n        bool idx_72049;\n        int64_t idx_72050;\n        int64_t idx_72051;\n        int64_t idx_72052;\n        bool loop_while_72053;\n        int64_t l_idx_72054;\n        int64_t r_idx_72055;\n        int64_t span_72056;\n        \n        loop_while_72053 = loop_cond_65369;\n        l_idx_72054 = init_idx_72029;\n        r_idx_72055 = init_idx_72029;\n        span_72056 = (int64_t) 1;\n        while (loop_while_72053) {\n            int64_t max_arg_72057 = sub64(l_idx_72054, (int64_t) 1);\n            int64_t max_res_72058 = smax64((int64_t) 0, max_arg_72057);\n            int64_t min_arg_72059 = add64((int64_t) 1, r_idx_7205",
            "5);\n            int64_t min_res_72060 = smin64(min_arg_72020, min_arg_72059);\n            bool x_72061 = sle64((int64_t) 0, max_res_72058);\n            bool y_72062 = slt64(max_res_72058, n_65344);\n            bool bounds_check_72063 = x_72061 && y_72062;\n            bool index_certs_72064;\n            \n            if (!bounds_check_72063) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_72058;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_72065;\n            \n            x_72065 = ((__global int64_t *) mem_77622)[gtid_72015 * n_65344 +\n                                                       max_res_72058];\n            \n            int64_t abs_arg_72066 = sub64(x_72065, defunc_0_g_res_72027);\n            int64_t abs_res_72067 = abs64(abs_arg_72066);\n            bool x_72068 = sle64((int64_t) 0, min_res_72060);\n            bool y_72069 = slt64(min_res_72060, n_65344);\n            bool bounds_check_72070 = x_72068 && y_72069;\n            bool index_certs_72071;\n            \n            if (!bounds_check_72070) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 42) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_72060;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_72072;\n            \n            x_72072 = ((__global int64_t *) mem_77622)[gtid_72015 * n_65344 +\n                                                       min_res_72060];\n            \n            int64_t abs_arg_72073 = sub64(x_72072, defunc_0_g_res_72027);\n",
            "            int64_t abs_res_72074 = abs64(abs_arg_72073);\n            bool cond_72075 = max_res_72058 == l_idx_72054;\n            int64_t loopres_72076;\n            int64_t loopres_72077;\n            int64_t loopres_72078;\n            \n            if (cond_72075) {\n                loopres_72076 = l_idx_72054;\n                loopres_72077 = r_idx_72055;\n                loopres_72078 = min_res_65364;\n            } else {\n                bool cond_72079 = slt64(abs_res_72067, abs_res_72074);\n                bool cond_f_res_72080 = min_res_72060 == r_idx_72055;\n                bool x_72081 = !cond_72079;\n                bool y_72082 = cond_f_res_72080 && x_72081;\n                bool cond_72083 = cond_72079 || y_72082;\n                int64_t loopres_f_res_72084;\n                \n                if (cond_72083) {\n                    loopres_f_res_72084 = max_res_72058;\n                } else {\n                    loopres_f_res_72084 = l_idx_72054;\n                }\n                \n                int64_t loopres_f_res_72085;\n                \n                if (cond_72083) {\n                    loopres_f_res_72085 = r_idx_72055;\n                } else {\n                    loopres_f_res_72085 = min_res_72060;\n                }\n                \n                int64_t loopres_f_res_72086;\n                \n                if (cond_72083) {\n                    int64_t loopres_f_res_t_res_72087 = add64((int64_t) 1,\n                                                              span_72056);\n                    \n                    loopres_f_res_72086 = loopres_f_res_t_res_72087;\n                } else {\n                    int64_t loopres_f_res_f_res_72088 = add64((int64_t) 1,\n                                                              span_72056);\n                    \n                    loopres_f_res_72086 = loopres_f_res_f_res_72088;\n                }\n                loopres_72076 = loopres_f_res_72084;\n                loopres_72077 = loopres_f_res_72085;\n             ",
            "   loopres_72078 = loopres_f_res_72086;\n            }\n            \n            bool loop_cond_72089 = slt64(loopres_72078, min_res_65364);\n            bool loop_while_tmp_79414 = loop_cond_72089;\n            int64_t l_idx_tmp_79415 = loopres_72076;\n            int64_t r_idx_tmp_79416 = loopres_72077;\n            int64_t span_tmp_79417 = loopres_72078;\n            \n            loop_while_72053 = loop_while_tmp_79414;\n            l_idx_72054 = l_idx_tmp_79415;\n            r_idx_72055 = r_idx_tmp_79416;\n            span_72056 = span_tmp_79417;\n        }\n        idx_72049 = loop_while_72053;\n        idx_72050 = l_idx_72054;\n        idx_72051 = r_idx_72055;\n        idx_72052 = span_72056;\n        \n        int64_t min_res_72090 = smin64(min_arg_72021, idx_72050);\n        int64_t max_res_72091 = smax64((int64_t) 0, min_res_72090);\n        int64_t x_72092 = add64(min_res_72022, max_res_72091);\n        int64_t r_72093 = sub64(x_72092, (int64_t) 1);\n        bool x_72094 = sle64((int64_t) 0, r_72093);\n        bool y_72095 = slt64(r_72093, n_65344);\n        bool bounds_check_72096 = x_72094 && y_72095;\n        bool index_certs_72097;\n        \n        if (!bounds_check_72096) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = (int64_t) r_72093;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_72098;\n        \n        x_72098 = ((__global int64_t *) mem_77616)[gtid_72015 * n_65344 +\n                                                   r_72093];\n        \n        int64_t abs_arg_72099 = sub64(x_72098, min_res_72026);\n        int64_t abs_res_72100 = abs64(abs_arg_72099);\n        bool x_72101 = sle64((int64_t) 0, max_res_72091);\n        bool y_72102 = slt64(max_res_72091, n_65344);\n        bool bounds_check_72103 = x_72101 && y_72102;\n        bool index_certs_72104;\n     ",
            "   \n        if (!bounds_check_72103) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 44) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_72091;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_72105;\n        \n        x_72105 = ((__global int64_t *) mem_77616)[gtid_72015 * n_65344 +\n                                                   max_res_72091];\n        \n        int64_t abs_arg_72106 = sub64(x_72105, min_res_72026);\n        int64_t abs_res_72107 = abs64(abs_arg_72106);\n        int64_t max_res_72108 = smax64(abs_res_72100, abs_res_72107);\n        float defunc_0_f_res_72109 = sitofp_i64_f32(max_res_72108);\n        float defunc_1_f_res_72110 = max_res_72023 + defunc_0_f_res_72109;\n        \n        ((__global int64_t *) mem_77747)[gtid_72015 * n_m_65352 + gtid_72016] =\n            min_res_72026;\n        ((__global int64_t *) mem_77751)[gtid_72015 * n_m_65352 + gtid_72016] =\n            max_res_72091;\n        ((__global float *) mem_77755)[gtid_72015 * n_m_65352 + gtid_72016] =\n            defunc_1_f_res_72110;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72010\n}\n__kernel void mainzisegmap_72182(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_m_65352, __global\n                                 unsigned char *mem_77760, __global\n                                 unsigned char *mem_77764, __global\n                                 unsigned char *mem_77768, __global\n                                 unsigned char *mem_77772, __global\n                                 unsigned char *mem_77776, __global\n                                 unsigned char *mem_77781, __global\n                                 unsigned char *mem_77785, __global\n                                 unsigned char *mem_77789, __global\n                               ",
            "  unsigned char *mem_77793, __global\n                                 unsigned char *mem_77797)\n{\n    #define segmap_group_sizze_72173 (mainzisegmap_group_sizze_70998)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79546;\n    int32_t local_tid_79547;\n    int64_t group_sizze_79550;\n    int32_t wave_sizze_79549;\n    int32_t group_tid_79548;\n    \n    global_tid_79546 = get_global_id(0);\n    local_tid_79547 = get_local_id(0);\n    group_sizze_79550 = get_local_size(0);\n    wave_sizze_79549 = LOCKSTEP_WIDTH;\n    group_tid_79548 = get_group_id(0);\n    \n    int32_t phys_tid_72182 = global_tid_79546;\n    int64_t global_tid_79551 = sext_i32_i64(group_tid_79548) *\n            segmap_group_sizze_72173 + sext_i32_i64(local_tid_79547);\n    int64_t slice_79552 = n_m_65352;\n    int64_t slice_79553 = m_65343 * slice_79552;\n    int64_t gtid_72180 = squot64(global_tid_79551, slice_79552);\n    int64_t remnant_79554 = global_tid_79551 - gtid_72180 * slice_79552;\n    int64_t gtid_72181 = remnant_79554;\n    int64_t remnant_79555 = remnant_79554 - gtid_72181;\n    \n    if (slt64(gtid_72180, m_65343) && slt64(gtid_72181, n_m_65352)) {\n        float defunc_2_reduce_res_72183;\n        \n        defunc_2_reduce_res_72183 = ((__global float *) mem_77760)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72184;\n        \n        defunc_2_reduce_res_72184 = ((__global float *) mem_77764)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72185;\n        \n        defunc_2_reduce_res_72185 = ((__global float *) mem_77768)[gtid_72180 *\n                    ",
            "                                               n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72186;\n        \n        defunc_2_reduce_res_72186 = ((__global float *) mem_77772)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72187;\n        \n        defunc_2_reduce_res_72187 = ((__global float *) mem_77776)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float x_72188 = defunc_2_reduce_res_72185 * defunc_2_reduce_res_72187;\n        float y_72189 = defunc_2_reduce_res_72186 * defunc_2_reduce_res_72186;\n        float a12_72190 = x_72188 - y_72189;\n        float x_72191 = defunc_2_reduce_res_72185 * defunc_2_reduce_res_72186;\n        float y_72192 = defunc_2_reduce_res_72184 * defunc_2_reduce_res_72187;\n        float b12_72193 = x_72191 - y_72192;\n        float x_72194 = defunc_2_reduce_res_72184 * defunc_2_reduce_res_72186;\n        float y_72195 = defunc_2_reduce_res_72185 * defunc_2_reduce_res_72185;\n        float c12_72196 = x_72194 - y_72195;\n        float x_72197 = defunc_2_reduce_res_72183 * defunc_2_reduce_res_72187;\n        float b2_72198 = x_72197 - y_72195;\n        float x_72199 = defunc_2_reduce_res_72184 * defunc_2_reduce_res_72185;\n        float y_72200 = defunc_2_reduce_res_72183 * defunc_2_reduce_res_72186;\n        float c2_72201 = x_72199 - y_72200;\n        float x_72202 = defunc_2_reduce_res_72183 * a12_72190;\n        float y_72203 = defunc_2_reduce_res_72184 * b12_72193;\n        float x_72204 = x_72202 + y_72203;\n        float y_72205 = defunc_2_reduce_res_72185 * c12_72196;\n        float y_72206 = x_72204 + y_72205;\n        float det_72207 = 1.0F / y_72206;\n     ",
            "   float a12_72208 = a12_72190 * det_72207;\n        float b12_72209 = b12_72193 * det_72207;\n        float c12_72210 = c12_72196 * det_72207;\n        float b2_72211 = b2_72198 * det_72207;\n        float c2_72212 = c2_72201 * det_72207;\n        \n        ((__global float *) mem_77781)[gtid_72180 * n_m_65352 + gtid_72181] =\n            a12_72208;\n        ((__global float *) mem_77785)[gtid_72180 * n_m_65352 + gtid_72181] =\n            b12_72209;\n        ((__global float *) mem_77789)[gtid_72180 * n_m_65352 + gtid_72181] =\n            c12_72210;\n        ((__global float *) mem_77793)[gtid_72180 * n_m_65352 + gtid_72181] =\n            b2_72211;\n        ((__global float *) mem_77797)[gtid_72180 * n_m_65352 + gtid_72181] =\n            c2_72212;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72173\n}\n__kernel void mainzisegmap_72718(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77833, __global\n                                 unsigned char *mem_77837, __global\n                                 unsigned char *mem_77841)\n{\n    #define segmap_group_sizze_72712 (mainzisegmap_group_sizze_72553)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79748;\n    int32_t local_tid_79749;\n    int64_t group_sizze_79752;\n    int32_t wave_sizze_79751;\n    int32_t group_tid_79750;\n    \n    global_tid_79748 = get_global_id(0);\n    local_tid_79749 = get_local_id(0);\n    group_sizze_79752 = get_local_size(0);\n    wave_sizze_79751 = LOCKSTEP_WIDTH;\n    group_tid_79750 = get_group_id(0);\n    \n    int32_t phys_tid_72718 = global_tid_79748;\n    int64_t global_tid_79753 = sext_i32_i64(group_tid_79750) *\n            segmap_group_sizze_72712 + sext_i32_i64(local_tid_79749);\n    int64_t s",
            "lice_79754 = n_65344;\n    int64_t slice_79755 = m_65343 * slice_79754;\n    int64_t gtid_72716 = squot64(global_tid_79753, slice_79754);\n    int64_t remnant_79756 = global_tid_79753 - gtid_72716 * slice_79754;\n    int64_t gtid_72717 = remnant_79756;\n    int64_t remnant_79757 = remnant_79756 - gtid_72717;\n    \n    if (slt64(gtid_72716, m_65343) && slt64(gtid_72717, n_65344)) {\n        float x_72719;\n        \n        x_72719 = ((__global float *) Y_mem_76976)[gtid_72716 * n_65344 +\n                                                   gtid_72717];\n        \n        bool isnan_res_72722;\n        \n        isnan_res_72722 = futrts_isnan32(x_72719);\n        \n        bool defunc_0_p_res_72723 = !isnan_res_72722;\n        int64_t defunc_1_f_res_72724;\n        \n        if (defunc_0_p_res_72723) {\n            int64_t x_72720;\n            \n            x_72720 = ((__global int64_t *) mem_77833)[gtid_72716 * n_65344 +\n                                                       gtid_72717];\n            \n            int64_t defunc_1_f_res_t_res_72725 = sub64(x_72720, (int64_t) 1);\n            \n            defunc_1_f_res_72724 = defunc_1_f_res_t_res_72725;\n        } else {\n            defunc_1_f_res_72724 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_72716) && slt64(gtid_72716, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_72724) &&\n             slt64(defunc_1_f_res_72724, n_65344))) {\n            ((__global int64_t *) mem_77841)[gtid_72716 * n_65344 +\n                                             defunc_1_f_res_72724] = gtid_72717;\n        }\n        if ((sle64((int64_t) 0, gtid_72716) && slt64(gtid_72716, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_72724) &&\n             slt64(defunc_1_f_res_72724, n_65344))) {\n            ((__global float *) mem_77837)[gtid_72716 * n_65344 +\n                                           defunc_1_f_res_72724] = x_72719;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72712\n}\n__kernel void m",
            "ainzisegmap_72737(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77841, __global\n                                 unsigned char *mem_77847)\n{\n    #define segmap_group_sizze_72732 (mainzisegmap_group_sizze_72527)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79758;\n    int32_t local_tid_79759;\n    int64_t group_sizze_79762;\n    int32_t wave_sizze_79761;\n    int32_t group_tid_79760;\n    \n    global_tid_79758 = get_global_id(0);\n    local_tid_79759 = get_local_id(0);\n    group_sizze_79762 = get_local_size(0);\n    wave_sizze_79761 = LOCKSTEP_WIDTH;\n    group_tid_79760 = get_group_id(0);\n    \n    int32_t phys_tid_72737 = global_tid_79758;\n    int64_t global_tid_79763 = sext_i32_i64(group_tid_79760) *\n            segmap_group_sizze_72732 + sext_i32_i64(local_tid_79759);\n    int64_t slice_79764 = n_65344;\n    int64_t slice_79765 = m_65343 * slice_79764;\n    int64_t gtid_72735 = squot64(global_tid_79763, slice_79764);\n    int64_t remnant_79766 = global_tid_79763 - gtid_72735 * slice_79764;\n    int64_t gtid_72736 = remnant_79766;\n    int64_t remnant_79767 = remnant_79766 - gtid_72736;\n    \n    if (slt64(gtid_72735, m_65343) && slt64(gtid_72736, n_65344)) {\n        int64_t x_72738;\n        \n        x_72738 = ((__global int64_t *) mem_77841)[gtid_72735 * n_65344 +\n                                                   gtid_72736];\n        \n        int64_t defunc_0_f_res_72739 = add64((int64_t) 1, x_72738);\n        \n        ((__global int64_t *) mem_77847)[gtid_72735 * n_65344 + gtid_72736] =\n            defunc_0_f_res_72739;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72732\n}\n__kernel void mainzisegmap_72749(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n      ",
            "                           int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77833, __global\n                                 unsigned char *mem_77851, __global\n                                 unsigned char *mem_77854, __global\n                                 unsigned char *mem_77857, __global\n                                 unsigned char *mem_77860)\n{\n    #define segmap_group_sizze_72742 (mainzisegmap_group_sizze_72501)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79768;\n    int32_t local_tid_79769;\n    int64_t group_sizze_79772;\n    int32_t wave_sizze_79771;\n    int32_t group_tid_79770;\n    \n    global_tid_79768 = get_global_id(0);\n    local_tid_79769 = get_local_id(0);\n    group_sizze_79772 = get_local_size(0);\n    wave_sizze_79771 = LOCKSTEP_WIDTH;\n    group_tid_79770 = get_group_id(0);\n    \n    int32_t phys_tid_72749 = global_tid_79768;\n    int64_t global_tid_79773 = sext_i32_i64(group_tid_79770) *\n            segmap_group_sizze_72742 + sext_i32_i64(local_tid_79769);\n    int64_t slice_79774 = m_65343;\n    int64_t gtid_72748 = global_tid_79773;\n    int64_t remnant_79775 = global_tid_79773 - gtid_72748;\n    \n    if (slt64(gtid_72748, m_65343)) {\n        int64_t last_res_72750;\n        \n        last_res_72750 = ((__global int64_t *) mem_77833)[gtid_72748 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_72751 = sub64(last_res_72750, (int64_t) 1);\n        int64_t min_arg_72752 = sub64(last_res_72750, min_res_65364);\n        int64_t min_res_72753 = smin64(q_65346, last_res_72750);\n        float i64_res_72754 = sitofp_i64_f32(last_res_72750);\n        float x_72755 = i64_res_65370 - i64_res_72754;\n        float max_arg_72756 = x_72755 / 2.0F;\n        float max_res_72757 = f",
            "max32(0.0F, max_arg_72756);\n        \n        ((__global int64_t *) mem_77851)[gtid_72748] = min_arg_72751;\n        ((__global int64_t *) mem_77854)[gtid_72748] = min_arg_72752;\n        ((__global int64_t *) mem_77857)[gtid_72748] = min_res_72753;\n        ((__global float *) mem_77860)[gtid_72748] = max_res_72757;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72742\n}\n__kernel void mainzisegmap_72769(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77833, __global\n                                 unsigned char *mem_77865)\n{\n    #define segmap_group_sizze_72764 (mainzisegmap_group_sizze_72476)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79776;\n    int32_t local_tid_79777;\n    int64_t group_sizze_79780;\n    int32_t wave_sizze_79779;\n    int32_t group_tid_79778;\n    \n    global_tid_79776 = get_global_id(0);\n    local_tid_79777 = get_local_id(0);\n    group_sizze_79780 = get_local_size(0);\n    wave_sizze_79779 = LOCKSTEP_WIDTH;\n    group_tid_79778 = get_group_id(0);\n    \n    int32_t phys_tid_72769 = global_tid_79776;\n    int64_t global_tid_79781 = sext_i32_i64(group_tid_79778) *\n            segmap_group_sizze_72764 + sext_i32_i64(local_tid_79777);\n    int64_t slice_79782 = q_65346;\n    int64_t slice_79783 = m_65343 * slice_79782;\n    int64_t gtid_72767 = squot64(global_tid_79781, slice_79782);\n    int64_t remnant_79784 = global_tid_79781 - gtid_72767 * slice_79782;\n    int64_t gtid_72768 = remnant_79784;\n    int64_t remnant_79785 = remnant_79784 - gtid_72768;\n    \n    if (slt64(gtid_72767, m_65343) && slt64(gtid_72768, q_65346)) {\n        int64_t last_res_72770;\n        \n        last_res_72770 = ((__global int64_t *) mem_77833)[gtid_72767 * n_65344 +\n    ",
            "                                                      i_65358];\n        \n        bool cond_72772 = sle64(last_res_72770, gtid_72768);\n        float defunc_0_f_res_72773;\n        \n        if (cond_72772) {\n            defunc_0_f_res_72773 = 0.0F;\n        } else {\n            defunc_0_f_res_72773 = 1.0F;\n        }\n        ((__global float *) mem_77865)[gtid_72767 * q_65346 + gtid_72768] =\n            defunc_0_f_res_72773;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72764\n}\n__kernel void mainzisegmap_73385(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77880, __global\n                                 unsigned char *mem_77884, __global\n                                 unsigned char *mem_77888)\n{\n    #define segmap_group_sizze_73379 (mainzisegmap_group_sizze_73220)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79917;\n    int32_t local_tid_79918;\n    int64_t group_sizze_79921;\n    int32_t wave_sizze_79920;\n    int32_t group_tid_79919;\n    \n    global_tid_79917 = get_global_id(0);\n    local_tid_79918 = get_local_id(0);\n    group_sizze_79921 = get_local_size(0);\n    wave_sizze_79920 = LOCKSTEP_WIDTH;\n    group_tid_79919 = get_group_id(0);\n    \n    int32_t phys_tid_73385 = global_tid_79917;\n    int64_t global_tid_79922 = sext_i32_i64(group_tid_79919) *\n            segmap_group_sizze_73379 + sext_i32_i64(local_tid_79918);\n    int64_t slice_79923 = n_65344;\n    int64_t slice_79924 = m_65343 * slice_79923;\n    int64_t gtid_73383 = squot64(global_tid_79922, slice_79923);\n    int64_t remnant_79925 = global_tid_79922 - gtid_73383 * slice_79923;\n    int64_t gtid_73384 = remnant_79925;\n    int64_t remnant_79926 = remnant_79925 - gtid_73384;\n    \n    if (slt64(",
            "gtid_73383, m_65343) && slt64(gtid_73384, n_65344)) {\n        float x_73386;\n        \n        x_73386 = ((__global float *) Y_mem_76976)[gtid_73383 * n_65344 +\n                                                   gtid_73384];\n        \n        bool isnan_res_73389;\n        \n        isnan_res_73389 = futrts_isnan32(x_73386);\n        \n        bool defunc_0_p_res_73390 = !isnan_res_73389;\n        int64_t defunc_1_f_res_73391;\n        \n        if (defunc_0_p_res_73390) {\n            int64_t x_73387;\n            \n            x_73387 = ((__global int64_t *) mem_77880)[gtid_73383 * n_65344 +\n                                                       gtid_73384];\n            \n            int64_t defunc_1_f_res_t_res_73392 = sub64(x_73387, (int64_t) 1);\n            \n            defunc_1_f_res_73391 = defunc_1_f_res_t_res_73392;\n        } else {\n            defunc_1_f_res_73391 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_73383) && slt64(gtid_73383, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_73391) &&\n             slt64(defunc_1_f_res_73391, n_65344))) {\n            ((__global int64_t *) mem_77888)[gtid_73383 * n_65344 +\n                                             defunc_1_f_res_73391] = gtid_73384;\n        }\n        if ((sle64((int64_t) 0, gtid_73383) && slt64(gtid_73383, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_73391) &&\n             slt64(defunc_1_f_res_73391, n_65344))) {\n            ((__global float *) mem_77884)[gtid_73383 * n_65344 +\n                                           defunc_1_f_res_73391] = x_73386;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73379\n}\n__kernel void mainzisegmap_73404(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77888, __global\n                                 unsigned char *mem_77894)\n{\n    #define segmap_group_sizze_73399 (mainzisegmap_group_sizze_73194)\n ",
            "   \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79927;\n    int32_t local_tid_79928;\n    int64_t group_sizze_79931;\n    int32_t wave_sizze_79930;\n    int32_t group_tid_79929;\n    \n    global_tid_79927 = get_global_id(0);\n    local_tid_79928 = get_local_id(0);\n    group_sizze_79931 = get_local_size(0);\n    wave_sizze_79930 = LOCKSTEP_WIDTH;\n    group_tid_79929 = get_group_id(0);\n    \n    int32_t phys_tid_73404 = global_tid_79927;\n    int64_t global_tid_79932 = sext_i32_i64(group_tid_79929) *\n            segmap_group_sizze_73399 + sext_i32_i64(local_tid_79928);\n    int64_t slice_79933 = n_65344;\n    int64_t slice_79934 = m_65343 * slice_79933;\n    int64_t gtid_73402 = squot64(global_tid_79932, slice_79933);\n    int64_t remnant_79935 = global_tid_79932 - gtid_73402 * slice_79933;\n    int64_t gtid_73403 = remnant_79935;\n    int64_t remnant_79936 = remnant_79935 - gtid_73403;\n    \n    if (slt64(gtid_73402, m_65343) && slt64(gtid_73403, n_65344)) {\n        int64_t x_73405;\n        \n        x_73405 = ((__global int64_t *) mem_77888)[gtid_73402 * n_65344 +\n                                                   gtid_73403];\n        \n        int64_t defunc_0_f_res_73406 = add64((int64_t) 1, x_73405);\n        \n        ((__global int64_t *) mem_77894)[gtid_73402 * n_65344 + gtid_73403] =\n            defunc_0_f_res_73406;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73399\n}\n__kernel void mainzisegmap_73416(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77880, __global\n                                 unsigned char *mem_77898, __global\n                                 unsigned char *mem_77901,",
            " __global\n                                 unsigned char *mem_77904, __global\n                                 unsigned char *mem_77907)\n{\n    #define segmap_group_sizze_73409 (mainzisegmap_group_sizze_73168)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79937;\n    int32_t local_tid_79938;\n    int64_t group_sizze_79941;\n    int32_t wave_sizze_79940;\n    int32_t group_tid_79939;\n    \n    global_tid_79937 = get_global_id(0);\n    local_tid_79938 = get_local_id(0);\n    group_sizze_79941 = get_local_size(0);\n    wave_sizze_79940 = LOCKSTEP_WIDTH;\n    group_tid_79939 = get_group_id(0);\n    \n    int32_t phys_tid_73416 = global_tid_79937;\n    int64_t global_tid_79942 = sext_i32_i64(group_tid_79939) *\n            segmap_group_sizze_73409 + sext_i32_i64(local_tid_79938);\n    int64_t slice_79943 = m_65343;\n    int64_t gtid_73415 = global_tid_79942;\n    int64_t remnant_79944 = global_tid_79942 - gtid_73415;\n    \n    if (slt64(gtid_73415, m_65343)) {\n        int64_t last_res_73417;\n        \n        last_res_73417 = ((__global int64_t *) mem_77880)[gtid_73415 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_73418 = sub64(last_res_73417, (int64_t) 1);\n        int64_t min_arg_73419 = sub64(last_res_73417, min_res_65364);\n        int64_t min_res_73420 = smin64(q_65346, last_res_73417);\n        float i64_res_73421 = sitofp_i64_f32(last_res_73417);\n        float x_73422 = i64_res_65370 - i64_res_73421;\n        float max_arg_73423 = x_73422 / 2.0F;\n        float max_res_73424 = fmax32(0.0F, max_arg_73423);\n        \n        ((__global int64_t *) mem_77898)[gtid_73415] = min_arg_73418;\n        ((__global int64_t *) mem_77901)[gtid_73415] = min_arg_73419;\n        ((__global int64_t *) mem_77904)[gtid_73415] = min_res_73420;\n        ((__global float *) mem_77907)[gtid_73415] = max_res_73424;\n    }\n   ",
            " \n  error_0:\n    return;\n    #undef segmap_group_sizze_73409\n}\n__kernel void mainzisegmap_73436(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77880, __global\n                                 unsigned char *mem_77912)\n{\n    #define segmap_group_sizze_73431 (mainzisegmap_group_sizze_73143)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79945;\n    int32_t local_tid_79946;\n    int64_t group_sizze_79949;\n    int32_t wave_sizze_79948;\n    int32_t group_tid_79947;\n    \n    global_tid_79945 = get_global_id(0);\n    local_tid_79946 = get_local_id(0);\n    group_sizze_79949 = get_local_size(0);\n    wave_sizze_79948 = LOCKSTEP_WIDTH;\n    group_tid_79947 = get_group_id(0);\n    \n    int32_t phys_tid_73436 = global_tid_79945;\n    int64_t global_tid_79950 = sext_i32_i64(group_tid_79947) *\n            segmap_group_sizze_73431 + sext_i32_i64(local_tid_79946);\n    int64_t slice_79951 = q_65346;\n    int64_t slice_79952 = m_65343 * slice_79951;\n    int64_t gtid_73434 = squot64(global_tid_79950, slice_79951);\n    int64_t remnant_79953 = global_tid_79950 - gtid_73434 * slice_79951;\n    int64_t gtid_73435 = remnant_79953;\n    int64_t remnant_79954 = remnant_79953 - gtid_73435;\n    \n    if (slt64(gtid_73434, m_65343) && slt64(gtid_73435, q_65346)) {\n        int64_t last_res_73437;\n        \n        last_res_73437 = ((__global int64_t *) mem_77880)[gtid_73434 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_73439 = sle64(last_res_73437, gtid_73435);\n        float defunc_0_f_res_73440;\n        \n        if (cond_73439) {\n            defunc_0_f_res_73440 = 0.0F;\n        } else {\n            defunc_0_f_res_73440 = 1.0F;\n        }\n        ((",
            "__global float *) mem_77912)[gtid_73434 * q_65346 + gtid_73435] =\n            defunc_0_f_res_73440;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73431\n}\n__kernel void mainzisegmap_74142(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77934, __global\n                                 unsigned char *mem_77938, __global\n                                 unsigned char *mem_77942)\n{\n    #define segmap_group_sizze_74136 (mainzisegmap_group_sizze_73977)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_80092;\n    int32_t local_tid_80093;\n    int64_t group_sizze_80096;\n    int32_t wave_sizze_80095;\n    int32_t group_tid_80094;\n    \n    global_tid_80092 = get_global_id(0);\n    local_tid_80093 = get_local_id(0);\n    group_sizze_80096 = get_local_size(0);\n    wave_sizze_80095 = LOCKSTEP_WIDTH;\n    group_tid_80094 = get_group_id(0);\n    \n    int32_t phys_tid_74142 = global_tid_80092;\n    int64_t global_tid_80097 = sext_i32_i64(group_tid_80094) *\n            segmap_group_sizze_74136 + sext_i32_i64(local_tid_80093);\n    int64_t slice_80098 = n_65344;\n    int64_t slice_80099 = m_65343 * slice_80098;\n    int64_t gtid_74140 = squot64(global_tid_80097, slice_80098);\n    int64_t remnant_80100 = global_tid_80097 - gtid_74140 * slice_80098;\n    int64_t gtid_74141 = remnant_80100;\n    int64_t remnant_80101 = remnant_80100 - gtid_74141;\n    \n    if (slt64(gtid_74140, m_65343) && slt64(gtid_74141, n_65344)) {\n        float x_74143;\n        \n        x_74143 = ((__global float *) Y_mem_76976)[gtid_74140 * n_65344 +\n                                                   gtid_74141];\n        \n        bool isnan_res_74146;\n        \n        isnan_res_74146 = futrts_isnan32(x_74143);\n ",
            "       \n        bool defunc_0_p_res_74147 = !isnan_res_74146;\n        int64_t defunc_1_f_res_74148;\n        \n        if (defunc_0_p_res_74147) {\n            int64_t x_74144;\n            \n            x_74144 = ((__global int64_t *) mem_77934)[gtid_74140 * n_65344 +\n                                                       gtid_74141];\n            \n            int64_t defunc_1_f_res_t_res_74149 = sub64(x_74144, (int64_t) 1);\n            \n            defunc_1_f_res_74148 = defunc_1_f_res_t_res_74149;\n        } else {\n            defunc_1_f_res_74148 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_74140) && slt64(gtid_74140, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_74148) &&\n             slt64(defunc_1_f_res_74148, n_65344))) {\n            ((__global int64_t *) mem_77942)[gtid_74140 * n_65344 +\n                                             defunc_1_f_res_74148] = gtid_74141;\n        }\n        if ((sle64((int64_t) 0, gtid_74140) && slt64(gtid_74140, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_74148) &&\n             slt64(defunc_1_f_res_74148, n_65344))) {\n            ((__global float *) mem_77938)[gtid_74140 * n_65344 +\n                                           defunc_1_f_res_74148] = x_74143;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74136\n}\n__kernel void mainzisegmap_74161(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77942, __global\n                                 unsigned char *mem_77948)\n{\n    #define segmap_group_sizze_74156 (mainzisegmap_group_sizze_73951)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_80102;\n    int32_t local_tid_80103;\n    int64_t group_sizze_80106;\n    int32_t wave_sizze_80105;\n    int32_t group_tid_80104;\n    \n    global_tid_80102",
            " = get_global_id(0);\n    local_tid_80103 = get_local_id(0);\n    group_sizze_80106 = get_local_size(0);\n    wave_sizze_80105 = LOCKSTEP_WIDTH;\n    group_tid_80104 = get_group_id(0);\n    \n    int32_t phys_tid_74161 = global_tid_80102;\n    int64_t global_tid_80107 = sext_i32_i64(group_tid_80104) *\n            segmap_group_sizze_74156 + sext_i32_i64(local_tid_80103);\n    int64_t slice_80108 = n_65344;\n    int64_t slice_80109 = m_65343 * slice_80108;\n    int64_t gtid_74159 = squot64(global_tid_80107, slice_80108);\n    int64_t remnant_80110 = global_tid_80107 - gtid_74159 * slice_80108;\n    int64_t gtid_74160 = remnant_80110;\n    int64_t remnant_80111 = remnant_80110 - gtid_74160;\n    \n    if (slt64(gtid_74159, m_65343) && slt64(gtid_74160, n_65344)) {\n        int64_t x_74162;\n        \n        x_74162 = ((__global int64_t *) mem_77942)[gtid_74159 * n_65344 +\n                                                   gtid_74160];\n        \n        int64_t defunc_0_f_res_74163 = add64((int64_t) 1, x_74162);\n        \n        ((__global int64_t *) mem_77948)[gtid_74159 * n_65344 + gtid_74160] =\n            defunc_0_f_res_74163;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74156\n}\n__kernel void mainzisegmap_74173(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77934, __global\n                                 unsigned char *mem_77952, __global\n                                 unsigned char *mem_77955, __global\n                                 unsigned char *mem_77958, __global\n                                 unsigned char *mem_77961)\n{\n    #define segmap_group_sizze_74166 (mainzisegmap_group_sizze_73925)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global",
            "_failure >= 0)\n        return;\n    \n    int32_t global_tid_80112;\n    int32_t local_tid_80113;\n    int64_t group_sizze_80116;\n    int32_t wave_sizze_80115;\n    int32_t group_tid_80114;\n    \n    global_tid_80112 = get_global_id(0);\n    local_tid_80113 = get_local_id(0);\n    group_sizze_80116 = get_local_size(0);\n    wave_sizze_80115 = LOCKSTEP_WIDTH;\n    group_tid_80114 = get_group_id(0);\n    \n    int32_t phys_tid_74173 = global_tid_80112;\n    int64_t global_tid_80117 = sext_i32_i64(group_tid_80114) *\n            segmap_group_sizze_74166 + sext_i32_i64(local_tid_80113);\n    int64_t slice_80118 = m_65343;\n    int64_t gtid_74172 = global_tid_80117;\n    int64_t remnant_80119 = global_tid_80117 - gtid_74172;\n    \n    if (slt64(gtid_74172, m_65343)) {\n        int64_t last_res_74174;\n        \n        last_res_74174 = ((__global int64_t *) mem_77934)[gtid_74172 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_74175 = sub64(last_res_74174, (int64_t) 1);\n        int64_t min_arg_74176 = sub64(last_res_74174, min_res_65364);\n        int64_t min_res_74177 = smin64(q_65346, last_res_74174);\n        float i64_res_74178 = sitofp_i64_f32(last_res_74174);\n        float x_74179 = i64_res_65370 - i64_res_74178;\n        float max_arg_74180 = x_74179 / 2.0F;\n        float max_res_74181 = fmax32(0.0F, max_arg_74180);\n        \n        ((__global int64_t *) mem_77952)[gtid_74172] = min_arg_74175;\n        ((__global int64_t *) mem_77955)[gtid_74172] = min_arg_74176;\n        ((__global int64_t *) mem_77958)[gtid_74172] = min_res_74177;\n        ((__global float *) mem_77961)[gtid_74172] = max_res_74181;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74166\n}\n__kernel void mainzisegmap_74193(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_779",
            "34, __global\n                                 unsigned char *mem_77966)\n{\n    #define segmap_group_sizze_74188 (mainzisegmap_group_sizze_73900)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_80120;\n    int32_t local_tid_80121;\n    int64_t group_sizze_80124;\n    int32_t wave_sizze_80123;\n    int32_t group_tid_80122;\n    \n    global_tid_80120 = get_global_id(0);\n    local_tid_80121 = get_local_id(0);\n    group_sizze_80124 = get_local_size(0);\n    wave_sizze_80123 = LOCKSTEP_WIDTH;\n    group_tid_80122 = get_group_id(0);\n    \n    int32_t phys_tid_74193 = global_tid_80120;\n    int64_t global_tid_80125 = sext_i32_i64(group_tid_80122) *\n            segmap_group_sizze_74188 + sext_i32_i64(local_tid_80121);\n    int64_t slice_80126 = q_65346;\n    int64_t slice_80127 = m_65343 * slice_80126;\n    int64_t gtid_74191 = squot64(global_tid_80125, slice_80126);\n    int64_t remnant_80128 = global_tid_80125 - gtid_74191 * slice_80126;\n    int64_t gtid_74192 = remnant_80128;\n    int64_t remnant_80129 = remnant_80128 - gtid_74192;\n    \n    if (slt64(gtid_74191, m_65343) && slt64(gtid_74192, q_65346)) {\n        int64_t last_res_74194;\n        \n        last_res_74194 = ((__global int64_t *) mem_77934)[gtid_74191 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_74196 = sle64(last_res_74194, gtid_74192);\n        float defunc_0_f_res_74197;\n        \n        if (cond_74196) {\n            defunc_0_f_res_74197 = 0.0F;\n        } else {\n            defunc_0_f_res_74197 = 1.0F;\n        }\n        ((__global float *) mem_77966)[gtid_74191 * q_65346 + gtid_74192] =\n            defunc_0_f_res_74197;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74188\n}\n__kernel void mainzisegmap_74555(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                     ",
            "            int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 int64_t y_66637, __global\n                                 unsigned char *ext_mem_77995, __global\n                                 unsigned char *ext_mem_77996, __global\n                                 unsigned char *mem_78001)\n{\n    #define segmap_group_sizze_74550 (mainzisegmap_group_sizze_74432)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_80167;\n    int32_t local_tid_80168;\n    int64_t group_sizze_80171;\n    int32_t wave_sizze_80170;\n    int32_t group_tid_80169;\n    \n    global_tid_80167 = get_global_id(0);\n    local_tid_80168 = get_local_id(0);\n    group_sizze_80171 = get_local_size(0);\n    wave_sizze_80170 = LOCKSTEP_WIDTH;\n    group_tid_80169 = get_group_id(0);\n    \n    int32_t phys_tid_74555 = global_tid_80167;\n    int64_t global_tid_80172 = sext_i32_i64(group_tid_80169) *\n            segmap_group_sizze_74550 + sext_i32_i64(local_tid_80168);\n    int64_t slice_80173 = n_65344;\n    int64_t slice_80174 = m_65343 * slice_80173;\n    int64_t gtid_74553 = squot64(global_tid_80172, slice_80173);\n    int64_t remnant_80175 = global_tid_80172 - gtid_74553 * slice_80173;\n    int64_t gtid_74554 = remnant_80175;\n    int64_t remnant_80176 = remnant_80175 - gtid_74554;\n    \n    if (slt64(gtid_74553, m_65343) && slt64(gtid_74554, n_65344)) {\n        int64_t m_v_74559 = sdiv64(gtid_74554, jump_65348);\n        bool cond_74560 = m_v_74559 == y_66637;\n        int64_t j_74561;\n        \n        if (cond_74560) {\n            int64_t j_t_res_74562 = sub64(m_v_74559, (int64_t) 1);\n            \n            j_74561 = j_t_res_74562;\n        } else {\n            j_74561 = m_v_74559;\n        }\n        \n        int64_t min_arg_74563 = ",
            "mul64(jump_65348, j_74561);\n        int64_t min_res_74564 = smin64(i_65358, min_arg_74563);\n        int64_t defunc_0_m_fun_arg_74565 = add64((int64_t) 1, j_74561);\n        int64_t min_arg_74566 = mul64(jump_65348, defunc_0_m_fun_arg_74565);\n        int64_t min_res_74567 = smin64(i_65358, min_arg_74566);\n        int64_t i64_arg_74568 = sub64(min_res_74567, min_res_74564);\n        float i64_res_74569 = sitofp_i64_f32(i64_arg_74568);\n        int64_t i64_arg_74570 = sub64(gtid_74554, min_res_74564);\n        float i64_res_74571 = sitofp_i64_f32(i64_arg_74570);\n        float u_74572 = i64_res_74571 / i64_res_74569;\n        float u2_74573 = u_74572 * u_74572;\n        float u3_74574 = u_74572 * u2_74573;\n        float x_74575 = 2.0F * u3_74574;\n        float y_74576 = 3.0F * u2_74573;\n        float x_74577 = x_74575 - y_74576;\n        float x_74578 = 1.0F + x_74577;\n        bool x_74579 = sle64((int64_t) 0, j_74561);\n        bool y_74580 = slt64(j_74561, n_m_65352);\n        bool bounds_check_74581 = x_74579 && y_74580;\n        bool index_certs_74582;\n        \n        if (!bounds_check_74581) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 60) == -1) {\n                    global_failure_args[0] = (int64_t) j_74561;\n                    global_failure_args[1] = (int64_t) n_m_65352;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_74583;\n        \n        y_74583 = ((__global float *) ext_mem_77996)[gtid_74553 * n_m_65352 +\n                                                     j_74561];\n        \n        float x_74584 = x_74578 * y_74583;\n        float x_74585 = y_74576 - x_74575;\n        bool x_74586 = sle64((int64_t) 0, defunc_0_m_fun_arg_74565);\n        bool y_74587 = slt64(defunc_0_m_fun_arg_74565, n_m_65352);\n        bool bounds_check_74588 = x_74586 && y_74587;\n        bool index_certs_74589;\n        \n        if (!bounds_check_74588) {\n            {\n                if (atomic_cm",
            "pxchg_i32_global(global_failure, -1, 61) == -1) {\n                    global_failure_args[0] = (int64_t) defunc_0_m_fun_arg_74565;\n                    global_failure_args[1] = (int64_t) n_m_65352;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_74590;\n        \n        y_74590 = ((__global float *) ext_mem_77996)[gtid_74553 * n_m_65352 +\n                                                     defunc_0_m_fun_arg_74565];\n        \n        float y_74591 = x_74585 * y_74590;\n        float x_74592 = x_74584 + y_74591;\n        float y_74593 = 2.0F * u2_74573;\n        float x_74594 = u3_74574 - y_74593;\n        float x_74595 = u_74572 + x_74594;\n        float y_74596;\n        \n        y_74596 = ((__global float *) ext_mem_77995)[gtid_74553 * n_m_65352 +\n                                                     j_74561];\n        \n        float x_74597 = x_74595 * y_74596;\n        float y_74598 = i64_res_74569 * x_74597;\n        float x_74599 = x_74592 + y_74598;\n        float x_74600 = u3_74574 - u2_74573;\n        float y_74601;\n        \n        y_74601 = ((__global float *) ext_mem_77995)[gtid_74553 * n_m_65352 +\n                                                     defunc_0_m_fun_arg_74565];\n        \n        float x_74602 = x_74600 * y_74601;\n        float y_74603 = i64_res_74569 * x_74602;\n        float defunc_4_interpolate_proc_res_74604 = x_74599 + y_74603;\n        \n        ((__global float *) mem_78001)[gtid_74553 * n_65344 + gtid_74554] =\n            defunc_4_interpolate_proc_res_74604;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74550\n}\n__kernel void mainzisegmap_intragroup_72785(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            uint red_arr_mem_79809_backing_offset_0,\n                                            uint re",
            "d_arr_mem_79805_backing_offset_1,\n                                            uint color_78194_backing_offset_2,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            __global unsigned char *mem_77833,\n                                            __global unsigned char *mem_77837,\n                                            __global unsigned char *mem_77841,\n                                            __global unsigned char *mem_77847,\n                                            __global unsigned char *mem_77851,\n                                            __global unsigned char *mem_77854,\n                                            __global unsigned char *mem_77857,\n                                            __global unsigned char *mem_77860,\n                                            __global unsigned char *mem_77865,\n                                            __global unsigned char *mem_77875)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\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_79809_backing_2 =\n                           &shared_mem[red_arr_mem_79809_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79805_backing_1 =\n                           &shared_mem[red_arr_mem_79805_backing_offset_1];\n    volatile unsigned char *color_78194_backing_0 =\n                           &shared_mem[color_78194_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_79786;\n    int32_t local_tid_79787;\n    int64_t group_sizze_79790;\n    int32_t wave_sizze_79789;\n    int32_t group_tid_79788;\n    \n    global_tid_79786 = get_global_id(0);\n    local_tid_79787 = get_local_id(0);\n    group_sizze_79790 = get_local_size(0);\n    wave_sizze_79789 = LOCKSTEP_WIDTH;\n    group_tid_79788 = get_group_id(0);\n    \n    int32_t phys_tid_72785 = group_tid_79788;\n    int64_t slice_79792 = q_65346;\n    int64_t ltid_pre_79791 = sext_i32_i64(local_tid_79787);\n    int64_t remnant_79793 = sext_i32_i64(local_tid_79787) - ltid_pre_79791;\n    int64_t slice_79794 = n_m_65352;\n    int64_t slice_79795 = m_65343 * slice_79794;\n    int64_t gtid_72783 = squot64(sext_i32_i64(group_tid_79788), slice_79794);\n    int64_t remnant_79796 = sext_i32_i64(group_tid_79788) - gtid_72783 *\n            slice_79794;\n    int64_t gtid_72784 = remnant_79796;\n    int64_t remnant_79797 = remnant_79796 - gtid_72784;\n    __local unsigned char *color_78194;\n    \n    color_78194 = (__local unsigned char *) color_78194_backing_0;\n    \n    int64_t last_res_72786;\n    \n    last_res_72786 = ((__global int64_t *) mem_77833)[gtid_72783 * n_65344 +\n                                                      i_65358];\n    \n    int64_t min_arg_72793;\n    \n    min_arg_72793 = ((__global int64_t *) mem_77851)[gtid_72783];\n    \n    int64_t min_arg_72794;\n    \n    min_arg_72794 = ((__global int64_t *) mem_77854)[gtid_72783];\n    \n    int64_t min_res_72795;\n    \n    min_res_72795 = ((__global int64_t *) mem_77857)[gtid_72783];\n    \n    float max_res_72796;\n    \n    max_res_72796 = ((__global float *) mem_77860)[gtid_72783];\n    \n    int64_t min_arg_72800 = mul64(jump_65348, gtid_72784);\n    int64_t min_res_72801 = smin64(i_65358, min_arg_72800);\n    int64_t defunc_0_g_res_72802 = add64((int64_t) 1, min_res_72801);\n    b",
            "ool init_idx_72803;\n    int64_t init_idx_72804;\n    int64_t init_idx_72805;\n    bool loop_while_72806;\n    int64_t low_72807;\n    int64_t high_72808;\n    \n    loop_while_72806 = x_65359;\n    low_72807 = (int64_t) 0;\n    high_72808 = i_65358;\n    while (loop_while_72806) {\n        int64_t x_72809 = add64(low_72807, high_72808);\n        int64_t mid_72810 = sdiv64(x_72809, (int64_t) 2);\n        bool x_72811 = sle64((int64_t) 0, mid_72810);\n        bool y_72812 = slt64(mid_72810, n_65344);\n        bool bounds_check_72813 = x_72811 && y_72812;\n        bool index_certs_72814;\n        \n        if (!bounds_check_72813) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 45) == -1) {\n                    global_failure_args[0] = (int64_t) mid_72810;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t mid_id_72815;\n        \n        mid_id_72815 = ((__global int64_t *) mem_77847)[gtid_72783 * n_65344 +\n                                                        mid_72810];\n        \n        bool cond_72816 = slt64(mid_id_72815, (int64_t) 0);\n        int64_t mid_idx_72817;\n        \n        if (cond_72816) {\n            mid_idx_72817 = (int64_t) 9223372036854775807;\n        } else {\n            mid_idx_72817 = mid_id_72815;\n        }\n        \n        bool cond_72818 = sle64(defunc_0_g_res_72802, mid_idx_72817);\n        int64_t loopres_72819;\n        int64_t loopres_72820;\n        \n        if (cond_72818) {\n            int64_t loopres_t_res_72821 = sub64(mid_72810, (int64_t) 1);\n            \n            loopres_72819 = low_72807;\n            loopres_72820 = loopres_t_res_72821;\n        } else {\n            int64_t loopres_f_res_72822 = add64((int64_t) 1, mid_72810);\n            \n            loopres_72819 = loopres_f_res_72822;\n            loopres_72820 = high_72808;\n        }\n        \n     ",
            "   bool loop_cond_72823 = sle64(loopres_72819, loopres_72820);\n        bool loop_while_tmp_79798 = loop_cond_72823;\n        int64_t low_tmp_79799 = loopres_72819;\n        int64_t high_tmp_79800 = loopres_72820;\n        \n        loop_while_72806 = loop_while_tmp_79798;\n        low_72807 = low_tmp_79799;\n        high_72808 = high_tmp_79800;\n    }\n    init_idx_72803 = loop_while_72806;\n    init_idx_72804 = low_72807;\n    init_idx_72805 = high_72808;\n    \n    bool idx_72824;\n    int64_t idx_72825;\n    int64_t idx_72826;\n    int64_t idx_72827;\n    bool loop_while_72828;\n    int64_t l_idx_72829;\n    int64_t r_idx_72830;\n    int64_t span_72831;\n    \n    loop_while_72828 = loop_cond_65369;\n    l_idx_72829 = init_idx_72804;\n    r_idx_72830 = init_idx_72804;\n    span_72831 = (int64_t) 1;\n    while (loop_while_72828) {\n        int64_t max_arg_72832 = sub64(l_idx_72829, (int64_t) 1);\n        int64_t max_res_72833 = smax64((int64_t) 0, max_arg_72832);\n        int64_t min_arg_72834 = add64((int64_t) 1, r_idx_72830);\n        int64_t min_res_72835 = smin64(min_arg_72793, min_arg_72834);\n        bool x_72836 = sle64((int64_t) 0, max_res_72833);\n        bool y_72837 = slt64(max_res_72833, n_65344);\n        bool bounds_check_72838 = x_72836 && y_72837;\n        bool index_certs_72839;\n        \n        if (!bounds_check_72838) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 46) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_72833;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_72840;\n        \n        x_72840 = ((__global int64_t *) mem_77847)[gtid_72783 * n_65344 +\n                                                   max_res_72833];\n        \n        int64_t abs_arg_72841 = sub64(x_72840, defunc_0_g_res_72802);\n        int64_t abs_res_72842 = abs64(abs_arg_72",
            "841);\n        bool x_72843 = sle64((int64_t) 0, min_res_72835);\n        bool y_72844 = slt64(min_res_72835, n_65344);\n        bool bounds_check_72845 = x_72843 && y_72844;\n        bool index_certs_72846;\n        \n        if (!bounds_check_72845) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 47) == -1) {\n                    global_failure_args[0] = (int64_t) min_res_72835;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_72847;\n        \n        x_72847 = ((__global int64_t *) mem_77847)[gtid_72783 * n_65344 +\n                                                   min_res_72835];\n        \n        int64_t abs_arg_72848 = sub64(x_72847, defunc_0_g_res_72802);\n        int64_t abs_res_72849 = abs64(abs_arg_72848);\n        bool cond_72850 = max_res_72833 == l_idx_72829;\n        int64_t loopres_72851;\n        int64_t loopres_72852;\n        int64_t loopres_72853;\n        \n        if (cond_72850) {\n            loopres_72851 = l_idx_72829;\n            loopres_72852 = r_idx_72830;\n            loopres_72853 = min_res_65364;\n        } else {\n            bool cond_72854 = slt64(abs_res_72842, abs_res_72849);\n            bool cond_f_res_72855 = min_res_72835 == r_idx_72830;\n            bool x_72856 = !cond_72854;\n            bool y_72857 = cond_f_res_72855 && x_72856;\n            bool cond_72858 = cond_72854 || y_72857;\n            int64_t loopres_f_res_72859;\n            \n            if (cond_72858) {\n                loopres_f_res_72859 = max_res_72833;\n            } else {\n                loopres_f_res_72859 = l_idx_72829;\n            }\n            \n            int64_t loopres_f_res_72860;\n            \n            if (cond_72858) {\n                loopres_f_res_72860 = r_idx_72830;\n            } else {\n                loopres_f_res_72860 = min_res_72835;\n            }\n         ",
            "   \n            int64_t loopres_f_res_72861;\n            \n            if (cond_72858) {\n                int64_t loopres_f_res_t_res_72862 = add64((int64_t) 1,\n                                                          span_72831);\n                \n                loopres_f_res_72861 = loopres_f_res_t_res_72862;\n            } else {\n                int64_t loopres_f_res_f_res_72863 = add64((int64_t) 1,\n                                                          span_72831);\n                \n                loopres_f_res_72861 = loopres_f_res_f_res_72863;\n            }\n            loopres_72851 = loopres_f_res_72859;\n            loopres_72852 = loopres_f_res_72860;\n            loopres_72853 = loopres_f_res_72861;\n        }\n        \n        bool loop_cond_72864 = slt64(loopres_72853, min_res_65364);\n        bool loop_while_tmp_79801 = loop_cond_72864;\n        int64_t l_idx_tmp_79802 = loopres_72851;\n        int64_t r_idx_tmp_79803 = loopres_72852;\n        int64_t span_tmp_79804 = loopres_72853;\n        \n        loop_while_72828 = loop_while_tmp_79801;\n        l_idx_72829 = l_idx_tmp_79802;\n        r_idx_72830 = r_idx_tmp_79803;\n        span_72831 = span_tmp_79804;\n    }\n    idx_72824 = loop_while_72828;\n    idx_72825 = l_idx_72829;\n    idx_72826 = r_idx_72830;\n    idx_72827 = span_72831;\n    \n    int64_t min_res_72865 = smin64(min_arg_72794, idx_72825);\n    int64_t max_res_72866 = smax64((int64_t) 0, min_res_72865);\n    int64_t x_72867 = add64(min_res_72795, max_res_72866);\n    int64_t r_72868 = sub64(x_72867, (int64_t) 1);\n    bool x_72869 = sle64((int64_t) 0, r_72868);\n    bool y_72870 = slt64(r_72868, n_65344);\n    bool bounds_check_72871 = x_72869 && y_72870;\n    bool index_certs_72872;\n    \n    if (!bounds_check_72871) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 48) == -1) {\n                global_failure_args[0] = (int64_t) r_72868;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            l",
            "ocal_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_72873;\n    \n    x_72873 = ((__global int64_t *) mem_77841)[gtid_72783 * n_65344 + r_72868];\n    \n    int64_t abs_arg_72874 = sub64(x_72873, min_res_72801);\n    int64_t abs_res_72875 = abs64(abs_arg_72874);\n    bool x_72876 = sle64((int64_t) 0, max_res_72866);\n    bool y_72877 = slt64(max_res_72866, n_65344);\n    bool bounds_check_72878 = x_72876 && y_72877;\n    bool index_certs_72879;\n    \n    if (!bounds_check_72878) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 49) == -1) {\n                global_failure_args[0] = (int64_t) max_res_72866;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_72880;\n    \n    x_72880 = ((__global int64_t *) mem_77841)[gtid_72783 * n_65344 +\n                                               max_res_72866];\n    \n    int64_t abs_arg_72881 = sub64(x_72880, min_res_72801);\n    int64_t abs_res_72882 = abs64(abs_arg_72881);\n    int64_t max_res_72883 = smax64(abs_res_72875, abs_res_72882);\n    float defunc_0_f_res_72884 = sitofp_i64_f32(max_res_72883);\n    float defunc_1_f_res_72885 = max_res_72796 + defunc_0_f_res_72884;\n    float defunc_2_reduce_res_72886;\n    int64_t gtid_72888 = sext_i32_i64(sext_i64_i32(ltid_pre_79791));\n    int32_t phys_tid_72889 = local_tid_79787;\n    __local unsigned char *red_arr_mem_79805;\n    \n    red_arr_mem_79805 = (__local unsigned char *) red_arr_mem_79805_backing_1;\n    \n    float x_72894;\n    \n    x_72894 = ((__global float *) mem_77865)[gtid_72783 * q_65346 + gtid_72888];\n    \n    bool cond_72895 = sle64(last_res_72786, gtid_72888);\n    int64_t defunc_0_f_res_72896;\n    \n    if (cond_72895) {\n        defunc_0_f_res_72896 = (int64_t) 0;\n    } else {\n        int64_t i_72897 = add64(max_res_72866, gtid_72888);\n        int64_t defunc_0_add_arg_72898;\n        \n        defunc_",
            "0_add_arg_72898 = ((__global int64_t *) mem_77841)[gtid_72783 *\n                                                                  n_65344 +\n                                                                  i_72897];\n        \n        int64_t defunc_1_add_res_72899 = add64((int64_t) 1,\n                                               defunc_0_add_arg_72898);\n        \n        defunc_0_f_res_72896 = defunc_1_add_res_72899;\n    }\n    \n    int64_t binop_p_72900 = sub64(defunc_0_f_res_72896, min_res_72801);\n    float defunc_0_f_res_72901 = sitofp_i64_f32(binop_p_72900);\n    float abs_res_72902 = (float) fabs(defunc_0_f_res_72901);\n    float tmp1_72903 = abs_res_72902 / defunc_1_f_res_72885;\n    float x_72904 = tmp1_72903 * tmp1_72903;\n    float y_72905 = tmp1_72903 * x_72904;\n    float tmp2_72906 = 1.0F - y_72905;\n    float x_72907 = tmp2_72906 * tmp2_72906;\n    float tmp3_72908 = tmp2_72906 * x_72907;\n    float tmp4_72909 = x_72894 * tmp3_72908;\n    \n    ((__local float *) red_arr_mem_79805)[gtid_72888] = tmp4_72909;\n    ((__local float *) color_78194)[gtid_72888] = tmp4_72909;\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79807;\n    int32_t skip_waves_79808 = 1;\n    float x_72890;\n    float x_72891;\n    \n    offset_79807 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79787, sext_i64_i32(q_65346))) {\n            x_72890 = ((__local\n                        float *) red_arr_mem_79805)[sext_i32_i64(local_tid_79787 +\n                                                    offset_79807)];\n        }\n    }\n    offset_79807 = 1;\n    while (slt32(offset_79807, wave_sizze_79789)) {\n        if (slt32(local_tid_79787 + offset_79807, sext_i64_i32(q_65346)) &&\n            ((local_tid_79787 - squot32(local_tid_79787, wave_sizze_79789) *\n              wave_sizze_79789) & (2 * offset_79807 - 1)) == 0) {\n            // read array element\n            {",
            "\n                x_72891 = ((volatile __local\n                            float *) red_arr_mem_79805)[sext_i32_i64(local_tid_79787 +\n                                                        offset_79807)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72892 = x_72890 + x_72891;\n                \n                x_72890 = defunc_1_op_res_72892;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79805)[sext_i32_i64(local_tid_79787)] =\n                    x_72890;\n            }\n        }\n        offset_79807 *= 2;\n    }\n    while (slt32(skip_waves_79808, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79789 - 1,\n                                           wave_sizze_79789))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79807 = skip_waves_79808 * wave_sizze_79789;\n        if (slt32(local_tid_79787 + offset_79807, sext_i64_i32(q_65346)) &&\n            ((local_tid_79787 - squot32(local_tid_79787, wave_sizze_79789) *\n              wave_sizze_79789) == 0 && (squot32(local_tid_79787,\n                                                 wave_sizze_79789) & (2 *\n                                                                      skip_waves_79808 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_72891 = ((__local\n                            float *) red_arr_mem_79805)[sext_i32_i64(local_tid_79787 +\n                                                        offset_79807)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72892 = x_72890 + x_72891;\n                \n                x_72890 = defunc_1_op_res_72892;\n            }\n            // write result of operation\n            {\n                ((__local\n               ",
            "   float *) red_arr_mem_79805)[sext_i32_i64(local_tid_79787)] =\n                    x_72890;\n            }\n        }\n        skip_waves_79808 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_72886 = ((__local\n                                  float *) red_arr_mem_79805)[(int64_t) 0];\n    \n    float a0_72910 = 1.0F / defunc_2_reduce_res_72886;\n    float defunc_2_reduce_res_72911;\n    int64_t gtid_72912 = sext_i32_i64(sext_i64_i32(ltid_pre_79791));\n    int32_t phys_tid_72913 = local_tid_79787;\n    __local unsigned char *red_arr_mem_79809;\n    \n    red_arr_mem_79809 = (__local unsigned char *) red_arr_mem_79809_backing_2;\n    \n    float x_72918;\n    \n    x_72918 = ((__local float *) color_78194)[gtid_72912];\n    \n    bool cond_72919 = sle64(last_res_72786, gtid_72912);\n    float defunc_0_f_res_72920;\n    \n    if (cond_72919) {\n        defunc_0_f_res_72920 = 0.0F;\n    } else {\n        int64_t i_72921 = add64(max_res_72866, gtid_72912);\n        float defunc_0_add_arg_72922;\n        \n        defunc_0_add_arg_72922 = ((__global float *) mem_77837)[gtid_72783 *\n                                                                n_65344 +\n                                                                i_72921];\n        defunc_0_f_res_72920 = defunc_0_add_arg_72922;\n    }\n    \n    float x_72923 = a0_72910 * x_72918;\n    float defunc_9_fit_fun_res_72924 = defunc_0_f_res_72920 * x_72923;\n    \n    ((__local float *) red_arr_mem_79809)[gtid_72912] =\n        defunc_9_fit_fun_res_72924;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79811;\n    int32_t skip_waves_79812 = 1;\n    float x_72914;\n    float x_72915;\n    \n    offset_79811 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79787, sext_i64_i32(q_65346))) {\n            x_72914 = ((__local\n                        float *) red_arr_mem_79809)[sext_i32_i64(local_tid_79787 +\n                                                    offset_79811)];\n        }\n    }\n   ",
            " offset_79811 = 1;\n    while (slt32(offset_79811, wave_sizze_79789)) {\n        if (slt32(local_tid_79787 + offset_79811, sext_i64_i32(q_65346)) &&\n            ((local_tid_79787 - squot32(local_tid_79787, wave_sizze_79789) *\n              wave_sizze_79789) & (2 * offset_79811 - 1)) == 0) {\n            // read array element\n            {\n                x_72915 = ((volatile __local\n                            float *) red_arr_mem_79809)[sext_i32_i64(local_tid_79787 +\n                                                        offset_79811)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72916 = x_72914 + x_72915;\n                \n                x_72914 = defunc_1_op_res_72916;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79809)[sext_i32_i64(local_tid_79787)] =\n                    x_72914;\n            }\n        }\n        offset_79811 *= 2;\n    }\n    while (slt32(skip_waves_79812, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79789 - 1,\n                                           wave_sizze_79789))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79811 = skip_waves_79812 * wave_sizze_79789;\n        if (slt32(local_tid_79787 + offset_79811, sext_i64_i32(q_65346)) &&\n            ((local_tid_79787 - squot32(local_tid_79787, wave_sizze_79789) *\n              wave_sizze_79789) == 0 && (squot32(local_tid_79787,\n                                                 wave_sizze_79789) & (2 *\n                                                                      skip_waves_79812 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_72915 = ((__local\n                            float *) red_arr_mem_79809)[sext_i32_i64(local_tid_79787 +\n                                             ",
            "           offset_79811)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72916 = x_72914 + x_72915;\n                \n                x_72914 = defunc_1_op_res_72916;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79809)[sext_i32_i64(local_tid_79787)] =\n                    x_72914;\n            }\n        }\n        skip_waves_79812 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_72911 = ((__local\n                                  float *) red_arr_mem_79809)[(int64_t) 0];\n    if (local_tid_79787 == 0) {\n        ((__global float *) mem_77875)[gtid_72783 * n_m_65352 + gtid_72784] =\n            defunc_2_reduce_res_72911;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_73453(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            uint red_arr_mem_79984_backing_offset_0,\n                                            uint red_arr_mem_79982_backing_offset_1,\n                                            uint red_arr_mem_79978_backing_offset_2,\n                                            uint red_arr_mem_79976_backing_offset_3,\n                                            uint red_arr_mem_79974_backing_offset_4,\n                                            uint color_78196_backing_offset_5,\n                                            uint color_78195_backing_offset_6,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t",
            " min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            __global unsigned char *mem_77880,\n                                            __global unsigned char *mem_77884,\n                                            __global unsigned char *mem_77888,\n                                            __global unsigned char *mem_77894,\n                                            __global unsigned char *mem_77898,\n                                            __global unsigned char *mem_77901,\n                                            __global unsigned char *mem_77904,\n                                            __global unsigned char *mem_77907,\n                                            __global unsigned char *mem_77912,\n                                            __global unsigned char *mem_77925,\n                                            __global unsigned char *mem_77929)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\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_79984_backing_6 =\n                           &shared_mem[red_arr_mem_79984_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79982_backing_5 =\n                           &shared_mem[red_arr_mem_79982_backing_offset_1];\n    volatile unsigned char *red_arr_mem_79978_backing_4 =\n                           &shared_mem[red_arr_mem_79978_backing_offset_2];\n    volatile unsigned char *red_arr_mem_79976_backing_3 =\n                           &shared_mem[red_arr_mem_79976_backing_offset_3];\n    volatile unsigned char *red_arr_mem_79974_backing_2 =\n                           &shared_mem[red_arr_mem_79974_backing_offset_4];\n    volatile unsigned char *color_78196_backing_1 =\n                           &shared_mem[color_78196_backing_offset_5];\n    volatile unsigned char *color_78195_backing_0 =\n                 ",
            "          &shared_mem[color_78195_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_79955;\n    int32_t local_tid_79956;\n    int64_t group_sizze_79959;\n    int32_t wave_sizze_79958;\n    int32_t group_tid_79957;\n    \n    global_tid_79955 = get_global_id(0);\n    local_tid_79956 = get_local_id(0);\n    group_sizze_79959 = get_local_size(0);\n    wave_sizze_79958 = LOCKSTEP_WIDTH;\n    group_tid_79957 = get_group_id(0);\n    \n    int32_t phys_tid_73453 = group_tid_79957;\n    int64_t slice_79961 = q_65346;\n    int64_t ltid_pre_79960 = sext_i32_i64(local_tid_79956);\n    int64_t remnant_79962 = sext_i32_i64(local_tid_79956) - ltid_pre_79960;\n    int64_t slice_79963 = n_m_65352;\n    int64_t slice_79964 = m_65343 * slice_79963;\n    int64_t gtid_73451 = squot64(sext_i32_i64(group_tid_79957), slice_79963);\n    int64_t remnant_79965 = sext_i32_i64(group_tid_79957) - gtid_73451 *\n            slice_79963;\n    int64_t gtid_73452 = remnant_79965;\n    int64_t remnant_79966 = remnant_79965 - gtid_73452;\n    __local unsigned char *color_78195;\n    \n    color_78195 = (__local unsigned char *) color_78195_backing_0;\n    \n    __local unsigned char *color_78196;\n    \n    color_78196 = (__local unsigned char *) color_78196_backing_1;\n    \n    int64_t last_res_73454;\n    \n    last_res_73454 = ((__global int64_t *) mem_77880)[gtid_73451 * n_65344 +\n                                                      i_65358];\n    \n    int64_t min_arg_73461;\n    \n    min_arg_73461 = ((__global int64_t *) mem_77898)[gtid_73451];\n    \n    int64_t min_arg_73462;\n    \n    min_arg_73462 = ((__global int64_t *) mem_77901)[gtid_73451];\n    \n    int64_t min_res_73463;\n    \n    min_res_73463 = ((__global int64_t *) mem_77904)[gtid_73451];\n    \n    float max_res_73464;\n    \n    max_res_73464 ",
            "= ((__global float *) mem_77907)[gtid_73451];\n    \n    int64_t min_arg_73468 = mul64(jump_65348, gtid_73452);\n    int64_t min_res_73469 = smin64(i_65358, min_arg_73468);\n    int64_t defunc_0_g_res_73470 = add64((int64_t) 1, min_res_73469);\n    bool init_idx_73471;\n    int64_t init_idx_73472;\n    int64_t init_idx_73473;\n    bool loop_while_73474;\n    int64_t low_73475;\n    int64_t high_73476;\n    \n    loop_while_73474 = x_65359;\n    low_73475 = (int64_t) 0;\n    high_73476 = i_65358;\n    while (loop_while_73474) {\n        int64_t x_73477 = add64(low_73475, high_73476);\n        int64_t mid_73478 = sdiv64(x_73477, (int64_t) 2);\n        bool x_73479 = sle64((int64_t) 0, mid_73478);\n        bool y_73480 = slt64(mid_73478, n_65344);\n        bool bounds_check_73481 = x_73479 && y_73480;\n        bool index_certs_73482;\n        \n        if (!bounds_check_73481) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 50) == -1) {\n                    global_failure_args[0] = (int64_t) mid_73478;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t mid_id_73483;\n        \n        mid_id_73483 = ((__global int64_t *) mem_77894)[gtid_73451 * n_65344 +\n                                                        mid_73478];\n        \n        bool cond_73484 = slt64(mid_id_73483, (int64_t) 0);\n        int64_t mid_idx_73485;\n        \n        if (cond_73484) {\n            mid_idx_73485 = (int64_t) 9223372036854775807;\n        } else {\n            mid_idx_73485 = mid_id_73483;\n        }\n        \n        bool cond_73486 = sle64(defunc_0_g_res_73470, mid_idx_73485);\n        int64_t loopres_73487;\n        int64_t loopres_73488;\n        \n        if (cond_73486) {\n            int64_t loopres_t_res_73489 = sub64(mid_73478, (int64_t) 1);\n            \n            loopres_73487 = low_73475;\n            loopres_",
            "73488 = loopres_t_res_73489;\n        } else {\n            int64_t loopres_f_res_73490 = add64((int64_t) 1, mid_73478);\n            \n            loopres_73487 = loopres_f_res_73490;\n            loopres_73488 = high_73476;\n        }\n        \n        bool loop_cond_73491 = sle64(loopres_73487, loopres_73488);\n        bool loop_while_tmp_79967 = loop_cond_73491;\n        int64_t low_tmp_79968 = loopres_73487;\n        int64_t high_tmp_79969 = loopres_73488;\n        \n        loop_while_73474 = loop_while_tmp_79967;\n        low_73475 = low_tmp_79968;\n        high_73476 = high_tmp_79969;\n    }\n    init_idx_73471 = loop_while_73474;\n    init_idx_73472 = low_73475;\n    init_idx_73473 = high_73476;\n    \n    bool idx_73492;\n    int64_t idx_73493;\n    int64_t idx_73494;\n    int64_t idx_73495;\n    bool loop_while_73496;\n    int64_t l_idx_73497;\n    int64_t r_idx_73498;\n    int64_t span_73499;\n    \n    loop_while_73496 = loop_cond_65369;\n    l_idx_73497 = init_idx_73472;\n    r_idx_73498 = init_idx_73472;\n    span_73499 = (int64_t) 1;\n    while (loop_while_73496) {\n        int64_t max_arg_73500 = sub64(l_idx_73497, (int64_t) 1);\n        int64_t max_res_73501 = smax64((int64_t) 0, max_arg_73500);\n        int64_t min_arg_73502 = add64((int64_t) 1, r_idx_73498);\n        int64_t min_res_73503 = smin64(min_arg_73461, min_arg_73502);\n        bool x_73504 = sle64((int64_t) 0, max_res_73501);\n        bool y_73505 = slt64(max_res_73501, n_65344);\n        bool bounds_check_73506 = x_73504 && y_73505;\n        bool index_certs_73507;\n        \n        if (!bounds_check_73506) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 51) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_73501;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_73508;\n        \n        x_73508 = ((__g",
            "lobal int64_t *) mem_77894)[gtid_73451 * n_65344 +\n                                                   max_res_73501];\n        \n        int64_t abs_arg_73509 = sub64(x_73508, defunc_0_g_res_73470);\n        int64_t abs_res_73510 = abs64(abs_arg_73509);\n        bool x_73511 = sle64((int64_t) 0, min_res_73503);\n        bool y_73512 = slt64(min_res_73503, n_65344);\n        bool bounds_check_73513 = x_73511 && y_73512;\n        bool index_certs_73514;\n        \n        if (!bounds_check_73513) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 52) == -1) {\n                    global_failure_args[0] = (int64_t) min_res_73503;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_73515;\n        \n        x_73515 = ((__global int64_t *) mem_77894)[gtid_73451 * n_65344 +\n                                                   min_res_73503];\n        \n        int64_t abs_arg_73516 = sub64(x_73515, defunc_0_g_res_73470);\n        int64_t abs_res_73517 = abs64(abs_arg_73516);\n        bool cond_73518 = max_res_73501 == l_idx_73497;\n        int64_t loopres_73519;\n        int64_t loopres_73520;\n        int64_t loopres_73521;\n        \n        if (cond_73518) {\n            loopres_73519 = l_idx_73497;\n            loopres_73520 = r_idx_73498;\n            loopres_73521 = min_res_65364;\n        } else {\n            bool cond_73522 = slt64(abs_res_73510, abs_res_73517);\n            bool cond_f_res_73523 = min_res_73503 == r_idx_73498;\n            bool x_73524 = !cond_73522;\n            bool y_73525 = cond_f_res_73523 && x_73524;\n            bool cond_73526 = cond_73522 || y_73525;\n            int64_t loopres_f_res_73527;\n            \n            if (cond_73526) {\n                loopres_f_res_73527 = max_res_73501;\n            } else {\n                loopres_f_res_73527 = l_idx_73497;\n            }\n",
            "            \n            int64_t loopres_f_res_73528;\n            \n            if (cond_73526) {\n                loopres_f_res_73528 = r_idx_73498;\n            } else {\n                loopres_f_res_73528 = min_res_73503;\n            }\n            \n            int64_t loopres_f_res_73529;\n            \n            if (cond_73526) {\n                int64_t loopres_f_res_t_res_73530 = add64((int64_t) 1,\n                                                          span_73499);\n                \n                loopres_f_res_73529 = loopres_f_res_t_res_73530;\n            } else {\n                int64_t loopres_f_res_f_res_73531 = add64((int64_t) 1,\n                                                          span_73499);\n                \n                loopres_f_res_73529 = loopres_f_res_f_res_73531;\n            }\n            loopres_73519 = loopres_f_res_73527;\n            loopres_73520 = loopres_f_res_73528;\n            loopres_73521 = loopres_f_res_73529;\n        }\n        \n        bool loop_cond_73532 = slt64(loopres_73521, min_res_65364);\n        bool loop_while_tmp_79970 = loop_cond_73532;\n        int64_t l_idx_tmp_79971 = loopres_73519;\n        int64_t r_idx_tmp_79972 = loopres_73520;\n        int64_t span_tmp_79973 = loopres_73521;\n        \n        loop_while_73496 = loop_while_tmp_79970;\n        l_idx_73497 = l_idx_tmp_79971;\n        r_idx_73498 = r_idx_tmp_79972;\n        span_73499 = span_tmp_79973;\n    }\n    idx_73492 = loop_while_73496;\n    idx_73493 = l_idx_73497;\n    idx_73494 = r_idx_73498;\n    idx_73495 = span_73499;\n    \n    int64_t min_res_73533 = smin64(min_arg_73462, idx_73493);\n    int64_t max_res_73534 = smax64((int64_t) 0, min_res_73533);\n    int64_t x_73535 = add64(min_res_73463, max_res_73534);\n    int64_t r_73536 = sub64(x_73535, (int64_t) 1);\n    bool x_73537 = sle64((int64_t) 0, r_73536);\n    bool y_73538 = slt64(r_73536, n_65344);\n    bool bounds_check_73539 = x_73537 && y_73538;\n    bool index_certs_73540;\n    \n    if (!bounds_check_73539) {\n     ",
            "   {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 53) == -1) {\n                global_failure_args[0] = (int64_t) r_73536;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_73541;\n    \n    x_73541 = ((__global int64_t *) mem_77888)[gtid_73451 * n_65344 + r_73536];\n    \n    int64_t abs_arg_73542 = sub64(x_73541, min_res_73469);\n    int64_t abs_res_73543 = abs64(abs_arg_73542);\n    bool x_73544 = sle64((int64_t) 0, max_res_73534);\n    bool y_73545 = slt64(max_res_73534, n_65344);\n    bool bounds_check_73546 = x_73544 && y_73545;\n    bool index_certs_73547;\n    \n    if (!bounds_check_73546) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 54) == -1) {\n                global_failure_args[0] = (int64_t) max_res_73534;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_73548;\n    \n    x_73548 = ((__global int64_t *) mem_77888)[gtid_73451 * n_65344 +\n                                               max_res_73534];\n    \n    int64_t abs_arg_73549 = sub64(x_73548, min_res_73469);\n    int64_t abs_res_73550 = abs64(abs_arg_73549);\n    int64_t max_res_73551 = smax64(abs_res_73543, abs_res_73550);\n    float defunc_0_f_res_73552 = sitofp_i64_f32(max_res_73551);\n    float defunc_1_f_res_73553 = max_res_73464 + defunc_0_f_res_73552;\n    float defunc_2_reduce_res_73554;\n    float defunc_2_reduce_res_73555;\n    float defunc_2_reduce_res_73556;\n    int64_t gtid_73559 = sext_i32_i64(sext_i64_i32(ltid_pre_79960));\n    int32_t phys_tid_73560 = local_tid_79956;\n    __local unsigned char *red_arr_mem_79974;\n    \n    red_arr_mem_79974 = (__local unsigned char *) red_arr_mem_79974_backing_2;\n    \n    __local unsigned char *red_arr_mem_79976;\n    \n    red_arr_mem_79976 = (__local unsign",
            "ed char *) red_arr_mem_79976_backing_3;\n    \n    __local unsigned char *red_arr_mem_79978;\n    \n    red_arr_mem_79978 = (__local unsigned char *) red_arr_mem_79978_backing_4;\n    \n    float x_73571;\n    \n    x_73571 = ((__global float *) mem_77912)[gtid_73451 * q_65346 + gtid_73559];\n    \n    bool cond_73572 = sle64(last_res_73454, gtid_73559);\n    int64_t defunc_0_f_res_73573;\n    \n    if (cond_73572) {\n        defunc_0_f_res_73573 = (int64_t) 0;\n    } else {\n        int64_t i_73574 = add64(max_res_73534, gtid_73559);\n        int64_t defunc_0_add_arg_73575;\n        \n        defunc_0_add_arg_73575 = ((__global int64_t *) mem_77888)[gtid_73451 *\n                                                                  n_65344 +\n                                                                  i_73574];\n        \n        int64_t defunc_1_add_res_73576 = add64((int64_t) 1,\n                                               defunc_0_add_arg_73575);\n        \n        defunc_0_f_res_73573 = defunc_1_add_res_73576;\n    }\n    \n    int64_t binop_p_73577 = sub64(defunc_0_f_res_73573, min_res_73469);\n    float defunc_0_f_res_73578 = sitofp_i64_f32(binop_p_73577);\n    float abs_res_73579 = (float) fabs(defunc_0_f_res_73578);\n    float tmp1_73580 = abs_res_73579 / defunc_1_f_res_73553;\n    float x_73581 = tmp1_73580 * tmp1_73580;\n    float y_73582 = tmp1_73580 * x_73581;\n    float tmp2_73583 = 1.0F - y_73582;\n    float x_73584 = tmp2_73583 * tmp2_73583;\n    float tmp3_73585 = tmp2_73583 * x_73584;\n    float tmp4_73586 = x_73571 * tmp3_73585;\n    float defunc_1_f_res_73587 = defunc_0_f_res_73578 * tmp4_73586;\n    float defunc_1_f_res_73588 = defunc_0_f_res_73578 * defunc_1_f_res_73587;\n    \n    ((__local float *) red_arr_mem_79974)[gtid_73559] = tmp4_73586;\n    ((__local float *) red_arr_mem_79976)[gtid_73559] = defunc_1_f_res_73587;\n    ((__local float *) red_arr_mem_79978)[gtid_73559] = defunc_1_f_res_73588;\n    ((__local float *) color_78196)[gtid_73559] = defunc_1_f_res_73587;\n    ((__loca",
            "l float *) color_78195)[gtid_73559] = tmp4_73586;\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79980;\n    int32_t skip_waves_79981 = 1;\n    float x_73561;\n    float x_73562;\n    float x_73563;\n    float x_73564;\n    float x_73565;\n    float x_73566;\n    \n    offset_79980 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79956, sext_i64_i32(q_65346))) {\n            x_73561 = ((__local\n                        float *) red_arr_mem_79974)[sext_i32_i64(local_tid_79956 +\n                                                    offset_79980)];\n            x_73562 = ((__local\n                        float *) red_arr_mem_79976)[sext_i32_i64(local_tid_79956 +\n                                                    offset_79980)];\n            x_73563 = ((__local\n                        float *) red_arr_mem_79978)[sext_i32_i64(local_tid_79956 +\n                                                    offset_79980)];\n        }\n    }\n    offset_79980 = 1;\n    while (slt32(offset_79980, wave_sizze_79958)) {\n        if (slt32(local_tid_79956 + offset_79980, sext_i64_i32(q_65346)) &&\n            ((local_tid_79956 - squot32(local_tid_79956, wave_sizze_79958) *\n              wave_sizze_79958) & (2 * offset_79980 - 1)) == 0) {\n            // read array element\n            {\n                x_73564 = ((volatile __local\n                            float *) red_arr_mem_79974)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79980)];\n                x_73565 = ((volatile __local\n                            float *) red_arr_mem_79976)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79980)];\n                x_73566 = ((volatile __local\n                            float *) red_arr_mem_79978)[sext_i32_i64(local_tid_79956 +\n                                                      ",
            "  offset_79980)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73567 = x_73561 + x_73564;\n                float defunc_1_op_res_73568 = x_73562 + x_73565;\n                float defunc_1_op_res_73569 = x_73563 + x_73566;\n                \n                x_73561 = defunc_1_op_res_73567;\n                x_73562 = defunc_1_op_res_73568;\n                x_73563 = defunc_1_op_res_73569;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79974)[sext_i32_i64(local_tid_79956)] =\n                    x_73561;\n                ((volatile __local\n                  float *) red_arr_mem_79976)[sext_i32_i64(local_tid_79956)] =\n                    x_73562;\n                ((volatile __local\n                  float *) red_arr_mem_79978)[sext_i32_i64(local_tid_79956)] =\n                    x_73563;\n            }\n        }\n        offset_79980 *= 2;\n    }\n    while (slt32(skip_waves_79981, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79958 - 1,\n                                           wave_sizze_79958))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79980 = skip_waves_79981 * wave_sizze_79958;\n        if (slt32(local_tid_79956 + offset_79980, sext_i64_i32(q_65346)) &&\n            ((local_tid_79956 - squot32(local_tid_79956, wave_sizze_79958) *\n              wave_sizze_79958) == 0 && (squot32(local_tid_79956,\n                                                 wave_sizze_79958) & (2 *\n                                                                      skip_waves_79981 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_73564 = ((__local\n                            float *) red_arr_mem_79974)[sext_i32_i64(local_tid_79956 +\n                                                       ",
            " offset_79980)];\n                x_73565 = ((__local\n                            float *) red_arr_mem_79976)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79980)];\n                x_73566 = ((__local\n                            float *) red_arr_mem_79978)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79980)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73567 = x_73561 + x_73564;\n                float defunc_1_op_res_73568 = x_73562 + x_73565;\n                float defunc_1_op_res_73569 = x_73563 + x_73566;\n                \n                x_73561 = defunc_1_op_res_73567;\n                x_73562 = defunc_1_op_res_73568;\n                x_73563 = defunc_1_op_res_73569;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79974)[sext_i32_i64(local_tid_79956)] =\n                    x_73561;\n                ((__local\n                  float *) red_arr_mem_79976)[sext_i32_i64(local_tid_79956)] =\n                    x_73562;\n                ((__local\n                  float *) red_arr_mem_79978)[sext_i32_i64(local_tid_79956)] =\n                    x_73563;\n            }\n        }\n        skip_waves_79981 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_73554 = ((__local\n                                  float *) red_arr_mem_79974)[(int64_t) 0];\n    defunc_2_reduce_res_73555 = ((__local\n                                  float *) red_arr_mem_79976)[(int64_t) 0];\n    defunc_2_reduce_res_73556 = ((__local\n                                  float *) red_arr_mem_79978)[(int64_t) 0];\n    \n    float x_73589 = defunc_2_reduce_res_73554 * defunc_2_reduce_res_73556;\n    float y_73590 = defunc_2_reduce_res_73555 * defunc_2_reduce_res_73555;\n    float y_73591 = x_73589 - y_73590;\n    float det1_73592 = 1.0F / y_73591;\n    float a1",
            "1_73593 = defunc_2_reduce_res_73556 * det1_73592;\n    float x_73594 = 0.0F - defunc_2_reduce_res_73555;\n    float b11_73595 = det1_73592 * x_73594;\n    float c11_73596 = defunc_2_reduce_res_73554 * det1_73592;\n    float defunc_2_reduce_res_73597;\n    float defunc_2_reduce_res_73598;\n    int64_t gtid_73599 = sext_i32_i64(sext_i64_i32(ltid_pre_79960));\n    int32_t phys_tid_73600 = local_tid_79956;\n    __local unsigned char *red_arr_mem_79982;\n    \n    red_arr_mem_79982 = (__local unsigned char *) red_arr_mem_79982_backing_5;\n    \n    __local unsigned char *red_arr_mem_79984;\n    \n    red_arr_mem_79984 = (__local unsigned char *) red_arr_mem_79984_backing_6;\n    \n    float x_73608;\n    \n    x_73608 = ((__local float *) color_78195)[gtid_73599];\n    \n    float x_73609;\n    \n    x_73609 = ((__local float *) color_78196)[gtid_73599];\n    \n    bool cond_73610 = sle64(last_res_73454, gtid_73599);\n    float defunc_0_f_res_73611;\n    \n    if (cond_73610) {\n        defunc_0_f_res_73611 = 0.0F;\n    } else {\n        int64_t i_73612 = add64(max_res_73534, gtid_73599);\n        float defunc_0_add_arg_73613;\n        \n        defunc_0_add_arg_73613 = ((__global float *) mem_77884)[gtid_73451 *\n                                                                n_65344 +\n                                                                i_73612];\n        defunc_0_f_res_73611 = defunc_0_add_arg_73613;\n    }\n    \n    float x_73614 = a11_73593 * x_73608;\n    float y_73615 = b11_73595 * x_73609;\n    float x_73616 = x_73614 + y_73615;\n    float defunc_9_fit_fun_res_73617 = defunc_0_f_res_73611 * x_73616;\n    float x_73618 = b11_73595 * x_73608;\n    float y_73619 = c11_73596 * x_73609;\n    float x_73620 = x_73618 + y_73619;\n    float defunc_9_slope_fun_res_73621 = defunc_0_f_res_73611 * x_73620;\n    \n    ((__local float *) red_arr_mem_79982)[gtid_73599] =\n        defunc_9_fit_fun_res_73617;\n    ((__local float *) red_arr_mem_79984)[gtid_73599] =\n        defunc_9_slope_fun_res_73621;\n    barrier(CL",
            "K_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79986;\n    int32_t skip_waves_79987 = 1;\n    float x_73601;\n    float x_73602;\n    float x_73603;\n    float x_73604;\n    \n    offset_79986 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79956, sext_i64_i32(q_65346))) {\n            x_73601 = ((__local\n                        float *) red_arr_mem_79982)[sext_i32_i64(local_tid_79956 +\n                                                    offset_79986)];\n            x_73602 = ((__local\n                        float *) red_arr_mem_79984)[sext_i32_i64(local_tid_79956 +\n                                                    offset_79986)];\n        }\n    }\n    offset_79986 = 1;\n    while (slt32(offset_79986, wave_sizze_79958)) {\n        if (slt32(local_tid_79956 + offset_79986, sext_i64_i32(q_65346)) &&\n            ((local_tid_79956 - squot32(local_tid_79956, wave_sizze_79958) *\n              wave_sizze_79958) & (2 * offset_79986 - 1)) == 0) {\n            // read array element\n            {\n                x_73603 = ((volatile __local\n                            float *) red_arr_mem_79982)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79986)];\n                x_73604 = ((volatile __local\n                            float *) red_arr_mem_79984)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79986)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73605 = x_73601 + x_73603;\n                float defunc_1_op_res_73606 = x_73602 + x_73604;\n                \n                x_73601 = defunc_1_op_res_73605;\n                x_73602 = defunc_1_op_res_73606;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79982)[sext_i32_i64(local_tid_79956)] =\n                    x_73601;\n                ((volatile __local",
            "\n                  float *) red_arr_mem_79984)[sext_i32_i64(local_tid_79956)] =\n                    x_73602;\n            }\n        }\n        offset_79986 *= 2;\n    }\n    while (slt32(skip_waves_79987, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79958 - 1,\n                                           wave_sizze_79958))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79986 = skip_waves_79987 * wave_sizze_79958;\n        if (slt32(local_tid_79956 + offset_79986, sext_i64_i32(q_65346)) &&\n            ((local_tid_79956 - squot32(local_tid_79956, wave_sizze_79958) *\n              wave_sizze_79958) == 0 && (squot32(local_tid_79956,\n                                                 wave_sizze_79958) & (2 *\n                                                                      skip_waves_79987 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_73603 = ((__local\n                            float *) red_arr_mem_79982)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79986)];\n                x_73604 = ((__local\n                            float *) red_arr_mem_79984)[sext_i32_i64(local_tid_79956 +\n                                                        offset_79986)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73605 = x_73601 + x_73603;\n                float defunc_1_op_res_73606 = x_73602 + x_73604;\n                \n                x_73601 = defunc_1_op_res_73605;\n                x_73602 = defunc_1_op_res_73606;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79982)[sext_i32_i64(local_tid_79956)] =\n                    x_73601;\n                ((__local\n                  float *) red_arr_mem_79984)[sext_i32_i64(local_tid_79956)] =\n ",
            "                   x_73602;\n            }\n        }\n        skip_waves_79987 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_73597 = ((__local\n                                  float *) red_arr_mem_79982)[(int64_t) 0];\n    defunc_2_reduce_res_73598 = ((__local\n                                  float *) red_arr_mem_79984)[(int64_t) 0];\n    if (local_tid_79956 == 0) {\n        ((__global float *) mem_77925)[gtid_73451 * n_m_65352 + gtid_73452] =\n            defunc_2_reduce_res_73597;\n    }\n    if (local_tid_79956 == 0) {\n        ((__global float *) mem_77929)[gtid_73451 * n_m_65352 + gtid_73452] =\n            defunc_2_reduce_res_73598;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_74210(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            uint red_arr_mem_80163_backing_offset_0,\n                                            uint red_arr_mem_80161_backing_offset_1,\n                                            uint red_arr_mem_80157_backing_offset_2,\n                                            uint red_arr_mem_80155_backing_offset_3,\n                                            uint red_arr_mem_80153_backing_offset_4,\n                                            uint red_arr_mem_80151_backing_offset_5,\n                                            uint red_arr_mem_80149_backing_offset_6,\n                                            uint color_78200_backing_offset_7,\n                                            uint color_78199_backing_offset_8,\n                                            uint color_78198_backing_offset_9,\n                                            uint color_78197_backing_offset_10,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n   ",
            "                                         int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            __global unsigned char *mem_77934,\n                                            __global unsigned char *mem_77938,\n                                            __global unsigned char *mem_77942,\n                                            __global unsigned char *mem_77948,\n                                            __global unsigned char *mem_77952,\n                                            __global unsigned char *mem_77955,\n                                            __global unsigned char *mem_77958,\n                                            __global unsigned char *mem_77961,\n                                            __global unsigned char *mem_77966,\n                                            __global unsigned char *mem_77986,\n                                            __global unsigned char *mem_77990)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\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_80163_backing_10 =\n                           &shared_mem[red_arr_mem_80163_backing_offset_0];\n    volatile unsigned char *red_arr_mem_80161_backing_9 =\n                           &shared_mem[red_arr_mem_80161_backing_offset_1];\n    volatile unsigned char *red_arr_mem_80157_backing_8 =\n                           &shared_mem[red_arr_mem_80157_backing_offset_2];\n    volatile unsigned char *red_arr_mem_80155_backing_7 =\n                           &shared_mem[red_arr_mem_80155_backing_offset_3];\n    volatile unsigned char *red_arr_mem_80153_backing_6 =\n                           &shared_mem[red_arr_mem_80153_backing_o",
            "ffset_4];\n    volatile unsigned char *red_arr_mem_80151_backing_5 =\n                           &shared_mem[red_arr_mem_80151_backing_offset_5];\n    volatile unsigned char *red_arr_mem_80149_backing_4 =\n                           &shared_mem[red_arr_mem_80149_backing_offset_6];\n    volatile unsigned char *color_78200_backing_3 =\n                           &shared_mem[color_78200_backing_offset_7];\n    volatile unsigned char *color_78199_backing_2 =\n                           &shared_mem[color_78199_backing_offset_8];\n    volatile unsigned char *color_78198_backing_1 =\n                           &shared_mem[color_78198_backing_offset_9];\n    volatile unsigned char *color_78197_backing_0 =\n                           &shared_mem[color_78197_backing_offset_10];\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_80130;\n    int32_t local_tid_80131;\n    int64_t group_sizze_80134;\n    int32_t wave_sizze_80133;\n    int32_t group_tid_80132;\n    \n    global_tid_80130 = get_global_id(0);\n    local_tid_80131 = get_local_id(0);\n    group_sizze_80134 = get_local_size(0);\n    wave_sizze_80133 = LOCKSTEP_WIDTH;\n    group_tid_80132 = get_group_id(0);\n    \n    int32_t phys_tid_74210 = group_tid_80132;\n    int64_t slice_80136 = q_65346;\n    int64_t ltid_pre_80135 = sext_i32_i64(local_tid_80131);\n    int64_t remnant_80137 = sext_i32_i64(local_tid_80131) - ltid_pre_80135;\n    int64_t slice_80138 = n_m_65352;\n    int64_t slice_80139 = m_65343 * slice_80138;\n    int64_t gtid_74208 = squot64(sext_i32_i64(group_tid_80132), slice_80138);\n    int64_t remnant_80140 = sext_i32_i64(group_tid_80132) - gtid_74208 *\n            slice_80138;\n    int64_t gtid_74209 = remnant_80140;\n    int64_t remnant_80141 = remnant_80140 - gtid_74209;\n    __local unsigned char *color_78197;\n    \n    color_7",
            "8197 = (__local unsigned char *) color_78197_backing_0;\n    \n    __local unsigned char *color_78198;\n    \n    color_78198 = (__local unsigned char *) color_78198_backing_1;\n    \n    __local unsigned char *color_78199;\n    \n    color_78199 = (__local unsigned char *) color_78199_backing_2;\n    \n    __local unsigned char *color_78200;\n    \n    color_78200 = (__local unsigned char *) color_78200_backing_3;\n    \n    int64_t last_res_74211;\n    \n    last_res_74211 = ((__global int64_t *) mem_77934)[gtid_74208 * n_65344 +\n                                                      i_65358];\n    \n    int64_t min_arg_74218;\n    \n    min_arg_74218 = ((__global int64_t *) mem_77952)[gtid_74208];\n    \n    int64_t min_arg_74219;\n    \n    min_arg_74219 = ((__global int64_t *) mem_77955)[gtid_74208];\n    \n    int64_t min_res_74220;\n    \n    min_res_74220 = ((__global int64_t *) mem_77958)[gtid_74208];\n    \n    float max_res_74221;\n    \n    max_res_74221 = ((__global float *) mem_77961)[gtid_74208];\n    \n    int64_t min_arg_74225 = mul64(jump_65348, gtid_74209);\n    int64_t min_res_74226 = smin64(i_65358, min_arg_74225);\n    int64_t defunc_0_g_res_74227 = add64((int64_t) 1, min_res_74226);\n    bool init_idx_74228;\n    int64_t init_idx_74229;\n    int64_t init_idx_74230;\n    bool loop_while_74231;\n    int64_t low_74232;\n    int64_t high_74233;\n    \n    loop_while_74231 = x_65359;\n    low_74232 = (int64_t) 0;\n    high_74233 = i_65358;\n    while (loop_while_74231) {\n        int64_t x_74234 = add64(low_74232, high_74233);\n        int64_t mid_74235 = sdiv64(x_74234, (int64_t) 2);\n        bool x_74236 = sle64((int64_t) 0, mid_74235);\n        bool y_74237 = slt64(mid_74235, n_65344);\n        bool bounds_check_74238 = x_74236 && y_74237;\n        bool index_certs_74239;\n        \n        if (!bounds_check_74238) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 55) == -1) {\n                    global_failure_args[0] = (int64_t) mid_74235;\n                    global_",
            "failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t mid_id_74240;\n        \n        mid_id_74240 = ((__global int64_t *) mem_77948)[gtid_74208 * n_65344 +\n                                                        mid_74235];\n        \n        bool cond_74241 = slt64(mid_id_74240, (int64_t) 0);\n        int64_t mid_idx_74242;\n        \n        if (cond_74241) {\n            mid_idx_74242 = (int64_t) 9223372036854775807;\n        } else {\n            mid_idx_74242 = mid_id_74240;\n        }\n        \n        bool cond_74243 = sle64(defunc_0_g_res_74227, mid_idx_74242);\n        int64_t loopres_74244;\n        int64_t loopres_74245;\n        \n        if (cond_74243) {\n            int64_t loopres_t_res_74246 = sub64(mid_74235, (int64_t) 1);\n            \n            loopres_74244 = low_74232;\n            loopres_74245 = loopres_t_res_74246;\n        } else {\n            int64_t loopres_f_res_74247 = add64((int64_t) 1, mid_74235);\n            \n            loopres_74244 = loopres_f_res_74247;\n            loopres_74245 = high_74233;\n        }\n        \n        bool loop_cond_74248 = sle64(loopres_74244, loopres_74245);\n        bool loop_while_tmp_80142 = loop_cond_74248;\n        int64_t low_tmp_80143 = loopres_74244;\n        int64_t high_tmp_80144 = loopres_74245;\n        \n        loop_while_74231 = loop_while_tmp_80142;\n        low_74232 = low_tmp_80143;\n        high_74233 = high_tmp_80144;\n    }\n    init_idx_74228 = loop_while_74231;\n    init_idx_74229 = low_74232;\n    init_idx_74230 = high_74233;\n    \n    bool idx_74249;\n    int64_t idx_74250;\n    int64_t idx_74251;\n    int64_t idx_74252;\n    bool loop_while_74253;\n    int64_t l_idx_74254;\n    int64_t r_idx_74255;\n    int64_t span_74256;\n    \n    loop_while_74253 = loop_cond_65369;\n    l_idx_74254 = init_idx_74229;\n    r_idx_74255 = init_idx_74229;\n    span_74256 = (int64_t) 1;\n    while (loop_wh",
            "ile_74253) {\n        int64_t max_arg_74257 = sub64(l_idx_74254, (int64_t) 1);\n        int64_t max_res_74258 = smax64((int64_t) 0, max_arg_74257);\n        int64_t min_arg_74259 = add64((int64_t) 1, r_idx_74255);\n        int64_t min_res_74260 = smin64(min_arg_74218, min_arg_74259);\n        bool x_74261 = sle64((int64_t) 0, max_res_74258);\n        bool y_74262 = slt64(max_res_74258, n_65344);\n        bool bounds_check_74263 = x_74261 && y_74262;\n        bool index_certs_74264;\n        \n        if (!bounds_check_74263) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 56) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_74258;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_74265;\n        \n        x_74265 = ((__global int64_t *) mem_77948)[gtid_74208 * n_65344 +\n                                                   max_res_74258];\n        \n        int64_t abs_arg_74266 = sub64(x_74265, defunc_0_g_res_74227);\n        int64_t abs_res_74267 = abs64(abs_arg_74266);\n        bool x_74268 = sle64((int64_t) 0, min_res_74260);\n        bool y_74269 = slt64(min_res_74260, n_65344);\n        bool bounds_check_74270 = x_74268 && y_74269;\n        bool index_certs_74271;\n        \n        if (!bounds_check_74270) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 57) == -1) {\n                    global_failure_args[0] = (int64_t) min_res_74260;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_74272;\n        \n        x_74272 = ((__global int64_t *) mem_77948)[gtid_74208 * n_65344 +\n                                                   min_res_74260];\n        \n       ",
            " int64_t abs_arg_74273 = sub64(x_74272, defunc_0_g_res_74227);\n        int64_t abs_res_74274 = abs64(abs_arg_74273);\n        bool cond_74275 = max_res_74258 == l_idx_74254;\n        int64_t loopres_74276;\n        int64_t loopres_74277;\n        int64_t loopres_74278;\n        \n        if (cond_74275) {\n            loopres_74276 = l_idx_74254;\n            loopres_74277 = r_idx_74255;\n            loopres_74278 = min_res_65364;\n        } else {\n            bool cond_74279 = slt64(abs_res_74267, abs_res_74274);\n            bool cond_f_res_74280 = min_res_74260 == r_idx_74255;\n            bool x_74281 = !cond_74279;\n            bool y_74282 = cond_f_res_74280 && x_74281;\n            bool cond_74283 = cond_74279 || y_74282;\n            int64_t loopres_f_res_74284;\n            \n            if (cond_74283) {\n                loopres_f_res_74284 = max_res_74258;\n            } else {\n                loopres_f_res_74284 = l_idx_74254;\n            }\n            \n            int64_t loopres_f_res_74285;\n            \n            if (cond_74283) {\n                loopres_f_res_74285 = r_idx_74255;\n            } else {\n                loopres_f_res_74285 = min_res_74260;\n            }\n            \n            int64_t loopres_f_res_74286;\n            \n            if (cond_74283) {\n                int64_t loopres_f_res_t_res_74287 = add64((int64_t) 1,\n                                                          span_74256);\n                \n                loopres_f_res_74286 = loopres_f_res_t_res_74287;\n            } else {\n                int64_t loopres_f_res_f_res_74288 = add64((int64_t) 1,\n                                                          span_74256);\n                \n                loopres_f_res_74286 = loopres_f_res_f_res_74288;\n            }\n            loopres_74276 = loopres_f_res_74284;\n            loopres_74277 = loopres_f_res_74285;\n            loopres_74278 = loopres_f_res_74286;\n        }\n        \n        bool loop_cond_74289 = slt64(loopres_74278, min_res_65364);\n  ",
            "      bool loop_while_tmp_80145 = loop_cond_74289;\n        int64_t l_idx_tmp_80146 = loopres_74276;\n        int64_t r_idx_tmp_80147 = loopres_74277;\n        int64_t span_tmp_80148 = loopres_74278;\n        \n        loop_while_74253 = loop_while_tmp_80145;\n        l_idx_74254 = l_idx_tmp_80146;\n        r_idx_74255 = r_idx_tmp_80147;\n        span_74256 = span_tmp_80148;\n    }\n    idx_74249 = loop_while_74253;\n    idx_74250 = l_idx_74254;\n    idx_74251 = r_idx_74255;\n    idx_74252 = span_74256;\n    \n    int64_t min_res_74290 = smin64(min_arg_74219, idx_74250);\n    int64_t max_res_74291 = smax64((int64_t) 0, min_res_74290);\n    int64_t x_74292 = add64(min_res_74220, max_res_74291);\n    int64_t r_74293 = sub64(x_74292, (int64_t) 1);\n    bool x_74294 = sle64((int64_t) 0, r_74293);\n    bool y_74295 = slt64(r_74293, n_65344);\n    bool bounds_check_74296 = x_74294 && y_74295;\n    bool index_certs_74297;\n    \n    if (!bounds_check_74296) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 58) == -1) {\n                global_failure_args[0] = (int64_t) r_74293;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_74298;\n    \n    x_74298 = ((__global int64_t *) mem_77942)[gtid_74208 * n_65344 + r_74293];\n    \n    int64_t abs_arg_74299 = sub64(x_74298, min_res_74226);\n    int64_t abs_res_74300 = abs64(abs_arg_74299);\n    bool x_74301 = sle64((int64_t) 0, max_res_74291);\n    bool y_74302 = slt64(max_res_74291, n_65344);\n    bool bounds_check_74303 = x_74301 && y_74302;\n    bool index_certs_74304;\n    \n    if (!bounds_check_74303) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 59) == -1) {\n                global_failure_args[0] = (int64_t) max_res_74291;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0",
            ";\n        }\n    }\n    \n    int64_t x_74305;\n    \n    x_74305 = ((__global int64_t *) mem_77942)[gtid_74208 * n_65344 +\n                                               max_res_74291];\n    \n    int64_t abs_arg_74306 = sub64(x_74305, min_res_74226);\n    int64_t abs_res_74307 = abs64(abs_arg_74306);\n    int64_t max_res_74308 = smax64(abs_res_74300, abs_res_74307);\n    float defunc_0_f_res_74309 = sitofp_i64_f32(max_res_74308);\n    float defunc_1_f_res_74310 = max_res_74221 + defunc_0_f_res_74309;\n    int64_t gtid_74313 = sext_i32_i64(sext_i64_i32(ltid_pre_80135));\n    int32_t phys_tid_74314 = local_tid_80131;\n    float x_74316;\n    \n    x_74316 = ((__global float *) mem_77966)[gtid_74208 * q_65346 + gtid_74313];\n    \n    bool cond_74317 = sle64(last_res_74211, gtid_74313);\n    int64_t defunc_0_f_res_74318;\n    \n    if (cond_74317) {\n        defunc_0_f_res_74318 = (int64_t) 0;\n    } else {\n        int64_t i_74319 = add64(max_res_74291, gtid_74313);\n        int64_t defunc_0_add_arg_74320;\n        \n        defunc_0_add_arg_74320 = ((__global int64_t *) mem_77942)[gtid_74208 *\n                                                                  n_65344 +\n                                                                  i_74319];\n        \n        int64_t defunc_1_add_res_74321 = add64((int64_t) 1,\n                                               defunc_0_add_arg_74320);\n        \n        defunc_0_f_res_74318 = defunc_1_add_res_74321;\n    }\n    \n    int64_t binop_p_74322 = sub64(defunc_0_f_res_74318, min_res_74226);\n    float defunc_0_f_res_74323 = sitofp_i64_f32(binop_p_74322);\n    float abs_res_74324 = (float) fabs(defunc_0_f_res_74323);\n    float tmp1_74325 = abs_res_74324 / defunc_1_f_res_74310;\n    float x_74326 = tmp1_74325 * tmp1_74325;\n    float y_74327 = tmp1_74325 * x_74326;\n    float tmp2_74328 = 1.0F - y_74327;\n    float x_74329 = tmp2_74328 * tmp2_74328;\n    float tmp3_74330 = tmp2_74328 * x_74329;\n    float tmp4_74331 = x_74316 * tmp3_74330;\n    \n    ((__local float *)",
            " color_78200)[gtid_74313] = defunc_0_f_res_74323;\n    ((__local float *) color_78199)[gtid_74313] = tmp4_74331;\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float defunc_2_reduce_res_74332;\n    float defunc_2_reduce_res_74333;\n    float defunc_2_reduce_res_74334;\n    float defunc_2_reduce_res_74335;\n    float defunc_2_reduce_res_74336;\n    int64_t gtid_74339 = sext_i32_i64(sext_i64_i32(ltid_pre_80135));\n    int32_t phys_tid_74340 = local_tid_80131;\n    __local unsigned char *red_arr_mem_80149;\n    \n    red_arr_mem_80149 = (__local unsigned char *) red_arr_mem_80149_backing_4;\n    \n    __local unsigned char *red_arr_mem_80151;\n    \n    red_arr_mem_80151 = (__local unsigned char *) red_arr_mem_80151_backing_5;\n    \n    __local unsigned char *red_arr_mem_80153;\n    \n    red_arr_mem_80153 = (__local unsigned char *) red_arr_mem_80153_backing_6;\n    \n    __local unsigned char *red_arr_mem_80155;\n    \n    red_arr_mem_80155 = (__local unsigned char *) red_arr_mem_80155_backing_7;\n    \n    __local unsigned char *red_arr_mem_80157;\n    \n    red_arr_mem_80157 = (__local unsigned char *) red_arr_mem_80157_backing_8;\n    \n    float x_74356;\n    \n    x_74356 = ((__local float *) color_78200)[gtid_74339];\n    \n    float x_74357;\n    \n    x_74357 = ((__local float *) color_78199)[gtid_74339];\n    \n    float defunc_1_f_res_74358 = x_74356 * x_74357;\n    float defunc_1_f_res_74359 = x_74356 * defunc_1_f_res_74358;\n    float defunc_1_f_res_74360 = x_74356 * defunc_1_f_res_74359;\n    float defunc_1_f_res_74361 = x_74356 * defunc_1_f_res_74360;\n    \n    ((__local float *) red_arr_mem_80149)[gtid_74339] = x_74357;\n    ((__local float *) red_arr_mem_80151)[gtid_74339] = defunc_1_f_res_74358;\n    ((__local float *) red_arr_mem_80153)[gtid_74339] = defunc_1_f_res_74359;\n    ((__local float *) red_arr_mem_80155)[gtid_74339] = defunc_1_f_res_74360;\n    ((__local float *) red_arr_mem_80157)[gtid_74339] = de",
            "func_1_f_res_74361;\n    ((__local float *) color_78198)[gtid_74339] = defunc_1_f_res_74359;\n    ((__local float *) color_78197)[gtid_74339] = defunc_1_f_res_74358;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_80159;\n    int32_t skip_waves_80160 = 1;\n    float x_74341;\n    float x_74342;\n    float x_74343;\n    float x_74344;\n    float x_74345;\n    float x_74346;\n    float x_74347;\n    float x_74348;\n    float x_74349;\n    float x_74350;\n    \n    offset_80159 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_80131, sext_i64_i32(q_65346))) {\n            x_74341 = ((__local\n                        float *) red_arr_mem_80149)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80159)];\n            x_74342 = ((__local\n                        float *) red_arr_mem_80151)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80159)];\n            x_74343 = ((__local\n                        float *) red_arr_mem_80153)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80159)];\n            x_74344 = ((__local\n                        float *) red_arr_mem_80155)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80159)];\n            x_74345 = ((__local\n                        float *) red_arr_mem_80157)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80159)];\n        }\n    }\n    offset_80159 = 1;\n    while (slt32(offset_80159, wave_sizze_80133)) {\n        if (slt32(local_tid_80131 + offset_80159, sext_i64_i32(q_65346)) &&\n            ((local_tid_80131 - squot32(local_tid_80131, wave_sizze_80133) *\n              wave_sizze_80133) & (2 * offset_80159 - 1)) == 0) {\n            // read array element\n            {\n                x_74346 = ((volatile __local\n                            float *) red_arr_mem_80149)[sext_i32_i64(local_tid_801",
            "31 +\n                                                        offset_80159)];\n                x_74347 = ((volatile __local\n                            float *) red_arr_mem_80151)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n                x_74348 = ((volatile __local\n                            float *) red_arr_mem_80153)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n                x_74349 = ((volatile __local\n                            float *) red_arr_mem_80155)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n                x_74350 = ((volatile __local\n                            float *) red_arr_mem_80157)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74351 = x_74341 + x_74346;\n                float defunc_1_op_res_74352 = x_74342 + x_74347;\n                float defunc_1_op_res_74353 = x_74343 + x_74348;\n                float defunc_1_op_res_74354 = x_74344 + x_74349;\n                float defunc_1_op_res_74355 = x_74345 + x_74350;\n                \n                x_74341 = defunc_1_op_res_74351;\n                x_74342 = defunc_1_op_res_74352;\n                x_74343 = defunc_1_op_res_74353;\n                x_74344 = defunc_1_op_res_74354;\n                x_74345 = defunc_1_op_res_74355;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_80149)[sext_i32_i64(local_tid_80131)] =\n                    x_74341;\n                ((volatile __local\n                  float *) red_arr_mem_80151)[sext_i32_i64(local_tid_80131)] =\n                    x_74342;\n                ((volatile __local\n                  float *) red_arr_mem_80153)[sext_i32_i64(lo",
            "cal_tid_80131)] =\n                    x_74343;\n                ((volatile __local\n                  float *) red_arr_mem_80155)[sext_i32_i64(local_tid_80131)] =\n                    x_74344;\n                ((volatile __local\n                  float *) red_arr_mem_80157)[sext_i32_i64(local_tid_80131)] =\n                    x_74345;\n            }\n        }\n        offset_80159 *= 2;\n    }\n    while (slt32(skip_waves_80160, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_80133 - 1,\n                                           wave_sizze_80133))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_80159 = skip_waves_80160 * wave_sizze_80133;\n        if (slt32(local_tid_80131 + offset_80159, sext_i64_i32(q_65346)) &&\n            ((local_tid_80131 - squot32(local_tid_80131, wave_sizze_80133) *\n              wave_sizze_80133) == 0 && (squot32(local_tid_80131,\n                                                 wave_sizze_80133) & (2 *\n                                                                      skip_waves_80160 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_74346 = ((__local\n                            float *) red_arr_mem_80149)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n                x_74347 = ((__local\n                            float *) red_arr_mem_80151)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n                x_74348 = ((__local\n                            float *) red_arr_mem_80153)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n                x_74349 = ((__local\n                            float *) red_arr_mem_80155)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n         ",
            "       x_74350 = ((__local\n                            float *) red_arr_mem_80157)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80159)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74351 = x_74341 + x_74346;\n                float defunc_1_op_res_74352 = x_74342 + x_74347;\n                float defunc_1_op_res_74353 = x_74343 + x_74348;\n                float defunc_1_op_res_74354 = x_74344 + x_74349;\n                float defunc_1_op_res_74355 = x_74345 + x_74350;\n                \n                x_74341 = defunc_1_op_res_74351;\n                x_74342 = defunc_1_op_res_74352;\n                x_74343 = defunc_1_op_res_74353;\n                x_74344 = defunc_1_op_res_74354;\n                x_74345 = defunc_1_op_res_74355;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_80149)[sext_i32_i64(local_tid_80131)] =\n                    x_74341;\n                ((__local\n                  float *) red_arr_mem_80151)[sext_i32_i64(local_tid_80131)] =\n                    x_74342;\n                ((__local\n                  float *) red_arr_mem_80153)[sext_i32_i64(local_tid_80131)] =\n                    x_74343;\n                ((__local\n                  float *) red_arr_mem_80155)[sext_i32_i64(local_tid_80131)] =\n                    x_74344;\n                ((__local\n                  float *) red_arr_mem_80157)[sext_i32_i64(local_tid_80131)] =\n                    x_74345;\n            }\n        }\n        skip_waves_80160 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_74332 = ((__local\n                                  float *) red_arr_mem_80149)[(int64_t) 0];\n    defunc_2_reduce_res_74333 = ((__local\n                                  float *) red_arr_mem_80151)[(int64_t) 0];\n    defunc_2_reduce_res_74334 = ((__local\n                                  float *) red",
            "_arr_mem_80153)[(int64_t) 0];\n    defunc_2_reduce_res_74335 = ((__local\n                                  float *) red_arr_mem_80155)[(int64_t) 0];\n    defunc_2_reduce_res_74336 = ((__local\n                                  float *) red_arr_mem_80157)[(int64_t) 0];\n    \n    float x_74362 = defunc_2_reduce_res_74334 * defunc_2_reduce_res_74336;\n    float y_74363 = defunc_2_reduce_res_74335 * defunc_2_reduce_res_74335;\n    float a12_74364 = x_74362 - y_74363;\n    float x_74365 = defunc_2_reduce_res_74334 * defunc_2_reduce_res_74335;\n    float y_74366 = defunc_2_reduce_res_74333 * defunc_2_reduce_res_74336;\n    float b12_74367 = x_74365 - y_74366;\n    float x_74368 = defunc_2_reduce_res_74333 * defunc_2_reduce_res_74335;\n    float y_74369 = defunc_2_reduce_res_74334 * defunc_2_reduce_res_74334;\n    float c12_74370 = x_74368 - y_74369;\n    float x_74371 = defunc_2_reduce_res_74332 * defunc_2_reduce_res_74336;\n    float b2_74372 = x_74371 - y_74369;\n    float x_74373 = defunc_2_reduce_res_74333 * defunc_2_reduce_res_74334;\n    float y_74374 = defunc_2_reduce_res_74332 * defunc_2_reduce_res_74335;\n    float c2_74375 = x_74373 - y_74374;\n    float x_74376 = defunc_2_reduce_res_74332 * a12_74364;\n    float y_74377 = defunc_2_reduce_res_74333 * b12_74367;\n    float x_74378 = x_74376 + y_74377;\n    float y_74379 = defunc_2_reduce_res_74334 * c12_74370;\n    float y_74380 = x_74378 + y_74379;\n    float det_74381 = 1.0F / y_74380;\n    float a12_74382 = a12_74364 * det_74381;\n    float b12_74383 = b12_74367 * det_74381;\n    float c12_74384 = c12_74370 * det_74381;\n    float b2_74385 = b2_74372 * det_74381;\n    float c2_74386 = c2_74375 * det_74381;\n    float defunc_2_reduce_res_74387;\n    float defunc_2_reduce_res_74388;\n    int64_t gtid_74389 = sext_i32_i64(sext_i64_i32(ltid_pre_80135));\n    int32_t phys_tid_74390 = local_tid_80131;\n    __local unsigned char *red_arr_mem_80161;\n    \n    red_arr_mem_80161 = (__local unsigned char *) red_arr_mem_80161_backing_9;\n    \n    __local u",
            "nsigned char *red_arr_mem_80163;\n    \n    red_arr_mem_80163 = (__local unsigned char *) red_arr_mem_80163_backing_10;\n    \n    float x_74398;\n    \n    x_74398 = ((__local float *) color_78199)[gtid_74389];\n    \n    float x_74399;\n    \n    x_74399 = ((__local float *) color_78197)[gtid_74389];\n    \n    float x_74400;\n    \n    x_74400 = ((__local float *) color_78198)[gtid_74389];\n    \n    bool cond_74401 = sle64(last_res_74211, gtid_74389);\n    float defunc_0_f_res_74402;\n    \n    if (cond_74401) {\n        defunc_0_f_res_74402 = 0.0F;\n    } else {\n        int64_t i_74403 = add64(max_res_74291, gtid_74389);\n        float defunc_0_add_arg_74404;\n        \n        defunc_0_add_arg_74404 = ((__global float *) mem_77938)[gtid_74208 *\n                                                                n_65344 +\n                                                                i_74403];\n        defunc_0_f_res_74402 = defunc_0_add_arg_74404;\n    }\n    \n    float x_74405 = a12_74382 * x_74398;\n    float y_74406 = b12_74383 * x_74399;\n    float x_74407 = x_74405 + y_74406;\n    float y_74408 = c12_74384 * x_74400;\n    float x_74409 = x_74407 + y_74408;\n    float defunc_9_fit_fun_res_74410 = defunc_0_f_res_74402 * x_74409;\n    float x_74411 = b12_74383 * x_74398;\n    float y_74412 = b2_74385 * x_74399;\n    float x_74413 = x_74411 + y_74412;\n    float y_74414 = c2_74386 * x_74400;\n    float x_74415 = x_74413 + y_74414;\n    float defunc_9_slope_fun_res_74416 = defunc_0_f_res_74402 * x_74415;\n    \n    ((__local float *) red_arr_mem_80161)[gtid_74389] =\n        defunc_9_fit_fun_res_74410;\n    ((__local float *) red_arr_mem_80163)[gtid_74389] =\n        defunc_9_slope_fun_res_74416;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_80165;\n    int32_t skip_waves_80166 = 1;\n    float x_74391;\n    float x_74392;\n    float x_74393;\n    float x_74394;\n    \n    offset_80165 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_80131, sext_i64_i32(q_65",
            "346))) {\n            x_74391 = ((__local\n                        float *) red_arr_mem_80161)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80165)];\n            x_74392 = ((__local\n                        float *) red_arr_mem_80163)[sext_i32_i64(local_tid_80131 +\n                                                    offset_80165)];\n        }\n    }\n    offset_80165 = 1;\n    while (slt32(offset_80165, wave_sizze_80133)) {\n        if (slt32(local_tid_80131 + offset_80165, sext_i64_i32(q_65346)) &&\n            ((local_tid_80131 - squot32(local_tid_80131, wave_sizze_80133) *\n              wave_sizze_80133) & (2 * offset_80165 - 1)) == 0) {\n            // read array element\n            {\n                x_74393 = ((volatile __local\n                            float *) red_arr_mem_80161)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80165)];\n                x_74394 = ((volatile __local\n                            float *) red_arr_mem_80163)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80165)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74395 = x_74391 + x_74393;\n                float defunc_1_op_res_74396 = x_74392 + x_74394;\n                \n                x_74391 = defunc_1_op_res_74395;\n                x_74392 = defunc_1_op_res_74396;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_80161)[sext_i32_i64(local_tid_80131)] =\n                    x_74391;\n                ((volatile __local\n                  float *) red_arr_mem_80163)[sext_i32_i64(local_tid_80131)] =\n                    x_74392;\n            }\n        }\n        offset_80165 *= 2;\n    }\n    while (slt32(skip_waves_80166, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_80133 - 1,\n  ",
            "                                         wave_sizze_80133))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_80165 = skip_waves_80166 * wave_sizze_80133;\n        if (slt32(local_tid_80131 + offset_80165, sext_i64_i32(q_65346)) &&\n            ((local_tid_80131 - squot32(local_tid_80131, wave_sizze_80133) *\n              wave_sizze_80133) == 0 && (squot32(local_tid_80131,\n                                                 wave_sizze_80133) & (2 *\n                                                                      skip_waves_80166 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_74393 = ((__local\n                            float *) red_arr_mem_80161)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80165)];\n                x_74394 = ((__local\n                            float *) red_arr_mem_80163)[sext_i32_i64(local_tid_80131 +\n                                                        offset_80165)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74395 = x_74391 + x_74393;\n                float defunc_1_op_res_74396 = x_74392 + x_74394;\n                \n                x_74391 = defunc_1_op_res_74395;\n                x_74392 = defunc_1_op_res_74396;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_80161)[sext_i32_i64(local_tid_80131)] =\n                    x_74391;\n                ((__local\n                  float *) red_arr_mem_80163)[sext_i32_i64(local_tid_80131)] =\n                    x_74392;\n            }\n        }\n        skip_waves_80166 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_74387 = ((__local\n                                  float *) red_arr_mem_80161)[(int64_t) 0];\n    defunc_2_reduce_res_74388 = ((__local\n                 ",
            "                 float *) red_arr_mem_80163)[(int64_t) 0];\n    if (local_tid_80131 == 0) {\n        ((__global float *) mem_77986)[gtid_74208 * n_m_65352 + gtid_74209] =\n            defunc_2_reduce_res_74387;\n    }\n    if (local_tid_80131 == 0) {\n        ((__global float *) mem_77990)[gtid_74208 * n_m_65352 + gtid_74209] =\n            defunc_2_reduce_res_74388;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_74758(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            uint color_78137_backing_offset_0,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            int64_t num_groups_x_74755,\n                                            int64_t num_groups_y_74756,\n                                            int64_t num_whole_tiles_74888,\n                                            int64_t residual_input_75084,\n                                            unsigned char cond_75085_bits,\n                                            __global unsigned char *mem_77082,\n                                            __global unsigned char *mem_77086,\n                                            __global unsigned char *mem_77090,\n                                            __global unsigned char *mem_77096,\n                                            __global unsigned char *mem_77100,\n                                            __global unsigned char *mem_77",
            "103,\n                                            __global unsigned char *mem_77106,\n                                            __global unsigned char *mem_77109,\n                                            __global unsigned char *mem_77114,\n                                            __global unsigned char *mem_77161)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    bool cond_75085 = cond_75085_bits;\n    \n    #define tile_sizze_74753 (mainzitile_sizze_74752)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_78137_backing_0 =\n                           &shared_mem[color_78137_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_78485;\n    int32_t local_tid_78486;\n    int64_t group_sizze_78489;\n    int32_t wave_sizze_78488;\n    int32_t group_tid_78487;\n    \n    global_tid_78485 = get_global_id(0);\n    local_tid_78486 = get_local_id(0);\n    group_sizze_78489 = get_local_size(0);\n    wave_sizze_78488 = LOCKSTEP_WIDTH;\n    group_tid_78487 = get_group_id(0);\n    \n    int32_t gid_flat_74758 = group_tid_78487;\n    int64_t slice_78492 = tile_sizze_74753;\n    int64_t slice_78493 = tile_sizze_74753 * slice_78492;\n    int64_t ltid_pre_78490 = squot64(sext_i32_i64(local_tid_78486),\n                                     slice_78492);\n    int64_t remnant_78494 = sext_i32_i64(local_tid_78486) - ltid_pre_78490 *\n            slice_78492;\n    int64_t ltid_pre_78491 = remnant_78494;\n    int64_t remnant_78495 = remnant_78494 - ltid_pre_78491;\n    int64_t slice_78496 = num_groups_y_74756;\n    int64_t slice_78497 = num_groups_x_74755 * slice_78496;\n    int64_t gid_x_74750 = squot64(sext_i32_i64(group_tid_78487), slice_78496);\n    int64_t remnant_",
            "78498 = sext_i32_i64(group_tid_78487) - gid_x_74750 *\n            slice_78496;\n    int64_t gid_y_74751 = remnant_78498;\n    int64_t remnant_78499 = remnant_78498 - gid_y_74751;\n    float color_78135[1];\n    float color_78136[1];\n    __local unsigned char *color_78137;\n    \n    color_78137 = (__local unsigned char *) color_78137_backing_0;\n    \n    float color_78138[1];\n    int64_t color_78139[1];\n    int64_t color_78140[1];\n    int64_t color_78141[1];\n    int64_t binop_x_74778 = gid_x_74750 * tile_sizze_74753;\n    int64_t binop_x_74780 = gid_y_74751 * tile_sizze_74753;\n    int64_t ltid_y_74777 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n    int64_t ltid_x_74775 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n    int32_t ltid_flat_74776 = local_tid_78486;\n    \n    if (slt64(ltid_y_74777, tile_sizze_74753) && slt64(ltid_x_74775,\n                                                       tile_sizze_74753)) {\n        int64_t gtid_74779 = ltid_y_74777 + binop_x_74778;\n        int64_t gtid_74781 = ltid_x_74775 + binop_x_74780;\n        bool binop_x_74782 = slt64(gtid_74779, m_65343);\n        bool binop_y_74783 = slt64(gtid_74781, n_m_65352);\n        bool cond_74784 = binop_x_74782 && binop_y_74783;\n        int64_t pre_74785;\n        int64_t pre_74786;\n        int64_t pre_74787;\n        float pre_74788;\n        \n        if (cond_74784) {\n            int64_t last_res_74789;\n            \n            last_res_74789 = ((__global int64_t *) mem_77082)[gtid_74779 *\n                                                              n_65344 +\n                                                              i_65358];\n            \n            int64_t min_arg_74790;\n            \n            min_arg_74790 = ((__global int64_t *) mem_77100)[gtid_74779];\n            \n            int64_t min_arg_74791;\n            \n            min_arg_74791 = ((__global int64_t *) mem_77103)[gtid_74779];\n            \n            int64_t min_res_74792;\n            \n            min_res_74792 = ((__global int64_t *) mem",
            "_77106)[gtid_74779];\n            \n            float max_res_74793;\n            \n            max_res_74793 = ((__global float *) mem_77109)[gtid_74779];\n            \n            int64_t min_arg_74794 = mul64(jump_65348, gtid_74781);\n            int64_t min_res_74795 = smin64(i_65358, min_arg_74794);\n            int64_t defunc_0_g_res_74796 = add64((int64_t) 1, min_res_74795);\n            bool init_idx_74797;\n            int64_t init_idx_74798;\n            int64_t init_idx_74799;\n            bool loop_while_74800;\n            int64_t low_74801;\n            int64_t high_74802;\n            \n            loop_while_74800 = x_65359;\n            low_74801 = (int64_t) 0;\n            high_74802 = i_65358;\n            while (loop_while_74800) {\n                int64_t x_74803 = add64(low_74801, high_74802);\n                int64_t mid_74804 = sdiv64(x_74803, (int64_t) 2);\n                bool x_74805 = sle64((int64_t) 0, mid_74804);\n                bool y_74806 = slt64(mid_74804, n_65344);\n                bool bounds_check_74807 = x_74805 && y_74806;\n                bool index_certs_74808;\n                \n                if (!bounds_check_74807) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 5) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) mid_74804;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t mid_id_74809;\n                \n                mid_id_74809 = ((__global int64_t *) mem_77096)[gtid_74779 *\n                                                                n_65344 +\n                                                                mid_74804];\n                \n                bool cond_74810 = slt64(mid_id_74809, (int64_t) 0)",
            ";\n                int64_t mid_idx_74811;\n                \n                if (cond_74810) {\n                    mid_idx_74811 = (int64_t) 9223372036854775807;\n                } else {\n                    mid_idx_74811 = mid_id_74809;\n                }\n                \n                bool cond_74812 = sle64(defunc_0_g_res_74796, mid_idx_74811);\n                int64_t loopres_74813;\n                int64_t loopres_74814;\n                \n                if (cond_74812) {\n                    int64_t loopres_t_res_74815 = sub64(mid_74804, (int64_t) 1);\n                    \n                    loopres_74813 = low_74801;\n                    loopres_74814 = loopres_t_res_74815;\n                } else {\n                    int64_t loopres_f_res_74816 = add64((int64_t) 1, mid_74804);\n                    \n                    loopres_74813 = loopres_f_res_74816;\n                    loopres_74814 = high_74802;\n                }\n                \n                bool loop_cond_74817 = sle64(loopres_74813, loopres_74814);\n                bool loop_while_tmp_78500 = loop_cond_74817;\n                int64_t low_tmp_78501 = loopres_74813;\n                int64_t high_tmp_78502 = loopres_74814;\n                \n                loop_while_74800 = loop_while_tmp_78500;\n                low_74801 = low_tmp_78501;\n                high_74802 = high_tmp_78502;\n            }\n            init_idx_74797 = loop_while_74800;\n            init_idx_74798 = low_74801;\n            init_idx_74799 = high_74802;\n            \n            bool idx_74818;\n            int64_t idx_74819;\n            int64_t idx_74820;\n            int64_t idx_74821;\n            bool loop_while_74822;\n            int64_t l_idx_74823;\n            int64_t r_idx_74824;\n            int64_t span_74825;\n            \n            loop_while_74822 = loop_cond_65369;\n            l_idx_74823 = init_idx_74798;\n            r_idx_74824 = init_idx_74798;\n            span_74825 = (int64_t) 1;\n            while (loop_while_74822) {\n          ",
            "      int64_t max_arg_74826 = sub64(l_idx_74823, (int64_t) 1);\n                int64_t max_res_74827 = smax64((int64_t) 0, max_arg_74826);\n                int64_t min_arg_74828 = add64((int64_t) 1, r_idx_74824);\n                int64_t min_res_74829 = smin64(min_arg_74790, min_arg_74828);\n                bool x_74830 = sle64((int64_t) 0, max_res_74827);\n                bool y_74831 = slt64(max_res_74827, n_65344);\n                bool bounds_check_74832 = x_74830 && y_74831;\n                bool index_certs_74833;\n                \n                if (!bounds_check_74832) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 6) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_74827;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_74834;\n                \n                x_74834 = ((__global int64_t *) mem_77096)[gtid_74779 *\n                                                           n_65344 +\n                                                           max_res_74827];\n                \n                int64_t abs_arg_74835 = sub64(x_74834, defunc_0_g_res_74796);\n                int64_t abs_res_74836 = abs64(abs_arg_74835);\n                bool x_74837 = sle64((int64_t) 0, min_res_74829);\n                bool y_74838 = slt64(min_res_74829, n_65344);\n                bool bounds_check_74839 = x_74837 && y_74838;\n                bool index_certs_74840;\n                \n                if (!bounds_check_74839) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 7) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) min_res_74829;\n          ",
            "                  global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_74841;\n                \n                x_74841 = ((__global int64_t *) mem_77096)[gtid_74779 *\n                                                           n_65344 +\n                                                           min_res_74829];\n                \n                int64_t abs_arg_74842 = sub64(x_74841, defunc_0_g_res_74796);\n                int64_t abs_res_74843 = abs64(abs_arg_74842);\n                bool cond_74844 = max_res_74827 == l_idx_74823;\n                int64_t loopres_74845;\n                int64_t loopres_74846;\n                int64_t loopres_74847;\n                \n                if (cond_74844) {\n                    loopres_74845 = l_idx_74823;\n                    loopres_74846 = r_idx_74824;\n                    loopres_74847 = min_res_65364;\n                } else {\n                    bool cond_74848 = slt64(abs_res_74836, abs_res_74843);\n                    bool cond_f_res_74849 = min_res_74829 == r_idx_74824;\n                    bool x_74850 = !cond_74848;\n                    bool y_74851 = cond_f_res_74849 && x_74850;\n                    bool cond_74852 = cond_74848 || y_74851;\n                    int64_t loopres_f_res_74853;\n                    \n                    if (cond_74852) {\n                        loopres_f_res_74853 = max_res_74827;\n                    } else {\n                        loopres_f_res_74853 = l_idx_74823;\n                    }\n                    \n                    int64_t loopres_f_res_74854;\n                    \n                    if (cond_74852) {\n                        loopres_f_res_74854 = r_idx_74824;\n                    } else {\n                        loopres_f_res_74854 = min_res_74829;\n                    }\n           ",
            "         \n                    int64_t loopres_f_res_74855;\n                    \n                    if (cond_74852) {\n                        int64_t loopres_f_res_t_res_74856 = add64((int64_t) 1,\n                                                                  span_74825);\n                        \n                        loopres_f_res_74855 = loopres_f_res_t_res_74856;\n                    } else {\n                        int64_t loopres_f_res_f_res_74857 = add64((int64_t) 1,\n                                                                  span_74825);\n                        \n                        loopres_f_res_74855 = loopres_f_res_f_res_74857;\n                    }\n                    loopres_74845 = loopres_f_res_74853;\n                    loopres_74846 = loopres_f_res_74854;\n                    loopres_74847 = loopres_f_res_74855;\n                }\n                \n                bool loop_cond_74858 = slt64(loopres_74847, min_res_65364);\n                bool loop_while_tmp_78503 = loop_cond_74858;\n                int64_t l_idx_tmp_78504 = loopres_74845;\n                int64_t r_idx_tmp_78505 = loopres_74846;\n                int64_t span_tmp_78506 = loopres_74847;\n                \n                loop_while_74822 = loop_while_tmp_78503;\n                l_idx_74823 = l_idx_tmp_78504;\n                r_idx_74824 = r_idx_tmp_78505;\n                span_74825 = span_tmp_78506;\n            }\n            idx_74818 = loop_while_74822;\n            idx_74819 = l_idx_74823;\n            idx_74820 = r_idx_74824;\n            idx_74821 = span_74825;\n            \n            int64_t min_res_74859 = smin64(min_arg_74791, idx_74819);\n            int64_t max_res_74860 = smax64((int64_t) 0, min_res_74859);\n            int64_t x_74861 = add64(min_res_74792, max_res_74860);\n            int64_t r_74862 = sub64(x_74861, (int64_t) 1);\n            bool x_74863 = sle64((int64_t) 0, r_74862);\n            bool y_74864 = slt64(r_74862, n_65344);\n            bool bounds_check_74865 = ",
            "x_74863 && y_74864;\n            bool index_certs_74866;\n            \n            if (!bounds_check_74865) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 8) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) r_74862;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_74867;\n            \n            x_74867 = ((__global int64_t *) mem_77090)[gtid_74779 * n_65344 +\n                                                       r_74862];\n            \n            int64_t abs_arg_74868 = sub64(x_74867, min_res_74795);\n            int64_t abs_res_74869 = abs64(abs_arg_74868);\n            bool x_74870 = sle64((int64_t) 0, max_res_74860);\n            bool y_74871 = slt64(max_res_74860, n_65344);\n            bool bounds_check_74872 = x_74870 && y_74871;\n            bool index_certs_74873;\n            \n            if (!bounds_check_74872) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_74860;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_74874;\n            \n            x_74874 = ((__global int64_t *) mem_77090)[gtid_74779 * n_65344 +\n                                                       max_res_74860];\n            \n            int64_t abs_arg_74875 = sub64(x_74874, min_res_74795);\n            int64_t abs_res_74876 = abs64(abs_arg_74875);\n            int64_t max_res_74877 = smax64(abs_res_74869, abs_res_74876);\n            float defunc_0_f_res_748",
            "78 = sitofp_i64_f32(max_res_74877);\n            float defunc_1_f_res_74879 = max_res_74793 + defunc_0_f_res_74878;\n            \n            pre_74785 = last_res_74789;\n            pre_74786 = min_res_74795;\n            pre_74787 = max_res_74860;\n            pre_74788 = defunc_1_f_res_74879;\n        } else {\n            pre_74785 = (int64_t) 0;\n            pre_74786 = (int64_t) 0;\n            pre_74787 = (int64_t) 0;\n            pre_74788 = 0.0F;\n        }\n        color_78141[(int64_t) 0] = pre_74785;\n        color_78140[(int64_t) 0] = pre_74786;\n        color_78139[(int64_t) 0] = pre_74787;\n        color_78138[(int64_t) 0] = pre_74788;\n    }\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ltid_y_74896 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n    int64_t ltid_x_74894 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n    int32_t ltid_flat_74895 = local_tid_78486;\n    \n    if (slt64(ltid_y_74896, tile_sizze_74753) && slt64(ltid_x_74894,\n                                                       tile_sizze_74753)) {\n        color_78136[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float tmp_78507;\n    \n    tmp_78507 = color_78136[(int64_t) 0];\n    color_78135[(int64_t) 0] = tmp_78507;\n    \n    float ext_mem_77143[1];\n    float ext_mem_unused_78078[1];\n    float mem_param_77133[1];\n    float mem_param_out_78079[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_77133[i_1] = color_78135[i_1];\n    for (int32_t i_2 = 0; i_2 < 1; i_2++)\n        mem_param_out_78079[i_2] = color_78136[i_2];\n    for (int64_t tile_id_74903 = 0; tile_id_74903 < num_whole_tiles_74888;\n         tile_id_74903++) {\n        int64_t binop_x_75004 = tile_sizze_74753 * tile_id_74903;\n        int64_t ltid_y_75001 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n        int64_t ltid_x_74999 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n        int32_t ltid_flat_75000 = local_tid_7",
            "8486;\n        int64_t j_75005 = ltid_x_74999 + binop_x_75004;\n        int64_t gtid_75007 = binop_x_74778 + ltid_y_75001;\n        bool binop_x_75015 = slt64(j_75005, q_65346);\n        bool binop_y_75016 = slt64(gtid_75007, m_65343);\n        bool cond_75017 = binop_x_75015 && binop_y_75016;\n        float pre2d_75018;\n        \n        if (cond_75017) {\n            float x_75019;\n            \n            x_75019 = ((__global float *) mem_77114)[gtid_75007 * q_65346 +\n                                                     j_75005];\n            pre2d_75018 = x_75019;\n        } else {\n            pre2d_75018 = 0.0F;\n        }\n        ((__local float *) color_78137)[ltid_y_75001 * tile_sizze_74753 +\n                                        ltid_x_74999] = pre2d_75018;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75024 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n        int64_t ltid_x_75022 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n        int32_t ltid_flat_75023 = local_tid_78486;\n        int64_t gtid_75026 = binop_x_74778 + ltid_y_75024;\n        int64_t gtid_75028 = binop_x_74780 + ltid_x_75022;\n        float acc_75034;\n        \n        acc_75034 = mem_param_77133[(int64_t) 0];\n        \n        bool binop_x_75038 = slt64(gtid_75026, m_65343);\n        bool binop_y_75039 = slt64(gtid_75028, n_m_65352);\n        bool cond_75040 = binop_x_75038 && binop_y_75039;\n        float acc_75041;\n        \n        if (cond_75040) {\n            int64_t last_res_75029;\n            \n            last_res_75029 = color_78141[(int64_t) 0];\n            \n            int64_t min_res_75030;\n            \n            min_res_75030 = color_78140[(int64_t) 0];\n            \n            int64_t max_res_75031;\n            \n            max_res_75031 = color_78139[(int64_t) 0];\n            \n            float defunc_1_f_res_75032;\n            \n            defunc_1_f_res_75032 = color_78138[(int64_t) 0];\n            \n            float x_75042;\n            float redout_76816 = acc_7",
            "5034;\n            \n            for (int64_t i_76817 = 0; i_76817 < tile_sizze_74753; i_76817++) {\n                int64_t index_primexp_76939 = add64(binop_x_75004, i_76817);\n                float x_75047;\n                \n                x_75047 = ((__local float *) color_78137)[ltid_y_75024 *\n                                                          tile_sizze_74753 +\n                                                          i_76817];\n                \n                bool cond_75048 = sle64(last_res_75029, index_primexp_76939);\n                int64_t defunc_0_f_res_75049;\n                \n                if (cond_75048) {\n                    defunc_0_f_res_75049 = (int64_t) 0;\n                } else {\n                    int64_t i_75050 = add64(max_res_75031, index_primexp_76939);\n                    int64_t defunc_0_add_arg_75051;\n                    \n                    defunc_0_add_arg_75051 = ((__global\n                                               int64_t *) mem_77090)[gtid_75026 *\n                                                                     n_65344 +\n                                                                     i_75050];\n                    \n                    int64_t defunc_1_add_res_75052 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75051);\n                    \n                    defunc_0_f_res_75049 = defunc_1_add_res_75052;\n                }\n                \n                int64_t binop_p_75053 = sub64(defunc_0_f_res_75049,\n                                              min_res_75030);\n                float defunc_0_f_res_75054 = sitofp_i64_f32(binop_p_75053);\n                float abs_res_75055 = (float) fabs(defunc_0_f_res_75054);\n                float tmp1_75056 = abs_res_75055 / defunc_1_f_res_75032;\n                float x_75057 = tmp1_75056 * tmp1_75056;\n                float y_75058 = tmp1_75056 * x_75057;\n                float tmp2_75059 = 1.0F - y_75058;\n                float",
            " x_75060 = tmp2_75059 * tmp2_75059;\n                float tmp3_75061 = tmp2_75059 * x_75060;\n                float w_j_75062 = x_75047 * tmp3_75061;\n                float defunc_1_op_res_75045 = w_j_75062 + redout_76816;\n                float redout_tmp_78511 = defunc_1_op_res_75045;\n                \n                redout_76816 = redout_tmp_78511;\n            }\n            x_75042 = redout_76816;\n            acc_75041 = x_75042;\n        } else {\n            acc_75041 = acc_75034;\n        }\n        mem_param_out_78079[(int64_t) 0] = acc_75041;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_78508[1];\n        \n        for (int32_t i_3 = 0; i_3 < 1; i_3++)\n            mem_param_tmp_78508[i_3] = mem_param_out_78079[i_3];\n        \n        float mem_param_out_tmp_78509[1];\n        \n        for (int32_t i_4 = 0; i_4 < 1; i_4++)\n            mem_param_out_tmp_78509[i_4] = mem_param_77133[i_4];\n        for (int32_t i_5 = 0; i_5 < 1; i_5++)\n            mem_param_77133[i_5] = mem_param_tmp_78508[i_5];\n        for (int32_t i_6 = 0; i_6 < 1; i_6++)\n            mem_param_out_78079[i_6] = mem_param_out_tmp_78509[i_6];\n    }\n    for (int32_t i_7 = 0; i_7 < 1; i_7++)\n        ext_mem_77143[i_7] = mem_param_77133[i_7];\n    for (int32_t i_8 = 0; i_8 < 1; i_8++)\n        ext_mem_unused_78078[i_8] = mem_param_out_78079[i_8];\n    if (cond_75085) {\n        float tmp_78512;\n        \n        tmp_78512 = ext_mem_77143[(int64_t) 0];\n        color_78135[(int64_t) 0] = tmp_78512;\n    } else {\n        int64_t binop_x_75187 = tile_sizze_74753 * num_whole_tiles_74888;\n        int64_t ltid_y_75184 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n        int64_t ltid_x_75182 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n        int32_t ltid_flat_75183 = local_tid_78486;\n        int64_t j_75188 = ltid_x_75182 + binop_x_75187;\n        int64_t gtid_75190 = binop_x_74778 + ltid_y_75184;\n        bool binop_x_75198 = slt64(j_75188, q_65346);\n        bool binop_y_75199 = slt64(gtid_75",
            "190, m_65343);\n        bool cond_75200 = binop_x_75198 && binop_y_75199;\n        float pre2d_75201;\n        \n        if (cond_75200) {\n            float x_75202;\n            \n            x_75202 = ((__global float *) mem_77114)[gtid_75190 * q_65346 +\n                                                     j_75188];\n            pre2d_75201 = x_75202;\n        } else {\n            pre2d_75201 = 0.0F;\n        }\n        ((__local float *) color_78137)[ltid_y_75184 * tile_sizze_74753 +\n                                        ltid_x_75182] = pre2d_75201;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75208 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n        int64_t ltid_x_75206 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n        int32_t ltid_flat_75207 = local_tid_78486;\n        int64_t gtid_75210 = binop_x_74778 + ltid_y_75208;\n        int64_t gtid_75212 = binop_x_74780 + ltid_x_75206;\n        float acc_75218;\n        \n        acc_75218 = ext_mem_77143[(int64_t) 0];\n        \n        bool binop_x_75222 = slt64(gtid_75210, m_65343);\n        bool binop_y_75223 = slt64(gtid_75212, n_m_65352);\n        bool cond_75224 = binop_x_75222 && binop_y_75223;\n        float acc_75225;\n        \n        if (cond_75224) {\n            int64_t last_res_75213;\n            \n            last_res_75213 = color_78141[(int64_t) 0];\n            \n            int64_t min_res_75214;\n            \n            min_res_75214 = color_78140[(int64_t) 0];\n            \n            int64_t max_res_75215;\n            \n            max_res_75215 = color_78139[(int64_t) 0];\n            \n            float defunc_1_f_res_75216;\n            \n            defunc_1_f_res_75216 = color_78138[(int64_t) 0];\n            \n            float x_75226;\n            float redout_76818 = acc_75218;\n            \n            for (int64_t i_76819 = 0; i_76819 < residual_input_75084;\n                 i_76819++) {\n                int64_t index_primexp_76937 = add64(binop_x_75187, i_76819);\n                float x",
            "_75231;\n                \n                x_75231 = ((__local float *) color_78137)[ltid_y_75208 *\n                                                          tile_sizze_74753 +\n                                                          i_76819];\n                \n                bool cond_75232 = sle64(last_res_75213, index_primexp_76937);\n                int64_t defunc_0_f_res_75233;\n                \n                if (cond_75232) {\n                    defunc_0_f_res_75233 = (int64_t) 0;\n                } else {\n                    int64_t i_75234 = add64(max_res_75215, index_primexp_76937);\n                    int64_t defunc_0_add_arg_75235;\n                    \n                    defunc_0_add_arg_75235 = ((__global\n                                               int64_t *) mem_77090)[gtid_75210 *\n                                                                     n_65344 +\n                                                                     i_75234];\n                    \n                    int64_t defunc_1_add_res_75236 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75235);\n                    \n                    defunc_0_f_res_75233 = defunc_1_add_res_75236;\n                }\n                \n                int64_t binop_p_75237 = sub64(defunc_0_f_res_75233,\n                                              min_res_75214);\n                float defunc_0_f_res_75238 = sitofp_i64_f32(binop_p_75237);\n                float abs_res_75239 = (float) fabs(defunc_0_f_res_75238);\n                float tmp1_75240 = abs_res_75239 / defunc_1_f_res_75216;\n                float x_75241 = tmp1_75240 * tmp1_75240;\n                float y_75242 = tmp1_75240 * x_75241;\n                float tmp2_75243 = 1.0F - y_75242;\n                float x_75244 = tmp2_75243 * tmp2_75243;\n                float tmp3_75245 = tmp2_75243 * x_75244;\n                float w_j_75246 = x_75231 * tmp3_75245;\n                float defunc_1_op_res_75229 = w_j",
            "_75246 + redout_76818;\n                float redout_tmp_78513 = defunc_1_op_res_75229;\n                \n                redout_76818 = redout_tmp_78513;\n            }\n            x_75226 = redout_76818;\n            acc_75225 = x_75226;\n        } else {\n            acc_75225 = acc_75218;\n        }\n        color_78136[(int64_t) 0] = acc_75225;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float tmp_78514;\n        \n        tmp_78514 = color_78136[(int64_t) 0];\n        color_78135[(int64_t) 0] = tmp_78514;\n    }\n    \n    int64_t ltid_y_75260 = sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n    int64_t ltid_x_75258 = sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n    int32_t ltid_flat_75259 = local_tid_78486;\n    \n    if (slt64(ltid_y_75260, tile_sizze_74753) && slt64(ltid_x_75258,\n                                                       tile_sizze_74753)) {\n        int64_t gtid_75262 = binop_x_74778 + ltid_y_75260;\n        int64_t gtid_75264 = binop_x_74780 + ltid_x_75258;\n        bool binop_x_75266 = slt64(gtid_75262, m_65343);\n        bool binop_y_75267 = slt64(gtid_75264, n_m_65352);\n        bool cond_75268 = binop_x_75266 && binop_y_75267;\n        float postlude_75269;\n        \n        if (cond_75268) {\n            float defunc_2_reduce_res_75265;\n            \n            defunc_2_reduce_res_75265 = color_78135[(int64_t) 0];\n            \n            int64_t last_res_75270;\n            \n            last_res_75270 = color_78141[(int64_t) 0];\n            \n            int64_t min_res_75271;\n            \n            min_res_75271 = color_78140[(int64_t) 0];\n            \n            int64_t max_res_75272;\n            \n            max_res_75272 = color_78139[(int64_t) 0];\n            \n            float defunc_1_f_res_75273;\n            \n            defunc_1_f_res_75273 = color_78138[(int64_t) 0];\n            \n            float a0_75275 = 1.0F / defunc_2_reduce_res_75265;\n            float defunc_2_reduce_res_75276;\n            float redout_76820 = 0.0F;\n            \n     ",
            "       for (int64_t i_76821 = 0; i_76821 < q_65346; i_76821++) {\n                float x_75281;\n                \n                x_75281 = ((__global float *) mem_77114)[gtid_75262 * q_65346 +\n                                                         i_76821];\n                \n                bool cond_75282 = sle64(last_res_75270, i_76821);\n                int64_t defunc_0_f_res_75283;\n                \n                if (cond_75282) {\n                    defunc_0_f_res_75283 = (int64_t) 0;\n                } else {\n                    int64_t i_75284 = add64(max_res_75272, i_76821);\n                    int64_t defunc_0_add_arg_75285;\n                    \n                    defunc_0_add_arg_75285 = ((__global\n                                               int64_t *) mem_77090)[gtid_75262 *\n                                                                     n_65344 +\n                                                                     i_75284];\n                    \n                    int64_t defunc_1_add_res_75286 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75285);\n                    \n                    defunc_0_f_res_75283 = defunc_1_add_res_75286;\n                }\n                \n                int64_t binop_p_75287 = sub64(defunc_0_f_res_75283,\n                                              min_res_75271);\n                float defunc_0_f_res_75288 = sitofp_i64_f32(binop_p_75287);\n                float abs_res_75289 = (float) fabs(defunc_0_f_res_75288);\n                float tmp1_75290 = abs_res_75289 / defunc_1_f_res_75273;\n                float x_75291 = tmp1_75290 * tmp1_75290;\n                float y_75292 = tmp1_75290 * x_75291;\n                float tmp2_75293 = 1.0F - y_75292;\n                float x_75294 = tmp2_75293 * tmp2_75293;\n                float tmp3_75295 = tmp2_75293 * x_75294;\n                float tmp4_75296 = x_75281 * tmp3_75295;\n                float defunc_0_f_res_75297;\n           ",
            "     \n                if (cond_75282) {\n                    defunc_0_f_res_75297 = 0.0F;\n                } else {\n                    int64_t i_75298 = add64(max_res_75272, i_76821);\n                    float defunc_0_add_arg_75299;\n                    \n                    defunc_0_add_arg_75299 = ((__global\n                                               float *) mem_77086)[gtid_75262 *\n                                                                   n_65344 +\n                                                                   i_75298];\n                    defunc_0_f_res_75297 = defunc_0_add_arg_75299;\n                }\n                \n                float x_75300 = a0_75275 * tmp4_75296;\n                float defunc_9_fit_fun_res_75301 = defunc_0_f_res_75297 *\n                      x_75300;\n                float defunc_1_op_res_75279 = defunc_9_fit_fun_res_75301 +\n                      redout_76820;\n                float redout_tmp_78515 = defunc_1_op_res_75279;\n                \n                redout_76820 = redout_tmp_78515;\n            }\n            defunc_2_reduce_res_75276 = redout_76820;\n            postlude_75269 = defunc_2_reduce_res_75276;\n        } else {\n            postlude_75269 = 0.0F;\n        }\n        color_78136[(int64_t) 0] = postlude_75269;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_78516 = gid_x_74750 * tile_sizze_74753 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78490));\n    int64_t thread_out_index_78517 = gid_y_74751 * tile_sizze_74753 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78491));\n    \n    if (slt64(thread_out_index_78516, m_65343) && slt64(thread_out_index_78517,\n                                                        n_m_65352)) {\n        float tmp_78518;\n        \n        tmp_78518 = color_78136[(int64_t) 0];\n        ((__global float *) mem_77161)[thread_out_index_78516 * n_m_65352 +\n                                       thread_out_index_78517] = tmp_78518;\n    }\n    \n  error_7:\n    return",
            ";\n    #undef tile_sizze_74753\n}\n__kernel void mainzisegmap_intragroup_75312(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            uint color_78159_backing_offset_0,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            int64_t num_groups_x_75309,\n                                            int64_t num_groups_y_75310,\n                                            int64_t num_whole_tiles_75442,\n                                            int64_t residual_input_75690,\n                                            unsigned char cond_75691_bits,\n                                            __global unsigned char *mem_77316,\n                                            __global unsigned char *mem_77320,\n                                            __global unsigned char *mem_77324,\n                                            __global unsigned char *mem_77330,\n                                            __global unsigned char *mem_77334,\n                                            __global unsigned char *mem_77337,\n                                            __global unsigned char *mem_77340,\n                                            __global unsigned char *mem_77343,\n                                            __global unsigned char *mem_77348,\n                                            __global unsigned char *mem_77422,\n                                            __",
            "global unsigned char *mem_77426)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    bool cond_75691 = cond_75691_bits;\n    \n    #define tile_sizze_75307 (mainzitile_sizze_75306)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_78159_backing_0 =\n                           &shared_mem[color_78159_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_78876;\n    int32_t local_tid_78877;\n    int64_t group_sizze_78880;\n    int32_t wave_sizze_78879;\n    int32_t group_tid_78878;\n    \n    global_tid_78876 = get_global_id(0);\n    local_tid_78877 = get_local_id(0);\n    group_sizze_78880 = get_local_size(0);\n    wave_sizze_78879 = LOCKSTEP_WIDTH;\n    group_tid_78878 = get_group_id(0);\n    \n    int32_t gid_flat_75312 = group_tid_78878;\n    int64_t slice_78883 = tile_sizze_75307;\n    int64_t slice_78884 = tile_sizze_75307 * slice_78883;\n    int64_t ltid_pre_78881 = squot64(sext_i32_i64(local_tid_78877),\n                                     slice_78883);\n    int64_t remnant_78885 = sext_i32_i64(local_tid_78877) - ltid_pre_78881 *\n            slice_78883;\n    int64_t ltid_pre_78882 = remnant_78885;\n    int64_t remnant_78886 = remnant_78885 - ltid_pre_78882;\n    int64_t slice_78887 = num_groups_y_75310;\n    int64_t slice_78888 = num_groups_x_75309 * slice_78887;\n    int64_t gid_x_75304 = squot64(sext_i32_i64(group_tid_78878), slice_78887);\n    int64_t remnant_78889 = sext_i32_i64(group_tid_78878) - gid_x_75304 *\n            slice_78887;\n    int64_t gid_y_75305 = remnant_78889;\n    int64_t remnant_78890 = remnant_78889 - gid_y_75305;\n    float color_78153[1];\n    float color_78154[1];\n    float color_78155[1];\n    float color_78156[1];\n    flo",
            "at color_78157[1];\n    float color_78158[1];\n    __local unsigned char *color_78159;\n    \n    color_78159 = (__local unsigned char *) color_78159_backing_0;\n    \n    float color_78160[1];\n    int64_t color_78161[1];\n    int64_t color_78162[1];\n    int64_t color_78163[1];\n    int64_t binop_x_75332 = gid_x_75304 * tile_sizze_75307;\n    int64_t binop_x_75334 = gid_y_75305 * tile_sizze_75307;\n    int64_t ltid_y_75331 = sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n    int64_t ltid_x_75329 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n    int32_t ltid_flat_75330 = local_tid_78877;\n    \n    if (slt64(ltid_y_75331, tile_sizze_75307) && slt64(ltid_x_75329,\n                                                       tile_sizze_75307)) {\n        int64_t gtid_75333 = ltid_y_75331 + binop_x_75332;\n        int64_t gtid_75335 = ltid_x_75329 + binop_x_75334;\n        bool binop_x_75336 = slt64(gtid_75333, m_65343);\n        bool binop_y_75337 = slt64(gtid_75335, n_m_65352);\n        bool cond_75338 = binop_x_75336 && binop_y_75337;\n        int64_t pre_75339;\n        int64_t pre_75340;\n        int64_t pre_75341;\n        float pre_75342;\n        \n        if (cond_75338) {\n            int64_t last_res_75343;\n            \n            last_res_75343 = ((__global int64_t *) mem_77316)[gtid_75333 *\n                                                              n_65344 +\n                                                              i_65358];\n            \n            int64_t min_arg_75344;\n            \n            min_arg_75344 = ((__global int64_t *) mem_77334)[gtid_75333];\n            \n            int64_t min_arg_75345;\n            \n            min_arg_75345 = ((__global int64_t *) mem_77337)[gtid_75333];\n            \n            int64_t min_res_75346;\n            \n            min_res_75346 = ((__global int64_t *) mem_77340)[gtid_75333];\n            \n            float max_res_75347;\n            \n            max_res_75347 = ((__global float *) mem_77343)[gtid_75333];\n            \n            int64_t",
            " min_arg_75348 = mul64(jump_65348, gtid_75335);\n            int64_t min_res_75349 = smin64(i_65358, min_arg_75348);\n            int64_t defunc_0_g_res_75350 = add64((int64_t) 1, min_res_75349);\n            bool init_idx_75351;\n            int64_t init_idx_75352;\n            int64_t init_idx_75353;\n            bool loop_while_75354;\n            int64_t low_75355;\n            int64_t high_75356;\n            \n            loop_while_75354 = x_65359;\n            low_75355 = (int64_t) 0;\n            high_75356 = i_65358;\n            while (loop_while_75354) {\n                int64_t x_75357 = add64(low_75355, high_75356);\n                int64_t mid_75358 = sdiv64(x_75357, (int64_t) 2);\n                bool x_75359 = sle64((int64_t) 0, mid_75358);\n                bool y_75360 = slt64(mid_75358, n_65344);\n                bool bounds_check_75361 = x_75359 && y_75360;\n                bool index_certs_75362;\n                \n                if (!bounds_check_75361) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 20) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) mid_75358;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t mid_id_75363;\n                \n                mid_id_75363 = ((__global int64_t *) mem_77330)[gtid_75333 *\n                                                                n_65344 +\n                                                                mid_75358];\n                \n                bool cond_75364 = slt64(mid_id_75363, (int64_t) 0);\n                int64_t mid_idx_75365;\n                \n                if (cond_75364) {\n                    mid_idx_75365 = (int64_t) 9223372036854775807;\n                } else {",
            "\n                    mid_idx_75365 = mid_id_75363;\n                }\n                \n                bool cond_75366 = sle64(defunc_0_g_res_75350, mid_idx_75365);\n                int64_t loopres_75367;\n                int64_t loopres_75368;\n                \n                if (cond_75366) {\n                    int64_t loopres_t_res_75369 = sub64(mid_75358, (int64_t) 1);\n                    \n                    loopres_75367 = low_75355;\n                    loopres_75368 = loopres_t_res_75369;\n                } else {\n                    int64_t loopres_f_res_75370 = add64((int64_t) 1, mid_75358);\n                    \n                    loopres_75367 = loopres_f_res_75370;\n                    loopres_75368 = high_75356;\n                }\n                \n                bool loop_cond_75371 = sle64(loopres_75367, loopres_75368);\n                bool loop_while_tmp_78891 = loop_cond_75371;\n                int64_t low_tmp_78892 = loopres_75367;\n                int64_t high_tmp_78893 = loopres_75368;\n                \n                loop_while_75354 = loop_while_tmp_78891;\n                low_75355 = low_tmp_78892;\n                high_75356 = high_tmp_78893;\n            }\n            init_idx_75351 = loop_while_75354;\n            init_idx_75352 = low_75355;\n            init_idx_75353 = high_75356;\n            \n            bool idx_75372;\n            int64_t idx_75373;\n            int64_t idx_75374;\n            int64_t idx_75375;\n            bool loop_while_75376;\n            int64_t l_idx_75377;\n            int64_t r_idx_75378;\n            int64_t span_75379;\n            \n            loop_while_75376 = loop_cond_65369;\n            l_idx_75377 = init_idx_75352;\n            r_idx_75378 = init_idx_75352;\n            span_75379 = (int64_t) 1;\n            while (loop_while_75376) {\n                int64_t max_arg_75380 = sub64(l_idx_75377, (int64_t) 1);\n                int64_t max_res_75381 = smax64((int64_t) 0, max_arg_75380);\n                int64_t min_arg_75382 = add6",
            "4((int64_t) 1, r_idx_75378);\n                int64_t min_res_75383 = smin64(min_arg_75344, min_arg_75382);\n                bool x_75384 = sle64((int64_t) 0, max_res_75381);\n                bool y_75385 = slt64(max_res_75381, n_65344);\n                bool bounds_check_75386 = x_75384 && y_75385;\n                bool index_certs_75387;\n                \n                if (!bounds_check_75386) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 21) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_75381;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_75388;\n                \n                x_75388 = ((__global int64_t *) mem_77330)[gtid_75333 *\n                                                           n_65344 +\n                                                           max_res_75381];\n                \n                int64_t abs_arg_75389 = sub64(x_75388, defunc_0_g_res_75350);\n                int64_t abs_res_75390 = abs64(abs_arg_75389);\n                bool x_75391 = sle64((int64_t) 0, min_res_75383);\n                bool y_75392 = slt64(min_res_75383, n_65344);\n                bool bounds_check_75393 = x_75391 && y_75392;\n                bool index_certs_75394;\n                \n                if (!bounds_check_75393) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 22) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) min_res_75383;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                 ",
            "       goto error_0;\n                    }\n                }\n                \n                int64_t x_75395;\n                \n                x_75395 = ((__global int64_t *) mem_77330)[gtid_75333 *\n                                                           n_65344 +\n                                                           min_res_75383];\n                \n                int64_t abs_arg_75396 = sub64(x_75395, defunc_0_g_res_75350);\n                int64_t abs_res_75397 = abs64(abs_arg_75396);\n                bool cond_75398 = max_res_75381 == l_idx_75377;\n                int64_t loopres_75399;\n                int64_t loopres_75400;\n                int64_t loopres_75401;\n                \n                if (cond_75398) {\n                    loopres_75399 = l_idx_75377;\n                    loopres_75400 = r_idx_75378;\n                    loopres_75401 = min_res_65364;\n                } else {\n                    bool cond_75402 = slt64(abs_res_75390, abs_res_75397);\n                    bool cond_f_res_75403 = min_res_75383 == r_idx_75378;\n                    bool x_75404 = !cond_75402;\n                    bool y_75405 = cond_f_res_75403 && x_75404;\n                    bool cond_75406 = cond_75402 || y_75405;\n                    int64_t loopres_f_res_75407;\n                    \n                    if (cond_75406) {\n                        loopres_f_res_75407 = max_res_75381;\n                    } else {\n                        loopres_f_res_75407 = l_idx_75377;\n                    }\n                    \n                    int64_t loopres_f_res_75408;\n                    \n                    if (cond_75406) {\n                        loopres_f_res_75408 = r_idx_75378;\n                    } else {\n                        loopres_f_res_75408 = min_res_75383;\n                    }\n                    \n                    int64_t loopres_f_res_75409;\n                    \n                    if (cond_75406) {\n                        int64_t loopres_f_res_t_res_75410 = add",
            "64((int64_t) 1,\n                                                                  span_75379);\n                        \n                        loopres_f_res_75409 = loopres_f_res_t_res_75410;\n                    } else {\n                        int64_t loopres_f_res_f_res_75411 = add64((int64_t) 1,\n                                                                  span_75379);\n                        \n                        loopres_f_res_75409 = loopres_f_res_f_res_75411;\n                    }\n                    loopres_75399 = loopres_f_res_75407;\n                    loopres_75400 = loopres_f_res_75408;\n                    loopres_75401 = loopres_f_res_75409;\n                }\n                \n                bool loop_cond_75412 = slt64(loopres_75401, min_res_65364);\n                bool loop_while_tmp_78894 = loop_cond_75412;\n                int64_t l_idx_tmp_78895 = loopres_75399;\n                int64_t r_idx_tmp_78896 = loopres_75400;\n                int64_t span_tmp_78897 = loopres_75401;\n                \n                loop_while_75376 = loop_while_tmp_78894;\n                l_idx_75377 = l_idx_tmp_78895;\n                r_idx_75378 = r_idx_tmp_78896;\n                span_75379 = span_tmp_78897;\n            }\n            idx_75372 = loop_while_75376;\n            idx_75373 = l_idx_75377;\n            idx_75374 = r_idx_75378;\n            idx_75375 = span_75379;\n            \n            int64_t min_res_75413 = smin64(min_arg_75345, idx_75373);\n            int64_t max_res_75414 = smax64((int64_t) 0, min_res_75413);\n            int64_t x_75415 = add64(min_res_75346, max_res_75414);\n            int64_t r_75416 = sub64(x_75415, (int64_t) 1);\n            bool x_75417 = sle64((int64_t) 0, r_75416);\n            bool y_75418 = slt64(r_75416, n_65344);\n            bool bounds_check_75419 = x_75417 && y_75418;\n            bool index_certs_75420;\n            \n            if (!bounds_check_75419) {\n                {\n                    if (atomic_cmpxchg_i32_global(globa",
            "l_failure, -1, 23) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) r_75416;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_75421;\n            \n            x_75421 = ((__global int64_t *) mem_77324)[gtid_75333 * n_65344 +\n                                                       r_75416];\n            \n            int64_t abs_arg_75422 = sub64(x_75421, min_res_75349);\n            int64_t abs_res_75423 = abs64(abs_arg_75422);\n            bool x_75424 = sle64((int64_t) 0, max_res_75414);\n            bool y_75425 = slt64(max_res_75414, n_65344);\n            bool bounds_check_75426 = x_75424 && y_75425;\n            bool index_certs_75427;\n            \n            if (!bounds_check_75426) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 24) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_75414;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_75428;\n            \n            x_75428 = ((__global int64_t *) mem_77324)[gtid_75333 * n_65344 +\n                                                       max_res_75414];\n            \n            int64_t abs_arg_75429 = sub64(x_75428, min_res_75349);\n            int64_t abs_res_75430 = abs64(abs_arg_75429);\n            int64_t max_res_75431 = smax64(abs_res_75423, abs_res_75430);\n            float defunc_0_f_res_75432 = sitofp_i64_f32(max_res_75431);\n            float defunc_1_f_res_75433 = max_res_75347 + defunc_0_f_res_75432;\n            \n            pre_75339 = last_res_75343;\n           ",
            " pre_75340 = min_res_75349;\n            pre_75341 = max_res_75414;\n            pre_75342 = defunc_1_f_res_75433;\n        } else {\n            pre_75339 = (int64_t) 0;\n            pre_75340 = (int64_t) 0;\n            pre_75341 = (int64_t) 0;\n            pre_75342 = 0.0F;\n        }\n        color_78163[(int64_t) 0] = pre_75339;\n        color_78162[(int64_t) 0] = pre_75340;\n        color_78161[(int64_t) 0] = pre_75341;\n        color_78160[(int64_t) 0] = pre_75342;\n    }\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ltid_y_75450 = sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n    int64_t ltid_x_75448 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n    int32_t ltid_flat_75449 = local_tid_78877;\n    \n    if (slt64(ltid_y_75450, tile_sizze_75307) && slt64(ltid_x_75448,\n                                                       tile_sizze_75307)) {\n        color_78154[(int64_t) 0] = 0.0F;\n        color_78153[(int64_t) 0] = 0.0F;\n        color_78156[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float tmp_78898;\n    \n    tmp_78898 = color_78154[(int64_t) 0];\n    color_78155[(int64_t) 0] = tmp_78898;\n    \n    float tmp_78899;\n    \n    tmp_78899 = color_78153[(int64_t) 0];\n    color_78154[(int64_t) 0] = tmp_78899;\n    \n    float tmp_78900;\n    \n    tmp_78900 = color_78156[(int64_t) 0];\n    color_78153[(int64_t) 0] = tmp_78900;\n    \n    float ext_mem_77393[1];\n    float ext_mem_unused_78084[1];\n    float ext_mem_77392[1];\n    float ext_mem_unused_78089[1];\n    float ext_mem_77391[1];\n    float ext_mem_unused_78094[1];\n    float mem_param_77373[1];\n    float mem_param_77374[1];\n    float mem_param_77375[1];\n    float mem_param_out_78085[1];\n    float mem_param_out_78090[1];\n    float mem_param_out_78095[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_77373[i_1] = color_78155[i_1];\n    for (int32_t i_2 = 0; i_2 < 1; i_2++)\n        mem_param_out_78085[i_",
            "2] = color_78158[i_2];\n    for (int32_t i_3 = 0; i_3 < 1; i_3++)\n        mem_param_77374[i_3] = color_78154[i_3];\n    for (int32_t i_4 = 0; i_4 < 1; i_4++)\n        mem_param_out_78090[i_4] = color_78157[i_4];\n    for (int32_t i_5 = 0; i_5 < 1; i_5++)\n        mem_param_77375[i_5] = color_78153[i_5];\n    for (int32_t i_6 = 0; i_6 < 1; i_6++)\n        mem_param_out_78095[i_6] = color_78156[i_6];\n    for (int64_t tile_id_75461 = 0; tile_id_75461 < num_whole_tiles_75442;\n         tile_id_75461++) {\n        int64_t binop_x_75584 = tile_sizze_75307 * tile_id_75461;\n        int64_t ltid_y_75581 = sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n        int64_t ltid_x_75579 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n        int32_t ltid_flat_75580 = local_tid_78877;\n        int64_t j_75585 = ltid_x_75579 + binop_x_75584;\n        int64_t gtid_75587 = binop_x_75332 + ltid_y_75581;\n        bool binop_x_75595 = slt64(j_75585, q_65346);\n        bool binop_y_75596 = slt64(gtid_75587, m_65343);\n        bool cond_75597 = binop_x_75595 && binop_y_75596;\n        float pre2d_75598;\n        \n        if (cond_75597) {\n            float x_75599;\n            \n            x_75599 = ((__global float *) mem_77348)[gtid_75587 * q_65346 +\n                                                     j_75585];\n            pre2d_75598 = x_75599;\n        } else {\n            pre2d_75598 = 0.0F;\n        }\n        ((__local float *) color_78159)[ltid_y_75581 * tile_sizze_75307 +\n                                        ltid_x_75579] = pre2d_75598;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75606 = sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n        int64_t ltid_x_75604 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n        int32_t ltid_flat_75605 = local_tid_78877;\n        int64_t gtid_75608 = binop_x_75332 + ltid_y_75606;\n        int64_t gtid_75610 = binop_x_75334 + ltid_x_75604;\n        float acc_75616;\n        \n        acc_75616 = mem_param_77373[(int64_t) 0];\n        \n        float ",
            "acc_75617;\n        \n        acc_75617 = mem_param_77374[(int64_t) 0];\n        \n        float acc_75618;\n        \n        acc_75618 = mem_param_77375[(int64_t) 0];\n        \n        bool binop_x_75622 = slt64(gtid_75608, m_65343);\n        bool binop_y_75623 = slt64(gtid_75610, n_m_65352);\n        bool cond_75624 = binop_x_75622 && binop_y_75623;\n        float acc_75625;\n        float acc_75626;\n        float acc_75627;\n        \n        if (cond_75624) {\n            int64_t last_res_75611;\n            \n            last_res_75611 = color_78163[(int64_t) 0];\n            \n            int64_t min_res_75612;\n            \n            min_res_75612 = color_78162[(int64_t) 0];\n            \n            int64_t max_res_75613;\n            \n            max_res_75613 = color_78161[(int64_t) 0];\n            \n            float defunc_1_f_res_75614;\n            \n            defunc_1_f_res_75614 = color_78160[(int64_t) 0];\n            \n            float x_75628;\n            float x_75629;\n            float x_75630;\n            float redout_76858;\n            float redout_76859;\n            float redout_76860;\n            \n            redout_76858 = acc_75616;\n            redout_76859 = acc_75617;\n            redout_76860 = acc_75618;\n            for (int64_t i_76861 = 0; i_76861 < tile_sizze_75307; i_76861++) {\n                int64_t index_primexp_76957 = add64(binop_x_75584, i_76861);\n                float x_75641;\n                \n                x_75641 = ((__local float *) color_78159)[ltid_y_75606 *\n                                                          tile_sizze_75307 +\n                                                          i_76861];\n                \n                bool cond_75642 = sle64(last_res_75611, index_primexp_76957);\n                int64_t defunc_0_f_res_75643;\n                \n                if (cond_75642) {\n                    defunc_0_f_res_75643 = (int64_t) 0;\n                } else {\n                    int64_t i_75644 = add64(max_res_75613, index_primex",
            "p_76957);\n                    int64_t defunc_0_add_arg_75645;\n                    \n                    defunc_0_add_arg_75645 = ((__global\n                                               int64_t *) mem_77324)[gtid_75608 *\n                                                                     n_65344 +\n                                                                     i_75644];\n                    \n                    int64_t defunc_1_add_res_75646 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75645);\n                    \n                    defunc_0_f_res_75643 = defunc_1_add_res_75646;\n                }\n                \n                int64_t binop_p_75647 = sub64(defunc_0_f_res_75643,\n                                              min_res_75612);\n                float defunc_0_f_res_75648 = sitofp_i64_f32(binop_p_75647);\n                float abs_res_75649 = (float) fabs(defunc_0_f_res_75648);\n                float tmp1_75650 = abs_res_75649 / defunc_1_f_res_75614;\n                float x_75651 = tmp1_75650 * tmp1_75650;\n                float y_75652 = tmp1_75650 * x_75651;\n                float tmp2_75653 = 1.0F - y_75652;\n                float x_75654 = tmp2_75653 * tmp2_75653;\n                float tmp3_75655 = tmp2_75653 * x_75654;\n                float w_j_75656 = x_75641 * tmp3_75655;\n                float xw_j_75657 = defunc_0_f_res_75648 * w_j_75656;\n                float x2w_j_75658 = defunc_0_f_res_75648 * xw_j_75657;\n                float defunc_1_op_res_75637 = w_j_75656 + redout_76858;\n                float defunc_1_op_res_75638 = xw_j_75657 + redout_76859;\n                float defunc_1_op_res_75639 = x2w_j_75658 + redout_76860;\n                float redout_tmp_78910 = defunc_1_op_res_75637;\n                float redout_tmp_78911 = defunc_1_op_res_75638;\n                float redout_tmp_78912 = defunc_1_op_res_75639;\n                \n                redout_76858 = redout_tmp_78910;\n                red",
            "out_76859 = redout_tmp_78911;\n                redout_76860 = redout_tmp_78912;\n            }\n            x_75628 = redout_76858;\n            x_75629 = redout_76859;\n            x_75630 = redout_76860;\n            acc_75625 = x_75628;\n            acc_75626 = x_75629;\n            acc_75627 = x_75630;\n        } else {\n            acc_75625 = acc_75616;\n            acc_75626 = acc_75617;\n            acc_75627 = acc_75618;\n        }\n        mem_param_out_78085[(int64_t) 0] = acc_75625;\n        mem_param_out_78090[(int64_t) 0] = acc_75626;\n        mem_param_out_78095[(int64_t) 0] = acc_75627;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_78901[1];\n        \n        for (int32_t i_7 = 0; i_7 < 1; i_7++)\n            mem_param_tmp_78901[i_7] = mem_param_out_78085[i_7];\n        \n        float mem_param_out_tmp_78902[1];\n        \n        for (int32_t i_8 = 0; i_8 < 1; i_8++)\n            mem_param_out_tmp_78902[i_8] = mem_param_77373[i_8];\n        \n        float mem_param_tmp_78903[1];\n        \n        for (int32_t i_9 = 0; i_9 < 1; i_9++)\n            mem_param_tmp_78903[i_9] = mem_param_out_78090[i_9];\n        \n        float mem_param_out_tmp_78904[1];\n        \n        for (int32_t i_10 = 0; i_10 < 1; i_10++)\n            mem_param_out_tmp_78904[i_10] = mem_param_77374[i_10];\n        \n        float mem_param_tmp_78905[1];\n        \n        for (int32_t i_11 = 0; i_11 < 1; i_11++)\n            mem_param_tmp_78905[i_11] = mem_param_out_78095[i_11];\n        \n        float mem_param_out_tmp_78906[1];\n        \n        for (int32_t i_12 = 0; i_12 < 1; i_12++)\n            mem_param_out_tmp_78906[i_12] = mem_param_77375[i_12];\n        for (int32_t i_13 = 0; i_13 < 1; i_13++)\n            mem_param_77373[i_13] = mem_param_tmp_78901[i_13];\n        for (int32_t i_14 = 0; i_14 < 1; i_14++)\n            mem_param_out_78085[i_14] = mem_param_out_tmp_78902[i_14];\n        for (int32_t i_15 = 0; i_15 < 1; i_15++)\n            mem_param_77374[i_15] = mem_param_tmp_78903[i_",
            "15];\n        for (int32_t i_16 = 0; i_16 < 1; i_16++)\n            mem_param_out_78090[i_16] = mem_param_out_tmp_78904[i_16];\n        for (int32_t i_17 = 0; i_17 < 1; i_17++)\n            mem_param_77375[i_17] = mem_param_tmp_78905[i_17];\n        for (int32_t i_18 = 0; i_18 < 1; i_18++)\n            mem_param_out_78095[i_18] = mem_param_out_tmp_78906[i_18];\n    }\n    for (int32_t i_19 = 0; i_19 < 1; i_19++)\n        ext_mem_77393[i_19] = mem_param_77373[i_19];\n    for (int32_t i_20 = 0; i_20 < 1; i_20++)\n        ext_mem_unused_78084[i_20] = mem_param_out_78085[i_20];\n    for (int32_t i_21 = 0; i_21 < 1; i_21++)\n        ext_mem_77392[i_21] = mem_param_77374[i_21];\n    for (int32_t i_22 = 0; i_22 < 1; i_22++)\n        ext_mem_unused_78089[i_22] = mem_param_out_78090[i_22];\n    for (int32_t i_23 = 0; i_23 < 1; i_23++)\n        ext_mem_77391[i_23] = mem_param_77375[i_23];\n    for (int32_t i_24 = 0; i_24 < 1; i_24++)\n        ext_mem_unused_78094[i_24] = mem_param_out_78095[i_24];\n    if (cond_75691) {\n        float tmp_78913;\n        \n        tmp_78913 = ext_mem_77393[(int64_t) 0];\n        color_78153[(int64_t) 0] = tmp_78913;\n        \n        float tmp_78914;\n        \n        tmp_78914 = ext_mem_77392[(int64_t) 0];\n        color_78154[(int64_t) 0] = tmp_78914;\n        \n        float tmp_78915;\n        \n        tmp_78915 = ext_mem_77391[(int64_t) 0];\n        color_78155[(int64_t) 0] = tmp_78915;\n    } else {\n        int64_t binop_x_75815 = tile_sizze_75307 * num_whole_tiles_75442;\n        int64_t ltid_y_75812 = sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n        int64_t ltid_x_75810 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n        int32_t ltid_flat_75811 = local_tid_78877;\n        int64_t j_75816 = ltid_x_75810 + binop_x_75815;\n        int64_t gtid_75818 = binop_x_75332 + ltid_y_75812;\n        bool binop_x_75826 = slt64(j_75816, q_65346);\n        bool binop_y_75827 = slt64(gtid_75818, m_65343);\n        bool cond_75828 = binop_x_75826 && binop_y_75827;\n        float pre2d_",
            "75829;\n        \n        if (cond_75828) {\n            float x_75830;\n            \n            x_75830 = ((__global float *) mem_77348)[gtid_75818 * q_65346 +\n                                                     j_75816];\n            pre2d_75829 = x_75830;\n        } else {\n            pre2d_75829 = 0.0F;\n        }\n        ((__local float *) color_78159)[ltid_y_75812 * tile_sizze_75307 +\n                                        ltid_x_75810] = pre2d_75829;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75838 = sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n        int64_t ltid_x_75836 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n        int32_t ltid_flat_75837 = local_tid_78877;\n        int64_t gtid_75840 = binop_x_75332 + ltid_y_75838;\n        int64_t gtid_75842 = binop_x_75334 + ltid_x_75836;\n        float acc_75848;\n        \n        acc_75848 = ext_mem_77393[(int64_t) 0];\n        \n        float acc_75849;\n        \n        acc_75849 = ext_mem_77392[(int64_t) 0];\n        \n        float acc_75850;\n        \n        acc_75850 = ext_mem_77391[(int64_t) 0];\n        \n        bool binop_x_75854 = slt64(gtid_75840, m_65343);\n        bool binop_y_75855 = slt64(gtid_75842, n_m_65352);\n        bool cond_75856 = binop_x_75854 && binop_y_75855;\n        float acc_75857;\n        float acc_75858;\n        float acc_75859;\n        \n        if (cond_75856) {\n            int64_t last_res_75843;\n            \n            last_res_75843 = color_78163[(int64_t) 0];\n            \n            int64_t min_res_75844;\n            \n            min_res_75844 = color_78162[(int64_t) 0];\n            \n            int64_t max_res_75845;\n            \n            max_res_75845 = color_78161[(int64_t) 0];\n            \n            float defunc_1_f_res_75846;\n            \n            defunc_1_f_res_75846 = color_78160[(int64_t) 0];\n            \n            float x_75860;\n            float x_75861;\n            float x_75862;\n            float redout_76862;\n            float redout_76863;\n",
            "            float redout_76864;\n            \n            redout_76862 = acc_75848;\n            redout_76863 = acc_75849;\n            redout_76864 = acc_75850;\n            for (int64_t i_76865 = 0; i_76865 < residual_input_75690;\n                 i_76865++) {\n                int64_t index_primexp_76955 = add64(binop_x_75815, i_76865);\n                float x_75873;\n                \n                x_75873 = ((__local float *) color_78159)[ltid_y_75838 *\n                                                          tile_sizze_75307 +\n                                                          i_76865];\n                \n                bool cond_75874 = sle64(last_res_75843, index_primexp_76955);\n                int64_t defunc_0_f_res_75875;\n                \n                if (cond_75874) {\n                    defunc_0_f_res_75875 = (int64_t) 0;\n                } else {\n                    int64_t i_75876 = add64(max_res_75845, index_primexp_76955);\n                    int64_t defunc_0_add_arg_75877;\n                    \n                    defunc_0_add_arg_75877 = ((__global\n                                               int64_t *) mem_77324)[gtid_75840 *\n                                                                     n_65344 +\n                                                                     i_75876];\n                    \n                    int64_t defunc_1_add_res_75878 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75877);\n                    \n                    defunc_0_f_res_75875 = defunc_1_add_res_75878;\n                }\n                \n                int64_t binop_p_75879 = sub64(defunc_0_f_res_75875,\n                                              min_res_75844);\n                float defunc_0_f_res_75880 = sitofp_i64_f32(binop_p_75879);\n                float abs_res_75881 = (float) fabs(defunc_0_f_res_75880);\n                float tmp1_75882 = abs_res_75881 / defunc_1_f_res_75846;\n                float ",
            "x_75883 = tmp1_75882 * tmp1_75882;\n                float y_75884 = tmp1_75882 * x_75883;\n                float tmp2_75885 = 1.0F - y_75884;\n                float x_75886 = tmp2_75885 * tmp2_75885;\n                float tmp3_75887 = tmp2_75885 * x_75886;\n                float w_j_75888 = x_75873 * tmp3_75887;\n                float xw_j_75889 = defunc_0_f_res_75880 * w_j_75888;\n                float x2w_j_75890 = defunc_0_f_res_75880 * xw_j_75889;\n                float defunc_1_op_res_75869 = w_j_75888 + redout_76862;\n                float defunc_1_op_res_75870 = xw_j_75889 + redout_76863;\n                float defunc_1_op_res_75871 = x2w_j_75890 + redout_76864;\n                float redout_tmp_78916 = defunc_1_op_res_75869;\n                float redout_tmp_78917 = defunc_1_op_res_75870;\n                float redout_tmp_78918 = defunc_1_op_res_75871;\n                \n                redout_76862 = redout_tmp_78916;\n                redout_76863 = redout_tmp_78917;\n                redout_76864 = redout_tmp_78918;\n            }\n            x_75860 = redout_76862;\n            x_75861 = redout_76863;\n            x_75862 = redout_76864;\n            acc_75857 = x_75860;\n            acc_75858 = x_75861;\n            acc_75859 = x_75862;\n        } else {\n            acc_75857 = acc_75848;\n            acc_75858 = acc_75849;\n            acc_75859 = acc_75850;\n        }\n        color_78158[(int64_t) 0] = acc_75857;\n        color_78157[(int64_t) 0] = acc_75858;\n        color_78156[(int64_t) 0] = acc_75859;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float tmp_78919;\n        \n        tmp_78919 = color_78158[(int64_t) 0];\n        color_78153[(int64_t) 0] = tmp_78919;\n        \n        float tmp_78920;\n        \n        tmp_78920 = color_78157[(int64_t) 0];\n        color_78154[(int64_t) 0] = tmp_78920;\n        \n        float tmp_78921;\n        \n        tmp_78921 = color_78156[(int64_t) 0];\n        color_78155[(int64_t) 0] = tmp_78921;\n    }\n    \n    int64_t ltid_y_75908 = sex",
            "t_i32_i64(sext_i64_i32(ltid_pre_78881));\n    int64_t ltid_x_75906 = sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n    int32_t ltid_flat_75907 = local_tid_78877;\n    \n    if (slt64(ltid_y_75908, tile_sizze_75307) && slt64(ltid_x_75906,\n                                                       tile_sizze_75307)) {\n        int64_t gtid_75910 = binop_x_75332 + ltid_y_75908;\n        int64_t gtid_75912 = binop_x_75334 + ltid_x_75906;\n        bool binop_x_75916 = slt64(gtid_75910, m_65343);\n        bool binop_y_75917 = slt64(gtid_75912, n_m_65352);\n        bool cond_75918 = binop_x_75916 && binop_y_75917;\n        float postlude_75919;\n        float postlude_75920;\n        \n        if (cond_75918) {\n            float defunc_2_reduce_res_75913;\n            \n            defunc_2_reduce_res_75913 = color_78153[(int64_t) 0];\n            \n            float defunc_2_reduce_res_75914;\n            \n            defunc_2_reduce_res_75914 = color_78154[(int64_t) 0];\n            \n            float defunc_2_reduce_res_75915;\n            \n            defunc_2_reduce_res_75915 = color_78155[(int64_t) 0];\n            \n            int64_t last_res_75921;\n            \n            last_res_75921 = color_78163[(int64_t) 0];\n            \n            int64_t min_res_75922;\n            \n            min_res_75922 = color_78162[(int64_t) 0];\n            \n            int64_t max_res_75923;\n            \n            max_res_75923 = color_78161[(int64_t) 0];\n            \n            float defunc_1_f_res_75924;\n            \n            defunc_1_f_res_75924 = color_78160[(int64_t) 0];\n            \n            float x_75926 = defunc_2_reduce_res_75913 *\n                  defunc_2_reduce_res_75915;\n            float y_75927 = defunc_2_reduce_res_75914 *\n                  defunc_2_reduce_res_75914;\n            float y_75928 = x_75926 - y_75927;\n            float det1_75929 = 1.0F / y_75928;\n            float a11_75930 = defunc_2_reduce_res_75915 * det1_75929;\n            float x_75931 = 0.0F - defunc_2_reduce_re",
            "s_75914;\n            float b11_75932 = det1_75929 * x_75931;\n            float c11_75933 = defunc_2_reduce_res_75913 * det1_75929;\n            float defunc_2_reduce_res_75934;\n            float defunc_2_reduce_res_75935;\n            float redout_76866;\n            float redout_76867;\n            \n            redout_76866 = 0.0F;\n            redout_76867 = 0.0F;\n            for (int64_t i_76868 = 0; i_76868 < q_65346; i_76868++) {\n                float x_75943;\n                \n                x_75943 = ((__global float *) mem_77348)[gtid_75910 * q_65346 +\n                                                         i_76868];\n                \n                bool cond_75944 = sle64(last_res_75921, i_76868);\n                int64_t defunc_0_f_res_75945;\n                \n                if (cond_75944) {\n                    defunc_0_f_res_75945 = (int64_t) 0;\n                } else {\n                    int64_t i_75946 = add64(max_res_75923, i_76868);\n                    int64_t defunc_0_add_arg_75947;\n                    \n                    defunc_0_add_arg_75947 = ((__global\n                                               int64_t *) mem_77324)[gtid_75910 *\n                                                                     n_65344 +\n                                                                     i_75946];\n                    \n                    int64_t defunc_1_add_res_75948 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75947);\n                    \n                    defunc_0_f_res_75945 = defunc_1_add_res_75948;\n                }\n                \n                int64_t binop_p_75949 = sub64(defunc_0_f_res_75945,\n                                              min_res_75922);\n                float defunc_0_f_res_75950 = sitofp_i64_f32(binop_p_75949);\n                float abs_res_75951 = (float) fabs(defunc_0_f_res_75950);\n                float tmp1_75952 = abs_res_75951 / defunc_1_f_res_75924;\n                flo",
            "at x_75953 = tmp1_75952 * tmp1_75952;\n                float y_75954 = tmp1_75952 * x_75953;\n                float tmp2_75955 = 1.0F - y_75954;\n                float x_75956 = tmp2_75955 * tmp2_75955;\n                float tmp3_75957 = tmp2_75955 * x_75956;\n                float tmp4_75958 = x_75943 * tmp3_75957;\n                float defunc_1_f_res_75959 = defunc_0_f_res_75950 * tmp4_75958;\n                float defunc_0_f_res_75960;\n                \n                if (cond_75944) {\n                    defunc_0_f_res_75960 = 0.0F;\n                } else {\n                    int64_t i_75961 = add64(max_res_75923, i_76868);\n                    float defunc_0_add_arg_75962;\n                    \n                    defunc_0_add_arg_75962 = ((__global\n                                               float *) mem_77320)[gtid_75910 *\n                                                                   n_65344 +\n                                                                   i_75961];\n                    defunc_0_f_res_75960 = defunc_0_add_arg_75962;\n                }\n                \n                float x_75963 = a11_75930 * tmp4_75958;\n                float y_75964 = b11_75932 * defunc_1_f_res_75959;\n                float x_75965 = x_75963 + y_75964;\n                float defunc_9_fit_fun_res_75966 = defunc_0_f_res_75960 *\n                      x_75965;\n                float x_75967 = b11_75932 * tmp4_75958;\n                float y_75968 = c11_75933 * defunc_1_f_res_75959;\n                float x_75969 = x_75967 + y_75968;\n                float defunc_9_slope_fun_res_75970 = defunc_0_f_res_75960 *\n                      x_75969;\n                float defunc_1_op_res_75938 = defunc_9_fit_fun_res_75966 +\n                      redout_76866;\n                float defunc_1_op_res_75941 = defunc_9_slope_fun_res_75970 +\n                      redout_76867;\n                float redout_tmp_78922 = defunc_1_op_res_75938;\n                float redout_tmp_78923 = defunc_1_op_res_75",
            "941;\n                \n                redout_76866 = redout_tmp_78922;\n                redout_76867 = redout_tmp_78923;\n            }\n            defunc_2_reduce_res_75934 = redout_76866;\n            defunc_2_reduce_res_75935 = redout_76867;\n            postlude_75919 = defunc_2_reduce_res_75934;\n            postlude_75920 = defunc_2_reduce_res_75935;\n        } else {\n            postlude_75919 = 0.0F;\n            postlude_75920 = 0.0F;\n        }\n        color_78157[(int64_t) 0] = postlude_75919;\n        color_78156[(int64_t) 0] = postlude_75920;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_78924 = gid_x_75304 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n    int64_t thread_out_index_78925 = gid_y_75305 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n    \n    if (slt64(thread_out_index_78924, m_65343) && slt64(thread_out_index_78925,\n                                                        n_m_65352)) {\n        float tmp_78926;\n        \n        tmp_78926 = color_78157[(int64_t) 0];\n        ((__global float *) mem_77422)[thread_out_index_78924 * n_m_65352 +\n                                       thread_out_index_78925] = tmp_78926;\n    }\n    \n    int64_t thread_out_index_78927 = gid_x_75304 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78881));\n    int64_t thread_out_index_78928 = gid_y_75305 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78882));\n    \n    if (slt64(thread_out_index_78927, m_65343) && slt64(thread_out_index_78928,\n                                                        n_m_65352)) {\n        float tmp_78929;\n        \n        tmp_78929 = color_78156[(int64_t) 0];\n        ((__global float *) mem_77426)[thread_out_index_78927 * n_m_65352 +\n                                       thread_out_index_78928] = tmp_78929;\n    }\n    \n  error_7:\n    return;\n    #undef tile_sizze_75307\n}\n__kernel void mainzisegmap_intragroup_75983(__glo",
            "bal int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            uint color_78189_backing_offset_0,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            int64_t num_groups_x_75980,\n                                            int64_t num_groups_y_75981,\n                                            int64_t num_whole_tiles_76113,\n                                            int64_t residual_input_76413,\n                                            unsigned char cond_76414_bits,\n                                            __global unsigned char *mem_77608,\n                                            __global unsigned char *mem_77612,\n                                            __global unsigned char *mem_77616,\n                                            __global unsigned char *mem_77622,\n                                            __global unsigned char *mem_77626,\n                                            __global unsigned char *mem_77629,\n                                            __global unsigned char *mem_77632,\n                                            __global unsigned char *mem_77635,\n                                            __global unsigned char *mem_77640,\n                                            __global unsigned char *mem_77738,\n                                            __global unsigned char *mem_77742)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop",
            "_cond_65369 = loop_cond_65369_bits;\n    bool cond_76414 = cond_76414_bits;\n    \n    #define tile_sizze_75978 (mainzitile_sizze_75977)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_78189_backing_0 =\n                           &shared_mem[color_78189_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_79331;\n    int32_t local_tid_79332;\n    int64_t group_sizze_79335;\n    int32_t wave_sizze_79334;\n    int32_t group_tid_79333;\n    \n    global_tid_79331 = get_global_id(0);\n    local_tid_79332 = get_local_id(0);\n    group_sizze_79335 = get_local_size(0);\n    wave_sizze_79334 = LOCKSTEP_WIDTH;\n    group_tid_79333 = get_group_id(0);\n    \n    int32_t gid_flat_75983 = group_tid_79333;\n    int64_t slice_79338 = tile_sizze_75978;\n    int64_t slice_79339 = tile_sizze_75978 * slice_79338;\n    int64_t ltid_pre_79336 = squot64(sext_i32_i64(local_tid_79332),\n                                     slice_79338);\n    int64_t remnant_79340 = sext_i32_i64(local_tid_79332) - ltid_pre_79336 *\n            slice_79338;\n    int64_t ltid_pre_79337 = remnant_79340;\n    int64_t remnant_79341 = remnant_79340 - ltid_pre_79337;\n    int64_t slice_79342 = num_groups_y_75981;\n    int64_t slice_79343 = num_groups_x_75980 * slice_79342;\n    int64_t gid_x_75975 = squot64(sext_i32_i64(group_tid_79333), slice_79342);\n    int64_t remnant_79344 = sext_i32_i64(group_tid_79333) - gid_x_75975 *\n            slice_79342;\n    int64_t gid_y_75976 = remnant_79344;\n    int64_t remnant_79345 = remnant_79344 - gid_y_75976;\n    float color_78179[1];\n    float color_78180[1];\n    float color_78181[1];\n    float color_78182[1];\n    float color_78183[1];\n    float color_78184[1];\n    float color_78185[1];\n    float ",
            "color_78186[1];\n    float color_78187[1];\n    float color_78188[1];\n    __local unsigned char *color_78189;\n    \n    color_78189 = (__local unsigned char *) color_78189_backing_0;\n    \n    float color_78190[1];\n    int64_t color_78191[1];\n    int64_t color_78192[1];\n    int64_t color_78193[1];\n    int64_t binop_x_76003 = gid_x_75975 * tile_sizze_75978;\n    int64_t binop_x_76005 = gid_y_75976 * tile_sizze_75978;\n    int64_t ltid_y_76002 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n    int64_t ltid_x_76000 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n    int32_t ltid_flat_76001 = local_tid_79332;\n    \n    if (slt64(ltid_y_76002, tile_sizze_75978) && slt64(ltid_x_76000,\n                                                       tile_sizze_75978)) {\n        int64_t gtid_76004 = ltid_y_76002 + binop_x_76003;\n        int64_t gtid_76006 = ltid_x_76000 + binop_x_76005;\n        bool binop_x_76007 = slt64(gtid_76004, m_65343);\n        bool binop_y_76008 = slt64(gtid_76006, n_m_65352);\n        bool cond_76009 = binop_x_76007 && binop_y_76008;\n        int64_t pre_76010;\n        int64_t pre_76011;\n        int64_t pre_76012;\n        float pre_76013;\n        \n        if (cond_76009) {\n            int64_t last_res_76014;\n            \n            last_res_76014 = ((__global int64_t *) mem_77608)[gtid_76004 *\n                                                              n_65344 +\n                                                              i_65358];\n            \n            int64_t min_arg_76015;\n            \n            min_arg_76015 = ((__global int64_t *) mem_77626)[gtid_76004];\n            \n            int64_t min_arg_76016;\n            \n            min_arg_76016 = ((__global int64_t *) mem_77629)[gtid_76004];\n            \n            int64_t min_res_76017;\n            \n            min_res_76017 = ((__global int64_t *) mem_77632)[gtid_76004];\n            \n            float max_res_76018;\n            \n            max_res_76018 = ((__global float *) mem_77635)[gtid_76004];\n         ",
            "   \n            int64_t min_arg_76019 = mul64(jump_65348, gtid_76006);\n            int64_t min_res_76020 = smin64(i_65358, min_arg_76019);\n            int64_t defunc_0_g_res_76021 = add64((int64_t) 1, min_res_76020);\n            bool init_idx_76022;\n            int64_t init_idx_76023;\n            int64_t init_idx_76024;\n            bool loop_while_76025;\n            int64_t low_76026;\n            int64_t high_76027;\n            \n            loop_while_76025 = x_65359;\n            low_76026 = (int64_t) 0;\n            high_76027 = i_65358;\n            while (loop_while_76025) {\n                int64_t x_76028 = add64(low_76026, high_76027);\n                int64_t mid_76029 = sdiv64(x_76028, (int64_t) 2);\n                bool x_76030 = sle64((int64_t) 0, mid_76029);\n                bool y_76031 = slt64(mid_76029, n_65344);\n                bool bounds_check_76032 = x_76030 && y_76031;\n                bool index_certs_76033;\n                \n                if (!bounds_check_76032) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 35) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) mid_76029;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t mid_id_76034;\n                \n                mid_id_76034 = ((__global int64_t *) mem_77622)[gtid_76004 *\n                                                                n_65344 +\n                                                                mid_76029];\n                \n                bool cond_76035 = slt64(mid_id_76034, (int64_t) 0);\n                int64_t mid_idx_76036;\n                \n                if (cond_76035) {\n                    mid_idx_76036 = (int64_t) 9223372036854775807;\n ",
            "               } else {\n                    mid_idx_76036 = mid_id_76034;\n                }\n                \n                bool cond_76037 = sle64(defunc_0_g_res_76021, mid_idx_76036);\n                int64_t loopres_76038;\n                int64_t loopres_76039;\n                \n                if (cond_76037) {\n                    int64_t loopres_t_res_76040 = sub64(mid_76029, (int64_t) 1);\n                    \n                    loopres_76038 = low_76026;\n                    loopres_76039 = loopres_t_res_76040;\n                } else {\n                    int64_t loopres_f_res_76041 = add64((int64_t) 1, mid_76029);\n                    \n                    loopres_76038 = loopres_f_res_76041;\n                    loopres_76039 = high_76027;\n                }\n                \n                bool loop_cond_76042 = sle64(loopres_76038, loopres_76039);\n                bool loop_while_tmp_79346 = loop_cond_76042;\n                int64_t low_tmp_79347 = loopres_76038;\n                int64_t high_tmp_79348 = loopres_76039;\n                \n                loop_while_76025 = loop_while_tmp_79346;\n                low_76026 = low_tmp_79347;\n                high_76027 = high_tmp_79348;\n            }\n            init_idx_76022 = loop_while_76025;\n            init_idx_76023 = low_76026;\n            init_idx_76024 = high_76027;\n            \n            bool idx_76043;\n            int64_t idx_76044;\n            int64_t idx_76045;\n            int64_t idx_76046;\n            bool loop_while_76047;\n            int64_t l_idx_76048;\n            int64_t r_idx_76049;\n            int64_t span_76050;\n            \n            loop_while_76047 = loop_cond_65369;\n            l_idx_76048 = init_idx_76023;\n            r_idx_76049 = init_idx_76023;\n            span_76050 = (int64_t) 1;\n            while (loop_while_76047) {\n                int64_t max_arg_76051 = sub64(l_idx_76048, (int64_t) 1);\n                int64_t max_res_76052 = smax64((int64_t) 0, max_arg_76051);\n                int64",
            "_t min_arg_76053 = add64((int64_t) 1, r_idx_76049);\n                int64_t min_res_76054 = smin64(min_arg_76015, min_arg_76053);\n                bool x_76055 = sle64((int64_t) 0, max_res_76052);\n                bool y_76056 = slt64(max_res_76052, n_65344);\n                bool bounds_check_76057 = x_76055 && y_76056;\n                bool index_certs_76058;\n                \n                if (!bounds_check_76057) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 36) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_76052;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_76059;\n                \n                x_76059 = ((__global int64_t *) mem_77622)[gtid_76004 *\n                                                           n_65344 +\n                                                           max_res_76052];\n                \n                int64_t abs_arg_76060 = sub64(x_76059, defunc_0_g_res_76021);\n                int64_t abs_res_76061 = abs64(abs_arg_76060);\n                bool x_76062 = sle64((int64_t) 0, min_res_76054);\n                bool y_76063 = slt64(min_res_76054, n_65344);\n                bool bounds_check_76064 = x_76062 && y_76063;\n                bool index_certs_76065;\n                \n                if (!bounds_check_76064) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) min_res_76054;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = ",
            "true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_76066;\n                \n                x_76066 = ((__global int64_t *) mem_77622)[gtid_76004 *\n                                                           n_65344 +\n                                                           min_res_76054];\n                \n                int64_t abs_arg_76067 = sub64(x_76066, defunc_0_g_res_76021);\n                int64_t abs_res_76068 = abs64(abs_arg_76067);\n                bool cond_76069 = max_res_76052 == l_idx_76048;\n                int64_t loopres_76070;\n                int64_t loopres_76071;\n                int64_t loopres_76072;\n                \n                if (cond_76069) {\n                    loopres_76070 = l_idx_76048;\n                    loopres_76071 = r_idx_76049;\n                    loopres_76072 = min_res_65364;\n                } else {\n                    bool cond_76073 = slt64(abs_res_76061, abs_res_76068);\n                    bool cond_f_res_76074 = min_res_76054 == r_idx_76049;\n                    bool x_76075 = !cond_76073;\n                    bool y_76076 = cond_f_res_76074 && x_76075;\n                    bool cond_76077 = cond_76073 || y_76076;\n                    int64_t loopres_f_res_76078;\n                    \n                    if (cond_76077) {\n                        loopres_f_res_76078 = max_res_76052;\n                    } else {\n                        loopres_f_res_76078 = l_idx_76048;\n                    }\n                    \n                    int64_t loopres_f_res_76079;\n                    \n                    if (cond_76077) {\n                        loopres_f_res_76079 = r_idx_76049;\n                    } else {\n                        loopres_f_res_76079 = min_res_76054;\n                    }\n                    \n                    int64_t loopres_f_res_76080;\n                    \n                    if (cond_76077) {\n                        int64_t loopres_",
            "f_res_t_res_76081 = add64((int64_t) 1,\n                                                                  span_76050);\n                        \n                        loopres_f_res_76080 = loopres_f_res_t_res_76081;\n                    } else {\n                        int64_t loopres_f_res_f_res_76082 = add64((int64_t) 1,\n                                                                  span_76050);\n                        \n                        loopres_f_res_76080 = loopres_f_res_f_res_76082;\n                    }\n                    loopres_76070 = loopres_f_res_76078;\n                    loopres_76071 = loopres_f_res_76079;\n                    loopres_76072 = loopres_f_res_76080;\n                }\n                \n                bool loop_cond_76083 = slt64(loopres_76072, min_res_65364);\n                bool loop_while_tmp_79349 = loop_cond_76083;\n                int64_t l_idx_tmp_79350 = loopres_76070;\n                int64_t r_idx_tmp_79351 = loopres_76071;\n                int64_t span_tmp_79352 = loopres_76072;\n                \n                loop_while_76047 = loop_while_tmp_79349;\n                l_idx_76048 = l_idx_tmp_79350;\n                r_idx_76049 = r_idx_tmp_79351;\n                span_76050 = span_tmp_79352;\n            }\n            idx_76043 = loop_while_76047;\n            idx_76044 = l_idx_76048;\n            idx_76045 = r_idx_76049;\n            idx_76046 = span_76050;\n            \n            int64_t min_res_76084 = smin64(min_arg_76016, idx_76044);\n            int64_t max_res_76085 = smax64((int64_t) 0, min_res_76084);\n            int64_t x_76086 = add64(min_res_76017, max_res_76085);\n            int64_t r_76087 = sub64(x_76086, (int64_t) 1);\n            bool x_76088 = sle64((int64_t) 0, r_76087);\n            bool y_76089 = slt64(r_76087, n_65344);\n            bool bounds_check_76090 = x_76088 && y_76089;\n            bool index_certs_76091;\n            \n            if (!bounds_check_76090) {\n                {\n                    if (atomic_c",
            "mpxchg_i32_global(global_failure, -1, 38) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) r_76087;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_76092;\n            \n            x_76092 = ((__global int64_t *) mem_77616)[gtid_76004 * n_65344 +\n                                                       r_76087];\n            \n            int64_t abs_arg_76093 = sub64(x_76092, min_res_76020);\n            int64_t abs_res_76094 = abs64(abs_arg_76093);\n            bool x_76095 = sle64((int64_t) 0, max_res_76085);\n            bool y_76096 = slt64(max_res_76085, n_65344);\n            bool bounds_check_76097 = x_76095 && y_76096;\n            bool index_certs_76098;\n            \n            if (!bounds_check_76097) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 39) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_76085;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_76099;\n            \n            x_76099 = ((__global int64_t *) mem_77616)[gtid_76004 * n_65344 +\n                                                       max_res_76085];\n            \n            int64_t abs_arg_76100 = sub64(x_76099, min_res_76020);\n            int64_t abs_res_76101 = abs64(abs_arg_76100);\n            int64_t max_res_76102 = smax64(abs_res_76094, abs_res_76101);\n            float defunc_0_f_res_76103 = sitofp_i64_f32(max_res_76102);\n            float defunc_1_f_res_76104 = max_res_76018 + defunc_0_f_res_76103;\n            \n            pre_76010 = last",
            "_res_76014;\n            pre_76011 = min_res_76020;\n            pre_76012 = max_res_76085;\n            pre_76013 = defunc_1_f_res_76104;\n        } else {\n            pre_76010 = (int64_t) 0;\n            pre_76011 = (int64_t) 0;\n            pre_76012 = (int64_t) 0;\n            pre_76013 = 0.0F;\n        }\n        color_78193[(int64_t) 0] = pre_76010;\n        color_78192[(int64_t) 0] = pre_76011;\n        color_78191[(int64_t) 0] = pre_76012;\n        color_78190[(int64_t) 0] = pre_76013;\n    }\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ltid_y_76121 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n    int64_t ltid_x_76119 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n    int32_t ltid_flat_76120 = local_tid_79332;\n    \n    if (slt64(ltid_y_76121, tile_sizze_75978) && slt64(ltid_x_76119,\n                                                       tile_sizze_75978)) {\n        color_78182[(int64_t) 0] = 0.0F;\n        color_78181[(int64_t) 0] = 0.0F;\n        color_78180[(int64_t) 0] = 0.0F;\n        color_78179[(int64_t) 0] = 0.0F;\n        color_78184[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float tmp_79353;\n    \n    tmp_79353 = color_78182[(int64_t) 0];\n    color_78183[(int64_t) 0] = tmp_79353;\n    \n    float tmp_79354;\n    \n    tmp_79354 = color_78181[(int64_t) 0];\n    color_78182[(int64_t) 0] = tmp_79354;\n    \n    float tmp_79355;\n    \n    tmp_79355 = color_78180[(int64_t) 0];\n    color_78181[(int64_t) 0] = tmp_79355;\n    \n    float tmp_79356;\n    \n    tmp_79356 = color_78179[(int64_t) 0];\n    color_78180[(int64_t) 0] = tmp_79356;\n    \n    float tmp_79357;\n    \n    tmp_79357 = color_78184[(int64_t) 0];\n    color_78179[(int64_t) 0] = tmp_79357;\n    \n    float ext_mem_77701[1];\n    float ext_mem_unused_78102[1];\n    float ext_mem_77700[1];\n    float ext_mem_unused_78107[1];\n    float ext_mem_77699[1];\n    float ext_mem_unused_78112[1];\n    float ext_mem_77698[1",
            "];\n    float ext_mem_unused_78117[1];\n    float ext_mem_77697[1];\n    float ext_mem_unused_78122[1];\n    float mem_param_77671[1];\n    float mem_param_77672[1];\n    float mem_param_77673[1];\n    float mem_param_77674[1];\n    float mem_param_77675[1];\n    float mem_param_out_78103[1];\n    float mem_param_out_78108[1];\n    float mem_param_out_78113[1];\n    float mem_param_out_78118[1];\n    float mem_param_out_78123[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_77671[i_1] = color_78183[i_1];\n    for (int32_t i_2 = 0; i_2 < 1; i_2++)\n        mem_param_out_78103[i_2] = color_78188[i_2];\n    for (int32_t i_3 = 0; i_3 < 1; i_3++)\n        mem_param_77672[i_3] = color_78182[i_3];\n    for (int32_t i_4 = 0; i_4 < 1; i_4++)\n        mem_param_out_78108[i_4] = color_78187[i_4];\n    for (int32_t i_5 = 0; i_5 < 1; i_5++)\n        mem_param_77673[i_5] = color_78181[i_5];\n    for (int32_t i_6 = 0; i_6 < 1; i_6++)\n        mem_param_out_78113[i_6] = color_78186[i_6];\n    for (int32_t i_7 = 0; i_7 < 1; i_7++)\n        mem_param_77674[i_7] = color_78180[i_7];\n    for (int32_t i_8 = 0; i_8 < 1; i_8++)\n        mem_param_out_78118[i_8] = color_78185[i_8];\n    for (int32_t i_9 = 0; i_9 < 1; i_9++)\n        mem_param_77675[i_9] = color_78179[i_9];\n    for (int32_t i_10 = 0; i_10 < 1; i_10++)\n        mem_param_out_78123[i_10] = color_78184[i_10];\n    for (int64_t tile_id_76136 = 0; tile_id_76136 < num_whole_tiles_76113;\n         tile_id_76136++) {\n        int64_t binop_x_76281 = tile_sizze_75978 * tile_id_76136;\n        int64_t ltid_y_76278 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n        int64_t ltid_x_76276 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n        int32_t ltid_flat_76277 = local_tid_79332;\n        int64_t j_76282 = ltid_x_76276 + binop_x_76281;\n        int64_t gtid_76284 = binop_x_76003 + ltid_y_76278;\n        bool binop_x_76292 = slt64(j_76282, q_65346);\n        bool binop_y_76293 = slt64(gtid_76284, m_65343);\n        bool cond_76294 = binop_x_76292 && ",
            "binop_y_76293;\n        float pre2d_76295;\n        \n        if (cond_76294) {\n            float x_76296;\n            \n            x_76296 = ((__global float *) mem_77640)[gtid_76284 * q_65346 +\n                                                     j_76282];\n            pre2d_76295 = x_76296;\n        } else {\n            pre2d_76295 = 0.0F;\n        }\n        ((__local float *) color_78189)[ltid_y_76278 * tile_sizze_75978 +\n                                        ltid_x_76276] = pre2d_76295;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_76305 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n        int64_t ltid_x_76303 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n        int32_t ltid_flat_76304 = local_tid_79332;\n        int64_t gtid_76307 = binop_x_76003 + ltid_y_76305;\n        int64_t gtid_76309 = binop_x_76005 + ltid_x_76303;\n        float acc_76315;\n        \n        acc_76315 = mem_param_77671[(int64_t) 0];\n        \n        float acc_76316;\n        \n        acc_76316 = mem_param_77672[(int64_t) 0];\n        \n        float acc_76317;\n        \n        acc_76317 = mem_param_77673[(int64_t) 0];\n        \n        float acc_76318;\n        \n        acc_76318 = mem_param_77674[(int64_t) 0];\n        \n        float acc_76319;\n        \n        acc_76319 = mem_param_77675[(int64_t) 0];\n        \n        bool binop_x_76323 = slt64(gtid_76307, m_65343);\n        bool binop_y_76324 = slt64(gtid_76309, n_m_65352);\n        bool cond_76325 = binop_x_76323 && binop_y_76324;\n        float acc_76326;\n        float acc_76327;\n        float acc_76328;\n        float acc_76329;\n        float acc_76330;\n        \n        if (cond_76325) {\n            int64_t last_res_76310;\n            \n            last_res_76310 = color_78193[(int64_t) 0];\n            \n            int64_t min_res_76311;\n            \n            min_res_76311 = color_78192[(int64_t) 0];\n            \n            int64_t max_res_76312;\n            \n            max_res_76312 = color_78191[(int64_t) 0];\n        ",
            "    \n            float defunc_1_f_res_76313;\n            \n            defunc_1_f_res_76313 = color_78190[(int64_t) 0];\n            \n            float x_76331;\n            float x_76332;\n            float x_76333;\n            float x_76334;\n            float x_76335;\n            float redout_76907;\n            float redout_76908;\n            float redout_76909;\n            float redout_76910;\n            float redout_76911;\n            \n            redout_76907 = acc_76315;\n            redout_76908 = acc_76316;\n            redout_76909 = acc_76317;\n            redout_76910 = acc_76318;\n            redout_76911 = acc_76319;\n            for (int64_t i_76912 = 0; i_76912 < tile_sizze_75978; i_76912++) {\n                int64_t index_primexp_76975 = add64(binop_x_76281, i_76912);\n                float x_76352;\n                \n                x_76352 = ((__local float *) color_78189)[ltid_y_76305 *\n                                                          tile_sizze_75978 +\n                                                          i_76912];\n                \n                bool cond_76353 = sle64(last_res_76310, index_primexp_76975);\n                int64_t defunc_0_f_res_76354;\n                \n                if (cond_76353) {\n                    defunc_0_f_res_76354 = (int64_t) 0;\n                } else {\n                    int64_t i_76355 = add64(max_res_76312, index_primexp_76975);\n                    int64_t defunc_0_add_arg_76356;\n                    \n                    defunc_0_add_arg_76356 = ((__global\n                                               int64_t *) mem_77616)[gtid_76307 *\n                                                                     n_65344 +\n                                                                     i_76355];\n                    \n                    int64_t defunc_1_add_res_76357 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_76356);\n                    \n                    defunc_",
            "0_f_res_76354 = defunc_1_add_res_76357;\n                }\n                \n                int64_t binop_p_76358 = sub64(defunc_0_f_res_76354,\n                                              min_res_76311);\n                float defunc_0_f_res_76359 = sitofp_i64_f32(binop_p_76358);\n                float abs_res_76360 = (float) fabs(defunc_0_f_res_76359);\n                float tmp1_76361 = abs_res_76360 / defunc_1_f_res_76313;\n                float x_76362 = tmp1_76361 * tmp1_76361;\n                float y_76363 = tmp1_76361 * x_76362;\n                float tmp2_76364 = 1.0F - y_76363;\n                float x_76365 = tmp2_76364 * tmp2_76364;\n                float tmp3_76366 = tmp2_76364 * x_76365;\n                float w_j_76367 = x_76352 * tmp3_76366;\n                float xw_j_76368 = defunc_0_f_res_76359 * w_j_76367;\n                float x2w_j_76369 = defunc_0_f_res_76359 * xw_j_76368;\n                float x3w_j_76370 = defunc_0_f_res_76359 * x2w_j_76369;\n                float x4w_j_76371 = defunc_0_f_res_76359 * x3w_j_76370;\n                float defunc_1_op_res_76346 = w_j_76367 + redout_76907;\n                float defunc_1_op_res_76347 = xw_j_76368 + redout_76908;\n                float defunc_1_op_res_76348 = x2w_j_76369 + redout_76909;\n                float defunc_1_op_res_76349 = x3w_j_76370 + redout_76910;\n                float defunc_1_op_res_76350 = x4w_j_76371 + redout_76911;\n                float redout_tmp_79373 = defunc_1_op_res_76346;\n                float redout_tmp_79374 = defunc_1_op_res_76347;\n                float redout_tmp_79375 = defunc_1_op_res_76348;\n                float redout_tmp_79376 = defunc_1_op_res_76349;\n                float redout_tmp_79377 = defunc_1_op_res_76350;\n                \n                redout_76907 = redout_tmp_79373;\n                redout_76908 = redout_tmp_79374;\n                redout_76909 = redout_tmp_79375;\n                redout_76910 = redout_tmp_79376;\n                redout_76911 = redout_tmp_79377;\n       ",
            "     }\n            x_76331 = redout_76907;\n            x_76332 = redout_76908;\n            x_76333 = redout_76909;\n            x_76334 = redout_76910;\n            x_76335 = redout_76911;\n            acc_76326 = x_76331;\n            acc_76327 = x_76332;\n            acc_76328 = x_76333;\n            acc_76329 = x_76334;\n            acc_76330 = x_76335;\n        } else {\n            acc_76326 = acc_76315;\n            acc_76327 = acc_76316;\n            acc_76328 = acc_76317;\n            acc_76329 = acc_76318;\n            acc_76330 = acc_76319;\n        }\n        mem_param_out_78103[(int64_t) 0] = acc_76326;\n        mem_param_out_78108[(int64_t) 0] = acc_76327;\n        mem_param_out_78113[(int64_t) 0] = acc_76328;\n        mem_param_out_78118[(int64_t) 0] = acc_76329;\n        mem_param_out_78123[(int64_t) 0] = acc_76330;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_79358[1];\n        \n        for (int32_t i_11 = 0; i_11 < 1; i_11++)\n            mem_param_tmp_79358[i_11] = mem_param_out_78103[i_11];\n        \n        float mem_param_out_tmp_79359[1];\n        \n        for (int32_t i_12 = 0; i_12 < 1; i_12++)\n            mem_param_out_tmp_79359[i_12] = mem_param_77671[i_12];\n        \n        float mem_param_tmp_79360[1];\n        \n        for (int32_t i_13 = 0; i_13 < 1; i_13++)\n            mem_param_tmp_79360[i_13] = mem_param_out_78108[i_13];\n        \n        float mem_param_out_tmp_79361[1];\n        \n        for (int32_t i_14 = 0; i_14 < 1; i_14++)\n            mem_param_out_tmp_79361[i_14] = mem_param_77672[i_14];\n        \n        float mem_param_tmp_79362[1];\n        \n        for (int32_t i_15 = 0; i_15 < 1; i_15++)\n            mem_param_tmp_79362[i_15] = mem_param_out_78113[i_15];\n        \n        float mem_param_out_tmp_79363[1];\n        \n        for (int32_t i_16 = 0; i_16 < 1; i_16++)\n            mem_param_out_tmp_79363[i_16] = mem_param_77673[i_16];\n        \n        float mem_param_tmp_79364[1];\n        \n        for (int32_t i_17 = 0; i_17 < ",
            "1; i_17++)\n            mem_param_tmp_79364[i_17] = mem_param_out_78118[i_17];\n        \n        float mem_param_out_tmp_79365[1];\n        \n        for (int32_t i_18 = 0; i_18 < 1; i_18++)\n            mem_param_out_tmp_79365[i_18] = mem_param_77674[i_18];\n        \n        float mem_param_tmp_79366[1];\n        \n        for (int32_t i_19 = 0; i_19 < 1; i_19++)\n            mem_param_tmp_79366[i_19] = mem_param_out_78123[i_19];\n        \n        float mem_param_out_tmp_79367[1];\n        \n        for (int32_t i_20 = 0; i_20 < 1; i_20++)\n            mem_param_out_tmp_79367[i_20] = mem_param_77675[i_20];\n        for (int32_t i_21 = 0; i_21 < 1; i_21++)\n            mem_param_77671[i_21] = mem_param_tmp_79358[i_21];\n        for (int32_t i_22 = 0; i_22 < 1; i_22++)\n            mem_param_out_78103[i_22] = mem_param_out_tmp_79359[i_22];\n        for (int32_t i_23 = 0; i_23 < 1; i_23++)\n            mem_param_77672[i_23] = mem_param_tmp_79360[i_23];\n        for (int32_t i_24 = 0; i_24 < 1; i_24++)\n            mem_param_out_78108[i_24] = mem_param_out_tmp_79361[i_24];\n        for (int32_t i_25 = 0; i_25 < 1; i_25++)\n            mem_param_77673[i_25] = mem_param_tmp_79362[i_25];\n        for (int32_t i_26 = 0; i_26 < 1; i_26++)\n            mem_param_out_78113[i_26] = mem_param_out_tmp_79363[i_26];\n        for (int32_t i_27 = 0; i_27 < 1; i_27++)\n            mem_param_77674[i_27] = mem_param_tmp_79364[i_27];\n        for (int32_t i_28 = 0; i_28 < 1; i_28++)\n            mem_param_out_78118[i_28] = mem_param_out_tmp_79365[i_28];\n        for (int32_t i_29 = 0; i_29 < 1; i_29++)\n            mem_param_77675[i_29] = mem_param_tmp_79366[i_29];\n        for (int32_t i_30 = 0; i_30 < 1; i_30++)\n            mem_param_out_78123[i_30] = mem_param_out_tmp_79367[i_30];\n    }\n    for (int32_t i_31 = 0; i_31 < 1; i_31++)\n        ext_mem_77701[i_31] = mem_param_77671[i_31];\n    for (int32_t i_32 = 0; i_32 < 1; i_32++)\n        ext_mem_unused_78102[i_32] = mem_param_out_78103[i_32];\n    for (int32_t i_33 = 0",
            "; i_33 < 1; i_33++)\n        ext_mem_77700[i_33] = mem_param_77672[i_33];\n    for (int32_t i_34 = 0; i_34 < 1; i_34++)\n        ext_mem_unused_78107[i_34] = mem_param_out_78108[i_34];\n    for (int32_t i_35 = 0; i_35 < 1; i_35++)\n        ext_mem_77699[i_35] = mem_param_77673[i_35];\n    for (int32_t i_36 = 0; i_36 < 1; i_36++)\n        ext_mem_unused_78112[i_36] = mem_param_out_78113[i_36];\n    for (int32_t i_37 = 0; i_37 < 1; i_37++)\n        ext_mem_77698[i_37] = mem_param_77674[i_37];\n    for (int32_t i_38 = 0; i_38 < 1; i_38++)\n        ext_mem_unused_78117[i_38] = mem_param_out_78118[i_38];\n    for (int32_t i_39 = 0; i_39 < 1; i_39++)\n        ext_mem_77697[i_39] = mem_param_77675[i_39];\n    for (int32_t i_40 = 0; i_40 < 1; i_40++)\n        ext_mem_unused_78122[i_40] = mem_param_out_78123[i_40];\n    if (cond_76414) {\n        float tmp_79378;\n        \n        tmp_79378 = ext_mem_77701[(int64_t) 0];\n        color_78179[(int64_t) 0] = tmp_79378;\n        \n        float tmp_79379;\n        \n        tmp_79379 = ext_mem_77700[(int64_t) 0];\n        color_78180[(int64_t) 0] = tmp_79379;\n        \n        float tmp_79380;\n        \n        tmp_79380 = ext_mem_77699[(int64_t) 0];\n        color_78181[(int64_t) 0] = tmp_79380;\n        \n        float tmp_79381;\n        \n        tmp_79381 = ext_mem_77698[(int64_t) 0];\n        color_78182[(int64_t) 0] = tmp_79381;\n        \n        float tmp_79382;\n        \n        tmp_79382 = ext_mem_77697[(int64_t) 0];\n        color_78183[(int64_t) 0] = tmp_79382;\n    } else {\n        int64_t binop_x_76560 = tile_sizze_75978 * num_whole_tiles_76113;\n        int64_t ltid_y_76557 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n        int64_t ltid_x_76555 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n        int32_t ltid_flat_76556 = local_tid_79332;\n        int64_t j_76561 = ltid_x_76555 + binop_x_76560;\n        int64_t gtid_76563 = binop_x_76003 + ltid_y_76557;\n        bool binop_x_76571 = slt64(j_76561, q_65346);\n        bool binop_y_76572 = slt64(gtid_76",
            "563, m_65343);\n        bool cond_76573 = binop_x_76571 && binop_y_76572;\n        float pre2d_76574;\n        \n        if (cond_76573) {\n            float x_76575;\n            \n            x_76575 = ((__global float *) mem_77640)[gtid_76563 * q_65346 +\n                                                     j_76561];\n            pre2d_76574 = x_76575;\n        } else {\n            pre2d_76574 = 0.0F;\n        }\n        ((__local float *) color_78189)[ltid_y_76557 * tile_sizze_75978 +\n                                        ltid_x_76555] = pre2d_76574;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_76585 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n        int64_t ltid_x_76583 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n        int32_t ltid_flat_76584 = local_tid_79332;\n        int64_t gtid_76587 = binop_x_76003 + ltid_y_76585;\n        int64_t gtid_76589 = binop_x_76005 + ltid_x_76583;\n        float acc_76595;\n        \n        acc_76595 = ext_mem_77701[(int64_t) 0];\n        \n        float acc_76596;\n        \n        acc_76596 = ext_mem_77700[(int64_t) 0];\n        \n        float acc_76597;\n        \n        acc_76597 = ext_mem_77699[(int64_t) 0];\n        \n        float acc_76598;\n        \n        acc_76598 = ext_mem_77698[(int64_t) 0];\n        \n        float acc_76599;\n        \n        acc_76599 = ext_mem_77697[(int64_t) 0];\n        \n        bool binop_x_76603 = slt64(gtid_76587, m_65343);\n        bool binop_y_76604 = slt64(gtid_76589, n_m_65352);\n        bool cond_76605 = binop_x_76603 && binop_y_76604;\n        float acc_76606;\n        float acc_76607;\n        float acc_76608;\n        float acc_76609;\n        float acc_76610;\n        \n        if (cond_76605) {\n            int64_t last_res_76590;\n            \n            last_res_76590 = color_78193[(int64_t) 0];\n            \n            int64_t min_res_76591;\n            \n            min_res_76591 = color_78192[(int64_t) 0];\n            \n            int64_t max_res_76592;\n            \n            ma",
            "x_res_76592 = color_78191[(int64_t) 0];\n            \n            float defunc_1_f_res_76593;\n            \n            defunc_1_f_res_76593 = color_78190[(int64_t) 0];\n            \n            float x_76611;\n            float x_76612;\n            float x_76613;\n            float x_76614;\n            float x_76615;\n            float redout_76913;\n            float redout_76914;\n            float redout_76915;\n            float redout_76916;\n            float redout_76917;\n            \n            redout_76913 = acc_76595;\n            redout_76914 = acc_76596;\n            redout_76915 = acc_76597;\n            redout_76916 = acc_76598;\n            redout_76917 = acc_76599;\n            for (int64_t i_76918 = 0; i_76918 < residual_input_76413;\n                 i_76918++) {\n                int64_t index_primexp_76973 = add64(binop_x_76560, i_76918);\n                float x_76632;\n                \n                x_76632 = ((__local float *) color_78189)[ltid_y_76585 *\n                                                          tile_sizze_75978 +\n                                                          i_76918];\n                \n                bool cond_76633 = sle64(last_res_76590, index_primexp_76973);\n                int64_t defunc_0_f_res_76634;\n                \n                if (cond_76633) {\n                    defunc_0_f_res_76634 = (int64_t) 0;\n                } else {\n                    int64_t i_76635 = add64(max_res_76592, index_primexp_76973);\n                    int64_t defunc_0_add_arg_76636;\n                    \n                    defunc_0_add_arg_76636 = ((__global\n                                               int64_t *) mem_77616)[gtid_76587 *\n                                                                     n_65344 +\n                                                                     i_76635];\n                    \n                    int64_t defunc_1_add_res_76637 = add64((int64_t) 1,\n                                                           defu",
            "nc_0_add_arg_76636);\n                    \n                    defunc_0_f_res_76634 = defunc_1_add_res_76637;\n                }\n                \n                int64_t binop_p_76638 = sub64(defunc_0_f_res_76634,\n                                              min_res_76591);\n                float defunc_0_f_res_76639 = sitofp_i64_f32(binop_p_76638);\n                float abs_res_76640 = (float) fabs(defunc_0_f_res_76639);\n                float tmp1_76641 = abs_res_76640 / defunc_1_f_res_76593;\n                float x_76642 = tmp1_76641 * tmp1_76641;\n                float y_76643 = tmp1_76641 * x_76642;\n                float tmp2_76644 = 1.0F - y_76643;\n                float x_76645 = tmp2_76644 * tmp2_76644;\n                float tmp3_76646 = tmp2_76644 * x_76645;\n                float w_j_76647 = x_76632 * tmp3_76646;\n                float xw_j_76648 = defunc_0_f_res_76639 * w_j_76647;\n                float x2w_j_76649 = defunc_0_f_res_76639 * xw_j_76648;\n                float x3w_j_76650 = defunc_0_f_res_76639 * x2w_j_76649;\n                float x4w_j_76651 = defunc_0_f_res_76639 * x3w_j_76650;\n                float defunc_1_op_res_76626 = w_j_76647 + redout_76913;\n                float defunc_1_op_res_76627 = xw_j_76648 + redout_76914;\n                float defunc_1_op_res_76628 = x2w_j_76649 + redout_76915;\n                float defunc_1_op_res_76629 = x3w_j_76650 + redout_76916;\n                float defunc_1_op_res_76630 = x4w_j_76651 + redout_76917;\n                float redout_tmp_79383 = defunc_1_op_res_76626;\n                float redout_tmp_79384 = defunc_1_op_res_76627;\n                float redout_tmp_79385 = defunc_1_op_res_76628;\n                float redout_tmp_79386 = defunc_1_op_res_76629;\n                float redout_tmp_79387 = defunc_1_op_res_76630;\n                \n                redout_76913 = redout_tmp_79383;\n                redout_76914 = redout_tmp_79384;\n                redout_76915 = redout_tmp_79385;\n                redout_76916 = redou",
            "t_tmp_79386;\n                redout_76917 = redout_tmp_79387;\n            }\n            x_76611 = redout_76913;\n            x_76612 = redout_76914;\n            x_76613 = redout_76915;\n            x_76614 = redout_76916;\n            x_76615 = redout_76917;\n            acc_76606 = x_76611;\n            acc_76607 = x_76612;\n            acc_76608 = x_76613;\n            acc_76609 = x_76614;\n            acc_76610 = x_76615;\n        } else {\n            acc_76606 = acc_76595;\n            acc_76607 = acc_76596;\n            acc_76608 = acc_76597;\n            acc_76609 = acc_76598;\n            acc_76610 = acc_76599;\n        }\n        color_78188[(int64_t) 0] = acc_76606;\n        color_78187[(int64_t) 0] = acc_76607;\n        color_78186[(int64_t) 0] = acc_76608;\n        color_78185[(int64_t) 0] = acc_76609;\n        color_78184[(int64_t) 0] = acc_76610;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float tmp_79388;\n        \n        tmp_79388 = color_78188[(int64_t) 0];\n        color_78179[(int64_t) 0] = tmp_79388;\n        \n        float tmp_79389;\n        \n        tmp_79389 = color_78187[(int64_t) 0];\n        color_78180[(int64_t) 0] = tmp_79389;\n        \n        float tmp_79390;\n        \n        tmp_79390 = color_78186[(int64_t) 0];\n        color_78181[(int64_t) 0] = tmp_79390;\n        \n        float tmp_79391;\n        \n        tmp_79391 = color_78185[(int64_t) 0];\n        color_78182[(int64_t) 0] = tmp_79391;\n        \n        float tmp_79392;\n        \n        tmp_79392 = color_78184[(int64_t) 0];\n        color_78183[(int64_t) 0] = tmp_79392;\n    }\n    \n    int64_t ltid_y_76671 = sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n    int64_t ltid_x_76669 = sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n    int32_t ltid_flat_76670 = local_tid_79332;\n    \n    if (slt64(ltid_y_76671, tile_sizze_75978) && slt64(ltid_x_76669,\n                                                       tile_sizze_75978)) {\n        int64_t gtid_76673 = binop_x_76003 + ltid_y_76671;\n        int64_t gtid_7667",
            "5 = binop_x_76005 + ltid_x_76669;\n        bool binop_x_76681 = slt64(gtid_76673, m_65343);\n        bool binop_y_76682 = slt64(gtid_76675, n_m_65352);\n        bool cond_76683 = binop_x_76681 && binop_y_76682;\n        float postlude_76684;\n        float postlude_76685;\n        \n        if (cond_76683) {\n            float defunc_2_reduce_res_76676;\n            \n            defunc_2_reduce_res_76676 = color_78179[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76677;\n            \n            defunc_2_reduce_res_76677 = color_78180[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76678;\n            \n            defunc_2_reduce_res_76678 = color_78181[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76679;\n            \n            defunc_2_reduce_res_76679 = color_78182[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76680;\n            \n            defunc_2_reduce_res_76680 = color_78183[(int64_t) 0];\n            \n            int64_t last_res_76686;\n            \n            last_res_76686 = color_78193[(int64_t) 0];\n            \n            int64_t min_res_76687;\n            \n            min_res_76687 = color_78192[(int64_t) 0];\n            \n            int64_t max_res_76688;\n            \n            max_res_76688 = color_78191[(int64_t) 0];\n            \n            float defunc_1_f_res_76689;\n            \n            defunc_1_f_res_76689 = color_78190[(int64_t) 0];\n            \n            float x_76691 = defunc_2_reduce_res_76678 *\n                  defunc_2_reduce_res_76680;\n            float y_76692 = defunc_2_reduce_res_76679 *\n                  defunc_2_reduce_res_76679;\n            float a12_76693 = x_76691 - y_76692;\n            float x_76694 = defunc_2_reduce_res_76678 *\n                  defunc_2_reduce_res_76679;\n            float y_76695 = defunc_2_reduce_res_76677 *\n                  defunc_2_reduce_res_76680;\n            float b12_76696 = x_76694 - y_76695;\n            float x_76697 = defunc_2",
            "_reduce_res_76677 *\n                  defunc_2_reduce_res_76679;\n            float y_76698 = defunc_2_reduce_res_76678 *\n                  defunc_2_reduce_res_76678;\n            float c12_76699 = x_76697 - y_76698;\n            float x_76700 = defunc_2_reduce_res_76676 *\n                  defunc_2_reduce_res_76680;\n            float b2_76701 = x_76700 - y_76698;\n            float x_76702 = defunc_2_reduce_res_76677 *\n                  defunc_2_reduce_res_76678;\n            float y_76703 = defunc_2_reduce_res_76676 *\n                  defunc_2_reduce_res_76679;\n            float c2_76704 = x_76702 - y_76703;\n            float x_76705 = defunc_2_reduce_res_76676 * a12_76693;\n            float y_76706 = defunc_2_reduce_res_76677 * b12_76696;\n            float x_76707 = x_76705 + y_76706;\n            float y_76708 = defunc_2_reduce_res_76678 * c12_76699;\n            float y_76709 = x_76707 + y_76708;\n            float det_76710 = 1.0F / y_76709;\n            float a12_76711 = a12_76693 * det_76710;\n            float b12_76712 = b12_76696 * det_76710;\n            float c12_76713 = c12_76699 * det_76710;\n            float b2_76714 = b2_76701 * det_76710;\n            float c2_76715 = c2_76704 * det_76710;\n            float defunc_2_reduce_res_76716;\n            float defunc_2_reduce_res_76717;\n            float redout_76919;\n            float redout_76920;\n            \n            redout_76919 = 0.0F;\n            redout_76920 = 0.0F;\n            for (int64_t i_76921 = 0; i_76921 < q_65346; i_76921++) {\n                float x_76725;\n                \n                x_76725 = ((__global float *) mem_77640)[gtid_76673 * q_65346 +\n                                                         i_76921];\n                \n                bool cond_76726 = sle64(last_res_76686, i_76921);\n                int64_t defunc_0_f_res_76727;\n                \n                if (cond_76726) {\n                    defunc_0_f_res_76727 = (int64_t) 0;\n                } else {\n                    int64",
            "_t i_76728 = add64(max_res_76688, i_76921);\n                    int64_t defunc_0_add_arg_76729;\n                    \n                    defunc_0_add_arg_76729 = ((__global\n                                               int64_t *) mem_77616)[gtid_76673 *\n                                                                     n_65344 +\n                                                                     i_76728];\n                    \n                    int64_t defunc_1_add_res_76730 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_76729);\n                    \n                    defunc_0_f_res_76727 = defunc_1_add_res_76730;\n                }\n                \n                int64_t binop_p_76731 = sub64(defunc_0_f_res_76727,\n                                              min_res_76687);\n                float defunc_0_f_res_76732 = sitofp_i64_f32(binop_p_76731);\n                float abs_res_76733 = (float) fabs(defunc_0_f_res_76732);\n                float tmp1_76734 = abs_res_76733 / defunc_1_f_res_76689;\n                float x_76735 = tmp1_76734 * tmp1_76734;\n                float y_76736 = tmp1_76734 * x_76735;\n                float tmp2_76737 = 1.0F - y_76736;\n                float x_76738 = tmp2_76737 * tmp2_76737;\n                float tmp3_76739 = tmp2_76737 * x_76738;\n                float tmp4_76740 = x_76725 * tmp3_76739;\n                float defunc_1_f_res_76741 = defunc_0_f_res_76732 * tmp4_76740;\n                float defunc_1_f_res_76742 = defunc_0_f_res_76732 *\n                      defunc_1_f_res_76741;\n                float defunc_0_f_res_76743;\n                \n                if (cond_76726) {\n                    defunc_0_f_res_76743 = 0.0F;\n                } else {\n                    int64_t i_76744 = add64(max_res_76688, i_76921);\n                    float defunc_0_add_arg_76745;\n                    \n                    defunc_0_add_arg_76745 = ((__global\n                                            ",
            "   float *) mem_77612)[gtid_76673 *\n                                                                   n_65344 +\n                                                                   i_76744];\n                    defunc_0_f_res_76743 = defunc_0_add_arg_76745;\n                }\n                \n                float x_76746 = a12_76711 * tmp4_76740;\n                float y_76747 = b12_76712 * defunc_1_f_res_76741;\n                float x_76748 = x_76746 + y_76747;\n                float y_76749 = c12_76713 * defunc_1_f_res_76742;\n                float x_76750 = x_76748 + y_76749;\n                float defunc_9_fit_fun_res_76751 = defunc_0_f_res_76743 *\n                      x_76750;\n                float x_76752 = b12_76712 * tmp4_76740;\n                float y_76753 = b2_76714 * defunc_1_f_res_76741;\n                float x_76754 = x_76752 + y_76753;\n                float y_76755 = c2_76715 * defunc_1_f_res_76742;\n                float x_76756 = x_76754 + y_76755;\n                float defunc_9_slope_fun_res_76757 = defunc_0_f_res_76743 *\n                      x_76756;\n                float defunc_1_op_res_76720 = defunc_9_fit_fun_res_76751 +\n                      redout_76919;\n                float defunc_1_op_res_76723 = defunc_9_slope_fun_res_76757 +\n                      redout_76920;\n                float redout_tmp_79393 = defunc_1_op_res_76720;\n                float redout_tmp_79394 = defunc_1_op_res_76723;\n                \n                redout_76919 = redout_tmp_79393;\n                redout_76920 = redout_tmp_79394;\n            }\n            defunc_2_reduce_res_76716 = redout_76919;\n            defunc_2_reduce_res_76717 = redout_76920;\n            postlude_76684 = defunc_2_reduce_res_76716;\n            postlude_76685 = defunc_2_reduce_res_76717;\n        } else {\n            postlude_76684 = 0.0F;\n            postlude_76685 = 0.0F;\n        }\n        color_78185[(int64_t) 0] = postlude_76684;\n        color_78184[(int64_t) 0] = postlude_76685;\n    }\n    barrier(",
            "CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_79395 = gid_x_75975 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n    int64_t thread_out_index_79396 = gid_y_75976 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n    \n    if (slt64(thread_out_index_79395, m_65343) && slt64(thread_out_index_79396,\n                                                        n_m_65352)) {\n        float tmp_79397;\n        \n        tmp_79397 = color_78185[(int64_t) 0];\n        ((__global float *) mem_77738)[thread_out_index_79395 * n_m_65352 +\n                                       thread_out_index_79396] = tmp_79397;\n    }\n    \n    int64_t thread_out_index_79398 = gid_x_75975 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79336));\n    int64_t thread_out_index_79399 = gid_y_75976 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79337));\n    \n    if (slt64(thread_out_index_79398, m_65343) && slt64(thread_out_index_79399,\n                                                        n_m_65352)) {\n        float tmp_79400;\n        \n        tmp_79400 = color_78184[(int64_t) 0];\n        ((__global float *) mem_77742)[thread_out_index_79398 * n_m_65352 +\n                                       thread_out_index_79399] = tmp_79400;\n    }\n    \n  error_7:\n    return;\n    #undef tile_sizze_75978\n}\n__kernel void mainzisegred_large_68229(__global int *global_failure,\n                                       uint sync_arr_mem_78581_backing_offset_0,\n                                       uint red_arr_mem_78579_backing_offset_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68223,\n                                       int64_t groups_per_segment_78565,\n                            ",
            "           int64_t elements_per_thread_78566,\n                                       int64_t virt_num_groups_78567,\n                                       int64_t threads_per_segment_78569,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77179,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78570,\n                                       __global\n                                       unsigned char *mainzicounter_mem_78572)\n{\n    #define segred_group_sizze_68222 (mainzisegred_group_sizze_67302)\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_78581_backing_1 =\n                           &shared_mem[sync_arr_mem_78581_backing_offset_0];\n    volatile unsigned char *red_arr_mem_78579_backing_0 =\n                           &shared_mem[red_arr_mem_78579_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78574;\n    int32_t local_tid_78575;\n    int64_t group_sizze_78578;\n    int32_t wave_sizze_78577;\n    int32_t group_tid_78576;\n    \n    global_tid_78574 = get_global_id(0);\n    local_tid_78575 = get_local_id(0);\n    group_sizze_78578 = get_local_size(0);\n    wave_sizze_78577 = LOCKSTEP_WIDTH;\n    group_tid_78576 = get_group_id(0);\n    \n    int32_t phys_tid_68229 = global_tid_78574;\n    __local unsigned char *red_arr_mem_78579;\n    \n    red_arr_mem_78579 = (__local unsigned char *) red_arr_mem_78579_backing_0;\n    \n    __local unsigned char *sync_arr_mem_78581;\n    \n    sync_arr_mem_78581 = (__",
            "local unsigned char *) sync_arr_mem_78581_backing_1;\n    \n    int32_t phys_group_id_78583;\n    \n    phys_group_id_78583 = get_group_id(0);\n    for (int32_t i_78584 = 0; i_78584 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_78567) - phys_group_id_78583,\n                   sext_i64_i32(num_groups_68223)); i_78584++) {\n        int32_t virt_group_id_78585 = phys_group_id_78583 + i_78584 *\n                sext_i64_i32(num_groups_68223);\n        int32_t flat_segment_id_78586 = squot32(virt_group_id_78585,\n                                                sext_i64_i32(groups_per_segment_78565));\n        int64_t global_tid_78587 = srem64(sext_i32_i64(virt_group_id_78585) *\n                                          segred_group_sizze_68222 +\n                                          sext_i32_i64(local_tid_78575),\n                                          segred_group_sizze_68222 *\n                                          groups_per_segment_78565);\n        int64_t slice_78588 = n_m_65352;\n        int64_t slice_78589 = m_65343 * slice_78588;\n        int64_t gtid_68226 = squot64(sext_i32_i64(flat_segment_id_78586),\n                                     slice_78588);\n        int64_t remnant_78590 = sext_i32_i64(flat_segment_id_78586) -\n                gtid_68226 * slice_78588;\n        int64_t gtid_68227 = remnant_78590;\n        int64_t remnant_78591 = remnant_78590 - gtid_68227;\n        int64_t gtid_68228;\n        float x_acc_78592;\n        int64_t chunk_sizze_78593 = smin64(elements_per_thread_78566,\n                                           sdiv_up64(q_65346 - global_tid_78587,\n                                                     threads_per_segment_78569));\n        float x_68230;\n        float x_68231;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_78592 = 0.0F;\n        }\n        for (int64_t i_78597 = 0; i_78597 < chunk_sizze_78593; i_78597++) {\n            gtid_68228 = global_tid_78587 + threads_per_segment_78569 * i_78597;\n          ",
            "  // apply map function\n            {\n                int64_t last_res_68233;\n                \n                last_res_68233 = ((__global int64_t *) mem_77082)[gtid_68226 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74680 = mul64(jump_65348, gtid_68227);\n                int64_t index_primexp_74681 = smin64(i_65358, binop_y_74680);\n                float defunc_1_f_res_68241;\n                \n                defunc_1_f_res_68241 = ((__global\n                                         float *) mem_77174)[gtid_68226 *\n                                                             n_m_65352 +\n                                                             gtid_68227];\n                \n                float x_68243;\n                \n                x_68243 = ((__global float *) mem_77114)[gtid_68226 * q_65346 +\n                                                         gtid_68228];\n                \n                bool cond_68244 = sle64(last_res_68233, gtid_68228);\n                int64_t defunc_0_f_res_68245;\n                \n                if (cond_68244) {\n                    defunc_0_f_res_68245 = (int64_t) 0;\n                } else {\n                    int64_t max_res_68240;\n                    \n                    max_res_68240 = ((__global\n                                      int64_t *) mem_77170)[gtid_68226 *\n                                                            n_m_65352 +\n                                                            gtid_68227];\n                    \n                    int64_t i_68246 = add64(gtid_68228, max_res_68240);\n                    int64_t defunc_0_add_arg_68247;\n                    \n                    defunc_0_add_arg_68247 = ((__global\n                                               int64_t *) mem_77090)[gtid_68226 *\n                                                                ",
            "     n_65344 +\n                                                                     i_68246];\n                    \n                    int64_t defunc_1_add_res_68248 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68247);\n                    \n                    defunc_0_f_res_68245 = defunc_1_add_res_68248;\n                }\n                \n                int64_t binop_p_68249 = sub64(defunc_0_f_res_68245,\n                                              index_primexp_74681);\n                float defunc_0_f_res_68250 = sitofp_i64_f32(binop_p_68249);\n                float abs_res_68251 = (float) fabs(defunc_0_f_res_68250);\n                float tmp1_68252 = abs_res_68251 / defunc_1_f_res_68241;\n                float x_68253 = tmp1_68252 * tmp1_68252;\n                float y_68254 = tmp1_68252 * x_68253;\n                float tmp2_68255 = 1.0F - y_68254;\n                float x_68256 = tmp2_68255 * tmp2_68255;\n                float tmp3_68257 = tmp2_68255 * x_68256;\n                float w_j_68258 = x_68243 * tmp3_68257;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_68230 = x_acc_78592;\n                }\n                // load new values\n                {\n                    x_68231 = w_j_68258;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_68232 = x_68230 + x_68231;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_78592 = defunc_1_op_res_68232;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_68230 = x_acc_78592;\n            ((__local\n              float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575)] =\n                x_68230;\n        }\n        barrier(CLK_LO",
            "CAL_MEM_FENCE);\n        \n        int32_t offset_78598;\n        int32_t skip_waves_78599 = 1;\n        float x_78594;\n        float x_78595;\n        \n        offset_78598 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_78575,\n                      sext_i64_i32(segred_group_sizze_68222))) {\n                x_78594 = ((__local\n                            float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575 +\n                                                        offset_78598)];\n            }\n        }\n        offset_78598 = 1;\n        while (slt32(offset_78598, wave_sizze_78577)) {\n            if (slt32(local_tid_78575 + offset_78598,\n                      sext_i64_i32(segred_group_sizze_68222)) &&\n                ((local_tid_78575 - squot32(local_tid_78575, wave_sizze_78577) *\n                  wave_sizze_78577) & (2 * offset_78598 - 1)) == 0) {\n                // read array element\n                {\n                    x_78595 = ((volatile __local\n                                float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575 +\n                                                            offset_78598)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78596 = x_78594 + x_78595;\n                    \n                    x_78594 = defunc_1_op_res_78596;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575)] =\n                        x_78594;\n                }\n            }\n            offset_78598 *= 2;\n        }\n        while (slt32(skip_waves_78599,\n                     squot32(sext_i64_i32(segred_group_sizze_68222) +\n                             wave_sizze_78577 - 1, wave_sizze_78577))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_78598 = skip_waves_78599 * wave_siz",
            "ze_78577;\n            if (slt32(local_tid_78575 + offset_78598,\n                      sext_i64_i32(segred_group_sizze_68222)) &&\n                ((local_tid_78575 - squot32(local_tid_78575, wave_sizze_78577) *\n                  wave_sizze_78577) == 0 && (squot32(local_tid_78575,\n                                                     wave_sizze_78577) & (2 *\n                                                                          skip_waves_78599 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_78595 = ((__local\n                                float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575 +\n                                                            offset_78598)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78596 = x_78594 + x_78595;\n                    \n                    x_78594 = defunc_1_op_res_78596;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575)] =\n                        x_78594;\n                }\n            }\n            skip_waves_78599 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_78575) == (int64_t) 0) {\n                x_acc_78592 = x_78594;\n            }\n        }\n        if (groups_per_segment_78565 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_78575 == 0) {\n                    ((__global float *) mem_77179)[gtid_68226 * n_m_65352 +\n                                                   gtid_68227] = x_acc_78592;\n                }\n            }\n        } else {\n            int32_t old_counter_78600;\n  ",
            "          \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_78575 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_78570)[sext_i32_i64(virt_group_id_78585)] =\n                        x_acc_78592;\n                    mem_fence_global();\n                    old_counter_78600 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78572)[sext_i32_i64(srem32(flat_segment_id_78586,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_78581)[(int64_t) 0] =\n                        old_counter_78600 == groups_per_segment_78565 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_78601;\n            \n            is_last_group_78601 = ((__local\n                                    bool *) sync_arr_mem_78581)[(int64_t) 0];\n            if (is_last_group_78601) {\n                if (local_tid_78575 == 0) {\n                    old_counter_78600 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78572)[sext_i32_i64(srem32(flat_segment_id_78586,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_78565));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_78602 =\n                            sdiv_up64(groups_per_segment_78565,\n                       ",
            "               segred_group_sizze_68222);\n                    \n                    x_68230 = 0.0F;\n                    for (int64_t i_78603 = 0; i_78603 < read_per_thread_78602;\n                         i_78603++) {\n                        int64_t group_res_id_78604 =\n                                sext_i32_i64(local_tid_78575) *\n                                read_per_thread_78602 + i_78603;\n                        int64_t index_of_group_res_78605 =\n                                sext_i32_i64(flat_segment_id_78586) *\n                                groups_per_segment_78565 + group_res_id_78604;\n                        \n                        if (slt64(group_res_id_78604,\n                                  groups_per_segment_78565)) {\n                            x_68231 = ((__global\n                                        float *) segred_tmp_mem_78570)[index_of_group_res_78605];\n                            \n                            float defunc_1_op_res_68232 = x_68230 + x_68231;\n                            \n                            x_68230 = defunc_1_op_res_68232;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575)] =\n                    x_68230;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_78606;\n                    int32_t skip_waves_78607 = 1;\n                    float x_78594;\n                    float x_78595;\n                    \n                    offset_78606 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_78575,\n                                  sext_i64_i32(segred_group_sizze_68222))) {\n                            x_78594 = ((__local\n                                        float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575 +\n         ",
            "                                                           offset_78606)];\n                        }\n                    }\n                    offset_78606 = 1;\n                    while (slt32(offset_78606, wave_sizze_78577)) {\n                        if (slt32(local_tid_78575 + offset_78606,\n                                  sext_i64_i32(segred_group_sizze_68222)) &&\n                            ((local_tid_78575 - squot32(local_tid_78575,\n                                                        wave_sizze_78577) *\n                              wave_sizze_78577) & (2 * offset_78606 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_78595 = ((volatile __local\n                                            float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575 +\n                                                                        offset_78606)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78596 = x_78594 + x_78595;\n                                \n                                x_78594 = defunc_1_op_res_78596;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575)] =\n                                    x_78594;\n                            }\n                        }\n                        offset_78606 *= 2;\n                    }\n                    while (slt32(skip_waves_78607,\n                                 squot32(sext_i64_i32(segred_group_sizze_68222) +\n                                         wave_sizze_78577 - 1,\n                                         wave_sizze_78577))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);",
            "\n                        offset_78606 = skip_waves_78607 * wave_sizze_78577;\n                        if (slt32(local_tid_78575 + offset_78606,\n                                  sext_i64_i32(segred_group_sizze_68222)) &&\n                            ((local_tid_78575 - squot32(local_tid_78575,\n                                                        wave_sizze_78577) *\n                              wave_sizze_78577) == 0 &&\n                             (squot32(local_tid_78575, wave_sizze_78577) & (2 *\n                                                                            skip_waves_78607 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_78595 = ((__local\n                                            float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575 +\n                                                                        offset_78606)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78596 = x_78594 + x_78595;\n                                \n                                x_78594 = defunc_1_op_res_78596;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_78579)[sext_i32_i64(local_tid_78575)] =\n                                    x_78594;\n                            }\n                        }\n                        skip_waves_78607 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_78575 == 0) {\n                            ((__global float *) mem_77179)[gtid_68226 *\n                             ",
            "                              n_m_65352 +\n                                                           gtid_68227] =\n                                x_78594;\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_68222\n}\n__kernel void mainzisegred_large_68279(__global int *global_failure,\n                                       uint sync_arr_mem_78663_backing_offset_0,\n                                       uint red_arr_mem_78661_backing_offset_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68273,\n                                       int64_t groups_per_segment_78647,\n                                       int64_t elements_per_thread_78648,\n                                       int64_t virt_num_groups_78649,\n                                       int64_t threads_per_segment_78651,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77086,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77184,\n                                       __global unsigned char *mem_77189,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78652,\n                                       __global\n                                       unsigned",
            " char *mainzicounter_mem_78654)\n{\n    #define segred_group_sizze_68272 (mainzisegred_group_sizze_67234)\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_78663_backing_1 =\n                           &shared_mem[sync_arr_mem_78663_backing_offset_0];\n    volatile unsigned char *red_arr_mem_78661_backing_0 =\n                           &shared_mem[red_arr_mem_78661_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78656;\n    int32_t local_tid_78657;\n    int64_t group_sizze_78660;\n    int32_t wave_sizze_78659;\n    int32_t group_tid_78658;\n    \n    global_tid_78656 = get_global_id(0);\n    local_tid_78657 = get_local_id(0);\n    group_sizze_78660 = get_local_size(0);\n    wave_sizze_78659 = LOCKSTEP_WIDTH;\n    group_tid_78658 = get_group_id(0);\n    \n    int32_t phys_tid_68279 = global_tid_78656;\n    __local unsigned char *red_arr_mem_78661;\n    \n    red_arr_mem_78661 = (__local unsigned char *) red_arr_mem_78661_backing_0;\n    \n    __local unsigned char *sync_arr_mem_78663;\n    \n    sync_arr_mem_78663 = (__local unsigned char *) sync_arr_mem_78663_backing_1;\n    \n    int32_t phys_group_id_78665;\n    \n    phys_group_id_78665 = get_group_id(0);\n    for (int32_t i_78666 = 0; i_78666 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_78649) - phys_group_id_78665,\n                   sext_i64_i32(num_groups_68273)); i_78666++) {\n        int32_t virt_group_id_78667 = phys_group_id_78665 + i_78666 *\n                sext_i64_i32(num_groups_68273);\n        int32_t flat_segment_id_78668 = squot32(virt_group_id_78667,\n                                                sext_i64_i32(groups_per_segment_78647));\n        int64_t global_tid_78669 = srem64(sext_i32_i64(virt_group_id_78667) *\n                                          segred_group_sizze_68272 +\n                                          sext_i32_i64(local_tid_78657),\n                                   ",
            "       segred_group_sizze_68272 *\n                                          groups_per_segment_78647);\n        int64_t slice_78670 = n_m_65352;\n        int64_t slice_78671 = m_65343 * slice_78670;\n        int64_t gtid_68276 = squot64(sext_i32_i64(flat_segment_id_78668),\n                                     slice_78670);\n        int64_t remnant_78672 = sext_i32_i64(flat_segment_id_78668) -\n                gtid_68276 * slice_78670;\n        int64_t gtid_68277 = remnant_78672;\n        int64_t remnant_78673 = remnant_78672 - gtid_68277;\n        int64_t gtid_68278;\n        float x_acc_78674;\n        int64_t chunk_sizze_78675 = smin64(elements_per_thread_78648,\n                                           sdiv_up64(q_65346 - global_tid_78669,\n                                                     threads_per_segment_78651));\n        float x_68280;\n        float x_68281;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_78674 = 0.0F;\n        }\n        for (int64_t i_78679 = 0; i_78679 < chunk_sizze_78675; i_78679++) {\n            gtid_68278 = global_tid_78669 + threads_per_segment_78651 * i_78679;\n            // apply map function\n            {\n                int64_t last_res_68283;\n                \n                last_res_68283 = ((__global int64_t *) mem_77082)[gtid_68276 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74676 = mul64(jump_65348, gtid_68277);\n                int64_t index_primexp_74677 = smin64(i_65358, binop_y_74676);\n                int64_t max_res_68292;\n                \n                max_res_68292 = ((__global int64_t *) mem_77170)[gtid_68276 *\n                                                                 n_m_65352 +\n                                                                 gtid_68277];\n                \n                float defunc_1_f_res_68293;\n           ",
            "     \n                defunc_1_f_res_68293 = ((__global\n                                         float *) mem_77174)[gtid_68276 *\n                                                             n_m_65352 +\n                                                             gtid_68277];\n                \n                float a0_68294;\n                \n                a0_68294 = ((__global float *) mem_77184)[gtid_68276 *\n                                                          n_m_65352 +\n                                                          gtid_68277];\n                \n                float x_68296;\n                \n                x_68296 = ((__global float *) mem_77114)[gtid_68276 * q_65346 +\n                                                         gtid_68278];\n                \n                bool cond_68297 = sle64(last_res_68283, gtid_68278);\n                int64_t defunc_0_f_res_68298;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68298 = (int64_t) 0;\n                } else {\n                    int64_t i_68299 = add64(gtid_68278, max_res_68292);\n                    int64_t defunc_0_add_arg_68300;\n                    \n                    defunc_0_add_arg_68300 = ((__global\n                                               int64_t *) mem_77090)[gtid_68276 *\n                                                                     n_65344 +\n                                                                     i_68299];\n                    \n                    int64_t defunc_1_add_res_68301 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68300);\n                    \n                    defunc_0_f_res_68298 = defunc_1_add_res_68301;\n                }\n                \n                int64_t binop_p_68302 = sub64(defunc_0_f_res_68298,\n                                              index_primexp_74677);\n                float defunc_0_f_res_68303 = sitofp_i64_f32(binop_p_68302);\n             ",
            "   float abs_res_68304 = (float) fabs(defunc_0_f_res_68303);\n                float tmp1_68305 = abs_res_68304 / defunc_1_f_res_68293;\n                float x_68306 = tmp1_68305 * tmp1_68305;\n                float y_68307 = tmp1_68305 * x_68306;\n                float tmp2_68308 = 1.0F - y_68307;\n                float x_68309 = tmp2_68308 * tmp2_68308;\n                float tmp3_68310 = tmp2_68308 * x_68309;\n                float tmp4_68311 = x_68296 * tmp3_68310;\n                float defunc_0_f_res_68312;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68312 = 0.0F;\n                } else {\n                    int64_t i_68313 = add64(gtid_68278, max_res_68292);\n                    float defunc_0_add_arg_68314;\n                    \n                    defunc_0_add_arg_68314 = ((__global\n                                               float *) mem_77086)[gtid_68276 *\n                                                                   n_65344 +\n                                                                   i_68313];\n                    defunc_0_f_res_68312 = defunc_0_add_arg_68314;\n                }\n                \n                float x_68315 = a0_68294 * tmp4_68311;\n                float defunc_9_fit_fun_res_68316 = defunc_0_f_res_68312 *\n                      x_68315;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_68280 = x_acc_78674;\n                }\n                // load new values\n                {\n                    x_68281 = defunc_9_fit_fun_res_68316;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_68282 = x_68280 + x_68281;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_78674 = defunc_1_op_res_68282;\n                    }\n                }\n            }\n        }\n     ",
            "   // to reduce current chunk, first store our result in memory\n        {\n            x_68280 = x_acc_78674;\n            ((__local\n              float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657)] =\n                x_68280;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_78680;\n        int32_t skip_waves_78681 = 1;\n        float x_78676;\n        float x_78677;\n        \n        offset_78680 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_78657,\n                      sext_i64_i32(segred_group_sizze_68272))) {\n                x_78676 = ((__local\n                            float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657 +\n                                                        offset_78680)];\n            }\n        }\n        offset_78680 = 1;\n        while (slt32(offset_78680, wave_sizze_78659)) {\n            if (slt32(local_tid_78657 + offset_78680,\n                      sext_i64_i32(segred_group_sizze_68272)) &&\n                ((local_tid_78657 - squot32(local_tid_78657, wave_sizze_78659) *\n                  wave_sizze_78659) & (2 * offset_78680 - 1)) == 0) {\n                // read array element\n                {\n                    x_78677 = ((volatile __local\n                                float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657 +\n                                                            offset_78680)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78678 = x_78676 + x_78677;\n                    \n                    x_78676 = defunc_1_op_res_78678;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657)] =\n                        x_78676;\n                }\n            }\n            offset_78680 *= 2;\n        }\n        while (",
            "slt32(skip_waves_78681,\n                     squot32(sext_i64_i32(segred_group_sizze_68272) +\n                             wave_sizze_78659 - 1, wave_sizze_78659))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_78680 = skip_waves_78681 * wave_sizze_78659;\n            if (slt32(local_tid_78657 + offset_78680,\n                      sext_i64_i32(segred_group_sizze_68272)) &&\n                ((local_tid_78657 - squot32(local_tid_78657, wave_sizze_78659) *\n                  wave_sizze_78659) == 0 && (squot32(local_tid_78657,\n                                                     wave_sizze_78659) & (2 *\n                                                                          skip_waves_78681 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_78677 = ((__local\n                                float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657 +\n                                                            offset_78680)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78678 = x_78676 + x_78677;\n                    \n                    x_78676 = defunc_1_op_res_78678;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657)] =\n                        x_78676;\n                }\n            }\n            skip_waves_78681 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_78657) == (int64_t) 0) {\n                x_acc_78674 = x_78676;\n            }\n        }\n        if (groups_per_segment_78647 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local",
            "_tid_78657 == 0) {\n                    ((__global float *) mem_77189)[gtid_68276 * n_m_65352 +\n                                                   gtid_68277] = x_acc_78674;\n                }\n            }\n        } else {\n            int32_t old_counter_78682;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_78657 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_78652)[sext_i32_i64(virt_group_id_78667)] =\n                        x_acc_78674;\n                    mem_fence_global();\n                    old_counter_78682 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78654)[sext_i32_i64(srem32(flat_segment_id_78668,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_78663)[(int64_t) 0] =\n                        old_counter_78682 == groups_per_segment_78647 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_78683;\n            \n            is_last_group_78683 = ((__local\n                                    bool *) sync_arr_mem_78663)[(int64_t) 0];\n            if (is_last_group_78683) {\n                if (local_tid_78657 == 0) {\n                    old_counter_78682 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78654)[sext_i32_i64(srem32(flat_segment_id_78668,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                          ",
            "           groups_per_segment_78647));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_78684 =\n                            sdiv_up64(groups_per_segment_78647,\n                                      segred_group_sizze_68272);\n                    \n                    x_68280 = 0.0F;\n                    for (int64_t i_78685 = 0; i_78685 < read_per_thread_78684;\n                         i_78685++) {\n                        int64_t group_res_id_78686 =\n                                sext_i32_i64(local_tid_78657) *\n                                read_per_thread_78684 + i_78685;\n                        int64_t index_of_group_res_78687 =\n                                sext_i32_i64(flat_segment_id_78668) *\n                                groups_per_segment_78647 + group_res_id_78686;\n                        \n                        if (slt64(group_res_id_78686,\n                                  groups_per_segment_78647)) {\n                            x_68281 = ((__global\n                                        float *) segred_tmp_mem_78652)[index_of_group_res_78687];\n                            \n                            float defunc_1_op_res_68282 = x_68280 + x_68281;\n                            \n                            x_68280 = defunc_1_op_res_68282;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657)] =\n                    x_68280;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_78688;\n                    int32_t skip_waves_78689 = 1;\n                    float x_78676;\n                    float x_78677;\n                    \n                    offset_78688 = 0;\n                    // participating threads read initial accumulator\n                    {\n                     ",
            "   if (slt32(local_tid_78657,\n                                  sext_i64_i32(segred_group_sizze_68272))) {\n                            x_78676 = ((__local\n                                        float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657 +\n                                                                    offset_78688)];\n                        }\n                    }\n                    offset_78688 = 1;\n                    while (slt32(offset_78688, wave_sizze_78659)) {\n                        if (slt32(local_tid_78657 + offset_78688,\n                                  sext_i64_i32(segred_group_sizze_68272)) &&\n                            ((local_tid_78657 - squot32(local_tid_78657,\n                                                        wave_sizze_78659) *\n                              wave_sizze_78659) & (2 * offset_78688 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_78677 = ((volatile __local\n                                            float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657 +\n                                                                        offset_78688)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78678 = x_78676 + x_78677;\n                                \n                                x_78676 = defunc_1_op_res_78678;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657)] =\n                                    x_78676;\n                            }\n                        }\n                        offset_78688 *= 2;\n                    }\n                    while (slt32(skip_waves_78689",
            ",\n                                 squot32(sext_i64_i32(segred_group_sizze_68272) +\n                                         wave_sizze_78659 - 1,\n                                         wave_sizze_78659))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_78688 = skip_waves_78689 * wave_sizze_78659;\n                        if (slt32(local_tid_78657 + offset_78688,\n                                  sext_i64_i32(segred_group_sizze_68272)) &&\n                            ((local_tid_78657 - squot32(local_tid_78657,\n                                                        wave_sizze_78659) *\n                              wave_sizze_78659) == 0 &&\n                             (squot32(local_tid_78657, wave_sizze_78659) & (2 *\n                                                                            skip_waves_78689 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_78677 = ((__local\n                                            float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657 +\n                                                                        offset_78688)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78678 = x_78676 + x_78677;\n                                \n                                x_78676 = defunc_1_op_res_78678;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_78661)[sext_i32_i64(local_tid_78657)] =\n                                    x_78676;\n                            }\n                        }\n                        skip_waves_78689 *= 2",
            ";\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_78657 == 0) {\n                            ((__global float *) mem_77189)[gtid_68276 *\n                                                           n_m_65352 +\n                                                           gtid_68277] =\n                                x_78676;\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_68272\n}\n__kernel void mainzisegred_large_70052(__global int *global_failure,\n                                       uint sync_arr_mem_79012_backing_offset_0,\n                                       uint red_arr_mem_79010_backing_offset_1,\n                                       uint red_arr_mem_79008_backing_offset_2,\n                                       uint red_arr_mem_79006_backing_offset_3,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70044,\n                                       int64_t groups_per_segment_78988,\n                                       int64_t elements_per_thread_78989,\n                                       int64_t virt_num_groups_78990,\n                                       int64_t threads_per_segment_78992,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                  ",
            "                     __global unsigned char *mem_77444,\n                                       __global unsigned char *mem_77448,\n                                       __global unsigned char *mem_77452,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78993,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78995,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78997,\n                                       __global\n                                       unsigned char *mainzicounter_mem_78999)\n{\n    #define segred_group_sizze_70043 (mainzisegred_group_sizze_69048)\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_79012_backing_3 =\n                           &shared_mem[sync_arr_mem_79012_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79010_backing_2 =\n                           &shared_mem[red_arr_mem_79010_backing_offset_1];\n    volatile unsigned char *red_arr_mem_79008_backing_1 =\n                           &shared_mem[red_arr_mem_79008_backing_offset_2];\n    volatile unsigned char *red_arr_mem_79006_backing_0 =\n                           &shared_mem[red_arr_mem_79006_backing_offset_3];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79001;\n    int32_t local_tid_79002;\n    int64_t group_sizze_79005;\n    int32_t wave_sizze_79004;\n    int32_t group_tid_79003;\n    \n    global_tid_79001 = get_global_id(0);\n    local_tid_79002 = get_local_id(0);\n    group_sizze_79005 = get_local_size(0);\n    wave_sizze_79004 = LOCKSTEP_WIDTH;\n    group_tid_79003 = get_group_id(0);\n    \n    int32_t phys_tid_70052 = global_tid_79001;\n    __local unsigned char *red_arr_mem_79006;\n    \n    red_arr_mem_79006 = (__local unsigned char *) red_arr_mem_79006_backing_0;",
            "\n    \n    __local unsigned char *red_arr_mem_79008;\n    \n    red_arr_mem_79008 = (__local unsigned char *) red_arr_mem_79008_backing_1;\n    \n    __local unsigned char *red_arr_mem_79010;\n    \n    red_arr_mem_79010 = (__local unsigned char *) red_arr_mem_79010_backing_2;\n    \n    __local unsigned char *sync_arr_mem_79012;\n    \n    sync_arr_mem_79012 = (__local unsigned char *) sync_arr_mem_79012_backing_3;\n    \n    int32_t phys_group_id_79014;\n    \n    phys_group_id_79014 = get_group_id(0);\n    for (int32_t i_79015 = 0; i_79015 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_78990) - phys_group_id_79014,\n                   sext_i64_i32(num_groups_70044)); i_79015++) {\n        int32_t virt_group_id_79016 = phys_group_id_79014 + i_79015 *\n                sext_i64_i32(num_groups_70044);\n        int32_t flat_segment_id_79017 = squot32(virt_group_id_79016,\n                                                sext_i64_i32(groups_per_segment_78988));\n        int64_t global_tid_79018 = srem64(sext_i32_i64(virt_group_id_79016) *\n                                          segred_group_sizze_70043 +\n                                          sext_i32_i64(local_tid_79002),\n                                          segred_group_sizze_70043 *\n                                          groups_per_segment_78988);\n        int64_t slice_79019 = n_m_65352;\n        int64_t slice_79020 = m_65343 * slice_79019;\n        int64_t gtid_70049 = squot64(sext_i32_i64(flat_segment_id_79017),\n                                     slice_79019);\n        int64_t remnant_79021 = sext_i32_i64(flat_segment_id_79017) -\n                gtid_70049 * slice_79019;\n        int64_t gtid_70050 = remnant_79021;\n        int64_t remnant_79022 = remnant_79021 - gtid_70050;\n        int64_t gtid_70051;\n        float x_acc_79023;\n        float x_acc_79024;\n        float x_acc_79025;\n        int64_t chunk_sizze_79026 = smin64(elements_per_thread_78989,\n                                           sdiv_up64(q_65346 - global_tid_",
            "79018,\n                                                     threads_per_segment_78992));\n        float x_70053;\n        float x_70054;\n        float x_70055;\n        float x_70056;\n        float x_70057;\n        float x_70058;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79023 = 0.0F;\n            x_acc_79024 = 0.0F;\n            x_acc_79025 = 0.0F;\n        }\n        for (int64_t i_79036 = 0; i_79036 < chunk_sizze_79026; i_79036++) {\n            gtid_70051 = global_tid_79018 + threads_per_segment_78992 * i_79036;\n            // apply map function\n            {\n                int64_t last_res_70062;\n                \n                last_res_70062 = ((__global int64_t *) mem_77316)[gtid_70049 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74688 = mul64(jump_65348, gtid_70050);\n                int64_t index_primexp_74689 = smin64(i_65358, binop_y_74688);\n                float defunc_1_f_res_70070;\n                \n                defunc_1_f_res_70070 = ((__global\n                                         float *) mem_77439)[gtid_70049 *\n                                                             n_m_65352 +\n                                                             gtid_70050];\n                \n                float x_70072;\n                \n                x_70072 = ((__global float *) mem_77348)[gtid_70049 * q_65346 +\n                                                         gtid_70051];\n                \n                bool cond_70073 = sle64(last_res_70062, gtid_70051);\n                int64_t defunc_0_f_res_70074;\n                \n                if (cond_70073) {\n                    defunc_0_f_res_70074 = (int64_t) 0;\n                } else {\n                    int64_t max_res_70069;\n                    \n                    max_res_70069 = ((__global\n                    ",
            "                  int64_t *) mem_77435)[gtid_70049 *\n                                                            n_m_65352 +\n                                                            gtid_70050];\n                    \n                    int64_t i_70075 = add64(gtid_70051, max_res_70069);\n                    int64_t defunc_0_add_arg_70076;\n                    \n                    defunc_0_add_arg_70076 = ((__global\n                                               int64_t *) mem_77324)[gtid_70049 *\n                                                                     n_65344 +\n                                                                     i_70075];\n                    \n                    int64_t defunc_1_add_res_70077 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70076);\n                    \n                    defunc_0_f_res_70074 = defunc_1_add_res_70077;\n                }\n                \n                int64_t binop_p_70078 = sub64(defunc_0_f_res_70074,\n                                              index_primexp_74689);\n                float defunc_0_f_res_70079 = sitofp_i64_f32(binop_p_70078);\n                float abs_res_70080 = (float) fabs(defunc_0_f_res_70079);\n                float tmp1_70081 = abs_res_70080 / defunc_1_f_res_70070;\n                float x_70082 = tmp1_70081 * tmp1_70081;\n                float y_70083 = tmp1_70081 * x_70082;\n                float tmp2_70084 = 1.0F - y_70083;\n                float x_70085 = tmp2_70084 * tmp2_70084;\n                float tmp3_70086 = tmp2_70084 * x_70085;\n                float w_j_70087 = x_70072 * tmp3_70086;\n                float xw_j_70088 = defunc_0_f_res_70079 * w_j_70087;\n                float x2w_j_70089 = defunc_0_f_res_70079 * xw_j_70088;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_70053 = x_acc_79023;\n                    x_70054 = x_acc",
            "_79024;\n                    x_70055 = x_acc_79025;\n                }\n                // load new values\n                {\n                    x_70056 = w_j_70087;\n                    x_70057 = xw_j_70088;\n                    x_70058 = x2w_j_70089;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_70059 = x_70053 + x_70056;\n                    float defunc_1_op_res_70060 = x_70054 + x_70057;\n                    float defunc_1_op_res_70061 = x_70055 + x_70058;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79023 = defunc_1_op_res_70059;\n                        x_acc_79024 = defunc_1_op_res_70060;\n                        x_acc_79025 = defunc_1_op_res_70061;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_70053 = x_acc_79023;\n            x_70054 = x_acc_79024;\n            x_70055 = x_acc_79025;\n            ((__local\n              float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002)] =\n                x_70053;\n            ((__local\n              float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002)] =\n                x_70054;\n            ((__local\n              float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002)] =\n                x_70055;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79037;\n        int32_t skip_waves_79038 = 1;\n        float x_79027;\n        float x_79028;\n        float x_79029;\n        float x_79030;\n        float x_79031;\n        float x_79032;\n        \n        offset_79037 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79002,\n                      sext_i64_i32(segred_group_sizze_70043))) {\n                x_79027 = ((__local\n                            float *) red_arr_mem_79006)[sext_i32_i64(local_",
            "tid_79002 +\n                                                        offset_79037)];\n                x_79028 = ((__local\n                            float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002 +\n                                                        offset_79037)];\n                x_79029 = ((__local\n                            float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002 +\n                                                        offset_79037)];\n            }\n        }\n        offset_79037 = 1;\n        while (slt32(offset_79037, wave_sizze_79004)) {\n            if (slt32(local_tid_79002 + offset_79037,\n                      sext_i64_i32(segred_group_sizze_70043)) &&\n                ((local_tid_79002 - squot32(local_tid_79002, wave_sizze_79004) *\n                  wave_sizze_79004) & (2 * offset_79037 - 1)) == 0) {\n                // read array element\n                {\n                    x_79030 = ((volatile __local\n                                float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002 +\n                                                            offset_79037)];\n                    x_79031 = ((volatile __local\n                                float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002 +\n                                                            offset_79037)];\n                    x_79032 = ((volatile __local\n                                float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002 +\n                                                            offset_79037)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79033 = x_79027 + x_79030;\n                    float defunc_1_op_res_79034 = x_79028 + x_79031;\n                    float defunc_1_op_res_79035 = x_79029 + x_79032;\n                    \n                    x_79027 = defunc_1_op_res_79033;\n                    x_79028 = defunc_1_op_res_79034;\n                    x_79029 = d",
            "efunc_1_op_res_79035;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002)] =\n                        x_79027;\n                    ((volatile __local\n                      float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002)] =\n                        x_79028;\n                    ((volatile __local\n                      float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002)] =\n                        x_79029;\n                }\n            }\n            offset_79037 *= 2;\n        }\n        while (slt32(skip_waves_79038,\n                     squot32(sext_i64_i32(segred_group_sizze_70043) +\n                             wave_sizze_79004 - 1, wave_sizze_79004))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79037 = skip_waves_79038 * wave_sizze_79004;\n            if (slt32(local_tid_79002 + offset_79037,\n                      sext_i64_i32(segred_group_sizze_70043)) &&\n                ((local_tid_79002 - squot32(local_tid_79002, wave_sizze_79004) *\n                  wave_sizze_79004) == 0 && (squot32(local_tid_79002,\n                                                     wave_sizze_79004) & (2 *\n                                                                          skip_waves_79038 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_79030 = ((__local\n                                float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002 +\n                                                            offset_79037)];\n                    x_79031 = ((__local\n                                float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002 +\n                                                            offset_79037)];\n                    x_79032 = ((__local\n                ",
            "                float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002 +\n                                                            offset_79037)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79033 = x_79027 + x_79030;\n                    float defunc_1_op_res_79034 = x_79028 + x_79031;\n                    float defunc_1_op_res_79035 = x_79029 + x_79032;\n                    \n                    x_79027 = defunc_1_op_res_79033;\n                    x_79028 = defunc_1_op_res_79034;\n                    x_79029 = defunc_1_op_res_79035;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002)] =\n                        x_79027;\n                    ((__local\n                      float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002)] =\n                        x_79028;\n                    ((__local\n                      float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002)] =\n                        x_79029;\n                }\n            }\n            skip_waves_79038 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79002) == (int64_t) 0) {\n                x_acc_79023 = x_79027;\n                x_acc_79024 = x_79028;\n                x_acc_79025 = x_79029;\n            }\n        }\n        if (groups_per_segment_78988 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_79002 == 0) {\n                    ((__global float *) mem_77444)[gtid_70049 * n_m_65352 +\n                                                   gtid_70050] = x_acc_79023;\n                    ((__global float *) mem_77448)[gtid_70049 * n_m_65352 +\n                                                   gtid_70050] = x_",
            "acc_79024;\n                    ((__global float *) mem_77452)[gtid_70049 * n_m_65352 +\n                                                   gtid_70050] = x_acc_79025;\n                }\n            }\n        } else {\n            int32_t old_counter_79039;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79002 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_78993)[sext_i32_i64(virt_group_id_79016)] =\n                        x_acc_79023;\n                    ((__global\n                      float *) segred_tmp_mem_78995)[sext_i32_i64(virt_group_id_79016)] =\n                        x_acc_79024;\n                    ((__global\n                      float *) segred_tmp_mem_78997)[sext_i32_i64(virt_group_id_79016)] =\n                        x_acc_79025;\n                    mem_fence_global();\n                    old_counter_79039 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78999)[sext_i32_i64(srem32(flat_segment_id_79017,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79012)[(int64_t) 0] =\n                        old_counter_79039 == groups_per_segment_78988 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_79040;\n            \n            is_last_group_79040 = ((__local\n                                    bool *) sync_arr_mem_79012)[(int64_t) 0];\n            if (is_last_group_79040) {\n                if (local_tid_79002 == 0) {\n                    old_counter_79039 =\n                        atomic_add_i32_global(&((volatile __global\n                                    ",
            "             int *) mainzicounter_mem_78999)[sext_i32_i64(srem32(flat_segment_id_79017,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_78988));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79041 =\n                            sdiv_up64(groups_per_segment_78988,\n                                      segred_group_sizze_70043);\n                    \n                    x_70053 = 0.0F;\n                    x_70054 = 0.0F;\n                    x_70055 = 0.0F;\n                    for (int64_t i_79042 = 0; i_79042 < read_per_thread_79041;\n                         i_79042++) {\n                        int64_t group_res_id_79043 =\n                                sext_i32_i64(local_tid_79002) *\n                                read_per_thread_79041 + i_79042;\n                        int64_t index_of_group_res_79044 =\n                                sext_i32_i64(flat_segment_id_79017) *\n                                groups_per_segment_78988 + group_res_id_79043;\n                        \n                        if (slt64(group_res_id_79043,\n                                  groups_per_segment_78988)) {\n                            x_70056 = ((__global\n                                        float *) segred_tmp_mem_78993)[index_of_group_res_79044];\n                            x_70057 = ((__global\n                                        float *) segred_tmp_mem_78995)[index_of_group_res_79044];\n                            x_70058 = ((__global\n                                        float *) segred_tmp_mem_78997)[index_of_group_res_79044];\n                            \n                            float defunc_1_op_res_70059 = x_70053 + x_70056;\n                            float defunc_1_op_res_70060 = x_70",
            "054 + x_70057;\n                            float defunc_1_op_res_70061 = x_70055 + x_70058;\n                            \n                            x_70053 = defunc_1_op_res_70059;\n                            x_70054 = defunc_1_op_res_70060;\n                            x_70055 = defunc_1_op_res_70061;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002)] =\n                    x_70053;\n                ((__local\n                  float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002)] =\n                    x_70054;\n                ((__local\n                  float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002)] =\n                    x_70055;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_79045;\n                    int32_t skip_waves_79046 = 1;\n                    float x_79027;\n                    float x_79028;\n                    float x_79029;\n                    float x_79030;\n                    float x_79031;\n                    float x_79032;\n                    \n                    offset_79045 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79002,\n                                  sext_i64_i32(segred_group_sizze_70043))) {\n                            x_79027 = ((__local\n                                        float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002 +\n                                                                    offset_79045)];\n                            x_79028 = ((__local\n                                        float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002 +\n                                                                    offset_79045)];\n                            x_79029 = ((__local\n                         ",
            "               float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002 +\n                                                                    offset_79045)];\n                        }\n                    }\n                    offset_79045 = 1;\n                    while (slt32(offset_79045, wave_sizze_79004)) {\n                        if (slt32(local_tid_79002 + offset_79045,\n                                  sext_i64_i32(segred_group_sizze_70043)) &&\n                            ((local_tid_79002 - squot32(local_tid_79002,\n                                                        wave_sizze_79004) *\n                              wave_sizze_79004) & (2 * offset_79045 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_79030 = ((volatile __local\n                                            float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002 +\n                                                                        offset_79045)];\n                                x_79031 = ((volatile __local\n                                            float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002 +\n                                                                        offset_79045)];\n                                x_79032 = ((volatile __local\n                                            float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002 +\n                                                                        offset_79045)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79033 = x_79027 + x_79030;\n                                float defunc_1_op_res_79034 = x_79028 + x_79031;\n                                float defunc_1_op_res_79035 = x_79029 + x_79032;\n                                \n                                x_79027 = defunc_1_op_res",
            "_79033;\n                                x_79028 = defunc_1_op_res_79034;\n                                x_79029 = defunc_1_op_res_79035;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002)] =\n                                    x_79027;\n                                ((volatile __local\n                                  float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002)] =\n                                    x_79028;\n                                ((volatile __local\n                                  float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002)] =\n                                    x_79029;\n                            }\n                        }\n                        offset_79045 *= 2;\n                    }\n                    while (slt32(skip_waves_79046,\n                                 squot32(sext_i64_i32(segred_group_sizze_70043) +\n                                         wave_sizze_79004 - 1,\n                                         wave_sizze_79004))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79045 = skip_waves_79046 * wave_sizze_79004;\n                        if (slt32(local_tid_79002 + offset_79045,\n                                  sext_i64_i32(segred_group_sizze_70043)) &&\n                            ((local_tid_79002 - squot32(local_tid_79002,\n                                                        wave_sizze_79004) *\n                              wave_sizze_79004) == 0 &&\n                             (squot32(local_tid_79002, wave_sizze_79004) & (2 *\n                                                                            skip_waves_79046 -\n                                                                            1)) ==\n                             0)) {\n                     ",
            "       // read array element\n                            {\n                                x_79030 = ((__local\n                                            float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002 +\n                                                                        offset_79045)];\n                                x_79031 = ((__local\n                                            float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002 +\n                                                                        offset_79045)];\n                                x_79032 = ((__local\n                                            float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002 +\n                                                                        offset_79045)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79033 = x_79027 + x_79030;\n                                float defunc_1_op_res_79034 = x_79028 + x_79031;\n                                float defunc_1_op_res_79035 = x_79029 + x_79032;\n                                \n                                x_79027 = defunc_1_op_res_79033;\n                                x_79028 = defunc_1_op_res_79034;\n                                x_79029 = defunc_1_op_res_79035;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79006)[sext_i32_i64(local_tid_79002)] =\n                                    x_79027;\n                                ((__local\n                                  float *) red_arr_mem_79008)[sext_i32_i64(local_tid_79002)] =\n                                    x_79028;\n                                ((__local\n                                  float *) red_arr_mem_79010)[sext_i32_i64(local_tid_79002)] =\n      ",
            "                              x_79029;\n                            }\n                        }\n                        skip_waves_79046 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79002 == 0) {\n                            ((__global float *) mem_77444)[gtid_70049 *\n                                                           n_m_65352 +\n                                                           gtid_70050] =\n                                x_79027;\n                            ((__global float *) mem_77448)[gtid_70049 *\n                                                           n_m_65352 +\n                                                           gtid_70050] =\n                                x_79028;\n                            ((__global float *) mem_77452)[gtid_70049 *\n                                                           n_m_65352 +\n                                                           gtid_70050] =\n                                x_79029;\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_70043\n}\n__kernel void mainzisegred_large_70122(__global int *global_failure,\n                                       uint sync_arr_mem_79112_backing_offset_0,\n                                       uint red_arr_mem_79110_backing_offset_1,\n                                       uint red_arr_mem_79108_backing_offset_2,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70115,\n                                       int64_t groups_per_segment_79092,\n                                ",
            "       int64_t elements_per_thread_79093,\n                                       int64_t virt_num_groups_79094,\n                                       int64_t threads_per_segment_79096,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77320,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77457,\n                                       __global unsigned char *mem_77461,\n                                       __global unsigned char *mem_77465,\n                                       __global unsigned char *mem_77470,\n                                       __global unsigned char *mem_77474,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79097,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79099,\n                                       __global\n                                       unsigned char *mainzicounter_mem_79101)\n{\n    #define segred_group_sizze_70114 (mainzisegred_group_sizze_68953)\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_79112_backing_2 =\n                           &shared_mem[sync_arr_mem_79112_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79110_backing_1 =\n                           &shared_mem[red_arr_mem_79110_backing_offset_1];\n    volatile unsigned char *red_arr_mem_79108_backing_0 =\n                           &shared_mem[red_arr_mem_79108_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n   ",
            " \n    int32_t global_tid_79103;\n    int32_t local_tid_79104;\n    int64_t group_sizze_79107;\n    int32_t wave_sizze_79106;\n    int32_t group_tid_79105;\n    \n    global_tid_79103 = get_global_id(0);\n    local_tid_79104 = get_local_id(0);\n    group_sizze_79107 = get_local_size(0);\n    wave_sizze_79106 = LOCKSTEP_WIDTH;\n    group_tid_79105 = get_group_id(0);\n    \n    int32_t phys_tid_70122 = global_tid_79103;\n    __local unsigned char *red_arr_mem_79108;\n    \n    red_arr_mem_79108 = (__local unsigned char *) red_arr_mem_79108_backing_0;\n    \n    __local unsigned char *red_arr_mem_79110;\n    \n    red_arr_mem_79110 = (__local unsigned char *) red_arr_mem_79110_backing_1;\n    \n    __local unsigned char *sync_arr_mem_79112;\n    \n    sync_arr_mem_79112 = (__local unsigned char *) sync_arr_mem_79112_backing_2;\n    \n    int32_t phys_group_id_79114;\n    \n    phys_group_id_79114 = get_group_id(0);\n    for (int32_t i_79115 = 0; i_79115 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_79094) - phys_group_id_79114,\n                   sext_i64_i32(num_groups_70115)); i_79115++) {\n        int32_t virt_group_id_79116 = phys_group_id_79114 + i_79115 *\n                sext_i64_i32(num_groups_70115);\n        int32_t flat_segment_id_79117 = squot32(virt_group_id_79116,\n                                                sext_i64_i32(groups_per_segment_79092));\n        int64_t global_tid_79118 = srem64(sext_i32_i64(virt_group_id_79116) *\n                                          segred_group_sizze_70114 +\n                                          sext_i32_i64(local_tid_79104),\n                                          segred_group_sizze_70114 *\n                                          groups_per_segment_79092);\n        int64_t slice_79119 = n_m_65352;\n        int64_t slice_79120 = m_65343 * slice_79119;\n        int64_t gtid_70119 = squot64(sext_i32_i64(flat_segment_id_79117),\n                                     slice_79119);\n        int64_t remnant_79121 = sext_i32_i64(flat_segment_id_79117",
            ") -\n                gtid_70119 * slice_79119;\n        int64_t gtid_70120 = remnant_79121;\n        int64_t remnant_79122 = remnant_79121 - gtid_70120;\n        int64_t gtid_70121;\n        float x_acc_79123;\n        float x_acc_79124;\n        int64_t chunk_sizze_79125 = smin64(elements_per_thread_79093,\n                                           sdiv_up64(q_65346 - global_tid_79118,\n                                                     threads_per_segment_79096));\n        float x_70123;\n        float x_70124;\n        float x_70125;\n        float x_70126;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79123 = 0.0F;\n            x_acc_79124 = 0.0F;\n        }\n        for (int64_t i_79132 = 0; i_79132 < chunk_sizze_79125; i_79132++) {\n            gtid_70121 = global_tid_79118 + threads_per_segment_79096 * i_79132;\n            // apply map function\n            {\n                int64_t last_res_70129;\n                \n                last_res_70129 = ((__global int64_t *) mem_77316)[gtid_70119 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74684 = mul64(jump_65348, gtid_70120);\n                int64_t index_primexp_74685 = smin64(i_65358, binop_y_74684);\n                int64_t max_res_70140;\n                \n                max_res_70140 = ((__global int64_t *) mem_77435)[gtid_70119 *\n                                                                 n_m_65352 +\n                                                                 gtid_70120];\n                \n                float defunc_1_f_res_70141;\n                \n                defunc_1_f_res_70141 = ((__global\n                                         float *) mem_77439)[gtid_70119 *\n                                                             n_m_65352 +\n                                                             gtid_70120];\n      ",
            "          \n                float a11_70142;\n                \n                a11_70142 = ((__global float *) mem_77457)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float b11_70143;\n                \n                b11_70143 = ((__global float *) mem_77461)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float c11_70144;\n                \n                c11_70144 = ((__global float *) mem_77465)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float x_70146;\n                \n                x_70146 = ((__global float *) mem_77348)[gtid_70119 * q_65346 +\n                                                         gtid_70121];\n                \n                bool cond_70147 = sle64(last_res_70129, gtid_70121);\n                int64_t defunc_0_f_res_70148;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70148 = (int64_t) 0;\n                } else {\n                    int64_t i_70149 = add64(gtid_70121, max_res_70140);\n                    int64_t defunc_0_add_arg_70150;\n                    \n                    defunc_0_add_arg_70150 = ((__global\n                                               int64_t *) mem_77324)[gtid_70119 *\n                                                                     n_65344 +\n                                                                     i_70149];\n                    \n                    int64_t defunc_1_add_res_70151 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70150);\n                    \n                    defunc_0_f_res_70148 =",
            " defunc_1_add_res_70151;\n                }\n                \n                int64_t binop_p_70152 = sub64(defunc_0_f_res_70148,\n                                              index_primexp_74685);\n                float defunc_0_f_res_70153 = sitofp_i64_f32(binop_p_70152);\n                float abs_res_70154 = (float) fabs(defunc_0_f_res_70153);\n                float tmp1_70155 = abs_res_70154 / defunc_1_f_res_70141;\n                float x_70156 = tmp1_70155 * tmp1_70155;\n                float y_70157 = tmp1_70155 * x_70156;\n                float tmp2_70158 = 1.0F - y_70157;\n                float x_70159 = tmp2_70158 * tmp2_70158;\n                float tmp3_70160 = tmp2_70158 * x_70159;\n                float tmp4_70161 = x_70146 * tmp3_70160;\n                float defunc_1_f_res_70162 = defunc_0_f_res_70153 * tmp4_70161;\n                float defunc_0_f_res_70163;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70163 = 0.0F;\n                } else {\n                    int64_t i_70164 = add64(gtid_70121, max_res_70140);\n                    float defunc_0_add_arg_70165;\n                    \n                    defunc_0_add_arg_70165 = ((__global\n                                               float *) mem_77320)[gtid_70119 *\n                                                                   n_65344 +\n                                                                   i_70164];\n                    defunc_0_f_res_70163 = defunc_0_add_arg_70165;\n                }\n                \n                float x_70166 = a11_70142 * tmp4_70161;\n                float y_70167 = b11_70143 * defunc_1_f_res_70162;\n                float x_70168 = x_70166 + y_70167;\n                float defunc_9_fit_fun_res_70169 = defunc_0_f_res_70163 *\n                      x_70168;\n                float x_70170 = b11_70143 * tmp4_70161;\n                float y_70171 = c11_70144 * defunc_1_f_res_70162;\n                float x_70172 = x_70170 + y_70171;\n             ",
            "   float defunc_9_slope_fun_res_70173 = defunc_0_f_res_70163 *\n                      x_70172;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_70123 = x_acc_79123;\n                    x_70124 = x_acc_79124;\n                }\n                // load new values\n                {\n                    x_70125 = defunc_9_fit_fun_res_70169;\n                    x_70126 = defunc_9_slope_fun_res_70173;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_70127 = x_70123 + x_70125;\n                    float defunc_1_op_res_70128 = x_70124 + x_70126;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79123 = defunc_1_op_res_70127;\n                        x_acc_79124 = defunc_1_op_res_70128;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_70123 = x_acc_79123;\n            x_70124 = x_acc_79124;\n            ((__local\n              float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104)] =\n                x_70123;\n            ((__local\n              float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104)] =\n                x_70124;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79133;\n        int32_t skip_waves_79134 = 1;\n        float x_79126;\n        float x_79127;\n        float x_79128;\n        float x_79129;\n        \n        offset_79133 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79104,\n                      sext_i64_i32(segred_group_sizze_70114))) {\n                x_79126 = ((__local\n                            float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104 +\n                                                        offset_79133)",
            "];\n                x_79127 = ((__local\n                            float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104 +\n                                                        offset_79133)];\n            }\n        }\n        offset_79133 = 1;\n        while (slt32(offset_79133, wave_sizze_79106)) {\n            if (slt32(local_tid_79104 + offset_79133,\n                      sext_i64_i32(segred_group_sizze_70114)) &&\n                ((local_tid_79104 - squot32(local_tid_79104, wave_sizze_79106) *\n                  wave_sizze_79106) & (2 * offset_79133 - 1)) == 0) {\n                // read array element\n                {\n                    x_79128 = ((volatile __local\n                                float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104 +\n                                                            offset_79133)];\n                    x_79129 = ((volatile __local\n                                float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104 +\n                                                            offset_79133)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79130 = x_79126 + x_79128;\n                    float defunc_1_op_res_79131 = x_79127 + x_79129;\n                    \n                    x_79126 = defunc_1_op_res_79130;\n                    x_79127 = defunc_1_op_res_79131;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104)] =\n                        x_79126;\n                    ((volatile __local\n                      float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104)] =\n                        x_79127;\n                }\n            }\n            offset_79133 *= 2;\n        }\n        while (slt32(skip_waves_79134,\n                     squot32(sext_i64_i32(segred_group_sizze_70114) +\n                   ",
            "          wave_sizze_79106 - 1, wave_sizze_79106))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79133 = skip_waves_79134 * wave_sizze_79106;\n            if (slt32(local_tid_79104 + offset_79133,\n                      sext_i64_i32(segred_group_sizze_70114)) &&\n                ((local_tid_79104 - squot32(local_tid_79104, wave_sizze_79106) *\n                  wave_sizze_79106) == 0 && (squot32(local_tid_79104,\n                                                     wave_sizze_79106) & (2 *\n                                                                          skip_waves_79134 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_79128 = ((__local\n                                float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104 +\n                                                            offset_79133)];\n                    x_79129 = ((__local\n                                float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104 +\n                                                            offset_79133)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79130 = x_79126 + x_79128;\n                    float defunc_1_op_res_79131 = x_79127 + x_79129;\n                    \n                    x_79126 = defunc_1_op_res_79130;\n                    x_79127 = defunc_1_op_res_79131;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104)] =\n                        x_79126;\n                    ((__local\n                      float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104)] =\n                        x_79127;\n                }\n            }\n            skip_waves_79134 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM",
            "_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79104) == (int64_t) 0) {\n                x_acc_79123 = x_79126;\n                x_acc_79124 = x_79127;\n            }\n        }\n        if (groups_per_segment_79092 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_79104 == 0) {\n                    ((__global float *) mem_77470)[gtid_70119 * n_m_65352 +\n                                                   gtid_70120] = x_acc_79123;\n                    ((__global float *) mem_77474)[gtid_70119 * n_m_65352 +\n                                                   gtid_70120] = x_acc_79124;\n                }\n            }\n        } else {\n            int32_t old_counter_79135;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79104 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_79097)[sext_i32_i64(virt_group_id_79116)] =\n                        x_acc_79123;\n                    ((__global\n                      float *) segred_tmp_mem_79099)[sext_i32_i64(virt_group_id_79116)] =\n                        x_acc_79124;\n                    mem_fence_global();\n                    old_counter_79135 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79101)[sext_i32_i64(srem32(flat_segment_id_79117,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79112)[(int64_t) 0] =\n                        old_counter_79135 == groups_per_segment_79092 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n       ",
            "     \n            bool is_last_group_79136;\n            \n            is_last_group_79136 = ((__local\n                                    bool *) sync_arr_mem_79112)[(int64_t) 0];\n            if (is_last_group_79136) {\n                if (local_tid_79104 == 0) {\n                    old_counter_79135 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79101)[sext_i32_i64(srem32(flat_segment_id_79117,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_79092));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79137 =\n                            sdiv_up64(groups_per_segment_79092,\n                                      segred_group_sizze_70114);\n                    \n                    x_70123 = 0.0F;\n                    x_70124 = 0.0F;\n                    for (int64_t i_79138 = 0; i_79138 < read_per_thread_79137;\n                         i_79138++) {\n                        int64_t group_res_id_79139 =\n                                sext_i32_i64(local_tid_79104) *\n                                read_per_thread_79137 + i_79138;\n                        int64_t index_of_group_res_79140 =\n                                sext_i32_i64(flat_segment_id_79117) *\n                                groups_per_segment_79092 + group_res_id_79139;\n                        \n                        if (slt64(group_res_id_79139,\n                                  groups_per_segment_79092)) {\n                            x_70125 = ((__global\n                                        float *) segred_tmp_mem_79097)[index_of_group_res_79140];\n                            x_70126 = ((__global\n                                        floa",
            "t *) segred_tmp_mem_79099)[index_of_group_res_79140];\n                            \n                            float defunc_1_op_res_70127 = x_70123 + x_70125;\n                            float defunc_1_op_res_70128 = x_70124 + x_70126;\n                            \n                            x_70123 = defunc_1_op_res_70127;\n                            x_70124 = defunc_1_op_res_70128;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104)] =\n                    x_70123;\n                ((__local\n                  float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104)] =\n                    x_70124;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_79141;\n                    int32_t skip_waves_79142 = 1;\n                    float x_79126;\n                    float x_79127;\n                    float x_79128;\n                    float x_79129;\n                    \n                    offset_79141 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79104,\n                                  sext_i64_i32(segred_group_sizze_70114))) {\n                            x_79126 = ((__local\n                                        float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104 +\n                                                                    offset_79141)];\n                            x_79127 = ((__local\n                                        float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104 +\n                                                                    offset_79141)];\n                        }\n                    }\n                    offset_79141 = 1;\n                    while (slt32(offset_79141, wave_sizze_79106)) {\n                        if (slt32(local",
            "_tid_79104 + offset_79141,\n                                  sext_i64_i32(segred_group_sizze_70114)) &&\n                            ((local_tid_79104 - squot32(local_tid_79104,\n                                                        wave_sizze_79106) *\n                              wave_sizze_79106) & (2 * offset_79141 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_79128 = ((volatile __local\n                                            float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104 +\n                                                                        offset_79141)];\n                                x_79129 = ((volatile __local\n                                            float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104 +\n                                                                        offset_79141)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79130 = x_79126 + x_79128;\n                                float defunc_1_op_res_79131 = x_79127 + x_79129;\n                                \n                                x_79126 = defunc_1_op_res_79130;\n                                x_79127 = defunc_1_op_res_79131;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104)] =\n                                    x_79126;\n                                ((volatile __local\n                                  float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104)] =\n                                    x_79127;\n                            }\n                        }\n                        offset_79141 *= 2;\n             ",
            "       }\n                    while (slt32(skip_waves_79142,\n                                 squot32(sext_i64_i32(segred_group_sizze_70114) +\n                                         wave_sizze_79106 - 1,\n                                         wave_sizze_79106))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79141 = skip_waves_79142 * wave_sizze_79106;\n                        if (slt32(local_tid_79104 + offset_79141,\n                                  sext_i64_i32(segred_group_sizze_70114)) &&\n                            ((local_tid_79104 - squot32(local_tid_79104,\n                                                        wave_sizze_79106) *\n                              wave_sizze_79106) == 0 &&\n                             (squot32(local_tid_79104, wave_sizze_79106) & (2 *\n                                                                            skip_waves_79142 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_79128 = ((__local\n                                            float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104 +\n                                                                        offset_79141)];\n                                x_79129 = ((__local\n                                            float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104 +\n                                                                        offset_79141)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79130 = x_79126 + x_79128;\n                                float defunc_1_op_res_79131 = x_79127 + x_79129;\n                                \n                                x_79126 = defunc_1_op_res_79130;\n                  ",
            "              x_79127 = defunc_1_op_res_79131;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79108)[sext_i32_i64(local_tid_79104)] =\n                                    x_79126;\n                                ((__local\n                                  float *) red_arr_mem_79110)[sext_i32_i64(local_tid_79104)] =\n                                    x_79127;\n                            }\n                        }\n                        skip_waves_79142 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79104 == 0) {\n                            ((__global float *) mem_77470)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120] =\n                                x_79126;\n                            ((__global float *) mem_77474)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120] =\n                                x_79127;\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_70114\n}\n__kernel void mainzisegred_large_72125(__global int *global_failure,\n                                       uint sync_arr_mem_79503_backing_offset_0,\n                                       uint red_arr_mem_79501_backing_offset_1,\n                                       uint red_arr_mem_79499_backing_offset_2,\n                                       uint red_arr_mem_79497_backing_offset_3,\n                                       uint red_arr_mem_79495_backing_offset_4,\n  ",
            "                                     uint red_arr_mem_79493_backing_offset_5,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72115,\n                                       int64_t groups_per_segment_79471,\n                                       int64_t elements_per_thread_79472,\n                                       int64_t virt_num_groups_79473,\n                                       int64_t threads_per_segment_79475,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77760,\n                                       __global unsigned char *mem_77764,\n                                       __global unsigned char *mem_77768,\n                                       __global unsigned char *mem_77772,\n                                       __global unsigned char *mem_77776,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79476,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79478,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79480,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79482,\n                                       __global\n                                       unsigned char *segr",
            "ed_tmp_mem_79484,\n                                       __global\n                                       unsigned char *mainzicounter_mem_79486)\n{\n    #define segred_group_sizze_72114 (mainzisegred_group_sizze_71039)\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_79503_backing_5 =\n                           &shared_mem[sync_arr_mem_79503_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79501_backing_4 =\n                           &shared_mem[red_arr_mem_79501_backing_offset_1];\n    volatile unsigned char *red_arr_mem_79499_backing_3 =\n                           &shared_mem[red_arr_mem_79499_backing_offset_2];\n    volatile unsigned char *red_arr_mem_79497_backing_2 =\n                           &shared_mem[red_arr_mem_79497_backing_offset_3];\n    volatile unsigned char *red_arr_mem_79495_backing_1 =\n                           &shared_mem[red_arr_mem_79495_backing_offset_4];\n    volatile unsigned char *red_arr_mem_79493_backing_0 =\n                           &shared_mem[red_arr_mem_79493_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79488;\n    int32_t local_tid_79489;\n    int64_t group_sizze_79492;\n    int32_t wave_sizze_79491;\n    int32_t group_tid_79490;\n    \n    global_tid_79488 = get_global_id(0);\n    local_tid_79489 = get_local_id(0);\n    group_sizze_79492 = get_local_size(0);\n    wave_sizze_79491 = LOCKSTEP_WIDTH;\n    group_tid_79490 = get_group_id(0);\n    \n    int32_t phys_tid_72125 = global_tid_79488;\n    __local unsigned char *red_arr_mem_79493;\n    \n    red_arr_mem_79493 = (__local unsigned char *) red_arr_mem_79493_backing_0;\n    \n    __local unsigned char *red_arr_mem_79495;\n    \n    red_arr_mem_79495 = (__local unsigned char *) red_arr_mem_79495_backing_1;\n    \n    __local unsigned char *red_arr_mem_79497;\n    \n    red_arr_mem_79497 = (__local unsigned char *) red_arr_mem_79497_backing_2;\n    \n    __local un",
            "signed char *red_arr_mem_79499;\n    \n    red_arr_mem_79499 = (__local unsigned char *) red_arr_mem_79499_backing_3;\n    \n    __local unsigned char *red_arr_mem_79501;\n    \n    red_arr_mem_79501 = (__local unsigned char *) red_arr_mem_79501_backing_4;\n    \n    __local unsigned char *sync_arr_mem_79503;\n    \n    sync_arr_mem_79503 = (__local unsigned char *) sync_arr_mem_79503_backing_5;\n    \n    int32_t phys_group_id_79505;\n    \n    phys_group_id_79505 = get_group_id(0);\n    for (int32_t i_79506 = 0; i_79506 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_79473) - phys_group_id_79505,\n                   sext_i64_i32(num_groups_72115)); i_79506++) {\n        int32_t virt_group_id_79507 = phys_group_id_79505 + i_79506 *\n                sext_i64_i32(num_groups_72115);\n        int32_t flat_segment_id_79508 = squot32(virt_group_id_79507,\n                                                sext_i64_i32(groups_per_segment_79471));\n        int64_t global_tid_79509 = srem64(sext_i32_i64(virt_group_id_79507) *\n                                          segred_group_sizze_72114 +\n                                          sext_i32_i64(local_tid_79489),\n                                          segred_group_sizze_72114 *\n                                          groups_per_segment_79471);\n        int64_t slice_79510 = n_m_65352;\n        int64_t slice_79511 = m_65343 * slice_79510;\n        int64_t gtid_72122 = squot64(sext_i32_i64(flat_segment_id_79508),\n                                     slice_79510);\n        int64_t remnant_79512 = sext_i32_i64(flat_segment_id_79508) -\n                gtid_72122 * slice_79510;\n        int64_t gtid_72123 = remnant_79512;\n        int64_t remnant_79513 = remnant_79512 - gtid_72123;\n        int64_t gtid_72124;\n        float x_acc_79514;\n        float x_acc_79515;\n        float x_acc_79516;\n        float x_acc_79517;\n        float x_acc_79518;\n        int64_t chunk_sizze_79519 = smin64(elements_per_thread_79472,\n                                        ",
            "   sdiv_up64(q_65346 - global_tid_79509,\n                                                     threads_per_segment_79475));\n        float x_72126;\n        float x_72127;\n        float x_72128;\n        float x_72129;\n        float x_72130;\n        float x_72131;\n        float x_72132;\n        float x_72133;\n        float x_72134;\n        float x_72135;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79514 = 0.0F;\n            x_acc_79515 = 0.0F;\n            x_acc_79516 = 0.0F;\n            x_acc_79517 = 0.0F;\n            x_acc_79518 = 0.0F;\n        }\n        for (int64_t i_79535 = 0; i_79535 < chunk_sizze_79519; i_79535++) {\n            gtid_72124 = global_tid_79509 + threads_per_segment_79475 * i_79535;\n            // apply map function\n            {\n                int64_t last_res_72141;\n                \n                last_res_72141 = ((__global int64_t *) mem_77608)[gtid_72122 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74696 = mul64(jump_65348, gtid_72123);\n                int64_t index_primexp_74697 = smin64(i_65358, binop_y_74696);\n                float defunc_1_f_res_72149;\n                \n                defunc_1_f_res_72149 = ((__global\n                                         float *) mem_77755)[gtid_72122 *\n                                                             n_m_65352 +\n                                                             gtid_72123];\n                \n                float x_72151;\n                \n                x_72151 = ((__global float *) mem_77640)[gtid_72122 * q_65346 +\n                                                         gtid_72124];\n                \n                bool cond_72152 = sle64(last_res_72141, gtid_72124);\n                int64_t defunc_0_f_res_72153;\n                \n                if (cond_72152) {\n                    de",
            "func_0_f_res_72153 = (int64_t) 0;\n                } else {\n                    int64_t max_res_72148;\n                    \n                    max_res_72148 = ((__global\n                                      int64_t *) mem_77751)[gtid_72122 *\n                                                            n_m_65352 +\n                                                            gtid_72123];\n                    \n                    int64_t i_72154 = add64(gtid_72124, max_res_72148);\n                    int64_t defunc_0_add_arg_72155;\n                    \n                    defunc_0_add_arg_72155 = ((__global\n                                               int64_t *) mem_77616)[gtid_72122 *\n                                                                     n_65344 +\n                                                                     i_72154];\n                    \n                    int64_t defunc_1_add_res_72156 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72155);\n                    \n                    defunc_0_f_res_72153 = defunc_1_add_res_72156;\n                }\n                \n                int64_t binop_p_72157 = sub64(defunc_0_f_res_72153,\n                                              index_primexp_74697);\n                float defunc_0_f_res_72158 = sitofp_i64_f32(binop_p_72157);\n                float abs_res_72159 = (float) fabs(defunc_0_f_res_72158);\n                float tmp1_72160 = abs_res_72159 / defunc_1_f_res_72149;\n                float x_72161 = tmp1_72160 * tmp1_72160;\n                float y_72162 = tmp1_72160 * x_72161;\n                float tmp2_72163 = 1.0F - y_72162;\n                float x_72164 = tmp2_72163 * tmp2_72163;\n                float tmp3_72165 = tmp2_72163 * x_72164;\n                float w_j_72166 = x_72151 * tmp3_72165;\n                float xw_j_72167 = defunc_0_f_res_72158 * w_j_72166;\n                float x2w_j_72168 = defunc_0_f_res_72158 * xw_j_72167;\n                flo",
            "at x3w_j_72169 = defunc_0_f_res_72158 * x2w_j_72168;\n                float x4w_j_72170 = defunc_0_f_res_72158 * x3w_j_72169;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_72126 = x_acc_79514;\n                    x_72127 = x_acc_79515;\n                    x_72128 = x_acc_79516;\n                    x_72129 = x_acc_79517;\n                    x_72130 = x_acc_79518;\n                }\n                // load new values\n                {\n                    x_72131 = w_j_72166;\n                    x_72132 = xw_j_72167;\n                    x_72133 = x2w_j_72168;\n                    x_72134 = x3w_j_72169;\n                    x_72135 = x4w_j_72170;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_72136 = x_72126 + x_72131;\n                    float defunc_1_op_res_72137 = x_72127 + x_72132;\n                    float defunc_1_op_res_72138 = x_72128 + x_72133;\n                    float defunc_1_op_res_72139 = x_72129 + x_72134;\n                    float defunc_1_op_res_72140 = x_72130 + x_72135;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79514 = defunc_1_op_res_72136;\n                        x_acc_79515 = defunc_1_op_res_72137;\n                        x_acc_79516 = defunc_1_op_res_72138;\n                        x_acc_79517 = defunc_1_op_res_72139;\n                        x_acc_79518 = defunc_1_op_res_72140;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_72126 = x_acc_79514;\n            x_72127 = x_acc_79515;\n            x_72128 = x_acc_79516;\n            x_72129 = x_acc_79517;\n            x_72130 = x_acc_79518;\n            ((__local\n              float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489)] =\n              ",
            "  x_72126;\n            ((__local\n              float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489)] =\n                x_72127;\n            ((__local\n              float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489)] =\n                x_72128;\n            ((__local\n              float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489)] =\n                x_72129;\n            ((__local\n              float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489)] =\n                x_72130;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79536;\n        int32_t skip_waves_79537 = 1;\n        float x_79520;\n        float x_79521;\n        float x_79522;\n        float x_79523;\n        float x_79524;\n        float x_79525;\n        float x_79526;\n        float x_79527;\n        float x_79528;\n        float x_79529;\n        \n        offset_79536 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79489,\n                      sext_i64_i32(segred_group_sizze_72114))) {\n                x_79520 = ((__local\n                            float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489 +\n                                                        offset_79536)];\n                x_79521 = ((__local\n                            float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489 +\n                                                        offset_79536)];\n                x_79522 = ((__local\n                            float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489 +\n                                                        offset_79536)];\n                x_79523 = ((__local\n                            float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489 +\n                                                        offset_79536)];\n                x_79524 = ((__local\n                            float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489 +\n                                    ",
            "                    offset_79536)];\n            }\n        }\n        offset_79536 = 1;\n        while (slt32(offset_79536, wave_sizze_79491)) {\n            if (slt32(local_tid_79489 + offset_79536,\n                      sext_i64_i32(segred_group_sizze_72114)) &&\n                ((local_tid_79489 - squot32(local_tid_79489, wave_sizze_79491) *\n                  wave_sizze_79491) & (2 * offset_79536 - 1)) == 0) {\n                // read array element\n                {\n                    x_79525 = ((volatile __local\n                                float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79526 = ((volatile __local\n                                float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79527 = ((volatile __local\n                                float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79528 = ((volatile __local\n                                float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79529 = ((volatile __local\n                                float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79530 = x_79520 + x_79525;\n                    float defunc_1_op_res_79531 = x_79521 + x_79526;\n                    float defunc_1_op_res_79532 = x_79522 + x_79527;\n                    float defunc_1_op_res_79533 = x_79523 + x_79528;\n                    float defunc_1_op_res_79534 = x_79524 + x_79529;\n                    \n     ",
            "               x_79520 = defunc_1_op_res_79530;\n                    x_79521 = defunc_1_op_res_79531;\n                    x_79522 = defunc_1_op_res_79532;\n                    x_79523 = defunc_1_op_res_79533;\n                    x_79524 = defunc_1_op_res_79534;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489)] =\n                        x_79520;\n                    ((volatile __local\n                      float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489)] =\n                        x_79521;\n                    ((volatile __local\n                      float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489)] =\n                        x_79522;\n                    ((volatile __local\n                      float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489)] =\n                        x_79523;\n                    ((volatile __local\n                      float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489)] =\n                        x_79524;\n                }\n            }\n            offset_79536 *= 2;\n        }\n        while (slt32(skip_waves_79537,\n                     squot32(sext_i64_i32(segred_group_sizze_72114) +\n                             wave_sizze_79491 - 1, wave_sizze_79491))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79536 = skip_waves_79537 * wave_sizze_79491;\n            if (slt32(local_tid_79489 + offset_79536,\n                      sext_i64_i32(segred_group_sizze_72114)) &&\n                ((local_tid_79489 - squot32(local_tid_79489, wave_sizze_79491) *\n                  wave_sizze_79491) == 0 && (squot32(local_tid_79489,\n                                                     wave_sizze_79491) & (2 *\n                                                                          skip_waves_79537 -\n                                                                          1)) ==\n ",
            "                0)) {\n                // read array element\n                {\n                    x_79525 = ((__local\n                                float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79526 = ((__local\n                                float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79527 = ((__local\n                                float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79528 = ((__local\n                                float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                    x_79529 = ((__local\n                                float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489 +\n                                                            offset_79536)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79530 = x_79520 + x_79525;\n                    float defunc_1_op_res_79531 = x_79521 + x_79526;\n                    float defunc_1_op_res_79532 = x_79522 + x_79527;\n                    float defunc_1_op_res_79533 = x_79523 + x_79528;\n                    float defunc_1_op_res_79534 = x_79524 + x_79529;\n                    \n                    x_79520 = defunc_1_op_res_79530;\n                    x_79521 = defunc_1_op_res_79531;\n                    x_79522 = defunc_1_op_res_79532;\n                    x_79523 = defunc_1_op_res_79533;\n                    x_79524 = defunc_1_op_res_79534;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79493)[sext_i32_i64(l",
            "ocal_tid_79489)] =\n                        x_79520;\n                    ((__local\n                      float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489)] =\n                        x_79521;\n                    ((__local\n                      float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489)] =\n                        x_79522;\n                    ((__local\n                      float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489)] =\n                        x_79523;\n                    ((__local\n                      float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489)] =\n                        x_79524;\n                }\n            }\n            skip_waves_79537 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79489) == (int64_t) 0) {\n                x_acc_79514 = x_79520;\n                x_acc_79515 = x_79521;\n                x_acc_79516 = x_79522;\n                x_acc_79517 = x_79523;\n                x_acc_79518 = x_79524;\n            }\n        }\n        if (groups_per_segment_79471 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_79489 == 0) {\n                    ((__global float *) mem_77760)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79514;\n                    ((__global float *) mem_77764)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79515;\n                    ((__global float *) mem_77768)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79516;\n                    ((__global float *) mem_77772)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79517;\n                    ((__global float *) mem_77776)[gtid_72122 * n_m_65352 +\n                             ",
            "                      gtid_72123] = x_acc_79518;\n                }\n            }\n        } else {\n            int32_t old_counter_79538;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79489 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_79476)[sext_i32_i64(virt_group_id_79507)] =\n                        x_acc_79514;\n                    ((__global\n                      float *) segred_tmp_mem_79478)[sext_i32_i64(virt_group_id_79507)] =\n                        x_acc_79515;\n                    ((__global\n                      float *) segred_tmp_mem_79480)[sext_i32_i64(virt_group_id_79507)] =\n                        x_acc_79516;\n                    ((__global\n                      float *) segred_tmp_mem_79482)[sext_i32_i64(virt_group_id_79507)] =\n                        x_acc_79517;\n                    ((__global\n                      float *) segred_tmp_mem_79484)[sext_i32_i64(virt_group_id_79507)] =\n                        x_acc_79518;\n                    mem_fence_global();\n                    old_counter_79538 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79486)[sext_i32_i64(srem32(flat_segment_id_79508,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79503)[(int64_t) 0] =\n                        old_counter_79538 == groups_per_segment_79471 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_79539;\n            \n            is_last_group_79539 = ((__local\n                                    bool *) sync_arr_mem_79503)[(int64_t) 0];\n            if (is_last_gr",
            "oup_79539) {\n                if (local_tid_79489 == 0) {\n                    old_counter_79538 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79486)[sext_i32_i64(srem32(flat_segment_id_79508,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_79471));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79540 =\n                            sdiv_up64(groups_per_segment_79471,\n                                      segred_group_sizze_72114);\n                    \n                    x_72126 = 0.0F;\n                    x_72127 = 0.0F;\n                    x_72128 = 0.0F;\n                    x_72129 = 0.0F;\n                    x_72130 = 0.0F;\n                    for (int64_t i_79541 = 0; i_79541 < read_per_thread_79540;\n                         i_79541++) {\n                        int64_t group_res_id_79542 =\n                                sext_i32_i64(local_tid_79489) *\n                                read_per_thread_79540 + i_79541;\n                        int64_t index_of_group_res_79543 =\n                                sext_i32_i64(flat_segment_id_79508) *\n                                groups_per_segment_79471 + group_res_id_79542;\n                        \n                        if (slt64(group_res_id_79542,\n                                  groups_per_segment_79471)) {\n                            x_72131 = ((__global\n                                        float *) segred_tmp_mem_79476)[index_of_group_res_79543];\n                            x_72132 = ((__global\n                                        float *) segred_tmp_mem_79478)[index_of_group_res_79543];\n                            x_72133 = ((__g",
            "lobal\n                                        float *) segred_tmp_mem_79480)[index_of_group_res_79543];\n                            x_72134 = ((__global\n                                        float *) segred_tmp_mem_79482)[index_of_group_res_79543];\n                            x_72135 = ((__global\n                                        float *) segred_tmp_mem_79484)[index_of_group_res_79543];\n                            \n                            float defunc_1_op_res_72136 = x_72126 + x_72131;\n                            float defunc_1_op_res_72137 = x_72127 + x_72132;\n                            float defunc_1_op_res_72138 = x_72128 + x_72133;\n                            float defunc_1_op_res_72139 = x_72129 + x_72134;\n                            float defunc_1_op_res_72140 = x_72130 + x_72135;\n                            \n                            x_72126 = defunc_1_op_res_72136;\n                            x_72127 = defunc_1_op_res_72137;\n                            x_72128 = defunc_1_op_res_72138;\n                            x_72129 = defunc_1_op_res_72139;\n                            x_72130 = defunc_1_op_res_72140;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489)] =\n                    x_72126;\n                ((__local\n                  float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489)] =\n                    x_72127;\n                ((__local\n                  float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489)] =\n                    x_72128;\n                ((__local\n                  float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489)] =\n                    x_72129;\n                ((__local\n                  float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489)] =\n                    x_72130;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n      ",
            "              int32_t offset_79544;\n                    int32_t skip_waves_79545 = 1;\n                    float x_79520;\n                    float x_79521;\n                    float x_79522;\n                    float x_79523;\n                    float x_79524;\n                    float x_79525;\n                    float x_79526;\n                    float x_79527;\n                    float x_79528;\n                    float x_79529;\n                    \n                    offset_79544 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79489,\n                                  sext_i64_i32(segred_group_sizze_72114))) {\n                            x_79520 = ((__local\n                                        float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489 +\n                                                                    offset_79544)];\n                            x_79521 = ((__local\n                                        float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489 +\n                                                                    offset_79544)];\n                            x_79522 = ((__local\n                                        float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489 +\n                                                                    offset_79544)];\n                            x_79523 = ((__local\n                                        float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489 +\n                                                                    offset_79544)];\n                            x_79524 = ((__local\n                                        float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489 +\n                                                                    offset_79544)];\n                        }\n                    }\n                    offset_79544 = 1;\n                    while (slt32(offset_7954",
            "4, wave_sizze_79491)) {\n                        if (slt32(local_tid_79489 + offset_79544,\n                                  sext_i64_i32(segred_group_sizze_72114)) &&\n                            ((local_tid_79489 - squot32(local_tid_79489,\n                                                        wave_sizze_79491) *\n                              wave_sizze_79491) & (2 * offset_79544 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_79525 = ((volatile __local\n                                            float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79526 = ((volatile __local\n                                            float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79527 = ((volatile __local\n                                            float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79528 = ((volatile __local\n                                            float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79529 = ((volatile __local\n                                            float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79530 = x_79520 + x_79525;\n                                floa",
            "t defunc_1_op_res_79531 = x_79521 + x_79526;\n                                float defunc_1_op_res_79532 = x_79522 + x_79527;\n                                float defunc_1_op_res_79533 = x_79523 + x_79528;\n                                float defunc_1_op_res_79534 = x_79524 + x_79529;\n                                \n                                x_79520 = defunc_1_op_res_79530;\n                                x_79521 = defunc_1_op_res_79531;\n                                x_79522 = defunc_1_op_res_79532;\n                                x_79523 = defunc_1_op_res_79533;\n                                x_79524 = defunc_1_op_res_79534;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489)] =\n                                    x_79520;\n                                ((volatile __local\n                                  float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489)] =\n                                    x_79521;\n                                ((volatile __local\n                                  float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489)] =\n                                    x_79522;\n                                ((volatile __local\n                                  float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489)] =\n                                    x_79523;\n                                ((volatile __local\n                                  float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489)] =\n                                    x_79524;\n                            }\n                        }\n                        offset_79544 *= 2;\n                    }\n                    while (slt32(skip_waves_79545,\n                                 squot32(sext_i64_i32(segred_group_sizze_72114) +\n                            ",
            "             wave_sizze_79491 - 1,\n                                         wave_sizze_79491))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79544 = skip_waves_79545 * wave_sizze_79491;\n                        if (slt32(local_tid_79489 + offset_79544,\n                                  sext_i64_i32(segred_group_sizze_72114)) &&\n                            ((local_tid_79489 - squot32(local_tid_79489,\n                                                        wave_sizze_79491) *\n                              wave_sizze_79491) == 0 &&\n                             (squot32(local_tid_79489, wave_sizze_79491) & (2 *\n                                                                            skip_waves_79545 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_79525 = ((__local\n                                            float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79526 = ((__local\n                                            float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79527 = ((__local\n                                            float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79528 = ((__local\n                                            float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                                x_79529 = ((__local\n                           ",
            "                 float *) red_arr_mem_79501)[sext_i32_i64(local_tid_79489 +\n                                                                        offset_79544)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79530 = x_79520 + x_79525;\n                                float defunc_1_op_res_79531 = x_79521 + x_79526;\n                                float defunc_1_op_res_79532 = x_79522 + x_79527;\n                                float defunc_1_op_res_79533 = x_79523 + x_79528;\n                                float defunc_1_op_res_79534 = x_79524 + x_79529;\n                                \n                                x_79520 = defunc_1_op_res_79530;\n                                x_79521 = defunc_1_op_res_79531;\n                                x_79522 = defunc_1_op_res_79532;\n                                x_79523 = defunc_1_op_res_79533;\n                                x_79524 = defunc_1_op_res_79534;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79493)[sext_i32_i64(local_tid_79489)] =\n                                    x_79520;\n                                ((__local\n                                  float *) red_arr_mem_79495)[sext_i32_i64(local_tid_79489)] =\n                                    x_79521;\n                                ((__local\n                                  float *) red_arr_mem_79497)[sext_i32_i64(local_tid_79489)] =\n                                    x_79522;\n                                ((__local\n                                  float *) red_arr_mem_79499)[sext_i32_i64(local_tid_79489)] =\n                                    x_79523;\n                                ((__local\n                                  float *) red_arr_mem_79501)[sext_i3",
            "2_i64(local_tid_79489)] =\n                                    x_79524;\n                            }\n                        }\n                        skip_waves_79545 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79489 == 0) {\n                            ((__global float *) mem_77760)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79520;\n                            ((__global float *) mem_77764)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79521;\n                            ((__global float *) mem_77768)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79522;\n                            ((__global float *) mem_77772)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79523;\n                            ((__global float *) mem_77776)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79524;\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_72114\n}\n__kernel void mainzisegred_large_72224(__global int *global_failure,\n                                       uint sync_arr_mem_79611_backing_offset_0,\n        ",
            "                               uint red_arr_mem_79609_backing_offset_1,\n                                       uint red_arr_mem_79607_backing_offset_2,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72217,\n                                       int64_t groups_per_segment_79591,\n                                       int64_t elements_per_thread_79592,\n                                       int64_t virt_num_groups_79593,\n                                       int64_t threads_per_segment_79595,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77612,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77781,\n                                       __global unsigned char *mem_77785,\n                                       __global unsigned char *mem_77789,\n                                       __global unsigned char *mem_77793,\n                                       __global unsigned char *mem_77797,\n                                       __global unsigned char *mem_77802,\n                                       __global unsigned char *mem_77806,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79596,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79598,\n                                       __global\n          ",
            "                             unsigned char *mainzicounter_mem_79600)\n{\n    #define segred_group_sizze_72216 (mainzisegred_group_sizze_70912)\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_79611_backing_2 =\n                           &shared_mem[sync_arr_mem_79611_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79609_backing_1 =\n                           &shared_mem[red_arr_mem_79609_backing_offset_1];\n    volatile unsigned char *red_arr_mem_79607_backing_0 =\n                           &shared_mem[red_arr_mem_79607_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79602;\n    int32_t local_tid_79603;\n    int64_t group_sizze_79606;\n    int32_t wave_sizze_79605;\n    int32_t group_tid_79604;\n    \n    global_tid_79602 = get_global_id(0);\n    local_tid_79603 = get_local_id(0);\n    group_sizze_79606 = get_local_size(0);\n    wave_sizze_79605 = LOCKSTEP_WIDTH;\n    group_tid_79604 = get_group_id(0);\n    \n    int32_t phys_tid_72224 = global_tid_79602;\n    __local unsigned char *red_arr_mem_79607;\n    \n    red_arr_mem_79607 = (__local unsigned char *) red_arr_mem_79607_backing_0;\n    \n    __local unsigned char *red_arr_mem_79609;\n    \n    red_arr_mem_79609 = (__local unsigned char *) red_arr_mem_79609_backing_1;\n    \n    __local unsigned char *sync_arr_mem_79611;\n    \n    sync_arr_mem_79611 = (__local unsigned char *) sync_arr_mem_79611_backing_2;\n    \n    int32_t phys_group_id_79613;\n    \n    phys_group_id_79613 = get_group_id(0);\n    for (int32_t i_79614 = 0; i_79614 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_79593) - phys_group_id_79613,\n                   sext_i64_i32(num_groups_72217)); i_79614++) {\n        int32_t virt_group_id_79615 = phys_group_id_79613 + i_79614 *\n                sext_i64_i32(num_groups_72217);\n        int32_t flat_segment_id_79616 = squot32(virt_group_id_79615,\n                                      ",
            "          sext_i64_i32(groups_per_segment_79591));\n        int64_t global_tid_79617 = srem64(sext_i32_i64(virt_group_id_79615) *\n                                          segred_group_sizze_72216 +\n                                          sext_i32_i64(local_tid_79603),\n                                          segred_group_sizze_72216 *\n                                          groups_per_segment_79591);\n        int64_t slice_79618 = n_m_65352;\n        int64_t slice_79619 = m_65343 * slice_79618;\n        int64_t gtid_72221 = squot64(sext_i32_i64(flat_segment_id_79616),\n                                     slice_79618);\n        int64_t remnant_79620 = sext_i32_i64(flat_segment_id_79616) -\n                gtid_72221 * slice_79618;\n        int64_t gtid_72222 = remnant_79620;\n        int64_t remnant_79621 = remnant_79620 - gtid_72222;\n        int64_t gtid_72223;\n        float x_acc_79622;\n        float x_acc_79623;\n        int64_t chunk_sizze_79624 = smin64(elements_per_thread_79592,\n                                           sdiv_up64(q_65346 - global_tid_79617,\n                                                     threads_per_segment_79595));\n        float x_72225;\n        float x_72226;\n        float x_72227;\n        float x_72228;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79622 = 0.0F;\n            x_acc_79623 = 0.0F;\n        }\n        for (int64_t i_79631 = 0; i_79631 < chunk_sizze_79624; i_79631++) {\n            gtid_72223 = global_tid_79617 + threads_per_segment_79595 * i_79631;\n            // apply map function\n            {\n                int64_t last_res_72231;\n                \n                last_res_72231 = ((__global int64_t *) mem_77608)[gtid_72221 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74692 = mul64(jump_65348, gtid_72222);\n                int64_t inde",
            "x_primexp_74693 = smin64(i_65358, binop_y_74692);\n                int64_t max_res_72244;\n                \n                max_res_72244 = ((__global int64_t *) mem_77751)[gtid_72221 *\n                                                                 n_m_65352 +\n                                                                 gtid_72222];\n                \n                float defunc_1_f_res_72245;\n                \n                defunc_1_f_res_72245 = ((__global\n                                         float *) mem_77755)[gtid_72221 *\n                                                             n_m_65352 +\n                                                             gtid_72222];\n                \n                float a12_72246;\n                \n                a12_72246 = ((__global float *) mem_77781)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float b12_72247;\n                \n                b12_72247 = ((__global float *) mem_77785)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float c12_72248;\n                \n                c12_72248 = ((__global float *) mem_77789)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float b2_72249;\n                \n                b2_72249 = ((__global float *) mem_77793)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float c2_72250;\n                \n                c2_72250 = ((__global float *) mem_77797)[gtid_72221 *\n                                                   ",
            "       n_m_65352 +\n                                                          gtid_72222];\n                \n                float x_72252;\n                \n                x_72252 = ((__global float *) mem_77640)[gtid_72221 * q_65346 +\n                                                         gtid_72223];\n                \n                bool cond_72253 = sle64(last_res_72231, gtid_72223);\n                int64_t defunc_0_f_res_72254;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72254 = (int64_t) 0;\n                } else {\n                    int64_t i_72255 = add64(gtid_72223, max_res_72244);\n                    int64_t defunc_0_add_arg_72256;\n                    \n                    defunc_0_add_arg_72256 = ((__global\n                                               int64_t *) mem_77616)[gtid_72221 *\n                                                                     n_65344 +\n                                                                     i_72255];\n                    \n                    int64_t defunc_1_add_res_72257 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72256);\n                    \n                    defunc_0_f_res_72254 = defunc_1_add_res_72257;\n                }\n                \n                int64_t binop_p_72258 = sub64(defunc_0_f_res_72254,\n                                              index_primexp_74693);\n                float defunc_0_f_res_72259 = sitofp_i64_f32(binop_p_72258);\n                float abs_res_72260 = (float) fabs(defunc_0_f_res_72259);\n                float tmp1_72261 = abs_res_72260 / defunc_1_f_res_72245;\n                float x_72262 = tmp1_72261 * tmp1_72261;\n                float y_72263 = tmp1_72261 * x_72262;\n                float tmp2_72264 = 1.0F - y_72263;\n                float x_72265 = tmp2_72264 * tmp2_72264;\n                float tmp3_72266 = tmp2_72264 * x_72265;\n                float tmp4_72267 = x_72252 * tmp3_72266",
            ";\n                float defunc_1_f_res_72268 = defunc_0_f_res_72259 * tmp4_72267;\n                float defunc_1_f_res_72269 = defunc_0_f_res_72259 *\n                      defunc_1_f_res_72268;\n                float defunc_0_f_res_72270;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72270 = 0.0F;\n                } else {\n                    int64_t i_72271 = add64(gtid_72223, max_res_72244);\n                    float defunc_0_add_arg_72272;\n                    \n                    defunc_0_add_arg_72272 = ((__global\n                                               float *) mem_77612)[gtid_72221 *\n                                                                   n_65344 +\n                                                                   i_72271];\n                    defunc_0_f_res_72270 = defunc_0_add_arg_72272;\n                }\n                \n                float x_72273 = a12_72246 * tmp4_72267;\n                float y_72274 = b12_72247 * defunc_1_f_res_72268;\n                float x_72275 = x_72273 + y_72274;\n                float y_72276 = c12_72248 * defunc_1_f_res_72269;\n                float x_72277 = x_72275 + y_72276;\n                float defunc_9_fit_fun_res_72278 = defunc_0_f_res_72270 *\n                      x_72277;\n                float x_72279 = b12_72247 * tmp4_72267;\n                float y_72280 = b2_72249 * defunc_1_f_res_72268;\n                float x_72281 = x_72279 + y_72280;\n                float y_72282 = c2_72250 * defunc_1_f_res_72269;\n                float x_72283 = x_72281 + y_72282;\n                float defunc_9_slope_fun_res_72284 = defunc_0_f_res_72270 *\n                      x_72283;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_72225 = x_acc_79622;\n                    x_72226 = x_acc_79623;\n                }\n                // load new values\n                {\n                    x_72",
            "227 = defunc_9_fit_fun_res_72278;\n                    x_72228 = defunc_9_slope_fun_res_72284;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_72229 = x_72225 + x_72227;\n                    float defunc_1_op_res_72230 = x_72226 + x_72228;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79622 = defunc_1_op_res_72229;\n                        x_acc_79623 = defunc_1_op_res_72230;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_72225 = x_acc_79622;\n            x_72226 = x_acc_79623;\n            ((__local\n              float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603)] =\n                x_72225;\n            ((__local\n              float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603)] =\n                x_72226;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79632;\n        int32_t skip_waves_79633 = 1;\n        float x_79625;\n        float x_79626;\n        float x_79627;\n        float x_79628;\n        \n        offset_79632 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79603,\n                      sext_i64_i32(segred_group_sizze_72216))) {\n                x_79625 = ((__local\n                            float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603 +\n                                                        offset_79632)];\n                x_79626 = ((__local\n                            float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603 +\n                                                        offset_79632)];\n            }\n        }\n        offset_79632 = 1;\n        while (slt32(offset_79632, wave_sizze_79605)) {\n            if (slt32(local_tid_79603 + offset_79632,\n                      sext_i64_i32(segred_group_",
            "sizze_72216)) &&\n                ((local_tid_79603 - squot32(local_tid_79603, wave_sizze_79605) *\n                  wave_sizze_79605) & (2 * offset_79632 - 1)) == 0) {\n                // read array element\n                {\n                    x_79627 = ((volatile __local\n                                float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603 +\n                                                            offset_79632)];\n                    x_79628 = ((volatile __local\n                                float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603 +\n                                                            offset_79632)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79629 = x_79625 + x_79627;\n                    float defunc_1_op_res_79630 = x_79626 + x_79628;\n                    \n                    x_79625 = defunc_1_op_res_79629;\n                    x_79626 = defunc_1_op_res_79630;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603)] =\n                        x_79625;\n                    ((volatile __local\n                      float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603)] =\n                        x_79626;\n                }\n            }\n            offset_79632 *= 2;\n        }\n        while (slt32(skip_waves_79633,\n                     squot32(sext_i64_i32(segred_group_sizze_72216) +\n                             wave_sizze_79605 - 1, wave_sizze_79605))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79632 = skip_waves_79633 * wave_sizze_79605;\n            if (slt32(local_tid_79603 + offset_79632,\n                      sext_i64_i32(segred_group_sizze_72216)) &&\n                ((local_tid_79603 - squot32(local_tid_79603, wave_sizze_79605) *\n                  wave_sizze_79605) == 0 && (s",
            "quot32(local_tid_79603,\n                                                     wave_sizze_79605) & (2 *\n                                                                          skip_waves_79633 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_79627 = ((__local\n                                float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603 +\n                                                            offset_79632)];\n                    x_79628 = ((__local\n                                float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603 +\n                                                            offset_79632)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79629 = x_79625 + x_79627;\n                    float defunc_1_op_res_79630 = x_79626 + x_79628;\n                    \n                    x_79625 = defunc_1_op_res_79629;\n                    x_79626 = defunc_1_op_res_79630;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603)] =\n                        x_79625;\n                    ((__local\n                      float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603)] =\n                        x_79626;\n                }\n            }\n            skip_waves_79633 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79603) == (int64_t) 0) {\n                x_acc_79622 = x_79625;\n                x_acc_79623 = x_79626;\n            }\n        }\n        if (groups_per_segment_79591 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_",
            "79603 == 0) {\n                    ((__global float *) mem_77802)[gtid_72221 * n_m_65352 +\n                                                   gtid_72222] = x_acc_79622;\n                    ((__global float *) mem_77806)[gtid_72221 * n_m_65352 +\n                                                   gtid_72222] = x_acc_79623;\n                }\n            }\n        } else {\n            int32_t old_counter_79634;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79603 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_79596)[sext_i32_i64(virt_group_id_79615)] =\n                        x_acc_79622;\n                    ((__global\n                      float *) segred_tmp_mem_79598)[sext_i32_i64(virt_group_id_79615)] =\n                        x_acc_79623;\n                    mem_fence_global();\n                    old_counter_79634 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79600)[sext_i32_i64(srem32(flat_segment_id_79616,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79611)[(int64_t) 0] =\n                        old_counter_79634 == groups_per_segment_79591 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_79635;\n            \n            is_last_group_79635 = ((__local\n                                    bool *) sync_arr_mem_79611)[(int64_t) 0];\n            if (is_last_group_79635) {\n                if (local_tid_79603 == 0) {\n                    old_counter_79634 =\n                        atomic_add_i32_global(&((volatile __global\n                                     ",
            "            int *) mainzicounter_mem_79600)[sext_i32_i64(srem32(flat_segment_id_79616,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_79591));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79636 =\n                            sdiv_up64(groups_per_segment_79591,\n                                      segred_group_sizze_72216);\n                    \n                    x_72225 = 0.0F;\n                    x_72226 = 0.0F;\n                    for (int64_t i_79637 = 0; i_79637 < read_per_thread_79636;\n                         i_79637++) {\n                        int64_t group_res_id_79638 =\n                                sext_i32_i64(local_tid_79603) *\n                                read_per_thread_79636 + i_79637;\n                        int64_t index_of_group_res_79639 =\n                                sext_i32_i64(flat_segment_id_79616) *\n                                groups_per_segment_79591 + group_res_id_79638;\n                        \n                        if (slt64(group_res_id_79638,\n                                  groups_per_segment_79591)) {\n                            x_72227 = ((__global\n                                        float *) segred_tmp_mem_79596)[index_of_group_res_79639];\n                            x_72228 = ((__global\n                                        float *) segred_tmp_mem_79598)[index_of_group_res_79639];\n                            \n                            float defunc_1_op_res_72229 = x_72225 + x_72227;\n                            float defunc_1_op_res_72230 = x_72226 + x_72228;\n                            \n                            x_72225 = defunc_1_op_res_72229;\n                            x_72226 = defunc_1_op_res_72230;\n                  ",
            "      }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603)] =\n                    x_72225;\n                ((__local\n                  float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603)] =\n                    x_72226;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_79640;\n                    int32_t skip_waves_79641 = 1;\n                    float x_79625;\n                    float x_79626;\n                    float x_79627;\n                    float x_79628;\n                    \n                    offset_79640 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79603,\n                                  sext_i64_i32(segred_group_sizze_72216))) {\n                            x_79625 = ((__local\n                                        float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603 +\n                                                                    offset_79640)];\n                            x_79626 = ((__local\n                                        float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603 +\n                                                                    offset_79640)];\n                        }\n                    }\n                    offset_79640 = 1;\n                    while (slt32(offset_79640, wave_sizze_79605)) {\n                        if (slt32(local_tid_79603 + offset_79640,\n                                  sext_i64_i32(segred_group_sizze_72216)) &&\n                            ((local_tid_79603 - squot32(local_tid_79603,\n                                                        wave_sizze_79605) *\n                              wave_sizze_79605) & (2 * offset_79640 - 1)) ==\n                            0) {\n                            // read array e",
            "lement\n                            {\n                                x_79627 = ((volatile __local\n                                            float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603 +\n                                                                        offset_79640)];\n                                x_79628 = ((volatile __local\n                                            float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603 +\n                                                                        offset_79640)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79629 = x_79625 + x_79627;\n                                float defunc_1_op_res_79630 = x_79626 + x_79628;\n                                \n                                x_79625 = defunc_1_op_res_79629;\n                                x_79626 = defunc_1_op_res_79630;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603)] =\n                                    x_79625;\n                                ((volatile __local\n                                  float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603)] =\n                                    x_79626;\n                            }\n                        }\n                        offset_79640 *= 2;\n                    }\n                    while (slt32(skip_waves_79641,\n                                 squot32(sext_i64_i32(segred_group_sizze_72216) +\n                                         wave_sizze_79605 - 1,\n                                         wave_sizze_79605))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79640 = skip_waves_79641 * wave_sizze_79605;\n        ",
            "                if (slt32(local_tid_79603 + offset_79640,\n                                  sext_i64_i32(segred_group_sizze_72216)) &&\n                            ((local_tid_79603 - squot32(local_tid_79603,\n                                                        wave_sizze_79605) *\n                              wave_sizze_79605) == 0 &&\n                             (squot32(local_tid_79603, wave_sizze_79605) & (2 *\n                                                                            skip_waves_79641 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_79627 = ((__local\n                                            float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603 +\n                                                                        offset_79640)];\n                                x_79628 = ((__local\n                                            float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603 +\n                                                                        offset_79640)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79629 = x_79625 + x_79627;\n                                float defunc_1_op_res_79630 = x_79626 + x_79628;\n                                \n                                x_79625 = defunc_1_op_res_79629;\n                                x_79626 = defunc_1_op_res_79630;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79607)[sext_i32_i64(local_tid_79603)] =\n                                    x_79625;\n                                ((__local\n                  ",
            "                float *) red_arr_mem_79609)[sext_i32_i64(local_tid_79603)] =\n                                    x_79626;\n                            }\n                        }\n                        skip_waves_79641 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79603 == 0) {\n                            ((__global float *) mem_77802)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222] =\n                                x_79625;\n                            ((__global float *) mem_77806)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222] =\n                                x_79626;\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_72216\n}\n__kernel void mainzisegred_small_68229(__global int *global_failure,\n                                       uint red_arr_mem_78543_backing_offset_0,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68223,\n                                       int64_t segment_sizze_nonzzero_78536,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_",
            "77174,\n                                       __global unsigned char *mem_77179)\n{\n    #define segred_group_sizze_68222 (mainzisegred_group_sizze_67302)\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_78543_backing_0 =\n                           &shared_mem[red_arr_mem_78543_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78538;\n    int32_t local_tid_78539;\n    int64_t group_sizze_78542;\n    int32_t wave_sizze_78541;\n    int32_t group_tid_78540;\n    \n    global_tid_78538 = get_global_id(0);\n    local_tid_78539 = get_local_id(0);\n    group_sizze_78542 = get_local_size(0);\n    wave_sizze_78541 = LOCKSTEP_WIDTH;\n    group_tid_78540 = get_group_id(0);\n    \n    int32_t phys_tid_68229 = global_tid_78538;\n    __local unsigned char *red_arr_mem_78543;\n    \n    red_arr_mem_78543 = (__local unsigned char *) red_arr_mem_78543_backing_0;\n    \n    int32_t phys_group_id_78545;\n    \n    phys_group_id_78545 = get_group_id(0);\n    for (int32_t i_78546 = 0; i_78546 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_68222,\n                                                  segment_sizze_nonzzero_78536))) -\n                   phys_group_id_78545, sext_i64_i32(num_groups_68223));\n         i_78546++) {\n        int32_t virt_group_id_78547 = phys_group_id_78545 + i_78546 *\n                sext_i64_i32(num_groups_68223);\n        int64_t slice_78548 = n_m_65352;\n        int64_t slice_78549 = m_65343 * slice_78548;\n        int64_t gtid_68226 = squot64(squot64(sext_i32_i64(local_tid_78539),\n                                             segment_sizze_nonzzero_78536) +\n                                     sext_i32_i64(virt_group_id_78547) *\n                                     squot64(segred_group_sizze_68222,\n                                             segment_sizze_nonzzero_7853",
            "6),\n                                     slice_78548);\n        int64_t remnant_78550 = squot64(sext_i32_i64(local_tid_78539),\n                                        segment_sizze_nonzzero_78536) +\n                sext_i32_i64(virt_group_id_78547) *\n                squot64(segred_group_sizze_68222,\n                        segment_sizze_nonzzero_78536) - gtid_68226 *\n                slice_78548;\n        int64_t gtid_68227 = remnant_78550;\n        int64_t remnant_78551 = remnant_78550 - gtid_68227;\n        int64_t gtid_68228 = srem64(sext_i32_i64(local_tid_78539), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_68226, m_65343) &&\n                                                 slt64(gtid_68227,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78539),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_68222,\n                                                              segment_sizze_nonzzero_78536)))) {\n                int64_t last_res_68233;\n                \n                last_res_68233 = ((__global int64_t *) mem_77082)[gtid_68226 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74680 = mul64(jump_65348, gtid_68227);\n                int64_t index_primexp_74681 = smin64(i_65358, binop_y_74680);\n                float defunc_1_f_res_68241;\n                \n                defunc_1_f_res_68241 = ((__global\n                                         float *) mem_77174)[gtid_68226 *\n                                                             n_m_65352 +\n                                                             gtid_68227];\n                \n      ",
            "          float x_68243;\n                \n                x_68243 = ((__global float *) mem_77114)[gtid_68226 * q_65346 +\n                                                         gtid_68228];\n                \n                bool cond_68244 = sle64(last_res_68233, gtid_68228);\n                int64_t defunc_0_f_res_68245;\n                \n                if (cond_68244) {\n                    defunc_0_f_res_68245 = (int64_t) 0;\n                } else {\n                    int64_t max_res_68240;\n                    \n                    max_res_68240 = ((__global\n                                      int64_t *) mem_77170)[gtid_68226 *\n                                                            n_m_65352 +\n                                                            gtid_68227];\n                    \n                    int64_t i_68246 = add64(gtid_68228, max_res_68240);\n                    int64_t defunc_0_add_arg_68247;\n                    \n                    defunc_0_add_arg_68247 = ((__global\n                                               int64_t *) mem_77090)[gtid_68226 *\n                                                                     n_65344 +\n                                                                     i_68246];\n                    \n                    int64_t defunc_1_add_res_68248 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68247);\n                    \n                    defunc_0_f_res_68245 = defunc_1_add_res_68248;\n                }\n                \n                int64_t binop_p_68249 = sub64(defunc_0_f_res_68245,\n                                              index_primexp_74681);\n                float defunc_0_f_res_68250 = sitofp_i64_f32(binop_p_68249);\n                float abs_res_68251 = (float) fabs(defunc_0_f_res_68250);\n                float tmp1_68252 = abs_res_68251 / defunc_1_f_res_68241;\n                float x_68253 = tmp1_68252 * tmp1_68252;\n                float y_68254 = tmp1_",
            "68252 * x_68253;\n                float tmp2_68255 = 1.0F - y_68254;\n                float x_68256 = tmp2_68255 * tmp2_68255;\n                float tmp3_68257 = tmp2_68255 * x_68256;\n                float w_j_68258 = x_68243 * tmp3_68257;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)] =\n                        w_j_68258;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_68230;\n                float x_68231;\n                float x_78552;\n                float x_78553;\n                bool ltid_in_bounds_78555 = slt64(sext_i32_i64(local_tid_78539),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_68222,\n                                                          segment_sizze_nonzzero_78536));\n                int32_t skip_threads_78556;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78555) {\n                        x_68231 = ((volatile __local\n                                    float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)];\n                        if ((local_tid_78539 - squot32(local_tid_78539, 32) *\n                             32) == 0) {\n                            x_68230 = x_68231;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78556 = 1;\n    ",
            "                while (slt32(skip_threads_78556, 32)) {\n                        bool thread_active_78557 = sle32(skip_threads_78556,\n                                                         local_tid_78539 -\n                                                         squot32(local_tid_78539,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78555;\n                        \n                        if (thread_active_78557) {\n                            // read operands\n                            {\n                                x_68230 = ((volatile __local\n                                            float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539) -\n                                                                        sext_i32_i64(skip_threads_78556)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78558 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78539),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_78539) -\n                                       sext_i32_i64(local_tid_78539 -\n                                       skip_threads_78556));\n                            \n                            if (thread_active_78557 && inactive_78558) {\n                                x_68230 = x_68231;\n                            }\n                            if (thread_active_78557) {\n                                if (!inactive_78558) {\n                                    float defunc_1_op_res_68232 = x_68230 +\n                                          x_68231;\n                                    \n                                    x_68230 = defunc_1_op_res_68232;\n                                }\n                            }\n                        }\n                        if (sl",
            "e32(wave_sizze_78541, skip_threads_78556)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78557) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)] =\n                                    x_68230;\n                                x_68231 = x_68230;\n                            }\n                        }\n                        if (sle32(wave_sizze_78541, skip_threads_78556)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78556 *= 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_78539 - squot32(local_tid_78539, 32) * 32) ==\n                        31 && ltid_in_bounds_78555) {\n                        ((volatile __local\n                          float *) red_arr_mem_78543)[sext_i32_i64(squot32(local_tid_78539,\n                                                                           32))] =\n                            x_68230;\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_78559;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78539, 32) == 0 &&\n                            ltid_in_bounds_78555) {\n                            x_78553 = ((volatile __local\n                                        float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)];\n                            if ((local_tid_78539 - ",
            "squot32(local_tid_78539,\n                                                           32) * 32) == 0) {\n                                x_78552 = x_78553;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78559 = 1;\n                        while (slt32(skip_threads_78559, 32)) {\n                            bool thread_active_78560 = sle32(skip_threads_78559,\n                                                             local_tid_78539 -\n                                                             squot32(local_tid_78539,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78539, 32) == 0 &&\n                                  ltid_in_bounds_78555);\n                            \n                            if (thread_active_78560) {\n                                // read operands\n                                {\n                                    x_78552 = ((volatile __local\n                                                float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539) -\n                                                                            sext_i32_i64(skip_threads_78559)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_78561 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78539 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78539 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78539 -\n                                        ",
            "                 skip_threads_78559) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78560 && inactive_78561) {\n                                    x_78552 = x_78553;\n                                }\n                                if (thread_active_78560) {\n                                    if (!inactive_78561) {\n                                        float defunc_1_op_res_78554 = x_78552 +\n                                              x_78553;\n                                        \n                                        x_78552 = defunc_1_op_res_78554;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78541, skip_threads_78559)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78560) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)] =\n                                        x_78552;\n                                    x_78553 = x_78552;\n                                }\n                            }\n                            if (sle32(wave_sizze_78541, skip_threads_78559)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_78559 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_78562 = squot32(local_tid_78539, 32) == 0 ||\n                     !ltid_in_bounds_78555;\n                \n                // carry-in for every block except the first\n                {\n                    // read operan",
            "ds\n                    {\n                        if (!no_carry_in_78562) {\n                            x_68231 = x_68230;\n                            x_68230 = ((__local\n                                        float *) red_arr_mem_78543)[sext_i32_i64(squot32(local_tid_78539,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78563 =\n                             slt64(srem64(sext_i32_i64(local_tid_78539),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_78539) -\n                                   sext_i32_i64(squot32(local_tid_78539, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_78562) {\n                            if (inactive_78563) {\n                                x_68230 = x_68231;\n                            }\n                        }\n                        if (!no_carry_in_78562) {\n                            if (!inactive_78563) {\n                                float defunc_1_op_res_68232 = x_68230 + x_68231;\n                                \n                                x_68230 = defunc_1_op_res_68232;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_78562) {\n                            ((__local\n                              float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)] =\n                                x_68230;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n           ",
            "         if (squot32(local_tid_78539, 32) == 0 &&\n                        ltid_in_bounds_78555) {\n                        ((__local\n                          float *) red_arr_mem_78543)[sext_i32_i64(local_tid_78539)] =\n                            x_68231;\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_78547) *\n                      squot64(segred_group_sizze_68222,\n                              segment_sizze_nonzzero_78536) +\n                      sext_i32_i64(local_tid_78539), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78539),\n                      squot64(segred_group_sizze_68222,\n                              segment_sizze_nonzzero_78536))) {\n                float tmp_78564;\n                \n                tmp_78564 = ((__local\n                              float *) red_arr_mem_78543)[(sext_i32_i64(local_tid_78539) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78536 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77179)[squot64(sext_i32_i64(virt_group_id_78547) *\n                                              squot64(segred_group_sizze_68222,\n                                                      segment_sizze_nonzzero_78536) +\n                                              sext_i32_i64(local_tid_78539),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78547) *\n                                       squot64(segred_group_sizze_68222,\n                                               segment_sizze_nonzzero_78536) +\n                                       sext_i32_i64(loc",
            "al_tid_78539) -\n                                       squot64(sext_i32_i64(virt_group_id_78547) *\n                                               squot64(segred_group_sizze_68222,\n                                                       segment_sizze_nonzzero_78536) +\n                                               sext_i32_i64(local_tid_78539),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78564;\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_68222\n}\n__kernel void mainzisegred_small_68279(__global int *global_failure,\n                                       uint red_arr_mem_78625_backing_offset_0,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68273,\n                                       int64_t segment_sizze_nonzzero_78618,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77086,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77184,\n                                       __global unsigned char *mem_77189)\n{\n    #define segred_group_sizze_68272 (mainzisegred_group_sizze_67234)\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_78625_backing_0 =\n                       ",
            "    &shared_mem[red_arr_mem_78625_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78620;\n    int32_t local_tid_78621;\n    int64_t group_sizze_78624;\n    int32_t wave_sizze_78623;\n    int32_t group_tid_78622;\n    \n    global_tid_78620 = get_global_id(0);\n    local_tid_78621 = get_local_id(0);\n    group_sizze_78624 = get_local_size(0);\n    wave_sizze_78623 = LOCKSTEP_WIDTH;\n    group_tid_78622 = get_group_id(0);\n    \n    int32_t phys_tid_68279 = global_tid_78620;\n    __local unsigned char *red_arr_mem_78625;\n    \n    red_arr_mem_78625 = (__local unsigned char *) red_arr_mem_78625_backing_0;\n    \n    int32_t phys_group_id_78627;\n    \n    phys_group_id_78627 = get_group_id(0);\n    for (int32_t i_78628 = 0; i_78628 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_68272,\n                                                  segment_sizze_nonzzero_78618))) -\n                   phys_group_id_78627, sext_i64_i32(num_groups_68273));\n         i_78628++) {\n        int32_t virt_group_id_78629 = phys_group_id_78627 + i_78628 *\n                sext_i64_i32(num_groups_68273);\n        int64_t slice_78630 = n_m_65352;\n        int64_t slice_78631 = m_65343 * slice_78630;\n        int64_t gtid_68276 = squot64(squot64(sext_i32_i64(local_tid_78621),\n                                             segment_sizze_nonzzero_78618) +\n                                     sext_i32_i64(virt_group_id_78629) *\n                                     squot64(segred_group_sizze_68272,\n                                             segment_sizze_nonzzero_78618),\n                                     slice_78630);\n        int64_t remnant_78632 = squot64(sext_i32_i64(local_tid_78621),\n                                        segment_sizze_nonzzero_78618) +\n                sext_i32_i64(virt_group_id_78629) *\n                squot64(segred_group_sizze_68272,\n                        segme",
            "nt_sizze_nonzzero_78618) - gtid_68276 *\n                slice_78630;\n        int64_t gtid_68277 = remnant_78632;\n        int64_t remnant_78633 = remnant_78632 - gtid_68277;\n        int64_t gtid_68278 = srem64(sext_i32_i64(local_tid_78621), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_68276, m_65343) &&\n                                                 slt64(gtid_68277,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78621),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_68272,\n                                                              segment_sizze_nonzzero_78618)))) {\n                int64_t last_res_68283;\n                \n                last_res_68283 = ((__global int64_t *) mem_77082)[gtid_68276 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74676 = mul64(jump_65348, gtid_68277);\n                int64_t index_primexp_74677 = smin64(i_65358, binop_y_74676);\n                int64_t max_res_68292;\n                \n                max_res_68292 = ((__global int64_t *) mem_77170)[gtid_68276 *\n                                                                 n_m_65352 +\n                                                                 gtid_68277];\n                \n                float defunc_1_f_res_68293;\n                \n                defunc_1_f_res_68293 = ((__global\n                                         float *) mem_77174)[gtid_68276 *\n                                                             n_m_65352 +\n                                                             gtid_68277];\n                \n                float a0_6829",
            "4;\n                \n                a0_68294 = ((__global float *) mem_77184)[gtid_68276 *\n                                                          n_m_65352 +\n                                                          gtid_68277];\n                \n                float x_68296;\n                \n                x_68296 = ((__global float *) mem_77114)[gtid_68276 * q_65346 +\n                                                         gtid_68278];\n                \n                bool cond_68297 = sle64(last_res_68283, gtid_68278);\n                int64_t defunc_0_f_res_68298;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68298 = (int64_t) 0;\n                } else {\n                    int64_t i_68299 = add64(gtid_68278, max_res_68292);\n                    int64_t defunc_0_add_arg_68300;\n                    \n                    defunc_0_add_arg_68300 = ((__global\n                                               int64_t *) mem_77090)[gtid_68276 *\n                                                                     n_65344 +\n                                                                     i_68299];\n                    \n                    int64_t defunc_1_add_res_68301 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68300);\n                    \n                    defunc_0_f_res_68298 = defunc_1_add_res_68301;\n                }\n                \n                int64_t binop_p_68302 = sub64(defunc_0_f_res_68298,\n                                              index_primexp_74677);\n                float defunc_0_f_res_68303 = sitofp_i64_f32(binop_p_68302);\n                float abs_res_68304 = (float) fabs(defunc_0_f_res_68303);\n                float tmp1_68305 = abs_res_68304 / defunc_1_f_res_68293;\n                float x_68306 = tmp1_68305 * tmp1_68305;\n                float y_68307 = tmp1_68305 * x_68306;\n                float tmp2_68308 = 1.0F - y_68307;\n                float x_683",
            "09 = tmp2_68308 * tmp2_68308;\n                float tmp3_68310 = tmp2_68308 * x_68309;\n                float tmp4_68311 = x_68296 * tmp3_68310;\n                float defunc_0_f_res_68312;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68312 = 0.0F;\n                } else {\n                    int64_t i_68313 = add64(gtid_68278, max_res_68292);\n                    float defunc_0_add_arg_68314;\n                    \n                    defunc_0_add_arg_68314 = ((__global\n                                               float *) mem_77086)[gtid_68276 *\n                                                                   n_65344 +\n                                                                   i_68313];\n                    defunc_0_f_res_68312 = defunc_0_add_arg_68314;\n                }\n                \n                float x_68315 = a0_68294 * tmp4_68311;\n                float defunc_9_fit_fun_res_68316 = defunc_0_f_res_68312 *\n                      x_68315;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)] =\n                        defunc_9_fit_fun_res_68316;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_68280;\n                float x_68281;\n                float x_78634;\n                float x_78635;\n                bool ltid_in_bounds_78637 = slt64(sext_i32_i64(local_tid_78621),\n                                                  q_65346 *\n                                                  squot64(segred_group_si",
            "zze_68272,\n                                                          segment_sizze_nonzzero_78618));\n                int32_t skip_threads_78638;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78637) {\n                        x_68281 = ((volatile __local\n                                    float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)];\n                        if ((local_tid_78621 - squot32(local_tid_78621, 32) *\n                             32) == 0) {\n                            x_68280 = x_68281;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78638 = 1;\n                    while (slt32(skip_threads_78638, 32)) {\n                        bool thread_active_78639 = sle32(skip_threads_78638,\n                                                         local_tid_78621 -\n                                                         squot32(local_tid_78621,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78637;\n                        \n                        if (thread_active_78639) {\n                            // read operands\n                            {\n                                x_68280 = ((volatile __local\n                                            float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621) -\n                                                                        sext_i32_i64(skip_threads_78638)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78640 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78621),\n                                              q_65346),\n                                       sext_i32_i64(local_tid",
            "_78621) -\n                                       sext_i32_i64(local_tid_78621 -\n                                       skip_threads_78638));\n                            \n                            if (thread_active_78639 && inactive_78640) {\n                                x_68280 = x_68281;\n                            }\n                            if (thread_active_78639) {\n                                if (!inactive_78640) {\n                                    float defunc_1_op_res_68282 = x_68280 +\n                                          x_68281;\n                                    \n                                    x_68280 = defunc_1_op_res_68282;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78623, skip_threads_78638)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78639) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)] =\n                                    x_68280;\n                                x_68281 = x_68280;\n                            }\n                        }\n                        if (sle32(wave_sizze_78623, skip_threads_78638)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78638 *= 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_78621 - squot32(local_tid_78621, 32) * 32) ==\n                        31 && ltid_in_bounds_78637) {\n                        ((volatile __local\n                          float *) red_arr_mem_78625)[sext_i32_i64(squot32(local_tid_78621,\n   ",
            "                                                                        32))] =\n                            x_68280;\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_78641;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78621, 32) == 0 &&\n                            ltid_in_bounds_78637) {\n                            x_78635 = ((volatile __local\n                                        float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)];\n                            if ((local_tid_78621 - squot32(local_tid_78621,\n                                                           32) * 32) == 0) {\n                                x_78634 = x_78635;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78641 = 1;\n                        while (slt32(skip_threads_78641, 32)) {\n                            bool thread_active_78642 = sle32(skip_threads_78641,\n                                                             local_tid_78621 -\n                                                             squot32(local_tid_78621,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78621, 32) == 0 &&\n                                  ltid_in_bounds_78637);\n                            \n                            if (thread_active_78642) {\n                                // read operands\n                                {\n                                    x_78634 = ((volatile __local\n                               ",
            "                 float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621) -\n                                                                            sext_i32_i64(skip_threads_78641)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_78643 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78621 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78621 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78621 -\n                                                         skip_threads_78641) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78642 && inactive_78643) {\n                                    x_78634 = x_78635;\n                                }\n                                if (thread_active_78642) {\n                                    if (!inactive_78643) {\n                                        float defunc_1_op_res_78636 = x_78634 +\n                                              x_78635;\n                                        \n                                        x_78634 = defunc_1_op_res_78636;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78623, skip_threads_78641)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78642) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78625)[sext_i32_i64(local_",
            "tid_78621)] =\n                                        x_78634;\n                                    x_78635 = x_78634;\n                                }\n                            }\n                            if (sle32(wave_sizze_78623, skip_threads_78641)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_78641 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_78644 = squot32(local_tid_78621, 32) == 0 ||\n                     !ltid_in_bounds_78637;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_78644) {\n                            x_68281 = x_68280;\n                            x_68280 = ((__local\n                                        float *) red_arr_mem_78625)[sext_i32_i64(squot32(local_tid_78621,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78645 =\n                             slt64(srem64(sext_i32_i64(local_tid_78621),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_78621) -\n                                   sext_i32_i64(squot32(local_tid_78621, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_78644) {\n                            if (inactive_78645) {\n                                x_68280 = x_68281;\n                            }\n                        }\n                        if (!no_carry_in_78644) {\n    ",
            "                        if (!inactive_78645) {\n                                float defunc_1_op_res_68282 = x_68280 + x_68281;\n                                \n                                x_68280 = defunc_1_op_res_68282;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_78644) {\n                            ((__local\n                              float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)] =\n                                x_68280;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_78621, 32) == 0 &&\n                        ltid_in_bounds_78637) {\n                        ((__local\n                          float *) red_arr_mem_78625)[sext_i32_i64(local_tid_78621)] =\n                            x_68281;\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_78629) *\n                      squot64(segred_group_sizze_68272,\n                              segment_sizze_nonzzero_78618) +\n                      sext_i32_i64(local_tid_78621), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78621),\n                      squot64(segred_group_sizze_68272,\n                              segment_sizze_nonzzero_78618))) {\n                float tmp_78646;\n                \n                tmp_78646 = ((__local\n                              float *) red_arr_mem_78625)[(sext_i32_i64(local_tid_78621) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzer",
            "o_78618 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77189)[squot64(sext_i32_i64(virt_group_id_78629) *\n                                              squot64(segred_group_sizze_68272,\n                                                      segment_sizze_nonzzero_78618) +\n                                              sext_i32_i64(local_tid_78621),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78629) *\n                                       squot64(segred_group_sizze_68272,\n                                               segment_sizze_nonzzero_78618) +\n                                       sext_i32_i64(local_tid_78621) -\n                                       squot64(sext_i32_i64(virt_group_id_78629) *\n                                               squot64(segred_group_sizze_68272,\n                                                       segment_sizze_nonzzero_78618) +\n                                               sext_i32_i64(local_tid_78621),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78646;\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_68272\n}\n__kernel void mainzisegred_small_70052(__global int *global_failure,\n                                       uint red_arr_mem_78958_backing_offset_0,\n                                       uint red_arr_mem_78956_backing_offset_1,\n                                       uint red_arr_mem_78954_backing_offset_2,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                   ",
            "    int64_t num_groups_70044,\n                                       int64_t segment_sizze_nonzzero_78947,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77444,\n                                       __global unsigned char *mem_77448,\n                                       __global unsigned char *mem_77452)\n{\n    #define segred_group_sizze_70043 (mainzisegred_group_sizze_69048)\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_78958_backing_2 =\n                           &shared_mem[red_arr_mem_78958_backing_offset_0];\n    volatile unsigned char *red_arr_mem_78956_backing_1 =\n                           &shared_mem[red_arr_mem_78956_backing_offset_1];\n    volatile unsigned char *red_arr_mem_78954_backing_0 =\n                           &shared_mem[red_arr_mem_78954_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78949;\n    int32_t local_tid_78950;\n    int64_t group_sizze_78953;\n    int32_t wave_sizze_78952;\n    int32_t group_tid_78951;\n    \n    global_tid_78949 = get_global_id(0);\n    local_tid_78950 = get_local_id(0);\n    group_sizze_78953 = get_local_size(0);\n    wave_sizze_78952 = LOCKSTEP_WIDTH;\n    group_tid_78951 = get_group_id(0);\n    \n    int32_t phys_tid_70052 = global_tid_78949;\n    __local unsigned char *red_arr_mem_78954;\n    \n    red_arr_mem_78954 = (__local unsigned char *) red_arr_mem_78954_backing_0;\n    \n    __local unsigned char *red_arr_mem_78956;\n    \n    red_arr_mem_78956 = (__local unsigned char *) red_arr_mem_78956_backing_1;\n    ",
            "\n    __local unsigned char *red_arr_mem_78958;\n    \n    red_arr_mem_78958 = (__local unsigned char *) red_arr_mem_78958_backing_2;\n    \n    int32_t phys_group_id_78960;\n    \n    phys_group_id_78960 = get_group_id(0);\n    for (int32_t i_78961 = 0; i_78961 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_70043,\n                                                  segment_sizze_nonzzero_78947))) -\n                   phys_group_id_78960, sext_i64_i32(num_groups_70044));\n         i_78961++) {\n        int32_t virt_group_id_78962 = phys_group_id_78960 + i_78961 *\n                sext_i64_i32(num_groups_70044);\n        int64_t slice_78963 = n_m_65352;\n        int64_t slice_78964 = m_65343 * slice_78963;\n        int64_t gtid_70049 = squot64(squot64(sext_i32_i64(local_tid_78950),\n                                             segment_sizze_nonzzero_78947) +\n                                     sext_i32_i64(virt_group_id_78962) *\n                                     squot64(segred_group_sizze_70043,\n                                             segment_sizze_nonzzero_78947),\n                                     slice_78963);\n        int64_t remnant_78965 = squot64(sext_i32_i64(local_tid_78950),\n                                        segment_sizze_nonzzero_78947) +\n                sext_i32_i64(virt_group_id_78962) *\n                squot64(segred_group_sizze_70043,\n                        segment_sizze_nonzzero_78947) - gtid_70049 *\n                slice_78963;\n        int64_t gtid_70050 = remnant_78965;\n        int64_t remnant_78966 = remnant_78965 - gtid_70050;\n        int64_t gtid_70051 = srem64(sext_i32_i64(local_tid_78950), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_70049, m_65343) &&\n                                                 slt64(gtid_70050,\n                                                       n_",
            "m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78950),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_70043,\n                                                              segment_sizze_nonzzero_78947)))) {\n                int64_t last_res_70062;\n                \n                last_res_70062 = ((__global int64_t *) mem_77316)[gtid_70049 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74688 = mul64(jump_65348, gtid_70050);\n                int64_t index_primexp_74689 = smin64(i_65358, binop_y_74688);\n                float defunc_1_f_res_70070;\n                \n                defunc_1_f_res_70070 = ((__global\n                                         float *) mem_77439)[gtid_70049 *\n                                                             n_m_65352 +\n                                                             gtid_70050];\n                \n                float x_70072;\n                \n                x_70072 = ((__global float *) mem_77348)[gtid_70049 * q_65346 +\n                                                         gtid_70051];\n                \n                bool cond_70073 = sle64(last_res_70062, gtid_70051);\n                int64_t defunc_0_f_res_70074;\n                \n                if (cond_70073) {\n                    defunc_0_f_res_70074 = (int64_t) 0;\n                } else {\n                    int64_t max_res_70069;\n                    \n                    max_res_70069 = ((__global\n                                      int64_t *) mem_77435)[gtid_70049 *\n                                                            n_m_65352 +\n                                                            gtid_70050];\n                    \n                    int64_t i_70075 = ",
            "add64(gtid_70051, max_res_70069);\n                    int64_t defunc_0_add_arg_70076;\n                    \n                    defunc_0_add_arg_70076 = ((__global\n                                               int64_t *) mem_77324)[gtid_70049 *\n                                                                     n_65344 +\n                                                                     i_70075];\n                    \n                    int64_t defunc_1_add_res_70077 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70076);\n                    \n                    defunc_0_f_res_70074 = defunc_1_add_res_70077;\n                }\n                \n                int64_t binop_p_70078 = sub64(defunc_0_f_res_70074,\n                                              index_primexp_74689);\n                float defunc_0_f_res_70079 = sitofp_i64_f32(binop_p_70078);\n                float abs_res_70080 = (float) fabs(defunc_0_f_res_70079);\n                float tmp1_70081 = abs_res_70080 / defunc_1_f_res_70070;\n                float x_70082 = tmp1_70081 * tmp1_70081;\n                float y_70083 = tmp1_70081 * x_70082;\n                float tmp2_70084 = 1.0F - y_70083;\n                float x_70085 = tmp2_70084 * tmp2_70084;\n                float tmp3_70086 = tmp2_70084 * x_70085;\n                float w_j_70087 = x_70072 * tmp3_70086;\n                float xw_j_70088 = defunc_0_f_res_70079 * w_j_70087;\n                float x2w_j_70089 = defunc_0_f_res_70079 * xw_j_70088;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)] =\n                        w_j_70087;\n                    ((__local\n                      float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)] =\n                        xw_j_70088;\n                    ((__loca",
            "l\n                      float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)] =\n                        x2w_j_70089;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_70053;\n                float x_70054;\n                float x_70055;\n                float x_70056;\n                float x_70057;\n                float x_70058;\n                float x_78967;\n                float x_78968;\n                float x_78969;\n                float x_78970;\n                float x_78971;\n                float x_78972;\n                bool ltid_in_bounds_78976 = slt64(sext_i32_i64(local_tid_78950),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_70043,\n                                                          segment_sizze_nonzzero_78947));\n                int32_t skip_threads_78977;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78976) {\n                        x_70056 = ((volatile __local\n                                    float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)];\n                        x_70057 = ((volatile __local\n                                    float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)];\n                        x_70058 = ((volatile __local\n                                    float *) red_arr_me",
            "m_78958)[sext_i32_i64(local_tid_78950)];\n                        if ((local_tid_78950 - squot32(local_tid_78950, 32) *\n                             32) == 0) {\n                            x_70053 = x_70056;\n                            x_70054 = x_70057;\n                            x_70055 = x_70058;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78977 = 1;\n                    while (slt32(skip_threads_78977, 32)) {\n                        bool thread_active_78978 = sle32(skip_threads_78977,\n                                                         local_tid_78950 -\n                                                         squot32(local_tid_78950,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78976;\n                        \n                        if (thread_active_78978) {\n                            // read operands\n                            {\n                                x_70053 = ((volatile __local\n                                            float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950) -\n                                                                        sext_i32_i64(skip_threads_78977)];\n                                x_70054 = ((volatile __local\n                                            float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950) -\n                                                                        sext_i32_i64(skip_threads_78977)];\n                                x_70055 = ((volatile __local\n                                            float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950) -\n                                                                        sext_i32_i64(skip_threads_78977)];\n                            }\n                        }\n                        // perform operation\n                ",
            "        {\n                            bool inactive_78979 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78950),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_78950) -\n                                       sext_i32_i64(local_tid_78950 -\n                                       skip_threads_78977));\n                            \n                            if (thread_active_78978 && inactive_78979) {\n                                x_70053 = x_70056;\n                                x_70054 = x_70057;\n                                x_70055 = x_70058;\n                            }\n                            if (thread_active_78978) {\n                                if (!inactive_78979) {\n                                    float defunc_1_op_res_70059 = x_70053 +\n                                          x_70056;\n                                    float defunc_1_op_res_70060 = x_70054 +\n                                          x_70057;\n                                    float defunc_1_op_res_70061 = x_70055 +\n                                          x_70058;\n                                    \n                                    x_70053 = defunc_1_op_res_70059;\n                                    x_70054 = defunc_1_op_res_70060;\n                                    x_70055 = defunc_1_op_res_70061;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78952, skip_threads_78977)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78978) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)] =\n                                    x_70053;\n                    ",
            "            x_70056 = x_70053;\n                                ((volatile __local\n                                  float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)] =\n                                    x_70054;\n                                x_70057 = x_70054;\n                                ((volatile __local\n                                  float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)] =\n                                    x_70055;\n                                x_70058 = x_70055;\n                            }\n                        }\n                        if (sle32(wave_sizze_78952, skip_threads_78977)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78977 *= 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_78950 - squot32(local_tid_78950, 32) * 32) ==\n                        31 && ltid_in_bounds_78976) {\n                        ((volatile __local\n                          float *) red_arr_mem_78954)[sext_i32_i64(squot32(local_tid_78950,\n                                                                           32))] =\n                            x_70053;\n                        ((volatile __local\n                          float *) red_arr_mem_78956)[sext_i32_i64(squot32(local_tid_78950,\n                                                                           32))] =\n                            x_70054;\n                        ((volatile __local\n                          float *) red_arr_mem_78958)[sext_i32_i64(squot32(local_tid_78950,\n                                                                           32))] =\n                            x_70055;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which of",
            "fset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_78980;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78950, 32) == 0 &&\n                            ltid_in_bounds_78976) {\n                            x_78970 = ((volatile __local\n                                        float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)];\n                            x_78971 = ((volatile __local\n                                        float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)];\n                            x_78972 = ((volatile __local\n                                        float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)];\n                            if ((local_tid_78950 - squot32(local_tid_78950,\n                                                           32) * 32) == 0) {\n                                x_78967 = x_78970;\n                                x_78968 = x_78971;\n                                x_78969 = x_78972;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78980 = 1;\n                        while (slt32(skip_threads_78980, 32)) {\n                            bool thread_active_78981 = sle32(skip_threads_78980,\n                                                             local_tid_78950 -\n                                                             squot32(local_tid_78950,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78950, 32) == 0 &&\n                                  ltid_in_bounds_78976);\n                            \n                            if (thread_active_78981) {\n                     ",
            "           // read operands\n                                {\n                                    x_78967 = ((volatile __local\n                                                float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950) -\n                                                                            sext_i32_i64(skip_threads_78980)];\n                                    x_78968 = ((volatile __local\n                                                float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950) -\n                                                                            sext_i32_i64(skip_threads_78980)];\n                                    x_78969 = ((volatile __local\n                                                float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950) -\n                                                                            sext_i32_i64(skip_threads_78980)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_78982 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78950 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78950 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78950 -\n                                                         skip_threads_78980) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78981 && inactive_78982) {\n                                    x_78967 = x_78970;\n                                    x_78968 = x_78971;\n                                    x_78969 = x_78972;\n                                }\n                                if (thread_active_78981) {\n                      ",
            "              if (!inactive_78982) {\n                                        float defunc_1_op_res_78973 = x_78967 +\n                                              x_78970;\n                                        float defunc_1_op_res_78974 = x_78968 +\n                                              x_78971;\n                                        float defunc_1_op_res_78975 = x_78969 +\n                                              x_78972;\n                                        \n                                        x_78967 = defunc_1_op_res_78973;\n                                        x_78968 = defunc_1_op_res_78974;\n                                        x_78969 = defunc_1_op_res_78975;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78952, skip_threads_78980)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78981) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)] =\n                                        x_78967;\n                                    x_78970 = x_78967;\n                                    ((volatile __local\n                                      float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)] =\n                                        x_78968;\n                                    x_78971 = x_78968;\n                                    ((volatile __local\n                                      float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)] =\n                                        x_78969;\n                                    x_78972 = x_78969;\n                                }\n                            }\n                            if (sle32(wave_sizze_7",
            "8952, skip_threads_78980)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_78980 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_78983 = squot32(local_tid_78950, 32) == 0 ||\n                     !ltid_in_bounds_78976;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_78983) {\n                            x_70056 = x_70053;\n                            x_70057 = x_70054;\n                            x_70058 = x_70055;\n                            x_70053 = ((__local\n                                        float *) red_arr_mem_78954)[sext_i32_i64(squot32(local_tid_78950,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_70054 = ((__local\n                                        float *) red_arr_mem_78956)[sext_i32_i64(squot32(local_tid_78950,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_70055 = ((__local\n                                        float *) red_arr_mem_78958)[sext_i32_i64(squot32(local_tid_78950,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78984 =\n                             slt64(srem64(sext_i32_i64(local_tid_78950),\n   ",
            "                                       q_65346),\n                                   sext_i32_i64(local_tid_78950) -\n                                   sext_i32_i64(squot32(local_tid_78950, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_78983) {\n                            if (inactive_78984) {\n                                x_70053 = x_70056;\n                                x_70054 = x_70057;\n                                x_70055 = x_70058;\n                            }\n                        }\n                        if (!no_carry_in_78983) {\n                            if (!inactive_78984) {\n                                float defunc_1_op_res_70059 = x_70053 + x_70056;\n                                float defunc_1_op_res_70060 = x_70054 + x_70057;\n                                float defunc_1_op_res_70061 = x_70055 + x_70058;\n                                \n                                x_70053 = defunc_1_op_res_70059;\n                                x_70054 = defunc_1_op_res_70060;\n                                x_70055 = defunc_1_op_res_70061;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_78983) {\n                            ((__local\n                              float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)] =\n                                x_70053;\n                            ((__local\n                              float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)] =\n                                x_70054;\n                            ((__local\n                              float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)] =\n                                x_70055;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct value",
            "s for first block\n                {\n                    if (squot32(local_tid_78950, 32) == 0 &&\n                        ltid_in_bounds_78976) {\n                        ((__local\n                          float *) red_arr_mem_78954)[sext_i32_i64(local_tid_78950)] =\n                            x_70056;\n                        ((__local\n                          float *) red_arr_mem_78956)[sext_i32_i64(local_tid_78950)] =\n                            x_70057;\n                        ((__local\n                          float *) red_arr_mem_78958)[sext_i32_i64(local_tid_78950)] =\n                            x_70058;\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_78962) *\n                      squot64(segred_group_sizze_70043,\n                              segment_sizze_nonzzero_78947) +\n                      sext_i32_i64(local_tid_78950), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78950),\n                      squot64(segred_group_sizze_70043,\n                              segment_sizze_nonzzero_78947))) {\n                float tmp_78985;\n                \n                tmp_78985 = ((__local\n                              float *) red_arr_mem_78954)[(sext_i32_i64(local_tid_78950) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78947 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77444)[squot64(sext_i32_i64(virt_group_id_78962) *\n                                              squot64(segred_group_sizze_70043,\n                                                      segment_sizze_nonzzero_78947) +\n                                              sext_i32_i64(local_ti",
            "d_78950),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78962) *\n                                       squot64(segred_group_sizze_70043,\n                                               segment_sizze_nonzzero_78947) +\n                                       sext_i32_i64(local_tid_78950) -\n                                       squot64(sext_i32_i64(virt_group_id_78962) *\n                                               squot64(segred_group_sizze_70043,\n                                                       segment_sizze_nonzzero_78947) +\n                                               sext_i32_i64(local_tid_78950),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78985;\n                \n                float tmp_78986;\n                \n                tmp_78986 = ((__local\n                              float *) red_arr_mem_78956)[(sext_i32_i64(local_tid_78950) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78947 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77448)[squot64(sext_i32_i64(virt_group_id_78962) *\n                                              squot64(segred_group_sizze_70043,\n                                                      segment_sizze_nonzzero_78947) +\n                                              sext_i32_i64(local_tid_78950),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78962) *\n                                       squot64(segred_group_sizze_70043,\n                                               segment_sizze_nonzzero_78947) +\n                                       sext_i32_i64(local_tid_78950) -\n                                   ",
            "    squot64(sext_i32_i64(virt_group_id_78962) *\n                                               squot64(segred_group_sizze_70043,\n                                                       segment_sizze_nonzzero_78947) +\n                                               sext_i32_i64(local_tid_78950),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78986;\n                \n                float tmp_78987;\n                \n                tmp_78987 = ((__local\n                              float *) red_arr_mem_78958)[(sext_i32_i64(local_tid_78950) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78947 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77452)[squot64(sext_i32_i64(virt_group_id_78962) *\n                                              squot64(segred_group_sizze_70043,\n                                                      segment_sizze_nonzzero_78947) +\n                                              sext_i32_i64(local_tid_78950),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78962) *\n                                       squot64(segred_group_sizze_70043,\n                                               segment_sizze_nonzzero_78947) +\n                                       sext_i32_i64(local_tid_78950) -\n                                       squot64(sext_i32_i64(virt_group_id_78962) *\n                                               squot64(segred_group_sizze_70043,\n                                                       segment_sizze_nonzzero_78947) +\n                                               sext_i32_i64(local_tid_78950),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78987;\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_70043\n}\n__kernel void mainzisegred_small_70122(__global int *global_failure,\n                                       uint red_arr_mem_79066_backing_offset_0,\n                                       uint red_arr_mem_79064_backing_offset_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70115,\n                                       int64_t segment_sizze_nonzzero_79057,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77320,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77457,\n                                       __global unsigned char *mem_77461,\n                                       __global unsigned char *mem_77465,\n                                       __global unsigned char *mem_77470,\n                                       __global unsigned char *mem_77474)\n{\n    #define segred_group_sizze_70114 (mainzisegred_group_sizze_68953)\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_79066_backing_1 =\n                           &shared_mem[red_arr_mem_79066_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79064_backing_0 =\n                           &shared_mem[red_arr_mem_7",
            "9064_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79059;\n    int32_t local_tid_79060;\n    int64_t group_sizze_79063;\n    int32_t wave_sizze_79062;\n    int32_t group_tid_79061;\n    \n    global_tid_79059 = get_global_id(0);\n    local_tid_79060 = get_local_id(0);\n    group_sizze_79063 = get_local_size(0);\n    wave_sizze_79062 = LOCKSTEP_WIDTH;\n    group_tid_79061 = get_group_id(0);\n    \n    int32_t phys_tid_70122 = global_tid_79059;\n    __local unsigned char *red_arr_mem_79064;\n    \n    red_arr_mem_79064 = (__local unsigned char *) red_arr_mem_79064_backing_0;\n    \n    __local unsigned char *red_arr_mem_79066;\n    \n    red_arr_mem_79066 = (__local unsigned char *) red_arr_mem_79066_backing_1;\n    \n    int32_t phys_group_id_79068;\n    \n    phys_group_id_79068 = get_group_id(0);\n    for (int32_t i_79069 = 0; i_79069 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_70114,\n                                                  segment_sizze_nonzzero_79057))) -\n                   phys_group_id_79068, sext_i64_i32(num_groups_70115));\n         i_79069++) {\n        int32_t virt_group_id_79070 = phys_group_id_79068 + i_79069 *\n                sext_i64_i32(num_groups_70115);\n        int64_t slice_79071 = n_m_65352;\n        int64_t slice_79072 = m_65343 * slice_79071;\n        int64_t gtid_70119 = squot64(squot64(sext_i32_i64(local_tid_79060),\n                                             segment_sizze_nonzzero_79057) +\n                                     sext_i32_i64(virt_group_id_79070) *\n                                     squot64(segred_group_sizze_70114,\n                                             segment_sizze_nonzzero_79057),\n                                     slice_79071);\n        int64_t remnant_79073 = squot64(sext_i32_i64(local_tid_79060),\n                                        segment_sizze_nonzzero_79057) +\n                sext_i32_",
            "i64(virt_group_id_79070) *\n                squot64(segred_group_sizze_70114,\n                        segment_sizze_nonzzero_79057) - gtid_70119 *\n                slice_79071;\n        int64_t gtid_70120 = remnant_79073;\n        int64_t remnant_79074 = remnant_79073 - gtid_70120;\n        int64_t gtid_70121 = srem64(sext_i32_i64(local_tid_79060), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_70119, m_65343) &&\n                                                 slt64(gtid_70120,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_79060),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_70114,\n                                                              segment_sizze_nonzzero_79057)))) {\n                int64_t last_res_70129;\n                \n                last_res_70129 = ((__global int64_t *) mem_77316)[gtid_70119 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74684 = mul64(jump_65348, gtid_70120);\n                int64_t index_primexp_74685 = smin64(i_65358, binop_y_74684);\n                int64_t max_res_70140;\n                \n                max_res_70140 = ((__global int64_t *) mem_77435)[gtid_70119 *\n                                                                 n_m_65352 +\n                                                                 gtid_70120];\n                \n                float defunc_1_f_res_70141;\n                \n                defunc_1_f_res_70141 = ((__global\n                                         float *) mem_77439)[gtid_70119 *\n                                                             n_m_65352 +\n              ",
            "                                               gtid_70120];\n                \n                float a11_70142;\n                \n                a11_70142 = ((__global float *) mem_77457)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float b11_70143;\n                \n                b11_70143 = ((__global float *) mem_77461)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float c11_70144;\n                \n                c11_70144 = ((__global float *) mem_77465)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float x_70146;\n                \n                x_70146 = ((__global float *) mem_77348)[gtid_70119 * q_65346 +\n                                                         gtid_70121];\n                \n                bool cond_70147 = sle64(last_res_70129, gtid_70121);\n                int64_t defunc_0_f_res_70148;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70148 = (int64_t) 0;\n                } else {\n                    int64_t i_70149 = add64(gtid_70121, max_res_70140);\n                    int64_t defunc_0_add_arg_70150;\n                    \n                    defunc_0_add_arg_70150 = ((__global\n                                               int64_t *) mem_77324)[gtid_70119 *\n                                                                     n_65344 +\n                                                                     i_70149];\n                    \n                    int64_t defunc_1_add_res_70151 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70150",
            ");\n                    \n                    defunc_0_f_res_70148 = defunc_1_add_res_70151;\n                }\n                \n                int64_t binop_p_70152 = sub64(defunc_0_f_res_70148,\n                                              index_primexp_74685);\n                float defunc_0_f_res_70153 = sitofp_i64_f32(binop_p_70152);\n                float abs_res_70154 = (float) fabs(defunc_0_f_res_70153);\n                float tmp1_70155 = abs_res_70154 / defunc_1_f_res_70141;\n                float x_70156 = tmp1_70155 * tmp1_70155;\n                float y_70157 = tmp1_70155 * x_70156;\n                float tmp2_70158 = 1.0F - y_70157;\n                float x_70159 = tmp2_70158 * tmp2_70158;\n                float tmp3_70160 = tmp2_70158 * x_70159;\n                float tmp4_70161 = x_70146 * tmp3_70160;\n                float defunc_1_f_res_70162 = defunc_0_f_res_70153 * tmp4_70161;\n                float defunc_0_f_res_70163;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70163 = 0.0F;\n                } else {\n                    int64_t i_70164 = add64(gtid_70121, max_res_70140);\n                    float defunc_0_add_arg_70165;\n                    \n                    defunc_0_add_arg_70165 = ((__global\n                                               float *) mem_77320)[gtid_70119 *\n                                                                   n_65344 +\n                                                                   i_70164];\n                    defunc_0_f_res_70163 = defunc_0_add_arg_70165;\n                }\n                \n                float x_70166 = a11_70142 * tmp4_70161;\n                float y_70167 = b11_70143 * defunc_1_f_res_70162;\n                float x_70168 = x_70166 + y_70167;\n                float defunc_9_fit_fun_res_70169 = defunc_0_f_res_70163 *\n                      x_70168;\n                float x_70170 = b11_70143 * tmp4_70161;\n                float y_70171 = c11_70144 * defunc_1_f_res_70162",
            ";\n                float x_70172 = x_70170 + y_70171;\n                float defunc_9_slope_fun_res_70173 = defunc_0_f_res_70163 *\n                      x_70172;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)] =\n                        defunc_9_fit_fun_res_70169;\n                    ((__local\n                      float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)] =\n                        defunc_9_slope_fun_res_70173;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_70123;\n                float x_70124;\n                float x_70125;\n                float x_70126;\n                float x_79075;\n                float x_79076;\n                float x_79077;\n                float x_79078;\n                bool ltid_in_bounds_79081 = slt64(sext_i32_i64(local_tid_79060),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_70114,\n                                                          segment_sizze_nonzzero_79057));\n                int32_t skip_threads_79082;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_79081) {\n                        x_70125 = ((volatile __local\n                                    float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)];\n ",
            "                       x_70126 = ((volatile __local\n                                    float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)];\n                        if ((local_tid_79060 - squot32(local_tid_79060, 32) *\n                             32) == 0) {\n                            x_70123 = x_70125;\n                            x_70124 = x_70126;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79082 = 1;\n                    while (slt32(skip_threads_79082, 32)) {\n                        bool thread_active_79083 = sle32(skip_threads_79082,\n                                                         local_tid_79060 -\n                                                         squot32(local_tid_79060,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_79081;\n                        \n                        if (thread_active_79083) {\n                            // read operands\n                            {\n                                x_70123 = ((volatile __local\n                                            float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060) -\n                                                                        sext_i32_i64(skip_threads_79082)];\n                                x_70124 = ((volatile __local\n                                            float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060) -\n                                                                        sext_i32_i64(skip_threads_79082)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79084 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79060),\n                                              q_65346),\n                   ",
            "                    sext_i32_i64(local_tid_79060) -\n                                       sext_i32_i64(local_tid_79060 -\n                                       skip_threads_79082));\n                            \n                            if (thread_active_79083 && inactive_79084) {\n                                x_70123 = x_70125;\n                                x_70124 = x_70126;\n                            }\n                            if (thread_active_79083) {\n                                if (!inactive_79084) {\n                                    float defunc_1_op_res_70127 = x_70123 +\n                                          x_70125;\n                                    float defunc_1_op_res_70128 = x_70124 +\n                                          x_70126;\n                                    \n                                    x_70123 = defunc_1_op_res_70127;\n                                    x_70124 = defunc_1_op_res_70128;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79062, skip_threads_79082)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79083) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)] =\n                                    x_70123;\n                                x_70125 = x_70123;\n                                ((volatile __local\n                                  float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)] =\n                                    x_70124;\n                                x_70126 = x_70124;\n                            }\n                        }\n                        if (sle32(wave_sizze_79062, skip_threads_79082)) {\n                            barrier(CLK_LOCAL_MEM_FENCE",
            ");\n                        }\n                        skip_threads_79082 *= 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_79060 - squot32(local_tid_79060, 32) * 32) ==\n                        31 && ltid_in_bounds_79081) {\n                        ((volatile __local\n                          float *) red_arr_mem_79064)[sext_i32_i64(squot32(local_tid_79060,\n                                                                           32))] =\n                            x_70123;\n                        ((volatile __local\n                          float *) red_arr_mem_79066)[sext_i32_i64(squot32(local_tid_79060,\n                                                                           32))] =\n                            x_70124;\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_79085;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_79060, 32) == 0 &&\n                            ltid_in_bounds_79081) {\n                            x_79077 = ((volatile __local\n                                        float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)];\n                            x_79078 = ((volatile __local\n                                        float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)];\n                            if ((local_tid_79060 - squot32(local_tid_79060,\n                                                           32) * 32) == 0) {\n                                x_79075 = x_79077;\n                                x_79076 = x_79078;\n                            }\n                        }\n          ",
            "          }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_79085 = 1;\n                        while (slt32(skip_threads_79085, 32)) {\n                            bool thread_active_79086 = sle32(skip_threads_79085,\n                                                             local_tid_79060 -\n                                                             squot32(local_tid_79060,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_79060, 32) == 0 &&\n                                  ltid_in_bounds_79081);\n                            \n                            if (thread_active_79086) {\n                                // read operands\n                                {\n                                    x_79075 = ((volatile __local\n                                                float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060) -\n                                                                            sext_i32_i64(skip_threads_79085)];\n                                    x_79076 = ((volatile __local\n                                                float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060) -\n                                                                            sext_i32_i64(skip_threads_79085)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_79087 =\n                                     slt64(srem64(sext_i32_i64(local_tid_79060 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_79060 * 32 +\n                                           32 - 1) -\n                                           sext_i3",
            "2_i64((local_tid_79060 -\n                                                         skip_threads_79085) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_79086 && inactive_79087) {\n                                    x_79075 = x_79077;\n                                    x_79076 = x_79078;\n                                }\n                                if (thread_active_79086) {\n                                    if (!inactive_79087) {\n                                        float defunc_1_op_res_79079 = x_79075 +\n                                              x_79077;\n                                        float defunc_1_op_res_79080 = x_79076 +\n                                              x_79078;\n                                        \n                                        x_79075 = defunc_1_op_res_79079;\n                                        x_79076 = defunc_1_op_res_79080;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_79062, skip_threads_79085)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_79086) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)] =\n                                        x_79075;\n                                    x_79077 = x_79075;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)] =\n                                        x_79076;\n                                    x_79078 = x_79076;\n                                }\n                            }\n                   ",
            "         if (sle32(wave_sizze_79062, skip_threads_79085)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_79085 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_79088 = squot32(local_tid_79060, 32) == 0 ||\n                     !ltid_in_bounds_79081;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_79088) {\n                            x_70125 = x_70123;\n                            x_70126 = x_70124;\n                            x_70123 = ((__local\n                                        float *) red_arr_mem_79064)[sext_i32_i64(squot32(local_tid_79060,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_70124 = ((__local\n                                        float *) red_arr_mem_79066)[sext_i32_i64(squot32(local_tid_79060,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79089 =\n                             slt64(srem64(sext_i32_i64(local_tid_79060),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_79060) -\n                                   sext_i32_i64(squot32(local_tid_79060, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_79088) {\n                            if (i",
            "nactive_79089) {\n                                x_70123 = x_70125;\n                                x_70124 = x_70126;\n                            }\n                        }\n                        if (!no_carry_in_79088) {\n                            if (!inactive_79089) {\n                                float defunc_1_op_res_70127 = x_70123 + x_70125;\n                                float defunc_1_op_res_70128 = x_70124 + x_70126;\n                                \n                                x_70123 = defunc_1_op_res_70127;\n                                x_70124 = defunc_1_op_res_70128;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_79088) {\n                            ((__local\n                              float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)] =\n                                x_70123;\n                            ((__local\n                              float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)] =\n                                x_70124;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_79060, 32) == 0 &&\n                        ltid_in_bounds_79081) {\n                        ((__local\n                          float *) red_arr_mem_79064)[sext_i32_i64(local_tid_79060)] =\n                            x_70125;\n                        ((__local\n                          float *) red_arr_mem_79066)[sext_i32_i64(local_tid_79060)] =\n                            x_70126;\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_79070)",
            " *\n                      squot64(segred_group_sizze_70114,\n                              segment_sizze_nonzzero_79057) +\n                      sext_i32_i64(local_tid_79060), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_79060),\n                      squot64(segred_group_sizze_70114,\n                              segment_sizze_nonzzero_79057))) {\n                float tmp_79090;\n                \n                tmp_79090 = ((__local\n                              float *) red_arr_mem_79064)[(sext_i32_i64(local_tid_79060) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79057 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77470)[squot64(sext_i32_i64(virt_group_id_79070) *\n                                              squot64(segred_group_sizze_70114,\n                                                      segment_sizze_nonzzero_79057) +\n                                              sext_i32_i64(local_tid_79060),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79070) *\n                                       squot64(segred_group_sizze_70114,\n                                               segment_sizze_nonzzero_79057) +\n                                       sext_i32_i64(local_tid_79060) -\n                                       squot64(sext_i32_i64(virt_group_id_79070) *\n                                               squot64(segred_group_sizze_70114,\n                                                       segment_sizze_nonzzero_79057) +\n                                               sext_i32_i64(local_tid_79060),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79090;\n                \n                float tmp_79091;\n          ",
            "      \n                tmp_79091 = ((__local\n                              float *) red_arr_mem_79066)[(sext_i32_i64(local_tid_79060) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79057 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77474)[squot64(sext_i32_i64(virt_group_id_79070) *\n                                              squot64(segred_group_sizze_70114,\n                                                      segment_sizze_nonzzero_79057) +\n                                              sext_i32_i64(local_tid_79060),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79070) *\n                                       squot64(segred_group_sizze_70114,\n                                               segment_sizze_nonzzero_79057) +\n                                       sext_i32_i64(local_tid_79060) -\n                                       squot64(sext_i32_i64(virt_group_id_79070) *\n                                               squot64(segred_group_sizze_70114,\n                                                       segment_sizze_nonzzero_79057) +\n                                               sext_i32_i64(local_tid_79060),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79091;\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_70114\n}\n__kernel void mainzisegred_small_72125(__global int *global_failure,\n                                       uint red_arr_mem_79433_backing_offset_0,\n                                       uint red_arr_mem_79431_backing_offset_1,\n                                       uint red_ar",
            "r_mem_79429_backing_offset_2,\n                                       uint red_arr_mem_79427_backing_offset_3,\n                                       uint red_arr_mem_79425_backing_offset_4,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72115,\n                                       int64_t segment_sizze_nonzzero_79418,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77760,\n                                       __global unsigned char *mem_77764,\n                                       __global unsigned char *mem_77768,\n                                       __global unsigned char *mem_77772,\n                                       __global unsigned char *mem_77776)\n{\n    #define segred_group_sizze_72114 (mainzisegred_group_sizze_71039)\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_79433_backing_4 =\n                           &shared_mem[red_arr_mem_79433_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79431_backing_3 =\n                           &shared_mem[red_arr_mem_79431_backing_offset_1];\n    volatile unsigned char *red_arr_mem_79429_backing_2 =\n                           &shared_mem[red_arr_mem_79429_backing_offset_2];\n    volatile unsigned char *red_arr_mem_79427_backing_1 =\n                           &shared_mem[red_arr_mem_79427_backing_offset_3];\n ",
            "   volatile unsigned char *red_arr_mem_79425_backing_0 =\n                           &shared_mem[red_arr_mem_79425_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79420;\n    int32_t local_tid_79421;\n    int64_t group_sizze_79424;\n    int32_t wave_sizze_79423;\n    int32_t group_tid_79422;\n    \n    global_tid_79420 = get_global_id(0);\n    local_tid_79421 = get_local_id(0);\n    group_sizze_79424 = get_local_size(0);\n    wave_sizze_79423 = LOCKSTEP_WIDTH;\n    group_tid_79422 = get_group_id(0);\n    \n    int32_t phys_tid_72125 = global_tid_79420;\n    __local unsigned char *red_arr_mem_79425;\n    \n    red_arr_mem_79425 = (__local unsigned char *) red_arr_mem_79425_backing_0;\n    \n    __local unsigned char *red_arr_mem_79427;\n    \n    red_arr_mem_79427 = (__local unsigned char *) red_arr_mem_79427_backing_1;\n    \n    __local unsigned char *red_arr_mem_79429;\n    \n    red_arr_mem_79429 = (__local unsigned char *) red_arr_mem_79429_backing_2;\n    \n    __local unsigned char *red_arr_mem_79431;\n    \n    red_arr_mem_79431 = (__local unsigned char *) red_arr_mem_79431_backing_3;\n    \n    __local unsigned char *red_arr_mem_79433;\n    \n    red_arr_mem_79433 = (__local unsigned char *) red_arr_mem_79433_backing_4;\n    \n    int32_t phys_group_id_79435;\n    \n    phys_group_id_79435 = get_group_id(0);\n    for (int32_t i_79436 = 0; i_79436 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_72114,\n                                                  segment_sizze_nonzzero_79418))) -\n                   phys_group_id_79435, sext_i64_i32(num_groups_72115));\n         i_79436++) {\n        int32_t virt_group_id_79437 = phys_group_id_79435 + i_79436 *\n                sext_i64_i32(num_groups_72115);\n        int64_t slice_79438 = n_m_65352;\n        int64_t slice_79439 = m_65343 * slice_79438;\n        int64_t gtid_72122 = squot64(squot64(sext_i32_i64(local_tid_79421),\n  ",
            "                                           segment_sizze_nonzzero_79418) +\n                                     sext_i32_i64(virt_group_id_79437) *\n                                     squot64(segred_group_sizze_72114,\n                                             segment_sizze_nonzzero_79418),\n                                     slice_79438);\n        int64_t remnant_79440 = squot64(sext_i32_i64(local_tid_79421),\n                                        segment_sizze_nonzzero_79418) +\n                sext_i32_i64(virt_group_id_79437) *\n                squot64(segred_group_sizze_72114,\n                        segment_sizze_nonzzero_79418) - gtid_72122 *\n                slice_79438;\n        int64_t gtid_72123 = remnant_79440;\n        int64_t remnant_79441 = remnant_79440 - gtid_72123;\n        int64_t gtid_72124 = srem64(sext_i32_i64(local_tid_79421), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_72122, m_65343) &&\n                                                 slt64(gtid_72123,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_79421),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_72114,\n                                                              segment_sizze_nonzzero_79418)))) {\n                int64_t last_res_72141;\n                \n                last_res_72141 = ((__global int64_t *) mem_77608)[gtid_72122 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74696 = mul64(jump_65348, gtid_72123);\n                int64_t index_primexp_74697 = smin64(i_65358, binop_y_74696);\n                float defunc_1_f_res_72149;\n                \n   ",
            "             defunc_1_f_res_72149 = ((__global\n                                         float *) mem_77755)[gtid_72122 *\n                                                             n_m_65352 +\n                                                             gtid_72123];\n                \n                float x_72151;\n                \n                x_72151 = ((__global float *) mem_77640)[gtid_72122 * q_65346 +\n                                                         gtid_72124];\n                \n                bool cond_72152 = sle64(last_res_72141, gtid_72124);\n                int64_t defunc_0_f_res_72153;\n                \n                if (cond_72152) {\n                    defunc_0_f_res_72153 = (int64_t) 0;\n                } else {\n                    int64_t max_res_72148;\n                    \n                    max_res_72148 = ((__global\n                                      int64_t *) mem_77751)[gtid_72122 *\n                                                            n_m_65352 +\n                                                            gtid_72123];\n                    \n                    int64_t i_72154 = add64(gtid_72124, max_res_72148);\n                    int64_t defunc_0_add_arg_72155;\n                    \n                    defunc_0_add_arg_72155 = ((__global\n                                               int64_t *) mem_77616)[gtid_72122 *\n                                                                     n_65344 +\n                                                                     i_72154];\n                    \n                    int64_t defunc_1_add_res_72156 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72155);\n                    \n                    defunc_0_f_res_72153 = defunc_1_add_res_72156;\n                }\n                \n                int64_t binop_p_72157 = sub64(defunc_0_f_res_72153,\n                                              index_primexp_74697);\n                float defu",
            "nc_0_f_res_72158 = sitofp_i64_f32(binop_p_72157);\n                float abs_res_72159 = (float) fabs(defunc_0_f_res_72158);\n                float tmp1_72160 = abs_res_72159 / defunc_1_f_res_72149;\n                float x_72161 = tmp1_72160 * tmp1_72160;\n                float y_72162 = tmp1_72160 * x_72161;\n                float tmp2_72163 = 1.0F - y_72162;\n                float x_72164 = tmp2_72163 * tmp2_72163;\n                float tmp3_72165 = tmp2_72163 * x_72164;\n                float w_j_72166 = x_72151 * tmp3_72165;\n                float xw_j_72167 = defunc_0_f_res_72158 * w_j_72166;\n                float x2w_j_72168 = defunc_0_f_res_72158 * xw_j_72167;\n                float x3w_j_72169 = defunc_0_f_res_72158 * x2w_j_72168;\n                float x4w_j_72170 = defunc_0_f_res_72158 * x3w_j_72169;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)] =\n                        w_j_72166;\n                    ((__local\n                      float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)] =\n                        xw_j_72167;\n                    ((__local\n                      float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)] =\n                        x2w_j_72168;\n                    ((__local\n                      float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)] =\n                        x3w_j_72169;\n                    ((__local\n                      float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)] =\n                        x4w_j_72170;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)] =\n                    0.0F",
            ";\n                ((__local\n                  float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_72126;\n                float x_72127;\n                float x_72128;\n                float x_72129;\n                float x_72130;\n                float x_72131;\n                float x_72132;\n                float x_72133;\n                float x_72134;\n                float x_72135;\n                float x_79442;\n                float x_79443;\n                float x_79444;\n                float x_79445;\n                float x_79446;\n                float x_79447;\n                float x_79448;\n                float x_79449;\n                float x_79450;\n                float x_79451;\n                bool ltid_in_bounds_79457 = slt64(sext_i32_i64(local_tid_79421),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_72114,\n                                                          segment_sizze_nonzzero_79418));\n                int32_t skip_threads_79458;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_79457) {\n                        x_72131 = ((volatile __local\n                                    float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)];\n                        x_72132 = ((volatile __local\n                                    float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)];\n                   ",
            "     x_72133 = ((volatile __local\n                                    float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)];\n                        x_72134 = ((volatile __local\n                                    float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)];\n                        x_72135 = ((volatile __local\n                                    float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)];\n                        if ((local_tid_79421 - squot32(local_tid_79421, 32) *\n                             32) == 0) {\n                            x_72126 = x_72131;\n                            x_72127 = x_72132;\n                            x_72128 = x_72133;\n                            x_72129 = x_72134;\n                            x_72130 = x_72135;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79458 = 1;\n                    while (slt32(skip_threads_79458, 32)) {\n                        bool thread_active_79459 = sle32(skip_threads_79458,\n                                                         local_tid_79421 -\n                                                         squot32(local_tid_79421,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_79457;\n                        \n                        if (thread_active_79459) {\n                            // read operands\n                            {\n                                x_72126 = ((volatile __local\n                                            float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421) -\n                                                                        sext_i32_i64(skip_threads_79458)];\n                                x_72127 = ((volatile __local\n                                            float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421) -\n               ",
            "                                                         sext_i32_i64(skip_threads_79458)];\n                                x_72128 = ((volatile __local\n                                            float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421) -\n                                                                        sext_i32_i64(skip_threads_79458)];\n                                x_72129 = ((volatile __local\n                                            float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421) -\n                                                                        sext_i32_i64(skip_threads_79458)];\n                                x_72130 = ((volatile __local\n                                            float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421) -\n                                                                        sext_i32_i64(skip_threads_79458)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79460 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79421),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_79421) -\n                                       sext_i32_i64(local_tid_79421 -\n                                       skip_threads_79458));\n                            \n                            if (thread_active_79459 && inactive_79460) {\n                                x_72126 = x_72131;\n                                x_72127 = x_72132;\n                                x_72128 = x_72133;\n                                x_72129 = x_72134;\n                                x_72130 = x_72135;\n                            }\n                            if (thread_active_79459) {\n                                if (!inactive_79460) {\n                                    float defunc_1_op_res_72136 = x_72126 +\n       ",
            "                                   x_72131;\n                                    float defunc_1_op_res_72137 = x_72127 +\n                                          x_72132;\n                                    float defunc_1_op_res_72138 = x_72128 +\n                                          x_72133;\n                                    float defunc_1_op_res_72139 = x_72129 +\n                                          x_72134;\n                                    float defunc_1_op_res_72140 = x_72130 +\n                                          x_72135;\n                                    \n                                    x_72126 = defunc_1_op_res_72136;\n                                    x_72127 = defunc_1_op_res_72137;\n                                    x_72128 = defunc_1_op_res_72138;\n                                    x_72129 = defunc_1_op_res_72139;\n                                    x_72130 = defunc_1_op_res_72140;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79423, skip_threads_79458)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79459) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)] =\n                                    x_72126;\n                                x_72131 = x_72126;\n                                ((volatile __local\n                                  float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)] =\n                                    x_72127;\n                                x_72132 = x_72127;\n                                ((volatile __local\n                                  float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)] =\n                                    x_72128;\n                 ",
            "               x_72133 = x_72128;\n                                ((volatile __local\n                                  float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)] =\n                                    x_72129;\n                                x_72134 = x_72129;\n                                ((volatile __local\n                                  float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)] =\n                                    x_72130;\n                                x_72135 = x_72130;\n                            }\n                        }\n                        if (sle32(wave_sizze_79423, skip_threads_79458)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79458 *= 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_79421 - squot32(local_tid_79421, 32) * 32) ==\n                        31 && ltid_in_bounds_79457) {\n                        ((volatile __local\n                          float *) red_arr_mem_79425)[sext_i32_i64(squot32(local_tid_79421,\n                                                                           32))] =\n                            x_72126;\n                        ((volatile __local\n                          float *) red_arr_mem_79427)[sext_i32_i64(squot32(local_tid_79421,\n                                                                           32))] =\n                            x_72127;\n                        ((volatile __local\n                          float *) red_arr_mem_79429)[sext_i32_i64(squot32(local_tid_79421,\n                                                                           32))] =\n                            x_72128;\n                        ((volatile __local\n                          float *) red_arr_mem_79431)[sext_i32_i64(squot32(local_tid_79421,\n   ",
            "                                                                        32))] =\n                            x_72129;\n                        ((volatile __local\n                          float *) red_arr_mem_79433)[sext_i32_i64(squot32(local_tid_79421,\n                                                                           32))] =\n                            x_72130;\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_79461;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_79421, 32) == 0 &&\n                            ltid_in_bounds_79457) {\n                            x_79447 = ((volatile __local\n                                        float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)];\n                            x_79448 = ((volatile __local\n                                        float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)];\n                            x_79449 = ((volatile __local\n                                        float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)];\n                            x_79450 = ((volatile __local\n                                        float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)];\n                            x_79451 = ((volatile __local\n                                        float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)];\n                            if ((local_tid_79421 - squot32(local_tid_79421,\n                                                           32) * 32) == 0) {\n                                x_79442 = x_79447;\n                                x_79443 = x_79448;\n                                x_79444 = x_79449;\n                                x_79445 = x_79450;\n                        ",
            "        x_79446 = x_79451;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_79461 = 1;\n                        while (slt32(skip_threads_79461, 32)) {\n                            bool thread_active_79462 = sle32(skip_threads_79461,\n                                                             local_tid_79421 -\n                                                             squot32(local_tid_79421,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_79421, 32) == 0 &&\n                                  ltid_in_bounds_79457);\n                            \n                            if (thread_active_79462) {\n                                // read operands\n                                {\n                                    x_79442 = ((volatile __local\n                                                float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421) -\n                                                                            sext_i32_i64(skip_threads_79461)];\n                                    x_79443 = ((volatile __local\n                                                float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421) -\n                                                                            sext_i32_i64(skip_threads_79461)];\n                                    x_79444 = ((volatile __local\n                                                float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421) -\n                                                                            sext_i32_i64(skip_threads_79461)];\n                                    x_79445 = ((volatile __local\n                                                float *) red_arr_mem_79431)[sext_i32_i64(loc",
            "al_tid_79421) -\n                                                                            sext_i32_i64(skip_threads_79461)];\n                                    x_79446 = ((volatile __local\n                                                float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421) -\n                                                                            sext_i32_i64(skip_threads_79461)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_79463 =\n                                     slt64(srem64(sext_i32_i64(local_tid_79421 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_79421 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_79421 -\n                                                         skip_threads_79461) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_79462 && inactive_79463) {\n                                    x_79442 = x_79447;\n                                    x_79443 = x_79448;\n                                    x_79444 = x_79449;\n                                    x_79445 = x_79450;\n                                    x_79446 = x_79451;\n                                }\n                                if (thread_active_79462) {\n                                    if (!inactive_79463) {\n                                        float defunc_1_op_res_79452 = x_79442 +\n                                              x_79447;\n                                        float defunc_1_op_res_79453 = x_79443 +\n                                              x_79448;\n                                        float defunc_1_op_res_79454 = x_79444 +\n      ",
            "                                        x_79449;\n                                        float defunc_1_op_res_79455 = x_79445 +\n                                              x_79450;\n                                        float defunc_1_op_res_79456 = x_79446 +\n                                              x_79451;\n                                        \n                                        x_79442 = defunc_1_op_res_79452;\n                                        x_79443 = defunc_1_op_res_79453;\n                                        x_79444 = defunc_1_op_res_79454;\n                                        x_79445 = defunc_1_op_res_79455;\n                                        x_79446 = defunc_1_op_res_79456;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_79423, skip_threads_79461)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_79462) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)] =\n                                        x_79442;\n                                    x_79447 = x_79442;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)] =\n                                        x_79443;\n                                    x_79448 = x_79443;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)] =\n                                        x_79444;\n                                    x_79449 = x_79444;\n                                    ((volatile __local\n                                    ",
            "  float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)] =\n                                        x_79445;\n                                    x_79450 = x_79445;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)] =\n                                        x_79446;\n                                    x_79451 = x_79446;\n                                }\n                            }\n                            if (sle32(wave_sizze_79423, skip_threads_79461)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_79461 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_79464 = squot32(local_tid_79421, 32) == 0 ||\n                     !ltid_in_bounds_79457;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_79464) {\n                            x_72131 = x_72126;\n                            x_72132 = x_72127;\n                            x_72133 = x_72128;\n                            x_72134 = x_72129;\n                            x_72135 = x_72130;\n                            x_72126 = ((__local\n                                        float *) red_arr_mem_79425)[sext_i32_i64(squot32(local_tid_79421,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72127 = ((__local\n                                        float *) red_arr_mem_79427)[sext_i32_i64(squot32(local_tid_79421,\n                                                                                         32)) -\n              ",
            "                                                      (int64_t) 1];\n                            x_72128 = ((__local\n                                        float *) red_arr_mem_79429)[sext_i32_i64(squot32(local_tid_79421,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72129 = ((__local\n                                        float *) red_arr_mem_79431)[sext_i32_i64(squot32(local_tid_79421,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72130 = ((__local\n                                        float *) red_arr_mem_79433)[sext_i32_i64(squot32(local_tid_79421,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79465 =\n                             slt64(srem64(sext_i32_i64(local_tid_79421),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_79421) -\n                                   sext_i32_i64(squot32(local_tid_79421, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_79464) {\n                            if (inactive_79465) {\n                                x_72126 = x_72131;\n                                x_72127 = x_72132;\n                                x_72128 = x_72133;\n                                x_72129 = x_72134;\n                                x_72130 = x_72135;\n                            }\n                        }\n                        if ",
            "(!no_carry_in_79464) {\n                            if (!inactive_79465) {\n                                float defunc_1_op_res_72136 = x_72126 + x_72131;\n                                float defunc_1_op_res_72137 = x_72127 + x_72132;\n                                float defunc_1_op_res_72138 = x_72128 + x_72133;\n                                float defunc_1_op_res_72139 = x_72129 + x_72134;\n                                float defunc_1_op_res_72140 = x_72130 + x_72135;\n                                \n                                x_72126 = defunc_1_op_res_72136;\n                                x_72127 = defunc_1_op_res_72137;\n                                x_72128 = defunc_1_op_res_72138;\n                                x_72129 = defunc_1_op_res_72139;\n                                x_72130 = defunc_1_op_res_72140;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_79464) {\n                            ((__local\n                              float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)] =\n                                x_72126;\n                            ((__local\n                              float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)] =\n                                x_72127;\n                            ((__local\n                              float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)] =\n                                x_72128;\n                            ((__local\n                              float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)] =\n                                x_72129;\n                            ((__local\n                              float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)] =\n                                x_72130;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n         ",
            "       // restore correct values for first block\n                {\n                    if (squot32(local_tid_79421, 32) == 0 &&\n                        ltid_in_bounds_79457) {\n                        ((__local\n                          float *) red_arr_mem_79425)[sext_i32_i64(local_tid_79421)] =\n                            x_72131;\n                        ((__local\n                          float *) red_arr_mem_79427)[sext_i32_i64(local_tid_79421)] =\n                            x_72132;\n                        ((__local\n                          float *) red_arr_mem_79429)[sext_i32_i64(local_tid_79421)] =\n                            x_72133;\n                        ((__local\n                          float *) red_arr_mem_79431)[sext_i32_i64(local_tid_79421)] =\n                            x_72134;\n                        ((__local\n                          float *) red_arr_mem_79433)[sext_i32_i64(local_tid_79421)] =\n                            x_72135;\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_79437) *\n                      squot64(segred_group_sizze_72114,\n                              segment_sizze_nonzzero_79418) +\n                      sext_i32_i64(local_tid_79421), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_79421),\n                      squot64(segred_group_sizze_72114,\n                              segment_sizze_nonzzero_79418))) {\n                float tmp_79466;\n                \n                tmp_79466 = ((__local\n                              float *) red_arr_mem_79425)[(sext_i32_i64(local_tid_79421) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79418 -\n                                                          (int64_t)",
            " 1];\n                ((__global\n                  float *) mem_77760)[squot64(sext_i32_i64(virt_group_id_79437) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79418) +\n                                              sext_i32_i64(local_tid_79421),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79437) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79418) +\n                                       sext_i32_i64(local_tid_79421) -\n                                       squot64(sext_i32_i64(virt_group_id_79437) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79418) +\n                                               sext_i32_i64(local_tid_79421),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79466;\n                \n                float tmp_79467;\n                \n                tmp_79467 = ((__local\n                              float *) red_arr_mem_79427)[(sext_i32_i64(local_tid_79421) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79418 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77764)[squot64(sext_i32_i64(virt_group_id_79437) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79418) +\n                                              sext_i32_i64(local_tid_79421),\n                                              n_m_65352) ",
            "* n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79437) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79418) +\n                                       sext_i32_i64(local_tid_79421) -\n                                       squot64(sext_i32_i64(virt_group_id_79437) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79418) +\n                                               sext_i32_i64(local_tid_79421),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79467;\n                \n                float tmp_79468;\n                \n                tmp_79468 = ((__local\n                              float *) red_arr_mem_79429)[(sext_i32_i64(local_tid_79421) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79418 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77768)[squot64(sext_i32_i64(virt_group_id_79437) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79418) +\n                                              sext_i32_i64(local_tid_79421),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79437) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79418) +\n                                       sext_i32_i64(local_tid_79421) -\n                                       squot64(sext_i32_i64(virt_group_id_79437) *\n                   ",
            "                            squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79418) +\n                                               sext_i32_i64(local_tid_79421),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79468;\n                \n                float tmp_79469;\n                \n                tmp_79469 = ((__local\n                              float *) red_arr_mem_79431)[(sext_i32_i64(local_tid_79421) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79418 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77772)[squot64(sext_i32_i64(virt_group_id_79437) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79418) +\n                                              sext_i32_i64(local_tid_79421),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79437) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79418) +\n                                       sext_i32_i64(local_tid_79421) -\n                                       squot64(sext_i32_i64(virt_group_id_79437) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79418) +\n                                               sext_i32_i64(local_tid_79421),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79469;\n                \n                float tmp_79470;\n                \n               ",
            " tmp_79470 = ((__local\n                              float *) red_arr_mem_79433)[(sext_i32_i64(local_tid_79421) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79418 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77776)[squot64(sext_i32_i64(virt_group_id_79437) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79418) +\n                                              sext_i32_i64(local_tid_79421),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79437) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79418) +\n                                       sext_i32_i64(local_tid_79421) -\n                                       squot64(sext_i32_i64(virt_group_id_79437) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79418) +\n                                               sext_i32_i64(local_tid_79421),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79470;\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_72114\n}\n__kernel void mainzisegred_small_72224(__global int *global_failure,\n                                       uint red_arr_mem_79565_backing_offset_0,\n                                       uint red_arr_mem_79563_backing_offset_1,\n                                       int64_t m_65343, int64_t n_65344,",
            "\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72217,\n                                       int64_t segment_sizze_nonzzero_79556,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77612,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77781,\n                                       __global unsigned char *mem_77785,\n                                       __global unsigned char *mem_77789,\n                                       __global unsigned char *mem_77793,\n                                       __global unsigned char *mem_77797,\n                                       __global unsigned char *mem_77802,\n                                       __global unsigned char *mem_77806)\n{\n    #define segred_group_sizze_72216 (mainzisegred_group_sizze_70912)\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_79565_backing_1 =\n                           &shared_mem[red_arr_mem_79565_backing_offset_0];\n    volatile unsigned char *red_arr_mem_79563_backing_0 =\n                           &shared_mem[red_arr_mem_79563_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79558;\n    int32_t local_tid_79559;\n    int64_t group_sizze_79562;\n    int32_t wave_sizze_79561;\n    int32_t group_tid_79560;\n    \n    global_tid_79558 = get_global_id(0);\n    local_tid_79559 = get_local_id(0);\n    group_sizze_795",
            "62 = get_local_size(0);\n    wave_sizze_79561 = LOCKSTEP_WIDTH;\n    group_tid_79560 = get_group_id(0);\n    \n    int32_t phys_tid_72224 = global_tid_79558;\n    __local unsigned char *red_arr_mem_79563;\n    \n    red_arr_mem_79563 = (__local unsigned char *) red_arr_mem_79563_backing_0;\n    \n    __local unsigned char *red_arr_mem_79565;\n    \n    red_arr_mem_79565 = (__local unsigned char *) red_arr_mem_79565_backing_1;\n    \n    int32_t phys_group_id_79567;\n    \n    phys_group_id_79567 = get_group_id(0);\n    for (int32_t i_79568 = 0; i_79568 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_72216,\n                                                  segment_sizze_nonzzero_79556))) -\n                   phys_group_id_79567, sext_i64_i32(num_groups_72217));\n         i_79568++) {\n        int32_t virt_group_id_79569 = phys_group_id_79567 + i_79568 *\n                sext_i64_i32(num_groups_72217);\n        int64_t slice_79570 = n_m_65352;\n        int64_t slice_79571 = m_65343 * slice_79570;\n        int64_t gtid_72221 = squot64(squot64(sext_i32_i64(local_tid_79559),\n                                             segment_sizze_nonzzero_79556) +\n                                     sext_i32_i64(virt_group_id_79569) *\n                                     squot64(segred_group_sizze_72216,\n                                             segment_sizze_nonzzero_79556),\n                                     slice_79570);\n        int64_t remnant_79572 = squot64(sext_i32_i64(local_tid_79559),\n                                        segment_sizze_nonzzero_79556) +\n                sext_i32_i64(virt_group_id_79569) *\n                squot64(segred_group_sizze_72216,\n                        segment_sizze_nonzzero_79556) - gtid_72221 *\n                slice_79570;\n        int64_t gtid_72222 = remnant_79572;\n        int64_t remnant_79573 = remnant_79572 - gtid_72222;\n        int64_t gtid_72223 = srem64(sext_i32_i64(local",
            "_tid_79559), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_72221, m_65343) &&\n                                                 slt64(gtid_72222,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_79559),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_72216,\n                                                              segment_sizze_nonzzero_79556)))) {\n                int64_t last_res_72231;\n                \n                last_res_72231 = ((__global int64_t *) mem_77608)[gtid_72221 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74692 = mul64(jump_65348, gtid_72222);\n                int64_t index_primexp_74693 = smin64(i_65358, binop_y_74692);\n                int64_t max_res_72244;\n                \n                max_res_72244 = ((__global int64_t *) mem_77751)[gtid_72221 *\n                                                                 n_m_65352 +\n                                                                 gtid_72222];\n                \n                float defunc_1_f_res_72245;\n                \n                defunc_1_f_res_72245 = ((__global\n                                         float *) mem_77755)[gtid_72221 *\n                                                             n_m_65352 +\n                                                             gtid_72222];\n                \n                float a12_72246;\n                \n                a12_72246 = ((__global float *) mem_77781)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid",
            "_72222];\n                \n                float b12_72247;\n                \n                b12_72247 = ((__global float *) mem_77785)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float c12_72248;\n                \n                c12_72248 = ((__global float *) mem_77789)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float b2_72249;\n                \n                b2_72249 = ((__global float *) mem_77793)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float c2_72250;\n                \n                c2_72250 = ((__global float *) mem_77797)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float x_72252;\n                \n                x_72252 = ((__global float *) mem_77640)[gtid_72221 * q_65346 +\n                                                         gtid_72223];\n                \n                bool cond_72253 = sle64(last_res_72231, gtid_72223);\n                int64_t defunc_0_f_res_72254;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72254 = (int64_t) 0;\n                } else {\n                    int64_t i_72255 = add64(gtid_72223, max_res_72244);\n                    int64_t defunc_0_add_arg_72256;\n                    \n                    defunc_0_add_arg_72256 = ((__global\n                                               int64_t *) mem_77616)[gtid_72221 *\n                                                                     n_65344 +\n                              ",
            "                                       i_72255];\n                    \n                    int64_t defunc_1_add_res_72257 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72256);\n                    \n                    defunc_0_f_res_72254 = defunc_1_add_res_72257;\n                }\n                \n                int64_t binop_p_72258 = sub64(defunc_0_f_res_72254,\n                                              index_primexp_74693);\n                float defunc_0_f_res_72259 = sitofp_i64_f32(binop_p_72258);\n                float abs_res_72260 = (float) fabs(defunc_0_f_res_72259);\n                float tmp1_72261 = abs_res_72260 / defunc_1_f_res_72245;\n                float x_72262 = tmp1_72261 * tmp1_72261;\n                float y_72263 = tmp1_72261 * x_72262;\n                float tmp2_72264 = 1.0F - y_72263;\n                float x_72265 = tmp2_72264 * tmp2_72264;\n                float tmp3_72266 = tmp2_72264 * x_72265;\n                float tmp4_72267 = x_72252 * tmp3_72266;\n                float defunc_1_f_res_72268 = defunc_0_f_res_72259 * tmp4_72267;\n                float defunc_1_f_res_72269 = defunc_0_f_res_72259 *\n                      defunc_1_f_res_72268;\n                float defunc_0_f_res_72270;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72270 = 0.0F;\n                } else {\n                    int64_t i_72271 = add64(gtid_72223, max_res_72244);\n                    float defunc_0_add_arg_72272;\n                    \n                    defunc_0_add_arg_72272 = ((__global\n                                               float *) mem_77612)[gtid_72221 *\n                                                                   n_65344 +\n                                                                   i_72271];\n                    defunc_0_f_res_72270 = defunc_0_add_arg_72272;\n                }\n                \n                float x_72273 = a12_72246 * tmp4_72267;\n       ",
            "         float y_72274 = b12_72247 * defunc_1_f_res_72268;\n                float x_72275 = x_72273 + y_72274;\n                float y_72276 = c12_72248 * defunc_1_f_res_72269;\n                float x_72277 = x_72275 + y_72276;\n                float defunc_9_fit_fun_res_72278 = defunc_0_f_res_72270 *\n                      x_72277;\n                float x_72279 = b12_72247 * tmp4_72267;\n                float y_72280 = b2_72249 * defunc_1_f_res_72268;\n                float x_72281 = x_72279 + y_72280;\n                float y_72282 = c2_72250 * defunc_1_f_res_72269;\n                float x_72283 = x_72281 + y_72282;\n                float defunc_9_slope_fun_res_72284 = defunc_0_f_res_72270 *\n                      x_72283;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)] =\n                        defunc_9_fit_fun_res_72278;\n                    ((__local\n                      float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)] =\n                        defunc_9_slope_fun_res_72284;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_72225;\n                float x_72226;\n                float x_72227;\n                float x_72228;\n                float x_79574;\n                float x_79575;\n                float x_79576;\n                float x_79577;\n                bool ltid_in_bounds_79580 = slt64(sext_i32_i64(local_tid_",
            "79559),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_72216,\n                                                          segment_sizze_nonzzero_79556));\n                int32_t skip_threads_79581;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_79580) {\n                        x_72227 = ((volatile __local\n                                    float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)];\n                        x_72228 = ((volatile __local\n                                    float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)];\n                        if ((local_tid_79559 - squot32(local_tid_79559, 32) *\n                             32) == 0) {\n                            x_72225 = x_72227;\n                            x_72226 = x_72228;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79581 = 1;\n                    while (slt32(skip_threads_79581, 32)) {\n                        bool thread_active_79582 = sle32(skip_threads_79581,\n                                                         local_tid_79559 -\n                                                         squot32(local_tid_79559,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_79580;\n                        \n                        if (thread_active_79582) {\n                            // read operands\n                            {\n                                x_72225 = ((volatile __local\n                                            float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559) -\n                                                                        sext_i32_i64(skip_threads_79581)];\n                                x_",
            "72226 = ((volatile __local\n                                            float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559) -\n                                                                        sext_i32_i64(skip_threads_79581)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79583 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79559),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_79559) -\n                                       sext_i32_i64(local_tid_79559 -\n                                       skip_threads_79581));\n                            \n                            if (thread_active_79582 && inactive_79583) {\n                                x_72225 = x_72227;\n                                x_72226 = x_72228;\n                            }\n                            if (thread_active_79582) {\n                                if (!inactive_79583) {\n                                    float defunc_1_op_res_72229 = x_72225 +\n                                          x_72227;\n                                    float defunc_1_op_res_72230 = x_72226 +\n                                          x_72228;\n                                    \n                                    x_72225 = defunc_1_op_res_72229;\n                                    x_72226 = defunc_1_op_res_72230;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79561, skip_threads_79581)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79582) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_m",
            "em_79563)[sext_i32_i64(local_tid_79559)] =\n                                    x_72225;\n                                x_72227 = x_72225;\n                                ((volatile __local\n                                  float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)] =\n                                    x_72226;\n                                x_72228 = x_72226;\n                            }\n                        }\n                        if (sle32(wave_sizze_79561, skip_threads_79581)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79581 *= 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_79559 - squot32(local_tid_79559, 32) * 32) ==\n                        31 && ltid_in_bounds_79580) {\n                        ((volatile __local\n                          float *) red_arr_mem_79563)[sext_i32_i64(squot32(local_tid_79559,\n                                                                           32))] =\n                            x_72225;\n                        ((volatile __local\n                          float *) red_arr_mem_79565)[sext_i32_i64(squot32(local_tid_79559,\n                                                                           32))] =\n                            x_72226;\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_79584;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_79559, 32) == 0 &&\n                            ltid_in_bounds_79580) {\n                            x_79576 = ((volatile __local\n           ",
            "                             float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)];\n                            x_79577 = ((volatile __local\n                                        float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)];\n                            if ((local_tid_79559 - squot32(local_tid_79559,\n                                                           32) * 32) == 0) {\n                                x_79574 = x_79576;\n                                x_79575 = x_79577;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_79584 = 1;\n                        while (slt32(skip_threads_79584, 32)) {\n                            bool thread_active_79585 = sle32(skip_threads_79584,\n                                                             local_tid_79559 -\n                                                             squot32(local_tid_79559,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_79559, 32) == 0 &&\n                                  ltid_in_bounds_79580);\n                            \n                            if (thread_active_79585) {\n                                // read operands\n                                {\n                                    x_79574 = ((volatile __local\n                                                float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559) -\n                                                                            sext_i32_i64(skip_threads_79584)];\n                                    x_79575 = ((volatile __local\n                                                float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559) -\n                                                                            se",
            "xt_i32_i64(skip_threads_79584)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_79586 =\n                                     slt64(srem64(sext_i32_i64(local_tid_79559 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_79559 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_79559 -\n                                                         skip_threads_79584) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_79585 && inactive_79586) {\n                                    x_79574 = x_79576;\n                                    x_79575 = x_79577;\n                                }\n                                if (thread_active_79585) {\n                                    if (!inactive_79586) {\n                                        float defunc_1_op_res_79578 = x_79574 +\n                                              x_79576;\n                                        float defunc_1_op_res_79579 = x_79575 +\n                                              x_79577;\n                                        \n                                        x_79574 = defunc_1_op_res_79578;\n                                        x_79575 = defunc_1_op_res_79579;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_79561, skip_threads_79584)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_79585) {\n                                // write result\n                                {\n                                ",
            "    ((volatile __local\n                                      float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)] =\n                                        x_79574;\n                                    x_79576 = x_79574;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)] =\n                                        x_79575;\n                                    x_79577 = x_79575;\n                                }\n                            }\n                            if (sle32(wave_sizze_79561, skip_threads_79584)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_79584 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_79587 = squot32(local_tid_79559, 32) == 0 ||\n                     !ltid_in_bounds_79580;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_79587) {\n                            x_72227 = x_72225;\n                            x_72228 = x_72226;\n                            x_72225 = ((__local\n                                        float *) red_arr_mem_79563)[sext_i32_i64(squot32(local_tid_79559,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72226 = ((__local\n                                        float *) red_arr_mem_79565)[sext_i32_i64(squot32(local_tid_79559,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n              ",
            "          }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79588 =\n                             slt64(srem64(sext_i32_i64(local_tid_79559),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_79559) -\n                                   sext_i32_i64(squot32(local_tid_79559, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_79587) {\n                            if (inactive_79588) {\n                                x_72225 = x_72227;\n                                x_72226 = x_72228;\n                            }\n                        }\n                        if (!no_carry_in_79587) {\n                            if (!inactive_79588) {\n                                float defunc_1_op_res_72229 = x_72225 + x_72227;\n                                float defunc_1_op_res_72230 = x_72226 + x_72228;\n                                \n                                x_72225 = defunc_1_op_res_72229;\n                                x_72226 = defunc_1_op_res_72230;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_79587) {\n                            ((__local\n                              float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)] =\n                                x_72225;\n                            ((__local\n                              float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)] =\n                                x_72226;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_79559, 32) == 0 &&\n                        ltid_in_bounds_79580) {\n   ",
            "                     ((__local\n                          float *) red_arr_mem_79563)[sext_i32_i64(local_tid_79559)] =\n                            x_72227;\n                        ((__local\n                          float *) red_arr_mem_79565)[sext_i32_i64(local_tid_79559)] =\n                            x_72228;\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_79569) *\n                      squot64(segred_group_sizze_72216,\n                              segment_sizze_nonzzero_79556) +\n                      sext_i32_i64(local_tid_79559), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_79559),\n                      squot64(segred_group_sizze_72216,\n                              segment_sizze_nonzzero_79556))) {\n                float tmp_79589;\n                \n                tmp_79589 = ((__local\n                              float *) red_arr_mem_79563)[(sext_i32_i64(local_tid_79559) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79556 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77802)[squot64(sext_i32_i64(virt_group_id_79569) *\n                                              squot64(segred_group_sizze_72216,\n                                                      segment_sizze_nonzzero_79556) +\n                                              sext_i32_i64(local_tid_79559),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79569) *\n                                       squot64(segred_group_sizze_72216,\n                                               segment_sizze_nonzzero_79556) ",
            "+\n                                       sext_i32_i64(local_tid_79559) -\n                                       squot64(sext_i32_i64(virt_group_id_79569) *\n                                               squot64(segred_group_sizze_72216,\n                                                       segment_sizze_nonzzero_79556) +\n                                               sext_i32_i64(local_tid_79559),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79589;\n                \n                float tmp_79590;\n                \n                tmp_79590 = ((__local\n                              float *) red_arr_mem_79565)[(sext_i32_i64(local_tid_79559) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79556 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77806)[squot64(sext_i32_i64(virt_group_id_79569) *\n                                              squot64(segred_group_sizze_72216,\n                                                      segment_sizze_nonzzero_79556) +\n                                              sext_i32_i64(local_tid_79559),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79569) *\n                                       squot64(segred_group_sizze_72216,\n                                               segment_sizze_nonzzero_79556) +\n                                       sext_i32_i64(local_tid_79559) -\n                                       squot64(sext_i32_i64(virt_group_id_79569) *\n                                               squot64(segred_group_sizze_72216,\n                                                       segment_sizze_nonzzero_79556) +\n                                               sext_i32_i64(local_tid_79559),\n            ",
            "                                   n_m_65352) * n_m_65352)] =\n                    tmp_79590;\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_72216\n}\n__kernel void mainzisegscan_67850(__global int *global_failure,\n                                  uint local_mem_78351_backing_offset_0,\n                                  int64_t m_65343, int64_t n_65344, __global\n                                  unsigned char *Y_mem_76976, __global\n                                  unsigned char *mem_77082, __global\n                                  unsigned char *mainziid_counter_mem_78322,\n                                  __global\n                                  unsigned char *status_flags_mem_78324,\n                                  __global unsigned char *aggregates_mem_78326,\n                                  __global unsigned char *incprefixes_mem_78328)\n{\n    #define segscan_group_sizze_67844 (mainzisegscan_group_sizze_67824)\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_78351_backing_0 =\n                           &shared_mem[local_mem_78351_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78342;\n    int32_t local_tid_78343;\n    int64_t group_sizze_78346;\n    int32_t wave_sizze_78345;\n    int32_t group_tid_78344;\n    \n    global_tid_78342 = get_global_id(0);\n    local_tid_78343 = get_local_id(0);\n    group_sizze_78346 = get_local_size(0);\n    wave_sizze_78345 = LOCKSTEP_WIDTH;\n    group_tid_78344 = get_group_id(0);\n    \n    int32_t phys_tid_67850 = global_tid_78342;\n    int64_t byte_offsets_78347 = (int64_t) 0;\n    int64_t byte_offsets_78348 = segscan_group_sizze_67844 * (int64_t) 8;\n    int64_t warp_byte_offset_78349 = (int64_t) 32;\n    int64_t warp_byte_offset_78350 = (int64_t) 288;\n    \n    // Allocat",
            "e reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_78351;\n    \n    local_mem_78351 = (__local unsigned char *) local_mem_78351_backing_0;\n    \n    int64_t trans_arr_len_78352 = (int64_t) 11 * segscan_group_sizze_67844;\n    int32_t dynamic_id_78358;\n    \n    if (local_tid_78343 == 0) {\n        dynamic_id_78358 = atomic_add_i32_global(&((volatile __global\n                                                    int *) mainziid_counter_mem_78322)[(int64_t) 0],\n                                                 (int) 1);\n        ((__local int32_t *) local_mem_78351)[(int64_t) 0] = dynamic_id_78358;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_78358 = ((__local int32_t *) local_mem_78351)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_78359 = sext_i32_i64(dynamic_id_78358) * (int64_t) 11 *\n            segscan_group_sizze_67844;\n    int64_t sgm_idx_78360 = smod64(blockOff_78359, n_65344);\n    int32_t boundary_78361 = sext_i64_i32(smin64((int64_t) 11 *\n                                                 segscan_group_sizze_67844,\n                                                 n_65344 - sgm_idx_78360));\n    int32_t segsizze_compact_78362 = sext_i64_i32(smin64((int64_t) 11 *\n                                                         segscan_group_sizze_67844,\n                                                         n_65344));\n    int64_t private_mem_78363[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_78365 = 0; i_78365 < (int64_t) 11; i_78365++) {\n            int64_t phys_tid_78366 = blockOff_78359 +\n                    sext_i32_i64(local_tid_78343) + i_78365 *\n                    segscan_group_sizze_67844;\n            int64_t slice_78367 = n_65344;\n            int64_t slice_78368 = m_65343 * slice_78367;\n            int64_t gtid_67848 = squot64(phys_tid_78366, slice_78367);\n            int64_t remnant_78369 = phys_tid_78366 - gtid_67848 * slice_78367;\n            int64_t gtid_67849 = remnant_78369;\n   ",
            "         int64_t remnant_78370 = remnant_78369 - gtid_67849;\n            \n            if (slt64(phys_tid_78366, m_65343 * n_65344)) {\n                float x_67855;\n                \n                x_67855 = ((__global float *) Y_mem_76976)[gtid_67848 *\n                                                           n_65344 +\n                                                           gtid_67849];\n                \n                bool isnan_res_67856;\n                \n                isnan_res_67856 = futrts_isnan32(x_67855);\n                \n                bool defunc_0_p_res_67857 = !isnan_res_67856;\n                int64_t defunc_0_f_res_67858 =\n                        btoi_bool_i64(defunc_0_p_res_67857);\n                \n                private_mem_78363[i_78365] = defunc_0_f_res_67858;\n            } else {\n                private_mem_78363[i_78365] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_78371 = 0; i_78371 < (int64_t) 11; i_78371++) {\n            int64_t sharedIdx_78372 = sext_i32_i64(local_tid_78343) + i_78371 *\n                    segscan_group_sizze_67844;\n            int64_t tmp_78373;\n            \n            tmp_78373 = private_mem_78363[i_78371];\n            ((__local int64_t *) local_mem_78351)[sharedIdx_78372] = tmp_78373;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_78374 = 0; i_78374 < 11; i_78374++) {\n            int32_t sharedIdx_78375 = local_tid_78343 * 11 + i_78374;\n            int64_t tmp_78376;\n            \n            tmp_78376 = ((__local\n                          int64_t *) local_mem_78351)[sext_i32_i64(sharedIdx_78375)];\n            private_mem_78363[sext_i32_i64(i_78374)] = tmp_78376;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_78377 = local_tid_78343 * 11 + 1;\n        \n        for (int64_t i_78378 = 0; i_78378 < (int64_t) 10; i_78378++) {\n            bool new",
            "_sgm_78379 = smod32(gidx_78377 + sext_i64_i32(i_78378) -\n                                        boundary_78361,\n                                        segsizze_compact_78362) == 0;\n            \n            if (!new_sgm_78379) {\n                int64_t x_67851;\n                int64_t x_67852;\n                \n                x_67851 = private_mem_78363[i_78378];\n                x_67852 = private_mem_78363[i_78378 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_67853 = add64(x_67851, x_67852);\n                \n                private_mem_78363[i_78378 + (int64_t) 1] =\n                    defunc_1_op_res_67853;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_78380;\n        \n        tmp_78380 = private_mem_78363[(int64_t) 10];\n        ((__local int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_78343)] =\n            tmp_78380;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_78384;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_78381;\n        int64_t x_78382;\n        int64_t x_78385;\n        int64_t x_78386;\n        bool ltid_in_bounds_78388 = slt64(sext_i32_i64(local_tid_78343),\n                                          segscan_group_sizze_67844);\n        int32_t skip_threads_78389;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_78388) {\n                x_78382 = ((volatile __local\n                            int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                                (int64_t) 8) +\n                                                        sext_i32_i64(local_tid_78343)];\n                if ((local_tid_78343 - squot32(local_tid_78343, 32) * 32) ==\n                    0) {\n                    x_78381 = x_78382;\n           ",
            "     }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_78389 = 1;\n            while (slt32(skip_threads_78389, 32)) {\n                bool thread_active_78390 = sle32(skip_threads_78389,\n                                                 local_tid_78343 -\n                                                 squot32(local_tid_78343, 32) *\n                                                 32) && ltid_in_bounds_78388;\n                \n                if (thread_active_78390) {\n                    // read operands\n                    {\n                        x_78381 = ((volatile __local\n                                    int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(local_tid_78343) -\n                                                                 sext_i32_i64(skip_threads_78389))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_78391 = slt32(smod32((local_tid_78343 + 1) *\n                                                       11 - 1 +\n                                                       segsizze_compact_78362 -\n                                                       boundary_78361,\n                                                       segsizze_compact_78362),\n                                                (local_tid_78343 + 1) * 11 - 1 -\n                                                ((local_tid_78343 -\n                                                  skip_threads_78389 + 1) * 11 -\n                                                 1));\n                    \n                    if (thread_active_78390 && inactive_78391) {\n                        x_78381 = x_78382;\n                    }\n                    if (thread_active_78390) {\n                     ",
            "   if (!inactive_78391) {\n                            int64_t defunc_1_op_res_78383 = add64(x_78381,\n                                                                  x_78382);\n                            \n                            x_78381 = defunc_1_op_res_78383;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_78345, skip_threads_78389)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_78390) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_78343)] =\n                            x_78381;\n                        x_78382 = x_78381;\n                    }\n                }\n                if (sle32(wave_sizze_78345, skip_threads_78389)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_78389 *= 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_78343 - squot32(local_tid_78343, 32) * 32) == 31 &&\n                ltid_in_bounds_78388) {\n                ((volatile __local\n                  int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_78343,\n                                                                   32))] =\n                    x_78381;\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_78392;\n            \n      ",
            "      // read input for in-block scan\n            {\n                if (squot32(local_tid_78343, 32) == 0 && ltid_in_bounds_78388) {\n                    x_78386 = ((volatile __local\n                                int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                                    (int64_t) 8) +\n                                                            sext_i32_i64(local_tid_78343)];\n                    if ((local_tid_78343 - squot32(local_tid_78343, 32) * 32) ==\n                        0) {\n                        x_78385 = x_78386;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_78392 = 1;\n                while (slt32(skip_threads_78392, 32)) {\n                    bool thread_active_78393 = sle32(skip_threads_78392,\n                                                     local_tid_78343 -\n                                                     squot32(local_tid_78343,\n                                                             32) * 32) &&\n                         (squot32(local_tid_78343, 32) == 0 &&\n                          ltid_in_bounds_78388);\n                    \n                    if (thread_active_78393) {\n                        // read operands\n                        {\n                            x_78385 = ((volatile __local\n                                        int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                                            (int64_t) 8) +\n                                                                    (sext_i32_i64(local_tid_78343) -\n                                                                     sext_i32_i64(skip_threads_78392))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78394 = slt32(smod32((local_tid_7834",
            "3 *\n                                                            32 + 32 - 1 + 1) *\n                                                           11 - 1 +\n                                                           segsizze_compact_78362 -\n                                                           boundary_78361,\n                                                           segsizze_compact_78362),\n                                                    (local_tid_78343 * 32 + 32 -\n                                                     1 + 1) * 11 - 1 -\n                                                    (((local_tid_78343 -\n                                                       skip_threads_78392) *\n                                                      32 + 32 - 1 + 1) * 11 -\n                                                     1));\n                        \n                        if (thread_active_78393 && inactive_78394) {\n                            x_78385 = x_78386;\n                        }\n                        if (thread_active_78393) {\n                            if (!inactive_78394) {\n                                int64_t defunc_1_op_res_78387 = add64(x_78385,\n                                                                      x_78386);\n                                \n                                x_78385 = defunc_1_op_res_78387;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_78345, skip_threads_78392)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_78393) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_78343)] =",
            "\n                                x_78385;\n                            x_78386 = x_78385;\n                        }\n                    }\n                    if (sle32(wave_sizze_78345, skip_threads_78392)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_78392 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_78395 = squot32(local_tid_78343, 32) == 0 ||\n             !ltid_in_bounds_78388;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_78395) {\n                    x_78382 = x_78381;\n                    x_78381 = ((__local\n                                int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                                    (int64_t) 8) +\n                                                            (sext_i32_i64(squot32(local_tid_78343,\n                                                                                  32)) -\n                                                             (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_78396 = slt32(smod32((local_tid_78343 + 1) * 11 -\n                                                   1 + segsizze_compact_78362 -\n                                                   boundary_78361,\n                                                   segsizze_compact_78362),\n                                            (local_tid_78343 + 1) * 11 - 1 -\n                                            ((squot32(local_tid_78343, 32) *\n                                              32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_78395) {\n                    if (inactive_78396) {\n                        x_78381 = x_78382;\n                    }\n                }\n               ",
            " if (!no_carry_in_78395) {\n                    if (!inactive_78396) {\n                        int64_t defunc_1_op_res_78383 = add64(x_78381, x_78382);\n                        \n                        x_78381 = defunc_1_op_res_78383;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_78395) {\n                    ((__local\n                      int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_78343)] =\n                        x_78381;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_78343, 32) == 0 && ltid_in_bounds_78388) {\n                ((__local\n                  int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_78343)] =\n                    x_78382;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_78343 == 0) {\n            acc_78384 = ((__local\n                          int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                              (int64_t) 8) +\n                                                      (segscan_group_sizze_67844 -\n                                                       (int64_t) 1)];\n        } else {\n            acc_78384 = ((__local\n                          int64_t *) local_mem_78351)[squot64(byte_offsets_78347,\n                                                              (int64_t) 8) +\n                                                      (sext_i32_i64(local_tid_78343) -\n                                                     ",
            "  (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_78397 = (int64_t) 0;\n    bool block_new_sgm_78398 = sgm_idx_78360 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_78398 && local_tid_78343 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_78328)[dynamic_id_78358] = acc_78384;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_78324)[dynamic_id_78358] = (int8_t) 2;\n            acc_78384 = (int64_t) 0;\n        }\n        if (!block_new_sgm_78398 && slt32(local_tid_78343, wave_sizze_78345)) {\n            if (local_tid_78343 == 0) {\n                if (boundary_78361 == sext_i64_i32(segscan_group_sizze_67844 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_78326)[dynamic_id_78358] =\n                        acc_78384;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_78324)[dynamic_id_78358] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_78328)[dynamic_id_78358] =\n                        acc_78384;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_78324)[dynamic_id_78358] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_78399;\n                \n                tmp_78399 = ((volatile __global\n                              int8_t *) status_flags_mem_78324)[dynamic_id_78358 -\n                                                                (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_78351)[(int64_t) 0] =\n                    tmp_78399;\n            }\n            mem_fence_local();\n            \n            int8_t s",
            "tatus_78400;\n            \n            status_78400 = ((__local int8_t *) local_mem_78351)[(int64_t) 0];\n            if (status_78400 == (int8_t) 2) {\n                if (local_tid_78343 == 0) {\n                    prefix_78397 = ((volatile __global\n                                     int64_t *) incprefixes_mem_78328)[dynamic_id_78358 -\n                                                                       (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_78401 = dynamic_id_78358 -\n                        sext_i32_i64(wave_sizze_78345);\n                \n                while (slt32(wave_sizze_78345 * -1, readOffset_78401)) {\n                    int32_t read_i_78402 = readOffset_78401 + local_tid_78343;\n                    int64_t aggr_78403 = (int64_t) 0;\n                    int8_t flag_78404 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_78402)) {\n                        if (sle64(blockOff_78359 - (sext_i32_i64(read_i_78402 +\n                                                    1) *\n                                                    segscan_group_sizze_67844 *\n                                                    (int64_t) 11 - (int64_t) 1),\n                                  sgm_idx_78360)) {\n                            flag_78404 = ((volatile __global\n                                           int8_t *) status_flags_mem_78324)[sext_i32_i64(read_i_78402)];\n                            if (flag_78404 == (int8_t) 2) {\n                                aggr_78403 = ((volatile __global\n                                               int64_t *) incprefixes_mem_78328)[sext_i32_i64(read_i_78402)];\n                            } else {\n                                if (flag_78404 == (int8_t) 1) {\n                                    aggr_78403 = ((volatile __global\n                                                   int64_t *) aggregates_mem_78326)[sext_i32_i64(read_i_78402)];\n                                }\n    ",
            "                        }\n                        } else {\n                            flag_78404 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_78343)] =\n                        aggr_78403;\n                    ((__local\n                      int8_t *) local_mem_78351)[sext_i32_i64(local_tid_78343)] =\n                        flag_78404;\n                    flag_78404 = ((__local\n                                   int8_t *) local_mem_78351)[sext_i32_i64(wave_sizze_78345) -\n                                                              (int64_t) 1];\n                    if (slt8(flag_78404, (int8_t) 2)) {\n                        int8_t flg_x_78408;\n                        int8_t flg_y_78409;\n                        int64_t x_78405;\n                        int64_t x_78406;\n                        int32_t skip_threads_78410;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_78409 = ((volatile __local\n                                            int8_t *) local_mem_78351)[sext_i32_i64(local_tid_78343)];\n                            x_78406 = ((volatile __local\n                                        int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                                            (int64_t) 8) +\n                                                                    sext_i32_i64(local_tid_78343)];\n                            if ((local_tid_78343 - squot32(local_tid_78343,\n                                                           32) * 32) == 0) {\n                                x_78405 = x_78406;\n                                flg_x_78408 = flg_y_78409;\n              ",
            "              }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_78410 = 1;\n                            while (slt32(skip_threads_78410, 32)) {\n                                if (sle32(skip_threads_78410, local_tid_78343 -\n                                          squot32(local_tid_78343, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_78408 = ((volatile __local\n                                                        int8_t *) local_mem_78351)[sext_i32_i64(local_tid_78343) -\n                                                                                   sext_i32_i64(skip_threads_78410)];\n                                        x_78405 = ((volatile __local\n                                                    int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                                                        (int64_t) 8) +\n                                                                                (sext_i32_i64(local_tid_78343) -\n                                                                                 sext_i32_i64(skip_threads_78410))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_78409 == (int8_t) 2 ||\n                                            flg_y_78409 == (int8_t) 0) {\n                                            flg_x_78408 = flg_y_78409;\n                                            x_78405 = x_78406;\n                                        } else {\n                                            int64_t defunc_1_op_res_78407 =\n                                                    add64(x_78405, x_78406);\n                                            \n         ",
            "                                   x_78405 = defunc_1_op_res_78407;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_78351)[sext_i32_i64(local_tid_78343)] =\n                                            flg_x_78408;\n                                        flg_y_78409 = flg_x_78408;\n                                        ((volatile __local\n                                          int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_78343)] =\n                                            x_78405;\n                                        x_78406 = x_78405;\n                                    }\n                                }\n                                skip_threads_78410 *= 2;\n                            }\n                        }\n                    }\n                    flag_78404 = ((__local\n                                   int8_t *) local_mem_78351)[sext_i32_i64(wave_sizze_78345) -\n                                                              (int64_t) 1];\n                    aggr_78403 = ((__local\n                                   int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                                       (int64_t) 8) +\n                                                               (sext_i32_i64(wave_sizze_78345) -\n                                                                (int64_t) 1)];\n                    if (flag_78404 == (int8_t) 2) {\n                        readOffset_78401 = wave_sizze_78345 * -1;\n                    } else {\n                        if (flag_78404 =",
            "= (int8_t) 1) {\n                            readOffset_78401 -= wave_sizze_78345;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_78404)) {\n                        int64_t x_78411 = aggr_78403;\n                        int64_t x_78412 = prefix_78397;\n                        int64_t defunc_1_op_res_78413 = add64(x_78411, x_78412);\n                        \n                        prefix_78397 = defunc_1_op_res_78413;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_78343 == 0) {\n                if (boundary_78361 == sext_i64_i32(segscan_group_sizze_67844 *\n                    (int64_t) 11)) {\n                    int64_t x_78414 = prefix_78397;\n                    int64_t x_78415 = acc_78384;\n                    int64_t defunc_1_op_res_78416 = add64(x_78414, x_78415);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_78328)[dynamic_id_78358] =\n                        defunc_1_op_res_78416;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_78324)[dynamic_id_78358] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                      (int64_t) 8)] =\n                    prefix_78397;\n                acc_78384 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_78358 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_78397 = ((__local\n                             int64_t *) local_mem_78351)[squot64(warp_byte_offset_78349,\n                                                                 (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_78417;\n        int64_t x_78418;\n    ",
            "    int64_t x_78420 = prefix_78397;\n        int64_t x_78421 = acc_78384;\n        \n        if (slt32(local_tid_78343 * 11, boundary_78361) &&\n            !block_new_sgm_78398) {\n            int64_t defunc_1_op_res_78422 = add64(x_78420, x_78421);\n            \n            x_78417 = defunc_1_op_res_78422;\n        } else {\n            x_78417 = acc_78384;\n        }\n        \n        int32_t stopping_point_78423 = segsizze_compact_78362 -\n                srem32(local_tid_78343 * 11 - 1 + segsizze_compact_78362 -\n                       boundary_78361, segsizze_compact_78362);\n        \n        for (int64_t i_78424 = 0; i_78424 < (int64_t) 11; i_78424++) {\n            if (slt32(sext_i64_i32(i_78424), stopping_point_78423 - 1)) {\n                x_78418 = private_mem_78363[i_78424];\n                \n                int64_t defunc_1_op_res_78419 = add64(x_78417, x_78418);\n                \n                private_mem_78363[i_78424] = defunc_1_op_res_78419;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_78425 = 0; i_78425 < (int64_t) 11; i_78425++) {\n            int64_t sharedIdx_78426 = sext_i32_i64(local_tid_78343 * 11) +\n                    i_78425;\n            int64_t tmp_78427;\n            \n            tmp_78427 = private_mem_78363[i_78425];\n            ((__local int64_t *) local_mem_78351)[sharedIdx_78426] = tmp_78427;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_78428 = 0; i_78428 < (int64_t) 11; i_78428++) {\n            int64_t flat_idx_78429 = blockOff_78359 +\n                    segscan_group_sizze_67844 * i_78428 +\n                    sext_i32_i64(local_tid_78343);\n            int64_t slice_78430 = n_65344;\n            int64_t slice_78431 = m_65343 * slice_78430;\n            int64_t gtid_67848 = squot64(flat_idx_78429, slice_78430);\n            int64_t remnant_78432 = flat_idx_78429 - gtid_67848 * slice_78430;\n            int64_t gtid_67849 = remnant_7",
            "8432;\n            int64_t remnant_78433 = remnant_78432 - gtid_67849;\n            \n            if (slt64(flat_idx_78429, m_65343 * n_65344)) {\n                int64_t tmp_78434;\n                \n                tmp_78434 = ((__local\n                              int64_t *) local_mem_78351)[flat_idx_78429 -\n                                                          blockOff_78359];\n                ((__global int64_t *) mem_77082)[gtid_67848 * n_65344 +\n                                                 gtid_67849] = tmp_78434;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_78358 == sdiv_up64(m_65343 * n_65344,\n                                          segscan_group_sizze_67844 *\n                                          (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_78322)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_67844\n}\n__kernel void mainzisegscan_69641(__global int *global_failure,\n                                  uint local_mem_78754_backing_offset_0,\n                                  int64_t m_65343, int64_t n_65344, __global\n                                  unsigned char *Y_mem_76976, __global\n                                  unsigned char *mem_77316, __global\n                                  unsigned char *mainziid_counter_mem_78737,\n                                  __global\n                                  unsigned char *status_flags_mem_78739,\n                                  __global unsigned char *aggregates_mem_78741,\n                                  __global unsigned char *incprefixes_mem_78743)\n{\n    #define segscan_group_sizze_69635 (mainzisegscan_group_sizze_69615)\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_78754_backing_0 =\n                           &shared_mem[loca",
            "l_mem_78754_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78745;\n    int32_t local_tid_78746;\n    int64_t group_sizze_78749;\n    int32_t wave_sizze_78748;\n    int32_t group_tid_78747;\n    \n    global_tid_78745 = get_global_id(0);\n    local_tid_78746 = get_local_id(0);\n    group_sizze_78749 = get_local_size(0);\n    wave_sizze_78748 = LOCKSTEP_WIDTH;\n    group_tid_78747 = get_group_id(0);\n    \n    int32_t phys_tid_69641 = global_tid_78745;\n    int64_t byte_offsets_78750 = (int64_t) 0;\n    int64_t byte_offsets_78751 = segscan_group_sizze_69635 * (int64_t) 8;\n    int64_t warp_byte_offset_78752 = (int64_t) 32;\n    int64_t warp_byte_offset_78753 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_78754;\n    \n    local_mem_78754 = (__local unsigned char *) local_mem_78754_backing_0;\n    \n    int64_t trans_arr_len_78755 = (int64_t) 11 * segscan_group_sizze_69635;\n    int32_t dynamic_id_78761;\n    \n    if (local_tid_78746 == 0) {\n        dynamic_id_78761 = atomic_add_i32_global(&((volatile __global\n                                                    int *) mainziid_counter_mem_78737)[(int64_t) 0],\n                                                 (int) 1);\n        ((__local int32_t *) local_mem_78754)[(int64_t) 0] = dynamic_id_78761;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_78761 = ((__local int32_t *) local_mem_78754)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_78762 = sext_i32_i64(dynamic_id_78761) * (int64_t) 11 *\n            segscan_group_sizze_69635;\n    int64_t sgm_idx_78763 = smod64(blockOff_78762, n_65344);\n    int32_t boundary_78764 = sext_i64_i32(smin64((int64_t) 11 *\n                                                 segscan_group_sizze_69635,\n                                                 n_65344 - sgm_idx_78763));\n    int32_t segsizze_compact_78765 = sext_i64_i32(smin64((int64_t) 11 *\n                           ",
            "                              segscan_group_sizze_69635,\n                                                         n_65344));\n    int64_t private_mem_78766[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_78768 = 0; i_78768 < (int64_t) 11; i_78768++) {\n            int64_t phys_tid_78769 = blockOff_78762 +\n                    sext_i32_i64(local_tid_78746) + i_78768 *\n                    segscan_group_sizze_69635;\n            int64_t slice_78770 = n_65344;\n            int64_t slice_78771 = m_65343 * slice_78770;\n            int64_t gtid_69639 = squot64(phys_tid_78769, slice_78770);\n            int64_t remnant_78772 = phys_tid_78769 - gtid_69639 * slice_78770;\n            int64_t gtid_69640 = remnant_78772;\n            int64_t remnant_78773 = remnant_78772 - gtid_69640;\n            \n            if (slt64(phys_tid_78769, m_65343 * n_65344)) {\n                float x_69646;\n                \n                x_69646 = ((__global float *) Y_mem_76976)[gtid_69639 *\n                                                           n_65344 +\n                                                           gtid_69640];\n                \n                bool isnan_res_69647;\n                \n                isnan_res_69647 = futrts_isnan32(x_69646);\n                \n                bool defunc_0_p_res_69648 = !isnan_res_69647;\n                int64_t defunc_0_f_res_69649 =\n                        btoi_bool_i64(defunc_0_p_res_69648);\n                \n                private_mem_78766[i_78768] = defunc_0_f_res_69649;\n            } else {\n                private_mem_78766[i_78768] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_78774 = 0; i_78774 < (int64_t) 11; i_78774++) {\n            int64_t sharedIdx_78775 = sext_i32_i64(local_tid_78746) + i_78774 *\n                    segscan_group_sizze_69635;\n            int64_t tmp_78776;\n            \n            tmp_78776 = private_mem_78766[i",
            "_78774];\n            ((__local int64_t *) local_mem_78754)[sharedIdx_78775] = tmp_78776;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_78777 = 0; i_78777 < 11; i_78777++) {\n            int32_t sharedIdx_78778 = local_tid_78746 * 11 + i_78777;\n            int64_t tmp_78779;\n            \n            tmp_78779 = ((__local\n                          int64_t *) local_mem_78754)[sext_i32_i64(sharedIdx_78778)];\n            private_mem_78766[sext_i32_i64(i_78777)] = tmp_78779;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_78780 = local_tid_78746 * 11 + 1;\n        \n        for (int64_t i_78781 = 0; i_78781 < (int64_t) 10; i_78781++) {\n            bool new_sgm_78782 = smod32(gidx_78780 + sext_i64_i32(i_78781) -\n                                        boundary_78764,\n                                        segsizze_compact_78765) == 0;\n            \n            if (!new_sgm_78782) {\n                int64_t x_69642;\n                int64_t x_69643;\n                \n                x_69642 = private_mem_78766[i_78781];\n                x_69643 = private_mem_78766[i_78781 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_69644 = add64(x_69642, x_69643);\n                \n                private_mem_78766[i_78781 + (int64_t) 1] =\n                    defunc_1_op_res_69644;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_78783;\n        \n        tmp_78783 = private_mem_78766[(int64_t) 10];\n        ((__local int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_78746)] =\n            tmp_78783;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_78787;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_78784;\n        int64_t x_78785;\n        int64_t x_78788;\n        int64_t",
            " x_78789;\n        bool ltid_in_bounds_78791 = slt64(sext_i32_i64(local_tid_78746),\n                                          segscan_group_sizze_69635);\n        int32_t skip_threads_78792;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_78791) {\n                x_78785 = ((volatile __local\n                            int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                                (int64_t) 8) +\n                                                        sext_i32_i64(local_tid_78746)];\n                if ((local_tid_78746 - squot32(local_tid_78746, 32) * 32) ==\n                    0) {\n                    x_78784 = x_78785;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_78792 = 1;\n            while (slt32(skip_threads_78792, 32)) {\n                bool thread_active_78793 = sle32(skip_threads_78792,\n                                                 local_tid_78746 -\n                                                 squot32(local_tid_78746, 32) *\n                                                 32) && ltid_in_bounds_78791;\n                \n                if (thread_active_78793) {\n                    // read operands\n                    {\n                        x_78784 = ((volatile __local\n                                    int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(local_tid_78746) -\n                                                                 sext_i32_i64(skip_threads_78792))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_78794 = slt32(smod32((local_tid_78746 + 1) *\n                                                       11 - 1 ",
            "+\n                                                       segsizze_compact_78765 -\n                                                       boundary_78764,\n                                                       segsizze_compact_78765),\n                                                (local_tid_78746 + 1) * 11 - 1 -\n                                                ((local_tid_78746 -\n                                                  skip_threads_78792 + 1) * 11 -\n                                                 1));\n                    \n                    if (thread_active_78793 && inactive_78794) {\n                        x_78784 = x_78785;\n                    }\n                    if (thread_active_78793) {\n                        if (!inactive_78794) {\n                            int64_t defunc_1_op_res_78786 = add64(x_78784,\n                                                                  x_78785);\n                            \n                            x_78784 = defunc_1_op_res_78786;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_78748, skip_threads_78792)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_78793) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_78746)] =\n                            x_78784;\n                        x_78785 = x_78784;\n                    }\n                }\n                if (sle32(wave_sizze_78748, skip_threads_78792)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_78792 *= 2;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // last thread of block 'i' writes its r",
            "esult to offset 'i'\n        {\n            if ((local_tid_78746 - squot32(local_tid_78746, 32) * 32) == 31 &&\n                ltid_in_bounds_78791) {\n                ((volatile __local\n                  int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_78746,\n                                                                   32))] =\n                    x_78784;\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_78795;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_78746, 32) == 0 && ltid_in_bounds_78791) {\n                    x_78789 = ((volatile __local\n                                int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                                    (int64_t) 8) +\n                                                            sext_i32_i64(local_tid_78746)];\n                    if ((local_tid_78746 - squot32(local_tid_78746, 32) * 32) ==\n                        0) {\n                        x_78788 = x_78789;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_78795 = 1;\n                while (slt32(skip_threads_78795, 32)) {\n                    bool thread_active_78796 = sle32(skip_threads_78795,\n                                                     local_tid_78746 -\n                                                     squot32(local_tid_78746,\n                                                             32) * 32) &&\n                         (squot32(local_tid_78746, 32) == 0 &&\n                          ltid_in_bounds_78791);\n                    \n             ",
            "       if (thread_active_78796) {\n                        // read operands\n                        {\n                            x_78788 = ((volatile __local\n                                        int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                                            (int64_t) 8) +\n                                                                    (sext_i32_i64(local_tid_78746) -\n                                                                     sext_i32_i64(skip_threads_78795))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78797 = slt32(smod32((local_tid_78746 *\n                                                            32 + 32 - 1 + 1) *\n                                                           11 - 1 +\n                                                           segsizze_compact_78765 -\n                                                           boundary_78764,\n                                                           segsizze_compact_78765),\n                                                    (local_tid_78746 * 32 + 32 -\n                                                     1 + 1) * 11 - 1 -\n                                                    (((local_tid_78746 -\n                                                       skip_threads_78795) *\n                                                      32 + 32 - 1 + 1) * 11 -\n                                                     1));\n                        \n                        if (thread_active_78796 && inactive_78797) {\n                            x_78788 = x_78789;\n                        }\n                        if (thread_active_78796) {\n                            if (!inactive_78797) {\n                                int64_t defunc_1_op_res_78790 = add64(x_78788,\n                                                                      x_78789);\n    ",
            "                            \n                                x_78788 = defunc_1_op_res_78790;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_78748, skip_threads_78795)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_78796) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_78746)] =\n                                x_78788;\n                            x_78789 = x_78788;\n                        }\n                    }\n                    if (sle32(wave_sizze_78748, skip_threads_78795)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_78795 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_78798 = squot32(local_tid_78746, 32) == 0 ||\n             !ltid_in_bounds_78791;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_78798) {\n                    x_78785 = x_78784;\n                    x_78784 = ((__local\n                                int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                                    (int64_t) 8) +\n                                                            (sext_i32_i64(squot32(local_tid_78746,\n                                                                                  32)) -\n                                                             (int64_t) 1)];\n                }\n            }\n            // perform operation\n    ",
            "        {\n                bool inactive_78799 = slt32(smod32((local_tid_78746 + 1) * 11 -\n                                                   1 + segsizze_compact_78765 -\n                                                   boundary_78764,\n                                                   segsizze_compact_78765),\n                                            (local_tid_78746 + 1) * 11 - 1 -\n                                            ((squot32(local_tid_78746, 32) *\n                                              32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_78798) {\n                    if (inactive_78799) {\n                        x_78784 = x_78785;\n                    }\n                }\n                if (!no_carry_in_78798) {\n                    if (!inactive_78799) {\n                        int64_t defunc_1_op_res_78786 = add64(x_78784, x_78785);\n                        \n                        x_78784 = defunc_1_op_res_78786;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_78798) {\n                    ((__local\n                      int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_78746)] =\n                        x_78784;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_78746, 32) == 0 && ltid_in_bounds_78791) {\n                ((__local\n                  int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_78746)] =\n                    x_78785;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENC",
            "E);\n        if (local_tid_78746 == 0) {\n            acc_78787 = ((__local\n                          int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                              (int64_t) 8) +\n                                                      (segscan_group_sizze_69635 -\n                                                       (int64_t) 1)];\n        } else {\n            acc_78787 = ((__local\n                          int64_t *) local_mem_78754)[squot64(byte_offsets_78750,\n                                                              (int64_t) 8) +\n                                                      (sext_i32_i64(local_tid_78746) -\n                                                       (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_78800 = (int64_t) 0;\n    bool block_new_sgm_78801 = sgm_idx_78763 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_78801 && local_tid_78746 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_78743)[dynamic_id_78761] = acc_78787;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_78739)[dynamic_id_78761] = (int8_t) 2;\n            acc_78787 = (int64_t) 0;\n        }\n        if (!block_new_sgm_78801 && slt32(local_tid_78746, wave_sizze_78748)) {\n            if (local_tid_78746 == 0) {\n                if (boundary_78764 == sext_i64_i32(segscan_group_sizze_69635 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_78741)[dynamic_id_78761] =\n                        acc_78787;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_78739)[dynamic_id_78761] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem",
            "_78743)[dynamic_id_78761] =\n                        acc_78787;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_78739)[dynamic_id_78761] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_78802;\n                \n                tmp_78802 = ((volatile __global\n                              int8_t *) status_flags_mem_78739)[dynamic_id_78761 -\n                                                                (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_78754)[(int64_t) 0] =\n                    tmp_78802;\n            }\n            mem_fence_local();\n            \n            int8_t status_78803;\n            \n            status_78803 = ((__local int8_t *) local_mem_78754)[(int64_t) 0];\n            if (status_78803 == (int8_t) 2) {\n                if (local_tid_78746 == 0) {\n                    prefix_78800 = ((volatile __global\n                                     int64_t *) incprefixes_mem_78743)[dynamic_id_78761 -\n                                                                       (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_78804 = dynamic_id_78761 -\n                        sext_i32_i64(wave_sizze_78748);\n                \n                while (slt32(wave_sizze_78748 * -1, readOffset_78804)) {\n                    int32_t read_i_78805 = readOffset_78804 + local_tid_78746;\n                    int64_t aggr_78806 = (int64_t) 0;\n                    int8_t flag_78807 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_78805)) {\n                        if (sle64(blockOff_78762 - (sext_i32_i64(read_i_78805 +\n                                                    1) *\n                                                    segscan_group_sizze_69635 *\n                                                    (int64_t) 11 - (int64_t) 1),\n                                  sgm_i",
            "dx_78763)) {\n                            flag_78807 = ((volatile __global\n                                           int8_t *) status_flags_mem_78739)[sext_i32_i64(read_i_78805)];\n                            if (flag_78807 == (int8_t) 2) {\n                                aggr_78806 = ((volatile __global\n                                               int64_t *) incprefixes_mem_78743)[sext_i32_i64(read_i_78805)];\n                            } else {\n                                if (flag_78807 == (int8_t) 1) {\n                                    aggr_78806 = ((volatile __global\n                                                   int64_t *) aggregates_mem_78741)[sext_i32_i64(read_i_78805)];\n                                }\n                            }\n                        } else {\n                            flag_78807 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_78746)] =\n                        aggr_78806;\n                    ((__local\n                      int8_t *) local_mem_78754)[sext_i32_i64(local_tid_78746)] =\n                        flag_78807;\n                    flag_78807 = ((__local\n                                   int8_t *) local_mem_78754)[sext_i32_i64(wave_sizze_78748) -\n                                                              (int64_t) 1];\n                    if (slt8(flag_78807, (int8_t) 2)) {\n                        int8_t flg_x_78811;\n                        int8_t flg_y_78812;\n                        int64_t x_78808;\n                        int64_t x_78809;\n                        int32_t skip_threads_78813;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_78812 = ((volatile ",
            "__local\n                                            int8_t *) local_mem_78754)[sext_i32_i64(local_tid_78746)];\n                            x_78809 = ((volatile __local\n                                        int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                                            (int64_t) 8) +\n                                                                    sext_i32_i64(local_tid_78746)];\n                            if ((local_tid_78746 - squot32(local_tid_78746,\n                                                           32) * 32) == 0) {\n                                x_78808 = x_78809;\n                                flg_x_78811 = flg_y_78812;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_78813 = 1;\n                            while (slt32(skip_threads_78813, 32)) {\n                                if (sle32(skip_threads_78813, local_tid_78746 -\n                                          squot32(local_tid_78746, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_78811 = ((volatile __local\n                                                        int8_t *) local_mem_78754)[sext_i32_i64(local_tid_78746) -\n                                                                                   sext_i32_i64(skip_threads_78813)];\n                                        x_78808 = ((volatile __local\n                                                    int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                                                        (int64_t) 8) +\n                                                                                (sext_i32_i64(local_tid_78746) -\n                                                  ",
            "                               sext_i32_i64(skip_threads_78813))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_78812 == (int8_t) 2 ||\n                                            flg_y_78812 == (int8_t) 0) {\n                                            flg_x_78811 = flg_y_78812;\n                                            x_78808 = x_78809;\n                                        } else {\n                                            int64_t defunc_1_op_res_78810 =\n                                                    add64(x_78808, x_78809);\n                                            \n                                            x_78808 = defunc_1_op_res_78810;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_78754)[sext_i32_i64(local_tid_78746)] =\n                                            flg_x_78811;\n                                        flg_y_78812 = flg_x_78811;\n                                        ((volatile __local\n                                          int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_78746)] =\n                                            x_78808;\n                                        x_78809 = x_78808;\n                                    }\n                                }\n                                skip_threads_78813 *= 2;\n                            }\n                        }\n                    }\n                    flag_78807 = ((__local\n                      ",
            "             int8_t *) local_mem_78754)[sext_i32_i64(wave_sizze_78748) -\n                                                              (int64_t) 1];\n                    aggr_78806 = ((__local\n                                   int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                                       (int64_t) 8) +\n                                                               (sext_i32_i64(wave_sizze_78748) -\n                                                                (int64_t) 1)];\n                    if (flag_78807 == (int8_t) 2) {\n                        readOffset_78804 = wave_sizze_78748 * -1;\n                    } else {\n                        if (flag_78807 == (int8_t) 1) {\n                            readOffset_78804 -= wave_sizze_78748;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_78807)) {\n                        int64_t x_78814 = aggr_78806;\n                        int64_t x_78815 = prefix_78800;\n                        int64_t defunc_1_op_res_78816 = add64(x_78814, x_78815);\n                        \n                        prefix_78800 = defunc_1_op_res_78816;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_78746 == 0) {\n                if (boundary_78764 == sext_i64_i32(segscan_group_sizze_69635 *\n                    (int64_t) 11)) {\n                    int64_t x_78817 = prefix_78800;\n                    int64_t x_78818 = acc_78787;\n                    int64_t defunc_1_op_res_78819 = add64(x_78817, x_78818);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_78743)[dynamic_id_78761] =\n                        defunc_1_op_res_78819;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_78739)[dynamic_id_78761] =\n                        (int8_t) ",
            "2;\n                }\n                ((__local\n                  int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                      (int64_t) 8)] =\n                    prefix_78800;\n                acc_78787 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_78761 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_78800 = ((__local\n                             int64_t *) local_mem_78754)[squot64(warp_byte_offset_78752,\n                                                                 (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_78820;\n        int64_t x_78821;\n        int64_t x_78823 = prefix_78800;\n        int64_t x_78824 = acc_78787;\n        \n        if (slt32(local_tid_78746 * 11, boundary_78764) &&\n            !block_new_sgm_78801) {\n            int64_t defunc_1_op_res_78825 = add64(x_78823, x_78824);\n            \n            x_78820 = defunc_1_op_res_78825;\n        } else {\n            x_78820 = acc_78787;\n        }\n        \n        int32_t stopping_point_78826 = segsizze_compact_78765 -\n                srem32(local_tid_78746 * 11 - 1 + segsizze_compact_78765 -\n                       boundary_78764, segsizze_compact_78765);\n        \n        for (int64_t i_78827 = 0; i_78827 < (int64_t) 11; i_78827++) {\n            if (slt32(sext_i64_i32(i_78827), stopping_point_78826 - 1)) {\n                x_78821 = private_mem_78766[i_78827];\n                \n                int64_t defunc_1_op_res_78822 = add64(x_78820, x_78821);\n                \n                private_mem_78766[i_78827] = defunc_1_op_res_78822;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_78828 = 0; i_78828 < (int64_t) 11; i_78828++) {\n            int64_t sharedIdx_78829 = sext_i32_i64(local_tid_78746 * 11) +\n                    i_78828;\n            in",
            "t64_t tmp_78830;\n            \n            tmp_78830 = private_mem_78766[i_78828];\n            ((__local int64_t *) local_mem_78754)[sharedIdx_78829] = tmp_78830;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_78831 = 0; i_78831 < (int64_t) 11; i_78831++) {\n            int64_t flat_idx_78832 = blockOff_78762 +\n                    segscan_group_sizze_69635 * i_78831 +\n                    sext_i32_i64(local_tid_78746);\n            int64_t slice_78833 = n_65344;\n            int64_t slice_78834 = m_65343 * slice_78833;\n            int64_t gtid_69639 = squot64(flat_idx_78832, slice_78833);\n            int64_t remnant_78835 = flat_idx_78832 - gtid_69639 * slice_78833;\n            int64_t gtid_69640 = remnant_78835;\n            int64_t remnant_78836 = remnant_78835 - gtid_69640;\n            \n            if (slt64(flat_idx_78832, m_65343 * n_65344)) {\n                int64_t tmp_78837;\n                \n                tmp_78837 = ((__local\n                              int64_t *) local_mem_78754)[flat_idx_78832 -\n                                                          blockOff_78762];\n                ((__global int64_t *) mem_77316)[gtid_69639 * n_65344 +\n                                                 gtid_69640] = tmp_78837;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_78761 == sdiv_up64(m_65343 * n_65344,\n                                          segscan_group_sizze_69635 *\n                                          (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_78737)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_69635\n}\n__kernel void mainzisegscan_71680(__global int *global_failure,\n                                  uint local_mem_79209_backing_offset_0,\n                                  int64_t m_65343, int64_t n_65344, __global\n                          ",
            "        unsigned char *Y_mem_76976, __global\n                                  unsigned char *mem_77608, __global\n                                  unsigned char *mainziid_counter_mem_79192,\n                                  __global\n                                  unsigned char *status_flags_mem_79194,\n                                  __global unsigned char *aggregates_mem_79196,\n                                  __global unsigned char *incprefixes_mem_79198)\n{\n    #define segscan_group_sizze_71674 (mainzisegscan_group_sizze_71654)\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_79209_backing_0 =\n                           &shared_mem[local_mem_79209_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79200;\n    int32_t local_tid_79201;\n    int64_t group_sizze_79204;\n    int32_t wave_sizze_79203;\n    int32_t group_tid_79202;\n    \n    global_tid_79200 = get_global_id(0);\n    local_tid_79201 = get_local_id(0);\n    group_sizze_79204 = get_local_size(0);\n    wave_sizze_79203 = LOCKSTEP_WIDTH;\n    group_tid_79202 = get_group_id(0);\n    \n    int32_t phys_tid_71680 = global_tid_79200;\n    int64_t byte_offsets_79205 = (int64_t) 0;\n    int64_t byte_offsets_79206 = segscan_group_sizze_71674 * (int64_t) 8;\n    int64_t warp_byte_offset_79207 = (int64_t) 32;\n    int64_t warp_byte_offset_79208 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_79209;\n    \n    local_mem_79209 = (__local unsigned char *) local_mem_79209_backing_0;\n    \n    int64_t trans_arr_len_79210 = (int64_t) 11 * segscan_group_sizze_71674;\n    int32_t dynamic_id_79216;\n    \n    if (local_tid_79201 == 0) {\n        dynamic_id_79216 = atomic_add_i32_global(&((volatile __global\n                                                    int *) mainziid_counter_mem_79192)[(int64_t) 0],\n                                                ",
            " (int) 1);\n        ((__local int32_t *) local_mem_79209)[(int64_t) 0] = dynamic_id_79216;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_79216 = ((__local int32_t *) local_mem_79209)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_79217 = sext_i32_i64(dynamic_id_79216) * (int64_t) 11 *\n            segscan_group_sizze_71674;\n    int64_t sgm_idx_79218 = smod64(blockOff_79217, n_65344);\n    int32_t boundary_79219 = sext_i64_i32(smin64((int64_t) 11 *\n                                                 segscan_group_sizze_71674,\n                                                 n_65344 - sgm_idx_79218));\n    int32_t segsizze_compact_79220 = sext_i64_i32(smin64((int64_t) 11 *\n                                                         segscan_group_sizze_71674,\n                                                         n_65344));\n    int64_t private_mem_79221[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_79223 = 0; i_79223 < (int64_t) 11; i_79223++) {\n            int64_t phys_tid_79224 = blockOff_79217 +\n                    sext_i32_i64(local_tid_79201) + i_79223 *\n                    segscan_group_sizze_71674;\n            int64_t slice_79225 = n_65344;\n            int64_t slice_79226 = m_65343 * slice_79225;\n            int64_t gtid_71678 = squot64(phys_tid_79224, slice_79225);\n            int64_t remnant_79227 = phys_tid_79224 - gtid_71678 * slice_79225;\n            int64_t gtid_71679 = remnant_79227;\n            int64_t remnant_79228 = remnant_79227 - gtid_71679;\n            \n            if (slt64(phys_tid_79224, m_65343 * n_65344)) {\n                float x_71685;\n                \n                x_71685 = ((__global float *) Y_mem_76976)[gtid_71678 *\n                                                           n_65344 +\n                                                           gtid_71679];\n                \n                bool isnan_res_71686;\n                \n                isnan_res_71686 = futrts_isnan32(x_71685);\n  ",
            "              \n                bool defunc_0_p_res_71687 = !isnan_res_71686;\n                int64_t defunc_0_f_res_71688 =\n                        btoi_bool_i64(defunc_0_p_res_71687);\n                \n                private_mem_79221[i_79223] = defunc_0_f_res_71688;\n            } else {\n                private_mem_79221[i_79223] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_79229 = 0; i_79229 < (int64_t) 11; i_79229++) {\n            int64_t sharedIdx_79230 = sext_i32_i64(local_tid_79201) + i_79229 *\n                    segscan_group_sizze_71674;\n            int64_t tmp_79231;\n            \n            tmp_79231 = private_mem_79221[i_79229];\n            ((__local int64_t *) local_mem_79209)[sharedIdx_79230] = tmp_79231;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_79232 = 0; i_79232 < 11; i_79232++) {\n            int32_t sharedIdx_79233 = local_tid_79201 * 11 + i_79232;\n            int64_t tmp_79234;\n            \n            tmp_79234 = ((__local\n                          int64_t *) local_mem_79209)[sext_i32_i64(sharedIdx_79233)];\n            private_mem_79221[sext_i32_i64(i_79232)] = tmp_79234;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_79235 = local_tid_79201 * 11 + 1;\n        \n        for (int64_t i_79236 = 0; i_79236 < (int64_t) 10; i_79236++) {\n            bool new_sgm_79237 = smod32(gidx_79235 + sext_i64_i32(i_79236) -\n                                        boundary_79219,\n                                        segsizze_compact_79220) == 0;\n            \n            if (!new_sgm_79237) {\n                int64_t x_71681;\n                int64_t x_71682;\n                \n                x_71681 = private_mem_79221[i_79236];\n                x_71682 = private_mem_79221[i_79236 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_71683 = add64(x_71681, x_71682);\n   ",
            "             \n                private_mem_79221[i_79236 + (int64_t) 1] =\n                    defunc_1_op_res_71683;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_79238;\n        \n        tmp_79238 = private_mem_79221[(int64_t) 10];\n        ((__local int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_79201)] =\n            tmp_79238;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_79242;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_79239;\n        int64_t x_79240;\n        int64_t x_79243;\n        int64_t x_79244;\n        bool ltid_in_bounds_79246 = slt64(sext_i32_i64(local_tid_79201),\n                                          segscan_group_sizze_71674);\n        int32_t skip_threads_79247;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_79246) {\n                x_79240 = ((volatile __local\n                            int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                                (int64_t) 8) +\n                                                        sext_i32_i64(local_tid_79201)];\n                if ((local_tid_79201 - squot32(local_tid_79201, 32) * 32) ==\n                    0) {\n                    x_79239 = x_79240;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79247 = 1;\n            while (slt32(skip_threads_79247, 32)) {\n                bool thread_active_79248 = sle32(skip_threads_79247,\n                                                 local_tid_79201 -\n                                                 squot32(local_tid_79201, 32) *\n                                                 32) && ltid_in_bounds_79246;\n                \n                if (thread_activ",
            "e_79248) {\n                    // read operands\n                    {\n                        x_79239 = ((volatile __local\n                                    int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(local_tid_79201) -\n                                                                 sext_i32_i64(skip_threads_79247))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79249 = slt32(smod32((local_tid_79201 + 1) *\n                                                       11 - 1 +\n                                                       segsizze_compact_79220 -\n                                                       boundary_79219,\n                                                       segsizze_compact_79220),\n                                                (local_tid_79201 + 1) * 11 - 1 -\n                                                ((local_tid_79201 -\n                                                  skip_threads_79247 + 1) * 11 -\n                                                 1));\n                    \n                    if (thread_active_79248 && inactive_79249) {\n                        x_79239 = x_79240;\n                    }\n                    if (thread_active_79248) {\n                        if (!inactive_79249) {\n                            int64_t defunc_1_op_res_79241 = add64(x_79239,\n                                                                  x_79240);\n                            \n                            x_79239 = defunc_1_op_res_79241;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_79203, skip_threads_79247)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79248) {\n                 ",
            "   // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_79201)] =\n                            x_79239;\n                        x_79240 = x_79239;\n                    }\n                }\n                if (sle32(wave_sizze_79203, skip_threads_79247)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79247 *= 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_79201 - squot32(local_tid_79201, 32) * 32) == 31 &&\n                ltid_in_bounds_79246) {\n                ((volatile __local\n                  int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_79201,\n                                                                   32))] =\n                    x_79239;\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_79250;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_79201, 32) == 0 && ltid_in_bounds_79246) {\n                    x_79244 = ((volatile __local\n                                int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                                    (int64_t) 8) +\n                                                            sext_i32_i64(local_tid_79201)];\n                    if ((local_tid_79201 - squot32(local_tid_79201, 32) * 32) ==\n  ",
            "                      0) {\n                        x_79243 = x_79244;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79250 = 1;\n                while (slt32(skip_threads_79250, 32)) {\n                    bool thread_active_79251 = sle32(skip_threads_79250,\n                                                     local_tid_79201 -\n                                                     squot32(local_tid_79201,\n                                                             32) * 32) &&\n                         (squot32(local_tid_79201, 32) == 0 &&\n                          ltid_in_bounds_79246);\n                    \n                    if (thread_active_79251) {\n                        // read operands\n                        {\n                            x_79243 = ((volatile __local\n                                        int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                                            (int64_t) 8) +\n                                                                    (sext_i32_i64(local_tid_79201) -\n                                                                     sext_i32_i64(skip_threads_79250))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79252 = slt32(smod32((local_tid_79201 *\n                                                            32 + 32 - 1 + 1) *\n                                                           11 - 1 +\n                                                           segsizze_compact_79220 -\n                                                           boundary_79219,\n                                                           segsizze_compact_79220),\n                                                    (local_tid_79201 * 32 + 32 -\n                                                     ",
            "1 + 1) * 11 - 1 -\n                                                    (((local_tid_79201 -\n                                                       skip_threads_79250) *\n                                                      32 + 32 - 1 + 1) * 11 -\n                                                     1));\n                        \n                        if (thread_active_79251 && inactive_79252) {\n                            x_79243 = x_79244;\n                        }\n                        if (thread_active_79251) {\n                            if (!inactive_79252) {\n                                int64_t defunc_1_op_res_79245 = add64(x_79243,\n                                                                      x_79244);\n                                \n                                x_79243 = defunc_1_op_res_79245;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79203, skip_threads_79250)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79251) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_79201)] =\n                                x_79243;\n                            x_79244 = x_79243;\n                        }\n                    }\n                    if (sle32(wave_sizze_79203, skip_threads_79250)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79250 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_79253 = squot32(local_tid_79201, 32) == 0 ||\n             !ltid_in_bounds_79246;\n    ",
            "    \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_79253) {\n                    x_79240 = x_79239;\n                    x_79239 = ((__local\n                                int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                                    (int64_t) 8) +\n                                                            (sext_i32_i64(squot32(local_tid_79201,\n                                                                                  32)) -\n                                                             (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79254 = slt32(smod32((local_tid_79201 + 1) * 11 -\n                                                   1 + segsizze_compact_79220 -\n                                                   boundary_79219,\n                                                   segsizze_compact_79220),\n                                            (local_tid_79201 + 1) * 11 - 1 -\n                                            ((squot32(local_tid_79201, 32) *\n                                              32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_79253) {\n                    if (inactive_79254) {\n                        x_79239 = x_79240;\n                    }\n                }\n                if (!no_carry_in_79253) {\n                    if (!inactive_79254) {\n                        int64_t defunc_1_op_res_79241 = add64(x_79239, x_79240);\n                        \n                        x_79239 = defunc_1_op_res_79241;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_79253) {\n                    ((__local\n                      int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                           ",
            "               (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_79201)] =\n                        x_79239;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_79201, 32) == 0 && ltid_in_bounds_79246) {\n                ((__local\n                  int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_79201)] =\n                    x_79240;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_79201 == 0) {\n            acc_79242 = ((__local\n                          int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                              (int64_t) 8) +\n                                                      (segscan_group_sizze_71674 -\n                                                       (int64_t) 1)];\n        } else {\n            acc_79242 = ((__local\n                          int64_t *) local_mem_79209)[squot64(byte_offsets_79205,\n                                                              (int64_t) 8) +\n                                                      (sext_i32_i64(local_tid_79201) -\n                                                       (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_79255 = (int64_t) 0;\n    bool block_new_sgm_79256 = sgm_idx_79218 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_79256 && local_tid_79201 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_79198)[dynamic_id_79216] = acc_79242;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_79194)[dynamic_id_79216] = (int8_t) 2;\n  ",
            "          acc_79242 = (int64_t) 0;\n        }\n        if (!block_new_sgm_79256 && slt32(local_tid_79201, wave_sizze_79203)) {\n            if (local_tid_79201 == 0) {\n                if (boundary_79219 == sext_i64_i32(segscan_group_sizze_71674 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_79196)[dynamic_id_79216] =\n                        acc_79242;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79194)[dynamic_id_79216] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79198)[dynamic_id_79216] =\n                        acc_79242;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79194)[dynamic_id_79216] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_79257;\n                \n                tmp_79257 = ((volatile __global\n                              int8_t *) status_flags_mem_79194)[dynamic_id_79216 -\n                                                                (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_79209)[(int64_t) 0] =\n                    tmp_79257;\n            }\n            mem_fence_local();\n            \n            int8_t status_79258;\n            \n            status_79258 = ((__local int8_t *) local_mem_79209)[(int64_t) 0];\n            if (status_79258 == (int8_t) 2) {\n                if (local_tid_79201 == 0) {\n                    prefix_79255 = ((volatile __global\n                                     int64_t *) incprefixes_mem_79198)[dynamic_id_79216 -\n                                                                       (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_79259 = dynamic_id_79216 -\n   ",
            "                     sext_i32_i64(wave_sizze_79203);\n                \n                while (slt32(wave_sizze_79203 * -1, readOffset_79259)) {\n                    int32_t read_i_79260 = readOffset_79259 + local_tid_79201;\n                    int64_t aggr_79261 = (int64_t) 0;\n                    int8_t flag_79262 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_79260)) {\n                        if (sle64(blockOff_79217 - (sext_i32_i64(read_i_79260 +\n                                                    1) *\n                                                    segscan_group_sizze_71674 *\n                                                    (int64_t) 11 - (int64_t) 1),\n                                  sgm_idx_79218)) {\n                            flag_79262 = ((volatile __global\n                                           int8_t *) status_flags_mem_79194)[sext_i32_i64(read_i_79260)];\n                            if (flag_79262 == (int8_t) 2) {\n                                aggr_79261 = ((volatile __global\n                                               int64_t *) incprefixes_mem_79198)[sext_i32_i64(read_i_79260)];\n                            } else {\n                                if (flag_79262 == (int8_t) 1) {\n                                    aggr_79261 = ((volatile __global\n                                                   int64_t *) aggregates_mem_79196)[sext_i32_i64(read_i_79260)];\n                                }\n                            }\n                        } else {\n                            flag_79262 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_79201)] =\n                        aggr_79261;\n                    ((__local\n                      int8_t *) lo",
            "cal_mem_79209)[sext_i32_i64(local_tid_79201)] =\n                        flag_79262;\n                    flag_79262 = ((__local\n                                   int8_t *) local_mem_79209)[sext_i32_i64(wave_sizze_79203) -\n                                                              (int64_t) 1];\n                    if (slt8(flag_79262, (int8_t) 2)) {\n                        int8_t flg_x_79266;\n                        int8_t flg_y_79267;\n                        int64_t x_79263;\n                        int64_t x_79264;\n                        int32_t skip_threads_79268;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_79267 = ((volatile __local\n                                            int8_t *) local_mem_79209)[sext_i32_i64(local_tid_79201)];\n                            x_79264 = ((volatile __local\n                                        int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                                            (int64_t) 8) +\n                                                                    sext_i32_i64(local_tid_79201)];\n                            if ((local_tid_79201 - squot32(local_tid_79201,\n                                                           32) * 32) == 0) {\n                                x_79263 = x_79264;\n                                flg_x_79266 = flg_y_79267;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_79268 = 1;\n                            while (slt32(skip_threads_79268, 32)) {\n                                if (sle32(skip_threads_79268, local_tid_79201 -\n                                          squot32(local_tid_79201, 32) * 32)) {\n                                    // read operands\n                                    {\n                 ",
            "                       flg_x_79266 = ((volatile __local\n                                                        int8_t *) local_mem_79209)[sext_i32_i64(local_tid_79201) -\n                                                                                   sext_i32_i64(skip_threads_79268)];\n                                        x_79263 = ((volatile __local\n                                                    int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                                                        (int64_t) 8) +\n                                                                                (sext_i32_i64(local_tid_79201) -\n                                                                                 sext_i32_i64(skip_threads_79268))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_79267 == (int8_t) 2 ||\n                                            flg_y_79267 == (int8_t) 0) {\n                                            flg_x_79266 = flg_y_79267;\n                                            x_79263 = x_79264;\n                                        } else {\n                                            int64_t defunc_1_op_res_79265 =\n                                                    add64(x_79263, x_79264);\n                                            \n                                            x_79263 = defunc_1_op_res_79265;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_79209)[sext_i32_i64(local_tid_79201)] =\n                                            flg_x_79266;\n                                        flg_y_79267 = flg_x_79266;\n     ",
            "                                   ((volatile __local\n                                          int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_79201)] =\n                                            x_79263;\n                                        x_79264 = x_79263;\n                                    }\n                                }\n                                skip_threads_79268 *= 2;\n                            }\n                        }\n                    }\n                    flag_79262 = ((__local\n                                   int8_t *) local_mem_79209)[sext_i32_i64(wave_sizze_79203) -\n                                                              (int64_t) 1];\n                    aggr_79261 = ((__local\n                                   int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                                       (int64_t) 8) +\n                                                               (sext_i32_i64(wave_sizze_79203) -\n                                                                (int64_t) 1)];\n                    if (flag_79262 == (int8_t) 2) {\n                        readOffset_79259 = wave_sizze_79203 * -1;\n                    } else {\n                        if (flag_79262 == (int8_t) 1) {\n                            readOffset_79259 -= wave_sizze_79203;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_79262)) {\n                        int64_t x_79269 = aggr_79261;\n                        int64_t x_79270 = prefix_79255;\n                        int64_t defunc_1_op_res_79271 = add64(x_79269, x_79270);\n                        \n                        prefix_79255 = defunc_1_op_res_79271;\n                    }\n                    mem_fence_local();\n   ",
            "             }\n            }\n            if (local_tid_79201 == 0) {\n                if (boundary_79219 == sext_i64_i32(segscan_group_sizze_71674 *\n                    (int64_t) 11)) {\n                    int64_t x_79272 = prefix_79255;\n                    int64_t x_79273 = acc_79242;\n                    int64_t defunc_1_op_res_79274 = add64(x_79272, x_79273);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79198)[dynamic_id_79216] =\n                        defunc_1_op_res_79274;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79194)[dynamic_id_79216] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                      (int64_t) 8)] =\n                    prefix_79255;\n                acc_79242 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_79216 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_79255 = ((__local\n                             int64_t *) local_mem_79209)[squot64(warp_byte_offset_79207,\n                                                                 (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_79275;\n        int64_t x_79276;\n        int64_t x_79278 = prefix_79255;\n        int64_t x_79279 = acc_79242;\n        \n        if (slt32(local_tid_79201 * 11, boundary_79219) &&\n            !block_new_sgm_79256) {\n            int64_t defunc_1_op_res_79280 = add64(x_79278, x_79279);\n            \n            x_79275 = defunc_1_op_res_79280;\n        } else {\n            x_79275 = acc_79242;\n        }\n        \n        int32_t stopping_point_79281 = segsizze_compact_79220 -\n                srem32(local_tid_79201 * 11 - 1 + segsizze_compact_79220 -\n                ",
            "       boundary_79219, segsizze_compact_79220);\n        \n        for (int64_t i_79282 = 0; i_79282 < (int64_t) 11; i_79282++) {\n            if (slt32(sext_i64_i32(i_79282), stopping_point_79281 - 1)) {\n                x_79276 = private_mem_79221[i_79282];\n                \n                int64_t defunc_1_op_res_79277 = add64(x_79275, x_79276);\n                \n                private_mem_79221[i_79282] = defunc_1_op_res_79277;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_79283 = 0; i_79283 < (int64_t) 11; i_79283++) {\n            int64_t sharedIdx_79284 = sext_i32_i64(local_tid_79201 * 11) +\n                    i_79283;\n            int64_t tmp_79285;\n            \n            tmp_79285 = private_mem_79221[i_79283];\n            ((__local int64_t *) local_mem_79209)[sharedIdx_79284] = tmp_79285;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_79286 = 0; i_79286 < (int64_t) 11; i_79286++) {\n            int64_t flat_idx_79287 = blockOff_79217 +\n                    segscan_group_sizze_71674 * i_79286 +\n                    sext_i32_i64(local_tid_79201);\n            int64_t slice_79288 = n_65344;\n            int64_t slice_79289 = m_65343 * slice_79288;\n            int64_t gtid_71678 = squot64(flat_idx_79287, slice_79288);\n            int64_t remnant_79290 = flat_idx_79287 - gtid_71678 * slice_79288;\n            int64_t gtid_71679 = remnant_79290;\n            int64_t remnant_79291 = remnant_79290 - gtid_71679;\n            \n            if (slt64(flat_idx_79287, m_65343 * n_65344)) {\n                int64_t tmp_79292;\n                \n                tmp_79292 = ((__local\n                              int64_t *) local_mem_79209)[flat_idx_79287 -\n                                                          blockOff_79217];\n                ((__global int64_t *) mem_77608)[gtid_71678 * n_65344 +\n                                                 gtid_71679] = tmp_79292;",
            "\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_79216 == sdiv_up64(m_65343 * n_65344,\n                                          segscan_group_sizze_71674 *\n                                          (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_79192)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_71674\n}\n__kernel void mainzisegscan_72665(__global int *global_failure,\n                                  uint local_mem_79664_backing_offset_0,\n                                  int64_t m_65343, int64_t n_65344, __global\n                                  unsigned char *Y_mem_76976, __global\n                                  unsigned char *mem_77833, __global\n                                  unsigned char *mainziid_counter_mem_79647,\n                                  __global\n                                  unsigned char *status_flags_mem_79649,\n                                  __global unsigned char *aggregates_mem_79651,\n                                  __global unsigned char *incprefixes_mem_79653)\n{\n    #define segscan_group_sizze_72659 (mainzisegscan_group_sizze_72639)\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_79664_backing_0 =\n                           &shared_mem[local_mem_79664_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79655;\n    int32_t local_tid_79656;\n    int64_t group_sizze_79659;\n    int32_t wave_sizze_79658;\n    int32_t group_tid_79657;\n    \n    global_tid_79655 = get_global_id(0);\n    local_tid_79656 = get_local_id(0);\n    group_sizze_79659 = get_local_size(0);\n    wave_sizze_79658 = LOCKSTEP_WIDTH;\n    group_tid_79657 = get_group_id(0);\n    \n    int32_t phys_tid_72665 = global_tid_79655;\n    int64_t byte_offsets_79660 = (",
            "int64_t) 0;\n    int64_t byte_offsets_79661 = segscan_group_sizze_72659 * (int64_t) 8;\n    int64_t warp_byte_offset_79662 = (int64_t) 32;\n    int64_t warp_byte_offset_79663 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_79664;\n    \n    local_mem_79664 = (__local unsigned char *) local_mem_79664_backing_0;\n    \n    int64_t trans_arr_len_79665 = (int64_t) 11 * segscan_group_sizze_72659;\n    int32_t dynamic_id_79671;\n    \n    if (local_tid_79656 == 0) {\n        dynamic_id_79671 = atomic_add_i32_global(&((volatile __global\n                                                    int *) mainziid_counter_mem_79647)[(int64_t) 0],\n                                                 (int) 1);\n        ((__local int32_t *) local_mem_79664)[(int64_t) 0] = dynamic_id_79671;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_79671 = ((__local int32_t *) local_mem_79664)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_79672 = sext_i32_i64(dynamic_id_79671) * (int64_t) 11 *\n            segscan_group_sizze_72659;\n    int64_t sgm_idx_79673 = smod64(blockOff_79672, n_65344);\n    int32_t boundary_79674 = sext_i64_i32(smin64((int64_t) 11 *\n                                                 segscan_group_sizze_72659,\n                                                 n_65344 - sgm_idx_79673));\n    int32_t segsizze_compact_79675 = sext_i64_i32(smin64((int64_t) 11 *\n                                                         segscan_group_sizze_72659,\n                                                         n_65344));\n    int64_t private_mem_79676[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_79678 = 0; i_79678 < (int64_t) 11; i_79678++) {\n            int64_t phys_tid_79679 = blockOff_79672 +\n                    sext_i32_i64(local_tid_79656) + i_79678 *\n                    segscan_group_sizze_72659;\n            int64_t slice_79680 = n_65344;\n            int64_t slice_79681 = m_65343 * slice_",
            "79680;\n            int64_t gtid_72663 = squot64(phys_tid_79679, slice_79680);\n            int64_t remnant_79682 = phys_tid_79679 - gtid_72663 * slice_79680;\n            int64_t gtid_72664 = remnant_79682;\n            int64_t remnant_79683 = remnant_79682 - gtid_72664;\n            \n            if (slt64(phys_tid_79679, m_65343 * n_65344)) {\n                float x_72670;\n                \n                x_72670 = ((__global float *) Y_mem_76976)[gtid_72663 *\n                                                           n_65344 +\n                                                           gtid_72664];\n                \n                bool isnan_res_72671;\n                \n                isnan_res_72671 = futrts_isnan32(x_72670);\n                \n                bool defunc_0_p_res_72672 = !isnan_res_72671;\n                int64_t defunc_0_f_res_72673 =\n                        btoi_bool_i64(defunc_0_p_res_72672);\n                \n                private_mem_79676[i_79678] = defunc_0_f_res_72673;\n            } else {\n                private_mem_79676[i_79678] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_79684 = 0; i_79684 < (int64_t) 11; i_79684++) {\n            int64_t sharedIdx_79685 = sext_i32_i64(local_tid_79656) + i_79684 *\n                    segscan_group_sizze_72659;\n            int64_t tmp_79686;\n            \n            tmp_79686 = private_mem_79676[i_79684];\n            ((__local int64_t *) local_mem_79664)[sharedIdx_79685] = tmp_79686;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_79687 = 0; i_79687 < 11; i_79687++) {\n            int32_t sharedIdx_79688 = local_tid_79656 * 11 + i_79687;\n            int64_t tmp_79689;\n            \n            tmp_79689 = ((__local\n                          int64_t *) local_mem_79664)[sext_i32_i64(sharedIdx_79688)];\n            private_mem_79676[sext_i32_i64(i_79687)] = tmp_79689;\n        }\n        barrier(CLK_",
            "LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_79690 = local_tid_79656 * 11 + 1;\n        \n        for (int64_t i_79691 = 0; i_79691 < (int64_t) 10; i_79691++) {\n            bool new_sgm_79692 = smod32(gidx_79690 + sext_i64_i32(i_79691) -\n                                        boundary_79674,\n                                        segsizze_compact_79675) == 0;\n            \n            if (!new_sgm_79692) {\n                int64_t x_72666;\n                int64_t x_72667;\n                \n                x_72666 = private_mem_79676[i_79691];\n                x_72667 = private_mem_79676[i_79691 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_72668 = add64(x_72666, x_72667);\n                \n                private_mem_79676[i_79691 + (int64_t) 1] =\n                    defunc_1_op_res_72668;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_79693;\n        \n        tmp_79693 = private_mem_79676[(int64_t) 10];\n        ((__local int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_79656)] =\n            tmp_79693;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_79697;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_79694;\n        int64_t x_79695;\n        int64_t x_79698;\n        int64_t x_79699;\n        bool ltid_in_bounds_79701 = slt64(sext_i32_i64(local_tid_79656),\n                                          segscan_group_sizze_72659);\n        int32_t skip_threads_79702;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_79701) {\n                x_79695 = ((volatile __local\n                            int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                                (int64_t) 8) +\n                                ",
            "                        sext_i32_i64(local_tid_79656)];\n                if ((local_tid_79656 - squot32(local_tid_79656, 32) * 32) ==\n                    0) {\n                    x_79694 = x_79695;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79702 = 1;\n            while (slt32(skip_threads_79702, 32)) {\n                bool thread_active_79703 = sle32(skip_threads_79702,\n                                                 local_tid_79656 -\n                                                 squot32(local_tid_79656, 32) *\n                                                 32) && ltid_in_bounds_79701;\n                \n                if (thread_active_79703) {\n                    // read operands\n                    {\n                        x_79694 = ((volatile __local\n                                    int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(local_tid_79656) -\n                                                                 sext_i32_i64(skip_threads_79702))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79704 = slt32(smod32((local_tid_79656 + 1) *\n                                                       11 - 1 +\n                                                       segsizze_compact_79675 -\n                                                       boundary_79674,\n                                                       segsizze_compact_79675),\n                                                (local_tid_79656 + 1) * 11 - 1 -\n                                                ((local_tid_79656 -\n                                                  skip_threads_79702 + 1) * 11 -\n                                                 1));\n           ",
            "         \n                    if (thread_active_79703 && inactive_79704) {\n                        x_79694 = x_79695;\n                    }\n                    if (thread_active_79703) {\n                        if (!inactive_79704) {\n                            int64_t defunc_1_op_res_79696 = add64(x_79694,\n                                                                  x_79695);\n                            \n                            x_79694 = defunc_1_op_res_79696;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_79658, skip_threads_79702)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79703) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_79656)] =\n                            x_79694;\n                        x_79695 = x_79694;\n                    }\n                }\n                if (sle32(wave_sizze_79658, skip_threads_79702)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79702 *= 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_79656 - squot32(local_tid_79656, 32) * 32) == 31 &&\n                ltid_in_bounds_79701) {\n                ((volatile __local\n                  int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_79656,\n                                                                   32))] =\n                    x_79694;\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_79705;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_79656, 32) == 0 && ltid_in_bounds_79701) {\n                    x_79699 = ((volatile __local\n                                int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                                    (int64_t) 8) +\n                                                            sext_i32_i64(local_tid_79656)];\n                    if ((local_tid_79656 - squot32(local_tid_79656, 32) * 32) ==\n                        0) {\n                        x_79698 = x_79699;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79705 = 1;\n                while (slt32(skip_threads_79705, 32)) {\n                    bool thread_active_79706 = sle32(skip_threads_79705,\n                                                     local_tid_79656 -\n                                                     squot32(local_tid_79656,\n                                                             32) * 32) &&\n                         (squot32(local_tid_79656, 32) == 0 &&\n                          ltid_in_bounds_79701);\n                    \n                    if (thread_active_79706) {\n                        // read operands\n                        {\n                            x_79698 = ((volatile __local\n                                        int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                                            (int64_t) 8) +\n                                                                    (sext_i32_i64(local_tid_79656) -\n                                                                     sext_i32_i64(",
            "skip_threads_79705))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79707 = slt32(smod32((local_tid_79656 *\n                                                            32 + 32 - 1 + 1) *\n                                                           11 - 1 +\n                                                           segsizze_compact_79675 -\n                                                           boundary_79674,\n                                                           segsizze_compact_79675),\n                                                    (local_tid_79656 * 32 + 32 -\n                                                     1 + 1) * 11 - 1 -\n                                                    (((local_tid_79656 -\n                                                       skip_threads_79705) *\n                                                      32 + 32 - 1 + 1) * 11 -\n                                                     1));\n                        \n                        if (thread_active_79706 && inactive_79707) {\n                            x_79698 = x_79699;\n                        }\n                        if (thread_active_79706) {\n                            if (!inactive_79707) {\n                                int64_t defunc_1_op_res_79700 = add64(x_79698,\n                                                                      x_79699);\n                                \n                                x_79698 = defunc_1_op_res_79700;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79658, skip_threads_79705)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79706) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_me",
            "m_79664)[squot64(byte_offsets_79660,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_79656)] =\n                                x_79698;\n                            x_79699 = x_79698;\n                        }\n                    }\n                    if (sle32(wave_sizze_79658, skip_threads_79705)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79705 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_79708 = squot32(local_tid_79656, 32) == 0 ||\n             !ltid_in_bounds_79701;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_79708) {\n                    x_79695 = x_79694;\n                    x_79694 = ((__local\n                                int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                                    (int64_t) 8) +\n                                                            (sext_i32_i64(squot32(local_tid_79656,\n                                                                                  32)) -\n                                                             (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79709 = slt32(smod32((local_tid_79656 + 1) * 11 -\n                                                   1 + segsizze_compact_79675 -\n                                                   boundary_79674,\n                                                   segsizze_compact_79675),\n                                            (local_tid_79656 + 1) * 11 - 1 -\n                                            ((squot32(local_tid_79656, 32) *\n                                              32 - 1 + 1) * 1",
            "1 - 1));\n                \n                if (!no_carry_in_79708) {\n                    if (inactive_79709) {\n                        x_79694 = x_79695;\n                    }\n                }\n                if (!no_carry_in_79708) {\n                    if (!inactive_79709) {\n                        int64_t defunc_1_op_res_79696 = add64(x_79694, x_79695);\n                        \n                        x_79694 = defunc_1_op_res_79696;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_79708) {\n                    ((__local\n                      int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_79656)] =\n                        x_79694;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_79656, 32) == 0 && ltid_in_bounds_79701) {\n                ((__local\n                  int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_79656)] =\n                    x_79695;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_79656 == 0) {\n            acc_79697 = ((__local\n                          int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n                                                              (int64_t) 8) +\n                                                      (segscan_group_sizze_72659 -\n                                                       (int64_t) 1)];\n        } else {\n            acc_79697 = ((__local\n                          int64_t *) local_mem_79664)[squot64(byte_offsets_79660,\n         ",
            "                                                     (int64_t) 8) +\n                                                      (sext_i32_i64(local_tid_79656) -\n                                                       (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_79710 = (int64_t) 0;\n    bool block_new_sgm_79711 = sgm_idx_79673 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_79711 && local_tid_79656 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_79653)[dynamic_id_79671] = acc_79697;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_79649)[dynamic_id_79671] = (int8_t) 2;\n            acc_79697 = (int64_t) 0;\n        }\n        if (!block_new_sgm_79711 && slt32(local_tid_79656, wave_sizze_79658)) {\n            if (local_tid_79656 == 0) {\n                if (boundary_79674 == sext_i64_i32(segscan_group_sizze_72659 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_79651)[dynamic_id_79671] =\n                        acc_79697;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79649)[dynamic_id_79671] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79653)[dynamic_id_79671] =\n                        acc_79697;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79649)[dynamic_id_79671] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_79712;\n                \n                tmp_79712 = ((volatile __global\n                              int8_t *) status_flags_mem_79649)[dynamic_id_79671 -\n                                                        ",
            "        (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_79664)[(int64_t) 0] =\n                    tmp_79712;\n            }\n            mem_fence_local();\n            \n            int8_t status_79713;\n            \n            status_79713 = ((__local int8_t *) local_mem_79664)[(int64_t) 0];\n            if (status_79713 == (int8_t) 2) {\n                if (local_tid_79656 == 0) {\n                    prefix_79710 = ((volatile __global\n                                     int64_t *) incprefixes_mem_79653)[dynamic_id_79671 -\n                                                                       (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_79714 = dynamic_id_79671 -\n                        sext_i32_i64(wave_sizze_79658);\n                \n                while (slt32(wave_sizze_79658 * -1, readOffset_79714)) {\n                    int32_t read_i_79715 = readOffset_79714 + local_tid_79656;\n                    int64_t aggr_79716 = (int64_t) 0;\n                    int8_t flag_79717 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_79715)) {\n                        if (sle64(blockOff_79672 - (sext_i32_i64(read_i_79715 +\n                                                    1) *\n                                                    segscan_group_sizze_72659 *\n                                                    (int64_t) 11 - (int64_t) 1),\n                                  sgm_idx_79673)) {\n                            flag_79717 = ((volatile __global\n                                           int8_t *) status_flags_mem_79649)[sext_i32_i64(read_i_79715)];\n                            if (flag_79717 == (int8_t) 2) {\n                                aggr_79716 = ((volatile __global\n                                               int64_t *) incprefixes_mem_79653)[sext_i32_i64(read_i_79715)];\n                            } else {\n                                if (flag_79717 == (int8_t) 1) {\n            ",
            "                        aggr_79716 = ((volatile __global\n                                                   int64_t *) aggregates_mem_79651)[sext_i32_i64(read_i_79715)];\n                                }\n                            }\n                        } else {\n                            flag_79717 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_79656)] =\n                        aggr_79716;\n                    ((__local\n                      int8_t *) local_mem_79664)[sext_i32_i64(local_tid_79656)] =\n                        flag_79717;\n                    flag_79717 = ((__local\n                                   int8_t *) local_mem_79664)[sext_i32_i64(wave_sizze_79658) -\n                                                              (int64_t) 1];\n                    if (slt8(flag_79717, (int8_t) 2)) {\n                        int8_t flg_x_79721;\n                        int8_t flg_y_79722;\n                        int64_t x_79718;\n                        int64_t x_79719;\n                        int32_t skip_threads_79723;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_79722 = ((volatile __local\n                                            int8_t *) local_mem_79664)[sext_i32_i64(local_tid_79656)];\n                            x_79719 = ((volatile __local\n                                        int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                                                                            (int64_t) 8) +\n                                                                    sext_i32_i64(local_tid_79656)];\n                            if ((local_tid_79656 - squot32(local_tid_",
            "79656,\n                                                           32) * 32) == 0) {\n                                x_79718 = x_79719;\n                                flg_x_79721 = flg_y_79722;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_79723 = 1;\n                            while (slt32(skip_threads_79723, 32)) {\n                                if (sle32(skip_threads_79723, local_tid_79656 -\n                                          squot32(local_tid_79656, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_79721 = ((volatile __local\n                                                        int8_t *) local_mem_79664)[sext_i32_i64(local_tid_79656) -\n                                                                                   sext_i32_i64(skip_threads_79723)];\n                                        x_79718 = ((volatile __local\n                                                    int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                                                                                        (int64_t) 8) +\n                                                                                (sext_i32_i64(local_tid_79656) -\n                                                                                 sext_i32_i64(skip_threads_79723))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_79722 == (int8_t) 2 ||\n                                            flg_y_79722 == (int8_t) 0) {\n                                            flg_x_79721 = flg_y_79722;\n                                            x_79718 = x_79719;\n                                        } else {",
            "\n                                            int64_t defunc_1_op_res_79720 =\n                                                    add64(x_79718, x_79719);\n                                            \n                                            x_79718 = defunc_1_op_res_79720;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_79664)[sext_i32_i64(local_tid_79656)] =\n                                            flg_x_79721;\n                                        flg_y_79722 = flg_x_79721;\n                                        ((volatile __local\n                                          int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_79656)] =\n                                            x_79718;\n                                        x_79719 = x_79718;\n                                    }\n                                }\n                                skip_threads_79723 *= 2;\n                            }\n                        }\n                    }\n                    flag_79717 = ((__local\n                                   int8_t *) local_mem_79664)[sext_i32_i64(wave_sizze_79658) -\n                                                              (int64_t) 1];\n                    aggr_79716 = ((__local\n                                   int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                                                                       (int64_t) 8) +\n                                                               (sext_i32_i64(wave_sizze_79658) -\n                                                          ",
            "      (int64_t) 1)];\n                    if (flag_79717 == (int8_t) 2) {\n                        readOffset_79714 = wave_sizze_79658 * -1;\n                    } else {\n                        if (flag_79717 == (int8_t) 1) {\n                            readOffset_79714 -= wave_sizze_79658;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_79717)) {\n                        int64_t x_79724 = aggr_79716;\n                        int64_t x_79725 = prefix_79710;\n                        int64_t defunc_1_op_res_79726 = add64(x_79724, x_79725);\n                        \n                        prefix_79710 = defunc_1_op_res_79726;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_79656 == 0) {\n                if (boundary_79674 == sext_i64_i32(segscan_group_sizze_72659 *\n                    (int64_t) 11)) {\n                    int64_t x_79727 = prefix_79710;\n                    int64_t x_79728 = acc_79697;\n                    int64_t defunc_1_op_res_79729 = add64(x_79727, x_79728);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79653)[dynamic_id_79671] =\n                        defunc_1_op_res_79729;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79649)[dynamic_id_79671] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                                                      (int64_t) 8)] =\n                    prefix_79710;\n                acc_79697 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_79671 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_79710 = ((__local\n                             int64_t *) local_mem_79664)[squot64(warp_byte_offset_79662,\n                ",
            "                                                 (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_79730;\n        int64_t x_79731;\n        int64_t x_79733 = prefix_79710;\n        int64_t x_79734 = acc_79697;\n        \n        if (slt32(local_tid_79656 * 11, boundary_79674) &&\n            !block_new_sgm_79711) {\n            int64_t defunc_1_op_res_79735 = add64(x_79733, x_79734);\n            \n            x_79730 = defunc_1_op_res_79735;\n        } else {\n            x_79730 = acc_79697;\n        }\n        \n        int32_t stopping_point_79736 = segsizze_compact_79675 -\n                srem32(local_tid_79656 * 11 - 1 + segsizze_compact_79675 -\n                       boundary_79674, segsizze_compact_79675);\n        \n        for (int64_t i_79737 = 0; i_79737 < (int64_t) 11; i_79737++) {\n            if (slt32(sext_i64_i32(i_79737), stopping_point_79736 - 1)) {\n                x_79731 = private_mem_79676[i_79737];\n                \n                int64_t defunc_1_op_res_79732 = add64(x_79730, x_79731);\n                \n                private_mem_79676[i_79737] = defunc_1_op_res_79732;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_79738 = 0; i_79738 < (int64_t) 11; i_79738++) {\n            int64_t sharedIdx_79739 = sext_i32_i64(local_tid_79656 * 11) +\n                    i_79738;\n            int64_t tmp_79740;\n            \n            tmp_79740 = private_mem_79676[i_79738];\n            ((__local int64_t *) local_mem_79664)[sharedIdx_79739] = tmp_79740;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_79741 = 0; i_79741 < (int64_t) 11; i_79741++) {\n            int64_t flat_idx_79742 = blockOff_79672 +\n                    segscan_group_sizze_72659 * i_79741 +\n                    sext_i32_i64(local_tid_79656);\n            int64_t slice_79743 = n_65344;\n            int64_t slice_79744 = m_65343",
            " * slice_79743;\n            int64_t gtid_72663 = squot64(flat_idx_79742, slice_79743);\n            int64_t remnant_79745 = flat_idx_79742 - gtid_72663 * slice_79743;\n            int64_t gtid_72664 = remnant_79745;\n            int64_t remnant_79746 = remnant_79745 - gtid_72664;\n            \n            if (slt64(flat_idx_79742, m_65343 * n_65344)) {\n                int64_t tmp_79747;\n                \n                tmp_79747 = ((__local\n                              int64_t *) local_mem_79664)[flat_idx_79742 -\n                                                          blockOff_79672];\n                ((__global int64_t *) mem_77833)[gtid_72663 * n_65344 +\n                                                 gtid_72664] = tmp_79747;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_79671 == sdiv_up64(m_65343 * n_65344,\n                                          segscan_group_sizze_72659 *\n                                          (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_79647)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_72659\n}\n__kernel void mainzisegscan_73332(__global int *global_failure,\n                                  uint local_mem_79833_backing_offset_0,\n                                  int64_t m_65343, int64_t n_65344, __global\n                                  unsigned char *Y_mem_76976, __global\n                                  unsigned char *mem_77880, __global\n                                  unsigned char *mainziid_counter_mem_79816,\n                                  __global\n                                  unsigned char *status_flags_mem_79818,\n                                  __global unsigned char *aggregates_mem_79820,\n                                  __global unsigned char *incprefixes_mem_79822)\n{\n    #define segscan_group_sizze_73326 (mainzisegscan_group",
            "_sizze_73306)\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_79833_backing_0 =\n                           &shared_mem[local_mem_79833_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79824;\n    int32_t local_tid_79825;\n    int64_t group_sizze_79828;\n    int32_t wave_sizze_79827;\n    int32_t group_tid_79826;\n    \n    global_tid_79824 = get_global_id(0);\n    local_tid_79825 = get_local_id(0);\n    group_sizze_79828 = get_local_size(0);\n    wave_sizze_79827 = LOCKSTEP_WIDTH;\n    group_tid_79826 = get_group_id(0);\n    \n    int32_t phys_tid_73332 = global_tid_79824;\n    int64_t byte_offsets_79829 = (int64_t) 0;\n    int64_t byte_offsets_79830 = segscan_group_sizze_73326 * (int64_t) 8;\n    int64_t warp_byte_offset_79831 = (int64_t) 32;\n    int64_t warp_byte_offset_79832 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_79833;\n    \n    local_mem_79833 = (__local unsigned char *) local_mem_79833_backing_0;\n    \n    int64_t trans_arr_len_79834 = (int64_t) 11 * segscan_group_sizze_73326;\n    int32_t dynamic_id_79840;\n    \n    if (local_tid_79825 == 0) {\n        dynamic_id_79840 = atomic_add_i32_global(&((volatile __global\n                                                    int *) mainziid_counter_mem_79816)[(int64_t) 0],\n                                                 (int) 1);\n        ((__local int32_t *) local_mem_79833)[(int64_t) 0] = dynamic_id_79840;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_79840 = ((__local int32_t *) local_mem_79833)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_79841 = sext_i32_i64(dynamic_id_79840) * (int64_t) 11 *\n            segscan_group_sizze_73326;\n    int64_t sgm_idx_79842 = smod64(blockOff_79841, n_65344);\n    int32_t boundary_79843 = sext_i64_i32(smin64((int64_t) 11 *\n                                           ",
            "      segscan_group_sizze_73326,\n                                                 n_65344 - sgm_idx_79842));\n    int32_t segsizze_compact_79844 = sext_i64_i32(smin64((int64_t) 11 *\n                                                         segscan_group_sizze_73326,\n                                                         n_65344));\n    int64_t private_mem_79845[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_79847 = 0; i_79847 < (int64_t) 11; i_79847++) {\n            int64_t phys_tid_79848 = blockOff_79841 +\n                    sext_i32_i64(local_tid_79825) + i_79847 *\n                    segscan_group_sizze_73326;\n            int64_t slice_79849 = n_65344;\n            int64_t slice_79850 = m_65343 * slice_79849;\n            int64_t gtid_73330 = squot64(phys_tid_79848, slice_79849);\n            int64_t remnant_79851 = phys_tid_79848 - gtid_73330 * slice_79849;\n            int64_t gtid_73331 = remnant_79851;\n            int64_t remnant_79852 = remnant_79851 - gtid_73331;\n            \n            if (slt64(phys_tid_79848, m_65343 * n_65344)) {\n                float x_73337;\n                \n                x_73337 = ((__global float *) Y_mem_76976)[gtid_73330 *\n                                                           n_65344 +\n                                                           gtid_73331];\n                \n                bool isnan_res_73338;\n                \n                isnan_res_73338 = futrts_isnan32(x_73337);\n                \n                bool defunc_0_p_res_73339 = !isnan_res_73338;\n                int64_t defunc_0_f_res_73340 =\n                        btoi_bool_i64(defunc_0_p_res_73339);\n                \n                private_mem_79845[i_79847] = defunc_0_f_res_73340;\n            } else {\n                private_mem_79845[i_79847] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_79853 = 0; i_79853 < (int64_t) 11; i_79853++) {\n      ",
            "      int64_t sharedIdx_79854 = sext_i32_i64(local_tid_79825) + i_79853 *\n                    segscan_group_sizze_73326;\n            int64_t tmp_79855;\n            \n            tmp_79855 = private_mem_79845[i_79853];\n            ((__local int64_t *) local_mem_79833)[sharedIdx_79854] = tmp_79855;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_79856 = 0; i_79856 < 11; i_79856++) {\n            int32_t sharedIdx_79857 = local_tid_79825 * 11 + i_79856;\n            int64_t tmp_79858;\n            \n            tmp_79858 = ((__local\n                          int64_t *) local_mem_79833)[sext_i32_i64(sharedIdx_79857)];\n            private_mem_79845[sext_i32_i64(i_79856)] = tmp_79858;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_79859 = local_tid_79825 * 11 + 1;\n        \n        for (int64_t i_79860 = 0; i_79860 < (int64_t) 10; i_79860++) {\n            bool new_sgm_79861 = smod32(gidx_79859 + sext_i64_i32(i_79860) -\n                                        boundary_79843,\n                                        segsizze_compact_79844) == 0;\n            \n            if (!new_sgm_79861) {\n                int64_t x_73333;\n                int64_t x_73334;\n                \n                x_73333 = private_mem_79845[i_79860];\n                x_73334 = private_mem_79845[i_79860 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_73335 = add64(x_73333, x_73334);\n                \n                private_mem_79845[i_79860 + (int64_t) 1] =\n                    defunc_1_op_res_73335;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_79862;\n        \n        tmp_79862 = private_mem_79845[(int64_t) 10];\n        ((__local int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_79825)] =\n            tmp_79862;\n  ",
            "      barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_79866;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_79863;\n        int64_t x_79864;\n        int64_t x_79867;\n        int64_t x_79868;\n        bool ltid_in_bounds_79870 = slt64(sext_i32_i64(local_tid_79825),\n                                          segscan_group_sizze_73326);\n        int32_t skip_threads_79871;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_79870) {\n                x_79864 = ((volatile __local\n                            int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                                (int64_t) 8) +\n                                                        sext_i32_i64(local_tid_79825)];\n                if ((local_tid_79825 - squot32(local_tid_79825, 32) * 32) ==\n                    0) {\n                    x_79863 = x_79864;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79871 = 1;\n            while (slt32(skip_threads_79871, 32)) {\n                bool thread_active_79872 = sle32(skip_threads_79871,\n                                                 local_tid_79825 -\n                                                 squot32(local_tid_79825, 32) *\n                                                 32) && ltid_in_bounds_79870;\n                \n                if (thread_active_79872) {\n                    // read operands\n                    {\n                        x_79863 = ((volatile __local\n                                    int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(local_tid_79825) -\n                                                                 sext_i32_i64(skip_threads_79871))];\n                    }\n      ",
            "          }\n                // perform operation\n                {\n                    bool inactive_79873 = slt32(smod32((local_tid_79825 + 1) *\n                                                       11 - 1 +\n                                                       segsizze_compact_79844 -\n                                                       boundary_79843,\n                                                       segsizze_compact_79844),\n                                                (local_tid_79825 + 1) * 11 - 1 -\n                                                ((local_tid_79825 -\n                                                  skip_threads_79871 + 1) * 11 -\n                                                 1));\n                    \n                    if (thread_active_79872 && inactive_79873) {\n                        x_79863 = x_79864;\n                    }\n                    if (thread_active_79872) {\n                        if (!inactive_79873) {\n                            int64_t defunc_1_op_res_79865 = add64(x_79863,\n                                                                  x_79864);\n                            \n                            x_79863 = defunc_1_op_res_79865;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_79827, skip_threads_79871)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79872) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_79825)] =\n                            x_79863;\n                        x_79864 = x_79863;\n                    }\n                }\n                if (sle32(wave_sizze_79827, skip_threads_79871)) {\n           ",
            "         barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79871 *= 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_79825 - squot32(local_tid_79825, 32) * 32) == 31 &&\n                ltid_in_bounds_79870) {\n                ((volatile __local\n                  int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_79825,\n                                                                   32))] =\n                    x_79863;\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_79874;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_79825, 32) == 0 && ltid_in_bounds_79870) {\n                    x_79868 = ((volatile __local\n                                int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                                    (int64_t) 8) +\n                                                            sext_i32_i64(local_tid_79825)];\n                    if ((local_tid_79825 - squot32(local_tid_79825, 32) * 32) ==\n                        0) {\n                        x_79867 = x_79868;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79874 = 1;\n                while (slt32(skip_threads_79874, 32)) {\n                    bool thread_active_79875 = sle32(skip_threads_79874,\n                                                     local_tid_79825 -\n                                                     squot32(local_tid_79825,\n            ",
            "                                                 32) * 32) &&\n                         (squot32(local_tid_79825, 32) == 0 &&\n                          ltid_in_bounds_79870);\n                    \n                    if (thread_active_79875) {\n                        // read operands\n                        {\n                            x_79867 = ((volatile __local\n                                        int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                                            (int64_t) 8) +\n                                                                    (sext_i32_i64(local_tid_79825) -\n                                                                     sext_i32_i64(skip_threads_79874))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79876 = slt32(smod32((local_tid_79825 *\n                                                            32 + 32 - 1 + 1) *\n                                                           11 - 1 +\n                                                           segsizze_compact_79844 -\n                                                           boundary_79843,\n                                                           segsizze_compact_79844),\n                                                    (local_tid_79825 * 32 + 32 -\n                                                     1 + 1) * 11 - 1 -\n                                                    (((local_tid_79825 -\n                                                       skip_threads_79874) *\n                                                      32 + 32 - 1 + 1) * 11 -\n                                                     1));\n                        \n                        if (thread_active_79875 && inactive_79876) {\n                            x_79867 = x_79868;\n                        }\n                        if (thread_active_79875) {\n      ",
            "                      if (!inactive_79876) {\n                                int64_t defunc_1_op_res_79869 = add64(x_79867,\n                                                                      x_79868);\n                                \n                                x_79867 = defunc_1_op_res_79869;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79827, skip_threads_79874)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79875) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_79825)] =\n                                x_79867;\n                            x_79868 = x_79867;\n                        }\n                    }\n                    if (sle32(wave_sizze_79827, skip_threads_79874)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79874 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_79877 = squot32(local_tid_79825, 32) == 0 ||\n             !ltid_in_bounds_79870;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_79877) {\n                    x_79864 = x_79863;\n                    x_79863 = ((__local\n                                int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                                    (int64_t) 8) +\n                                                            (sext_i32_i64(squot32(local_tid_79825,\n                          ",
            "                                                        32)) -\n                                                             (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79878 = slt32(smod32((local_tid_79825 + 1) * 11 -\n                                                   1 + segsizze_compact_79844 -\n                                                   boundary_79843,\n                                                   segsizze_compact_79844),\n                                            (local_tid_79825 + 1) * 11 - 1 -\n                                            ((squot32(local_tid_79825, 32) *\n                                              32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_79877) {\n                    if (inactive_79878) {\n                        x_79863 = x_79864;\n                    }\n                }\n                if (!no_carry_in_79877) {\n                    if (!inactive_79878) {\n                        int64_t defunc_1_op_res_79865 = add64(x_79863, x_79864);\n                        \n                        x_79863 = defunc_1_op_res_79865;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_79877) {\n                    ((__local\n                      int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_79825)] =\n                        x_79863;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_79825, 32) == 0 && ltid_in_bounds_79870) {\n                ((__local\n                  int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                      (int64_t) 8",
            ") +\n                                              sext_i32_i64(local_tid_79825)] =\n                    x_79864;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_79825 == 0) {\n            acc_79866 = ((__local\n                          int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                              (int64_t) 8) +\n                                                      (segscan_group_sizze_73326 -\n                                                       (int64_t) 1)];\n        } else {\n            acc_79866 = ((__local\n                          int64_t *) local_mem_79833)[squot64(byte_offsets_79829,\n                                                              (int64_t) 8) +\n                                                      (sext_i32_i64(local_tid_79825) -\n                                                       (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_79879 = (int64_t) 0;\n    bool block_new_sgm_79880 = sgm_idx_79842 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_79880 && local_tid_79825 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_79822)[dynamic_id_79840] = acc_79866;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_79818)[dynamic_id_79840] = (int8_t) 2;\n            acc_79866 = (int64_t) 0;\n        }\n        if (!block_new_sgm_79880 && slt32(local_tid_79825, wave_sizze_79827)) {\n            if (local_tid_79825 == 0) {\n                if (boundary_79843 == sext_i64_i32(segscan_group_sizze_73326 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_79820)[dynamic_id_79840] =\n                        acc_79866;\n                    mem_fence_global();\n                    ((volatile __global\n                 ",
            "     int8_t *) status_flags_mem_79818)[dynamic_id_79840] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79822)[dynamic_id_79840] =\n                        acc_79866;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79818)[dynamic_id_79840] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_79881;\n                \n                tmp_79881 = ((volatile __global\n                              int8_t *) status_flags_mem_79818)[dynamic_id_79840 -\n                                                                (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_79833)[(int64_t) 0] =\n                    tmp_79881;\n            }\n            mem_fence_local();\n            \n            int8_t status_79882;\n            \n            status_79882 = ((__local int8_t *) local_mem_79833)[(int64_t) 0];\n            if (status_79882 == (int8_t) 2) {\n                if (local_tid_79825 == 0) {\n                    prefix_79879 = ((volatile __global\n                                     int64_t *) incprefixes_mem_79822)[dynamic_id_79840 -\n                                                                       (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_79883 = dynamic_id_79840 -\n                        sext_i32_i64(wave_sizze_79827);\n                \n                while (slt32(wave_sizze_79827 * -1, readOffset_79883)) {\n                    int32_t read_i_79884 = readOffset_79883 + local_tid_79825;\n                    int64_t aggr_79885 = (int64_t) 0;\n                    int8_t flag_79886 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_79884)) {\n                        if (sle64(blockOff_79841 - (sext_i32_i64(read_i_79884 +\n                                                 ",
            "   1) *\n                                                    segscan_group_sizze_73326 *\n                                                    (int64_t) 11 - (int64_t) 1),\n                                  sgm_idx_79842)) {\n                            flag_79886 = ((volatile __global\n                                           int8_t *) status_flags_mem_79818)[sext_i32_i64(read_i_79884)];\n                            if (flag_79886 == (int8_t) 2) {\n                                aggr_79885 = ((volatile __global\n                                               int64_t *) incprefixes_mem_79822)[sext_i32_i64(read_i_79884)];\n                            } else {\n                                if (flag_79886 == (int8_t) 1) {\n                                    aggr_79885 = ((volatile __global\n                                                   int64_t *) aggregates_mem_79820)[sext_i32_i64(read_i_79884)];\n                                }\n                            }\n                        } else {\n                            flag_79886 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_79825)] =\n                        aggr_79885;\n                    ((__local\n                      int8_t *) local_mem_79833)[sext_i32_i64(local_tid_79825)] =\n                        flag_79886;\n                    flag_79886 = ((__local\n                                   int8_t *) local_mem_79833)[sext_i32_i64(wave_sizze_79827) -\n                                                              (int64_t) 1];\n                    if (slt8(flag_79886, (int8_t) 2)) {\n                        int8_t flg_x_79890;\n                        int8_t flg_y_79891;\n                        int64_t x_79887;\n                        int64_t x_79888;\n    ",
            "                    int32_t skip_threads_79892;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_79891 = ((volatile __local\n                                            int8_t *) local_mem_79833)[sext_i32_i64(local_tid_79825)];\n                            x_79888 = ((volatile __local\n                                        int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                                            (int64_t) 8) +\n                                                                    sext_i32_i64(local_tid_79825)];\n                            if ((local_tid_79825 - squot32(local_tid_79825,\n                                                           32) * 32) == 0) {\n                                x_79887 = x_79888;\n                                flg_x_79890 = flg_y_79891;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_79892 = 1;\n                            while (slt32(skip_threads_79892, 32)) {\n                                if (sle32(skip_threads_79892, local_tid_79825 -\n                                          squot32(local_tid_79825, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_79890 = ((volatile __local\n                                                        int8_t *) local_mem_79833)[sext_i32_i64(local_tid_79825) -\n                                                                                   sext_i32_i64(skip_threads_79892)];\n                                        x_79887 = ((volatile __local\n                                                    int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                          ",
            "                              (int64_t) 8) +\n                                                                                (sext_i32_i64(local_tid_79825) -\n                                                                                 sext_i32_i64(skip_threads_79892))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_79891 == (int8_t) 2 ||\n                                            flg_y_79891 == (int8_t) 0) {\n                                            flg_x_79890 = flg_y_79891;\n                                            x_79887 = x_79888;\n                                        } else {\n                                            int64_t defunc_1_op_res_79889 =\n                                                    add64(x_79887, x_79888);\n                                            \n                                            x_79887 = defunc_1_op_res_79889;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_79833)[sext_i32_i64(local_tid_79825)] =\n                                            flg_x_79890;\n                                        flg_y_79891 = flg_x_79890;\n                                        ((volatile __local\n                                          int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_79825)] =\n                                            x_79887;\n                                        x_79888 = x_79887;\n                                    }\n                          ",
            "      }\n                                skip_threads_79892 *= 2;\n                            }\n                        }\n                    }\n                    flag_79886 = ((__local\n                                   int8_t *) local_mem_79833)[sext_i32_i64(wave_sizze_79827) -\n                                                              (int64_t) 1];\n                    aggr_79885 = ((__local\n                                   int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                                       (int64_t) 8) +\n                                                               (sext_i32_i64(wave_sizze_79827) -\n                                                                (int64_t) 1)];\n                    if (flag_79886 == (int8_t) 2) {\n                        readOffset_79883 = wave_sizze_79827 * -1;\n                    } else {\n                        if (flag_79886 == (int8_t) 1) {\n                            readOffset_79883 -= wave_sizze_79827;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_79886)) {\n                        int64_t x_79893 = aggr_79885;\n                        int64_t x_79894 = prefix_79879;\n                        int64_t defunc_1_op_res_79895 = add64(x_79893, x_79894);\n                        \n                        prefix_79879 = defunc_1_op_res_79895;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_79825 == 0) {\n                if (boundary_79843 == sext_i64_i32(segscan_group_sizze_73326 *\n                    (int64_t) 11)) {\n                    int64_t x_79896 = prefix_79879;\n                    int64_t x_79897 = acc_79866;\n                    int64_t defunc_1_op_res_79898 = add64(x_79896, x_79897);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79822)[dynamic_id_79840] =\n                        defu",
            "nc_1_op_res_79898;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79818)[dynamic_id_79840] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                      (int64_t) 8)] =\n                    prefix_79879;\n                acc_79866 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_79840 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_79879 = ((__local\n                             int64_t *) local_mem_79833)[squot64(warp_byte_offset_79831,\n                                                                 (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_79899;\n        int64_t x_79900;\n        int64_t x_79902 = prefix_79879;\n        int64_t x_79903 = acc_79866;\n        \n        if (slt32(local_tid_79825 * 11, boundary_79843) &&\n            !block_new_sgm_79880) {\n            int64_t defunc_1_op_res_79904 = add64(x_79902, x_79903);\n            \n            x_79899 = defunc_1_op_res_79904;\n        } else {\n            x_79899 = acc_79866;\n        }\n        \n        int32_t stopping_point_79905 = segsizze_compact_79844 -\n                srem32(local_tid_79825 * 11 - 1 + segsizze_compact_79844 -\n                       boundary_79843, segsizze_compact_79844);\n        \n        for (int64_t i_79906 = 0; i_79906 < (int64_t) 11; i_79906++) {\n            if (slt32(sext_i64_i32(i_79906), stopping_point_79905 - 1)) {\n                x_79900 = private_mem_79845[i_79906];\n                \n                int64_t defunc_1_op_res_79901 = add64(x_79899, x_79900);\n                \n                private_mem_79845[i_79906] = defunc_1_op_res_79901;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coale",
            "sced fashion\n    {\n        for (int64_t i_79907 = 0; i_79907 < (int64_t) 11; i_79907++) {\n            int64_t sharedIdx_79908 = sext_i32_i64(local_tid_79825 * 11) +\n                    i_79907;\n            int64_t tmp_79909;\n            \n            tmp_79909 = private_mem_79845[i_79907];\n            ((__local int64_t *) local_mem_79833)[sharedIdx_79908] = tmp_79909;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_79910 = 0; i_79910 < (int64_t) 11; i_79910++) {\n            int64_t flat_idx_79911 = blockOff_79841 +\n                    segscan_group_sizze_73326 * i_79910 +\n                    sext_i32_i64(local_tid_79825);\n            int64_t slice_79912 = n_65344;\n            int64_t slice_79913 = m_65343 * slice_79912;\n            int64_t gtid_73330 = squot64(flat_idx_79911, slice_79912);\n            int64_t remnant_79914 = flat_idx_79911 - gtid_73330 * slice_79912;\n            int64_t gtid_73331 = remnant_79914;\n            int64_t remnant_79915 = remnant_79914 - gtid_73331;\n            \n            if (slt64(flat_idx_79911, m_65343 * n_65344)) {\n                int64_t tmp_79916;\n                \n                tmp_79916 = ((__local\n                              int64_t *) local_mem_79833)[flat_idx_79911 -\n                                                          blockOff_79841];\n                ((__global int64_t *) mem_77880)[gtid_73330 * n_65344 +\n                                                 gtid_73331] = tmp_79916;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_79840 == sdiv_up64(m_65343 * n_65344,\n                                          segscan_group_sizze_73326 *\n                                          (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_79816)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_73326\n}\n__kernel void mainzisegscan_7408",
            "9(__global int *global_failure,\n                                  uint local_mem_80008_backing_offset_0,\n                                  int64_t m_65343, int64_t n_65344, __global\n                                  unsigned char *Y_mem_76976, __global\n                                  unsigned char *mem_77934, __global\n                                  unsigned char *mainziid_counter_mem_79991,\n                                  __global\n                                  unsigned char *status_flags_mem_79993,\n                                  __global unsigned char *aggregates_mem_79995,\n                                  __global unsigned char *incprefixes_mem_79997)\n{\n    #define segscan_group_sizze_74083 (mainzisegscan_group_sizze_74063)\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_80008_backing_0 =\n                           &shared_mem[local_mem_80008_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79999;\n    int32_t local_tid_80000;\n    int64_t group_sizze_80003;\n    int32_t wave_sizze_80002;\n    int32_t group_tid_80001;\n    \n    global_tid_79999 = get_global_id(0);\n    local_tid_80000 = get_local_id(0);\n    group_sizze_80003 = get_local_size(0);\n    wave_sizze_80002 = LOCKSTEP_WIDTH;\n    group_tid_80001 = get_group_id(0);\n    \n    int32_t phys_tid_74089 = global_tid_79999;\n    int64_t byte_offsets_80004 = (int64_t) 0;\n    int64_t byte_offsets_80005 = segscan_group_sizze_74083 * (int64_t) 8;\n    int64_t warp_byte_offset_80006 = (int64_t) 32;\n    int64_t warp_byte_offset_80007 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_80008;\n    \n    local_mem_80008 = (__local unsigned char *) local_mem_80008_backing_0;\n    \n    int64_t trans_arr_len_80009 = (int64_t) 11 * segscan_group_sizze_74083;\n    int32_t dynamic_id_80015;\n    \n    if (local_tid_80000 == 0) {\n        dyn",
            "amic_id_80015 = atomic_add_i32_global(&((volatile __global\n                                                    int *) mainziid_counter_mem_79991)[(int64_t) 0],\n                                                 (int) 1);\n        ((__local int32_t *) local_mem_80008)[(int64_t) 0] = dynamic_id_80015;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_80015 = ((__local int32_t *) local_mem_80008)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_80016 = sext_i32_i64(dynamic_id_80015) * (int64_t) 11 *\n            segscan_group_sizze_74083;\n    int64_t sgm_idx_80017 = smod64(blockOff_80016, n_65344);\n    int32_t boundary_80018 = sext_i64_i32(smin64((int64_t) 11 *\n                                                 segscan_group_sizze_74083,\n                                                 n_65344 - sgm_idx_80017));\n    int32_t segsizze_compact_80019 = sext_i64_i32(smin64((int64_t) 11 *\n                                                         segscan_group_sizze_74083,\n                                                         n_65344));\n    int64_t private_mem_80020[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_80022 = 0; i_80022 < (int64_t) 11; i_80022++) {\n            int64_t phys_tid_80023 = blockOff_80016 +\n                    sext_i32_i64(local_tid_80000) + i_80022 *\n                    segscan_group_sizze_74083;\n            int64_t slice_80024 = n_65344;\n            int64_t slice_80025 = m_65343 * slice_80024;\n            int64_t gtid_74087 = squot64(phys_tid_80023, slice_80024);\n            int64_t remnant_80026 = phys_tid_80023 - gtid_74087 * slice_80024;\n            int64_t gtid_74088 = remnant_80026;\n            int64_t remnant_80027 = remnant_80026 - gtid_74088;\n            \n            if (slt64(phys_tid_80023, m_65343 * n_65344)) {\n                float x_74094;\n                \n                x_74094 = ((__global float *) Y_mem_76976)[gtid_74087 *\n                                                           n_65344",
            " +\n                                                           gtid_74088];\n                \n                bool isnan_res_74095;\n                \n                isnan_res_74095 = futrts_isnan32(x_74094);\n                \n                bool defunc_0_p_res_74096 = !isnan_res_74095;\n                int64_t defunc_0_f_res_74097 =\n                        btoi_bool_i64(defunc_0_p_res_74096);\n                \n                private_mem_80020[i_80022] = defunc_0_f_res_74097;\n            } else {\n                private_mem_80020[i_80022] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_80028 = 0; i_80028 < (int64_t) 11; i_80028++) {\n            int64_t sharedIdx_80029 = sext_i32_i64(local_tid_80000) + i_80028 *\n                    segscan_group_sizze_74083;\n            int64_t tmp_80030;\n            \n            tmp_80030 = private_mem_80020[i_80028];\n            ((__local int64_t *) local_mem_80008)[sharedIdx_80029] = tmp_80030;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_80031 = 0; i_80031 < 11; i_80031++) {\n            int32_t sharedIdx_80032 = local_tid_80000 * 11 + i_80031;\n            int64_t tmp_80033;\n            \n            tmp_80033 = ((__local\n                          int64_t *) local_mem_80008)[sext_i32_i64(sharedIdx_80032)];\n            private_mem_80020[sext_i32_i64(i_80031)] = tmp_80033;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_80034 = local_tid_80000 * 11 + 1;\n        \n        for (int64_t i_80035 = 0; i_80035 < (int64_t) 10; i_80035++) {\n            bool new_sgm_80036 = smod32(gidx_80034 + sext_i64_i32(i_80035) -\n                                        boundary_80018,\n                                        segsizze_compact_80019) == 0;\n            \n            if (!new_sgm_80036) {\n                int64_t x_74090;\n                int64_t x_74091;\n                \n       ",
            "         x_74090 = private_mem_80020[i_80035];\n                x_74091 = private_mem_80020[i_80035 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_74092 = add64(x_74090, x_74091);\n                \n                private_mem_80020[i_80035 + (int64_t) 1] =\n                    defunc_1_op_res_74092;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_80037;\n        \n        tmp_80037 = private_mem_80020[(int64_t) 10];\n        ((__local int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_80000)] =\n            tmp_80037;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_80041;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_80038;\n        int64_t x_80039;\n        int64_t x_80042;\n        int64_t x_80043;\n        bool ltid_in_bounds_80045 = slt64(sext_i32_i64(local_tid_80000),\n                                          segscan_group_sizze_74083);\n        int32_t skip_threads_80046;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_80045) {\n                x_80039 = ((volatile __local\n                            int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                                (int64_t) 8) +\n                                                        sext_i32_i64(local_tid_80000)];\n                if ((local_tid_80000 - squot32(local_tid_80000, 32) * 32) ==\n                    0) {\n                    x_80038 = x_80039;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_80046 = 1;\n            while (slt32(skip_threads_80046, 32)) {\n                bool thread_active_80047 = sle32(skip_threads_80046,\n                                                 local_tid_80000 -",
            "\n                                                 squot32(local_tid_80000, 32) *\n                                                 32) && ltid_in_bounds_80045;\n                \n                if (thread_active_80047) {\n                    // read operands\n                    {\n                        x_80038 = ((volatile __local\n                                    int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(local_tid_80000) -\n                                                                 sext_i32_i64(skip_threads_80046))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_80048 = slt32(smod32((local_tid_80000 + 1) *\n                                                       11 - 1 +\n                                                       segsizze_compact_80019 -\n                                                       boundary_80018,\n                                                       segsizze_compact_80019),\n                                                (local_tid_80000 + 1) * 11 - 1 -\n                                                ((local_tid_80000 -\n                                                  skip_threads_80046 + 1) * 11 -\n                                                 1));\n                    \n                    if (thread_active_80047 && inactive_80048) {\n                        x_80038 = x_80039;\n                    }\n                    if (thread_active_80047) {\n                        if (!inactive_80048) {\n                            int64_t defunc_1_op_res_80040 = add64(x_80038,\n                                                                  x_80039);\n                            \n                            x_80038 = defunc_1_op_res_80040;\n                        }\n                    }\n     ",
            "           }\n                if (sle32(wave_sizze_80002, skip_threads_80046)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_80047) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_80000)] =\n                            x_80038;\n                        x_80039 = x_80038;\n                    }\n                }\n                if (sle32(wave_sizze_80002, skip_threads_80046)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_80046 *= 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_80000 - squot32(local_tid_80000, 32) * 32) == 31 &&\n                ltid_in_bounds_80045) {\n                ((volatile __local\n                  int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_80000,\n                                                                   32))] =\n                    x_80038;\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_80049;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_80000, 32) == 0 && ltid_in_bounds_80045) {\n                    x_80043 = ((volatile __local\n                                int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                  ",
            "                  (int64_t) 8) +\n                                                            sext_i32_i64(local_tid_80000)];\n                    if ((local_tid_80000 - squot32(local_tid_80000, 32) * 32) ==\n                        0) {\n                        x_80042 = x_80043;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_80049 = 1;\n                while (slt32(skip_threads_80049, 32)) {\n                    bool thread_active_80050 = sle32(skip_threads_80049,\n                                                     local_tid_80000 -\n                                                     squot32(local_tid_80000,\n                                                             32) * 32) &&\n                         (squot32(local_tid_80000, 32) == 0 &&\n                          ltid_in_bounds_80045);\n                    \n                    if (thread_active_80050) {\n                        // read operands\n                        {\n                            x_80042 = ((volatile __local\n                                        int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                                            (int64_t) 8) +\n                                                                    (sext_i32_i64(local_tid_80000) -\n                                                                     sext_i32_i64(skip_threads_80049))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_80051 = slt32(smod32((local_tid_80000 *\n                                                            32 + 32 - 1 + 1) *\n                                                           11 - 1 +\n                                                           segsizze_compact_80019 -\n                                                           boundary_80018,\n          ",
            "                                                 segsizze_compact_80019),\n                                                    (local_tid_80000 * 32 + 32 -\n                                                     1 + 1) * 11 - 1 -\n                                                    (((local_tid_80000 -\n                                                       skip_threads_80049) *\n                                                      32 + 32 - 1 + 1) * 11 -\n                                                     1));\n                        \n                        if (thread_active_80050 && inactive_80051) {\n                            x_80042 = x_80043;\n                        }\n                        if (thread_active_80050) {\n                            if (!inactive_80051) {\n                                int64_t defunc_1_op_res_80044 = add64(x_80042,\n                                                                      x_80043);\n                                \n                                x_80042 = defunc_1_op_res_80044;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_80002, skip_threads_80049)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_80050) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_80000)] =\n                                x_80042;\n                            x_80043 = x_80042;\n                        }\n                    }\n                    if (sle32(wave_sizze_80002, skip_threads_80049)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_800",
            "49 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_80052 = squot32(local_tid_80000, 32) == 0 ||\n             !ltid_in_bounds_80045;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_80052) {\n                    x_80039 = x_80038;\n                    x_80038 = ((__local\n                                int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                                    (int64_t) 8) +\n                                                            (sext_i32_i64(squot32(local_tid_80000,\n                                                                                  32)) -\n                                                             (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_80053 = slt32(smod32((local_tid_80000 + 1) * 11 -\n                                                   1 + segsizze_compact_80019 -\n                                                   boundary_80018,\n                                                   segsizze_compact_80019),\n                                            (local_tid_80000 + 1) * 11 - 1 -\n                                            ((squot32(local_tid_80000, 32) *\n                                              32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_80052) {\n                    if (inactive_80053) {\n                        x_80038 = x_80039;\n                    }\n                }\n                if (!no_carry_in_80052) {\n                    if (!inactive_80053) {\n                        int64_t defunc_1_op_res_80040 = add64(x_80038, x_80039);\n                        \n                        x_80038 = defunc_1_op_res_80040;\n                    }\n                }\n            }\n            // write final result",
            "\n            {\n                if (!no_carry_in_80052) {\n                    ((__local\n                      int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_80000)] =\n                        x_80038;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_80000, 32) == 0 && ltid_in_bounds_80045) {\n                ((__local\n                  int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_80000)] =\n                    x_80039;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_80000 == 0) {\n            acc_80041 = ((__local\n                          int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                              (int64_t) 8) +\n                                                      (segscan_group_sizze_74083 -\n                                                       (int64_t) 1)];\n        } else {\n            acc_80041 = ((__local\n                          int64_t *) local_mem_80008)[squot64(byte_offsets_80004,\n                                                              (int64_t) 8) +\n                                                      (sext_i32_i64(local_tid_80000) -\n                                                       (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_80054 = (int64_t) 0;\n    bool block_new_sgm_80055 = sgm_idx_80017 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_80055 && local_tid_80000 == 0) {\n            ((volatile __global\n              int",
            "64_t *) incprefixes_mem_79997)[dynamic_id_80015] = acc_80041;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_79993)[dynamic_id_80015] = (int8_t) 2;\n            acc_80041 = (int64_t) 0;\n        }\n        if (!block_new_sgm_80055 && slt32(local_tid_80000, wave_sizze_80002)) {\n            if (local_tid_80000 == 0) {\n                if (boundary_80018 == sext_i64_i32(segscan_group_sizze_74083 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_79995)[dynamic_id_80015] =\n                        acc_80041;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79993)[dynamic_id_80015] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79997)[dynamic_id_80015] =\n                        acc_80041;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79993)[dynamic_id_80015] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_80056;\n                \n                tmp_80056 = ((volatile __global\n                              int8_t *) status_flags_mem_79993)[dynamic_id_80015 -\n                                                                (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_80008)[(int64_t) 0] =\n                    tmp_80056;\n            }\n            mem_fence_local();\n            \n            int8_t status_80057;\n            \n            status_80057 = ((__local int8_t *) local_mem_80008)[(int64_t) 0];\n            if (status_80057 == (int8_t) 2) {\n                if (local_tid_80000 == 0) {\n                    prefix_80054 = ((volatile __global\n                                     int64_t *) incprefixes_mem_79997)[",
            "dynamic_id_80015 -\n                                                                       (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_80058 = dynamic_id_80015 -\n                        sext_i32_i64(wave_sizze_80002);\n                \n                while (slt32(wave_sizze_80002 * -1, readOffset_80058)) {\n                    int32_t read_i_80059 = readOffset_80058 + local_tid_80000;\n                    int64_t aggr_80060 = (int64_t) 0;\n                    int8_t flag_80061 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_80059)) {\n                        if (sle64(blockOff_80016 - (sext_i32_i64(read_i_80059 +\n                                                    1) *\n                                                    segscan_group_sizze_74083 *\n                                                    (int64_t) 11 - (int64_t) 1),\n                                  sgm_idx_80017)) {\n                            flag_80061 = ((volatile __global\n                                           int8_t *) status_flags_mem_79993)[sext_i32_i64(read_i_80059)];\n                            if (flag_80061 == (int8_t) 2) {\n                                aggr_80060 = ((volatile __global\n                                               int64_t *) incprefixes_mem_79997)[sext_i32_i64(read_i_80059)];\n                            } else {\n                                if (flag_80061 == (int8_t) 1) {\n                                    aggr_80060 = ((volatile __global\n                                                   int64_t *) aggregates_mem_79995)[sext_i32_i64(read_i_80059)];\n                                }\n                            }\n                        } else {\n                            flag_80061 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                ",
            "          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_80000)] =\n                        aggr_80060;\n                    ((__local\n                      int8_t *) local_mem_80008)[sext_i32_i64(local_tid_80000)] =\n                        flag_80061;\n                    flag_80061 = ((__local\n                                   int8_t *) local_mem_80008)[sext_i32_i64(wave_sizze_80002) -\n                                                              (int64_t) 1];\n                    if (slt8(flag_80061, (int8_t) 2)) {\n                        int8_t flg_x_80065;\n                        int8_t flg_y_80066;\n                        int64_t x_80062;\n                        int64_t x_80063;\n                        int32_t skip_threads_80067;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_80066 = ((volatile __local\n                                            int8_t *) local_mem_80008)[sext_i32_i64(local_tid_80000)];\n                            x_80063 = ((volatile __local\n                                        int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                                            (int64_t) 8) +\n                                                                    sext_i32_i64(local_tid_80000)];\n                            if ((local_tid_80000 - squot32(local_tid_80000,\n                                                           32) * 32) == 0) {\n                                x_80062 = x_80063;\n                                flg_x_80065 = flg_y_80066;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_80067 = 1;\n                            while (slt32(skip_threads_80067, 32)) {\n                                if (sle32(skip_threads_80067",
            ", local_tid_80000 -\n                                          squot32(local_tid_80000, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_80065 = ((volatile __local\n                                                        int8_t *) local_mem_80008)[sext_i32_i64(local_tid_80000) -\n                                                                                   sext_i32_i64(skip_threads_80067)];\n                                        x_80062 = ((volatile __local\n                                                    int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                                                        (int64_t) 8) +\n                                                                                (sext_i32_i64(local_tid_80000) -\n                                                                                 sext_i32_i64(skip_threads_80067))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_80066 == (int8_t) 2 ||\n                                            flg_y_80066 == (int8_t) 0) {\n                                            flg_x_80065 = flg_y_80066;\n                                            x_80062 = x_80063;\n                                        } else {\n                                            int64_t defunc_1_op_res_80064 =\n                                                    add64(x_80062, x_80063);\n                                            \n                                            x_80062 = defunc_1_op_res_80064;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                       ",
            "                   int8_t *) local_mem_80008)[sext_i32_i64(local_tid_80000)] =\n                                            flg_x_80065;\n                                        flg_y_80066 = flg_x_80065;\n                                        ((volatile __local\n                                          int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_80000)] =\n                                            x_80062;\n                                        x_80063 = x_80062;\n                                    }\n                                }\n                                skip_threads_80067 *= 2;\n                            }\n                        }\n                    }\n                    flag_80061 = ((__local\n                                   int8_t *) local_mem_80008)[sext_i32_i64(wave_sizze_80002) -\n                                                              (int64_t) 1];\n                    aggr_80060 = ((__local\n                                   int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                                       (int64_t) 8) +\n                                                               (sext_i32_i64(wave_sizze_80002) -\n                                                                (int64_t) 1)];\n                    if (flag_80061 == (int8_t) 2) {\n                        readOffset_80058 = wave_sizze_80002 * -1;\n                    } else {\n                        if (flag_80061 == (int8_t) 1) {\n                            readOffset_80058 -= wave_sizze_80002;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_80061)) {\n                        int64_t x_80068 = aggr_80060;\n                        int64_t x_80069 = prefix_80054;\n                        ",
            "int64_t defunc_1_op_res_80070 = add64(x_80068, x_80069);\n                        \n                        prefix_80054 = defunc_1_op_res_80070;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_80000 == 0) {\n                if (boundary_80018 == sext_i64_i32(segscan_group_sizze_74083 *\n                    (int64_t) 11)) {\n                    int64_t x_80071 = prefix_80054;\n                    int64_t x_80072 = acc_80041;\n                    int64_t defunc_1_op_res_80073 = add64(x_80071, x_80072);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_79997)[dynamic_id_80015] =\n                        defunc_1_op_res_80073;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_79993)[dynamic_id_80015] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                      (int64_t) 8)] =\n                    prefix_80054;\n                acc_80041 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_80015 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_80054 = ((__local\n                             int64_t *) local_mem_80008)[squot64(warp_byte_offset_80006,\n                                                                 (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_80074;\n        int64_t x_80075;\n        int64_t x_80077 = prefix_80054;\n        int64_t x_80078 = acc_80041;\n        \n        if (slt32(local_tid_80000 * 11, boundary_80018) &&\n            !block_new_sgm_80055) {\n            int64_t defunc_1_op_res_80079 = add64(x_80077, x_80078);\n            \n            x_80074 = defunc_1_op_res_80079;\n        } else {",
            "\n            x_80074 = acc_80041;\n        }\n        \n        int32_t stopping_point_80080 = segsizze_compact_80019 -\n                srem32(local_tid_80000 * 11 - 1 + segsizze_compact_80019 -\n                       boundary_80018, segsizze_compact_80019);\n        \n        for (int64_t i_80081 = 0; i_80081 < (int64_t) 11; i_80081++) {\n            if (slt32(sext_i64_i32(i_80081), stopping_point_80080 - 1)) {\n                x_80075 = private_mem_80020[i_80081];\n                \n                int64_t defunc_1_op_res_80076 = add64(x_80074, x_80075);\n                \n                private_mem_80020[i_80081] = defunc_1_op_res_80076;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_80082 = 0; i_80082 < (int64_t) 11; i_80082++) {\n            int64_t sharedIdx_80083 = sext_i32_i64(local_tid_80000 * 11) +\n                    i_80082;\n            int64_t tmp_80084;\n            \n            tmp_80084 = private_mem_80020[i_80082];\n            ((__local int64_t *) local_mem_80008)[sharedIdx_80083] = tmp_80084;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_80085 = 0; i_80085 < (int64_t) 11; i_80085++) {\n            int64_t flat_idx_80086 = blockOff_80016 +\n                    segscan_group_sizze_74083 * i_80085 +\n                    sext_i32_i64(local_tid_80000);\n            int64_t slice_80087 = n_65344;\n            int64_t slice_80088 = m_65343 * slice_80087;\n            int64_t gtid_74087 = squot64(flat_idx_80086, slice_80087);\n            int64_t remnant_80089 = flat_idx_80086 - gtid_74087 * slice_80087;\n            int64_t gtid_74088 = remnant_80089;\n            int64_t remnant_80090 = remnant_80089 - gtid_74088;\n            \n            if (slt64(flat_idx_80086, m_65343 * n_65344)) {\n                int64_t tmp_80091;\n                \n                tmp_80091 = ((__local\n                              int64_t *) local_mem_80008)[flat_idx_80086 -\n            ",
            "                                              blockOff_80016];\n                ((__global int64_t *) mem_77934)[gtid_74087 * n_65344 +\n                                                 gtid_74088] = tmp_80091;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_80015 == sdiv_up64(m_65343 * n_65344,\n                                          segscan_group_sizze_74083 *\n                                          (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_79991)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_74083\n}\n",
            NULL};
static const char *tuning_param_names[] =
                  {"builtin#replicate_f32.group_size_78278",
                   "builtin#replicate_i64.group_size_78442",
                   "builtin#replicate_i8.group_size_78337",
                   "main.segmap_group_size_66697",
                   "main.segmap_group_size_67289",
                   "main.segmap_group_size_67347",
                   "main.segmap_group_size_67661",
                   "main.segmap_group_size_67686",
                   "main.segmap_group_size_67712",
                   "main.segmap_group_size_67738",
                   "main.segmap_group_size_68324",
                   "main.segmap_group_size_69026",
                   "main.segmap_group_size_69101",
                   "main.segmap_group_size_69452",
                   "main.segmap_group_size_69477",
                   "main.segmap_group_size_69503",
                   "main.segmap_group_size_69529",
                   "main.segmap_group_size_70183",
                   "main.segmap_group_size_70998",
                   "main.segmap_group_size_71100",
                   "main.segmap_group_size_71491",
                   "main.segmap_group_size_71516",
                   "main.segmap_group_size_71542",
                   "main.segmap_group_size_71568",
                   "main.segmap_group_size_72476",
                   "main.segmap_group_size_72501",
                   "main.segmap_group_size_72527",
                   "main.segmap_group_size_72553",
                   "main.segmap_group_size_73143",
                   "main.segmap_group_size_73168",
                   "main.segmap_group_size_73194",
                   "main.segmap_group_size_73220",
                   "main.segmap_group_size_73900",
                   "main.segmap_group_size_73925",
                   "main.segmap_group_size_73951",
                   "main.segmap_group_size_73977",
                   "main.segmap_group_size_74432",
                   "main.segmap_num_groups_66699",
                   "main.segmap_num_groups_68326",
                   "main.segmap_num_groups_70185",
                   "main.segred_group_size_67234",
                   "main.segred_group_size_67302",
                   "main.segred_group_size_68953",
                   "main.segred_group_size_69048",
                   "main.segred_group_size_70912",
                   "main.segred_group_size_71039",
                   "main.segred_num_groups_67236",
                   "main.segred_num_groups_67304",
                   "main.segred_num_groups_68955",
                   "main.segred_num_groups_69050",
                   "main.segred_num_groups_70914",
                   "main.segred_num_groups_71041",
                   "main.segscan_group_size_67824",
                   "main.segscan_group_size_69615",
                   "main.segscan_group_size_71654",
                   "main.segscan_group_size_72639",
                   "main.segscan_group_size_73306",
                   "main.segscan_group_size_74063",
                   "main.segscan_num_groups_67826",
                   "main.segscan_num_groups_69617",
                   "main.segscan_num_groups_71656",
                   "main.segscan_num_groups_72641",
                   "main.segscan_num_groups_73308",
                   "main.segscan_num_groups_74065", "main.suff_outer_par_0",
                   "main.suff_outer_par_1", "main.suff_outer_par_2",
                   "main.suff_outer_par_3", "main.suff_outer_par_4",
                   "main.suff_outer_par_5", "main.tile_size_74752",
                   "main.tile_size_75306", "main.tile_size_75977"};
static const char *tuning_param_vars[] =
                  {"builtinzhreplicate_f32zigroup_sizze_78278",
                   "builtinzhreplicate_i64zigroup_sizze_78442",
                   "builtinzhreplicate_i8zigroup_sizze_78337",
                   "mainzisegmap_group_sizze_66697",
                   "mainzisegmap_group_sizze_67289",
                   "mainzisegmap_group_sizze_67347",
                   "mainzisegmap_group_sizze_67661",
                   "mainzisegmap_group_sizze_67686",
                   "mainzisegmap_group_sizze_67712",
                   "mainzisegmap_group_sizze_67738",
                   "mainzisegmap_group_sizze_68324",
                   "mainzisegmap_group_sizze_69026",
                   "mainzisegmap_group_sizze_69101",
                   "mainzisegmap_group_sizze_69452",
                   "mainzisegmap_group_sizze_69477",
                   "mainzisegmap_group_sizze_69503",
                   "mainzisegmap_group_sizze_69529",
                   "mainzisegmap_group_sizze_70183",
                   "mainzisegmap_group_sizze_70998",
                   "mainzisegmap_group_sizze_71100",
                   "mainzisegmap_group_sizze_71491",
                   "mainzisegmap_group_sizze_71516",
                   "mainzisegmap_group_sizze_71542",
                   "mainzisegmap_group_sizze_71568",
                   "mainzisegmap_group_sizze_72476",
                   "mainzisegmap_group_sizze_72501",
                   "mainzisegmap_group_sizze_72527",
                   "mainzisegmap_group_sizze_72553",
                   "mainzisegmap_group_sizze_73143",
                   "mainzisegmap_group_sizze_73168",
                   "mainzisegmap_group_sizze_73194",
                   "mainzisegmap_group_sizze_73220",
                   "mainzisegmap_group_sizze_73900",
                   "mainzisegmap_group_sizze_73925",
                   "mainzisegmap_group_sizze_73951",
                   "mainzisegmap_group_sizze_73977",
                   "mainzisegmap_group_sizze_74432",
                   "mainzisegmap_num_groups_66699",
                   "mainzisegmap_num_groups_68326",
                   "mainzisegmap_num_groups_70185",
                   "mainzisegred_group_sizze_67234",
                   "mainzisegred_group_sizze_67302",
                   "mainzisegred_group_sizze_68953",
                   "mainzisegred_group_sizze_69048",
                   "mainzisegred_group_sizze_70912",
                   "mainzisegred_group_sizze_71039",
                   "mainzisegred_num_groups_67236",
                   "mainzisegred_num_groups_67304",
                   "mainzisegred_num_groups_68955",
                   "mainzisegred_num_groups_69050",
                   "mainzisegred_num_groups_70914",
                   "mainzisegred_num_groups_71041",
                   "mainzisegscan_group_sizze_67824",
                   "mainzisegscan_group_sizze_69615",
                   "mainzisegscan_group_sizze_71654",
                   "mainzisegscan_group_sizze_72639",
                   "mainzisegscan_group_sizze_73306",
                   "mainzisegscan_group_sizze_74063",
                   "mainzisegscan_num_groups_67826",
                   "mainzisegscan_num_groups_69617",
                   "mainzisegscan_num_groups_71656",
                   "mainzisegscan_num_groups_72641",
                   "mainzisegscan_num_groups_73308",
                   "mainzisegscan_num_groups_74065", "mainzisuff_outer_par_0",
                   "mainzisuff_outer_par_1", "mainzisuff_outer_par_2",
                   "mainzisuff_outer_par_3", "mainzisuff_outer_par_4",
                   "mainzisuff_outer_par_5", "mainzitile_sizze_74752",
                   "mainzitile_sizze_75306", "mainzitile_sizze_75977"};
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", "num_groups",
                                             "num_groups", "num_groups",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "num_groups", "num_groups",
                                             "num_groups", "num_groups",
                                             "num_groups", "num_groups",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "num_groups", "num_groups",
                                             "num_groups", "num_groups",
                                             "num_groups", "num_groups",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_0)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_2)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_4)",
                                             "tile_size", "tile_size",
                                             "tile_size"};
struct tuning_params {
    int64_t *builtinzhreplicate_f32zigroup_sizze_78278;
    int64_t *builtinzhreplicate_i64zigroup_sizze_78442;
    int64_t *builtinzhreplicate_i8zigroup_sizze_78337;
    int64_t *mainzisegmap_group_sizze_66697;
    int64_t *mainzisegmap_group_sizze_67289;
    int64_t *mainzisegmap_group_sizze_67347;
    int64_t *mainzisegmap_group_sizze_67661;
    int64_t *mainzisegmap_group_sizze_67686;
    int64_t *mainzisegmap_group_sizze_67712;
    int64_t *mainzisegmap_group_sizze_67738;
    int64_t *mainzisegmap_group_sizze_68324;
    int64_t *mainzisegmap_group_sizze_69026;
    int64_t *mainzisegmap_group_sizze_69101;
    int64_t *mainzisegmap_group_sizze_69452;
    int64_t *mainzisegmap_group_sizze_69477;
    int64_t *mainzisegmap_group_sizze_69503;
    int64_t *mainzisegmap_group_sizze_69529;
    int64_t *mainzisegmap_group_sizze_70183;
    int64_t *mainzisegmap_group_sizze_70998;
    int64_t *mainzisegmap_group_sizze_71100;
    int64_t *mainzisegmap_group_sizze_71491;
    int64_t *mainzisegmap_group_sizze_71516;
    int64_t *mainzisegmap_group_sizze_71542;
    int64_t *mainzisegmap_group_sizze_71568;
    int64_t *mainzisegmap_group_sizze_72476;
    int64_t *mainzisegmap_group_sizze_72501;
    int64_t *mainzisegmap_group_sizze_72527;
    int64_t *mainzisegmap_group_sizze_72553;
    int64_t *mainzisegmap_group_sizze_73143;
    int64_t *mainzisegmap_group_sizze_73168;
    int64_t *mainzisegmap_group_sizze_73194;
    int64_t *mainzisegmap_group_sizze_73220;
    int64_t *mainzisegmap_group_sizze_73900;
    int64_t *mainzisegmap_group_sizze_73925;
    int64_t *mainzisegmap_group_sizze_73951;
    int64_t *mainzisegmap_group_sizze_73977;
    int64_t *mainzisegmap_group_sizze_74432;
    int64_t *mainzisegmap_num_groups_66699;
    int64_t *mainzisegmap_num_groups_68326;
    int64_t *mainzisegmap_num_groups_70185;
    int64_t *mainzisegred_group_sizze_67234;
    int64_t *mainzisegred_group_sizze_67302;
    int64_t *mainzisegred_group_sizze_68953;
    int64_t *mainzisegred_group_sizze_69048;
    int64_t *mainzisegred_group_sizze_70912;
    int64_t *mainzisegred_group_sizze_71039;
    int64_t *mainzisegred_num_groups_67236;
    int64_t *mainzisegred_num_groups_67304;
    int64_t *mainzisegred_num_groups_68955;
    int64_t *mainzisegred_num_groups_69050;
    int64_t *mainzisegred_num_groups_70914;
    int64_t *mainzisegred_num_groups_71041;
    int64_t *mainzisegscan_group_sizze_67824;
    int64_t *mainzisegscan_group_sizze_69615;
    int64_t *mainzisegscan_group_sizze_71654;
    int64_t *mainzisegscan_group_sizze_72639;
    int64_t *mainzisegscan_group_sizze_73306;
    int64_t *mainzisegscan_group_sizze_74063;
    int64_t *mainzisegscan_num_groups_67826;
    int64_t *mainzisegscan_num_groups_69617;
    int64_t *mainzisegscan_num_groups_71656;
    int64_t *mainzisegscan_num_groups_72641;
    int64_t *mainzisegscan_num_groups_73308;
    int64_t *mainzisegscan_num_groups_74065;
    int64_t *mainzisuff_outer_par_0;
    int64_t *mainzisuff_outer_par_1;
    int64_t *mainzisuff_outer_par_2;
    int64_t *mainzisuff_outer_par_3;
    int64_t *mainzisuff_outer_par_4;
    int64_t *mainzisuff_outer_par_5;
    int64_t *mainzitile_sizze_74752;
    int64_t *mainzitile_sizze_75306;
    int64_t *mainzitile_sizze_75977;
};
struct futhark_context_config {
    int in_use;
    struct cuda_config cu_cfg;
    int profiling;
    int64_t tuning_params[73];
    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;
    cuda_config_init(&cfg->cu_cfg, 73, 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 < 73; 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_78322;
    struct memblock_device mainzicounter_mem_78572;
    struct memblock_device mainzicounter_mem_78654;
    struct memblock_device mainziid_counter_mem_78737;
    struct memblock_device mainzicounter_mem_78999;
    struct memblock_device mainzicounter_mem_79101;
    struct memblock_device mainziid_counter_mem_79192;
    struct memblock_device mainzicounter_mem_79486;
    struct memblock_device mainzicounter_mem_79600;
    struct memblock_device mainziid_counter_mem_79647;
    struct memblock_device mainziid_counter_mem_79816;
    struct memblock_device mainziid_counter_mem_79991;
    CUfunction builtinzhreplicate_f32zireplicate_78275;
    int64_t builtinzhreplicate_f32zireplicate_78275_total_runtime;
    int builtinzhreplicate_f32zireplicate_78275_runs;
    CUfunction builtinzhreplicate_i64zireplicate_78439;
    int64_t builtinzhreplicate_i64zireplicate_78439_total_runtime;
    int builtinzhreplicate_i64zireplicate_78439_runs;
    CUfunction builtinzhreplicate_i8zireplicate_78334;
    int64_t builtinzhreplicate_i8zireplicate_78334_total_runtime;
    int builtinzhreplicate_i8zireplicate_78334_runs;
    CUfunction gpu_map_transpose_f32;
    int64_t gpu_map_transpose_f32_total_runtime;
    int gpu_map_transpose_f32_runs;
    CUfunction gpu_map_transpose_f32_low_height;
    int64_t gpu_map_transpose_f32_low_height_total_runtime;
    int gpu_map_transpose_f32_low_height_runs;
    CUfunction gpu_map_transpose_f32_low_width;
    int64_t gpu_map_transpose_f32_low_width_total_runtime;
    int gpu_map_transpose_f32_low_width_runs;
    CUfunction gpu_map_transpose_f32_small;
    int64_t gpu_map_transpose_f32_small_total_runtime;
    int gpu_map_transpose_f32_small_runs;
    CUfunction mainzisegmap_66881;
    int64_t mainzisegmap_66881_total_runtime;
    int mainzisegmap_66881_runs;
    CUfunction mainzisegmap_67903;
    int64_t mainzisegmap_67903_total_runtime;
    int mainzisegmap_67903_runs;
    CUfunction mainzisegmap_67922;
    int64_t mainzisegmap_67922_total_runtime;
    int mainzisegmap_67922_runs;
    CUfunction mainzisegmap_67934;
    int64_t mainzisegmap_67934_total_runtime;
    int mainzisegmap_67934_runs;
    CUfunction mainzisegmap_67954;
    int64_t mainzisegmap_67954_total_runtime;
    int mainzisegmap_67954_runs;
    CUfunction mainzisegmap_68125;
    int64_t mainzisegmap_68125_total_runtime;
    int mainzisegmap_68125_runs;
    CUfunction mainzisegmap_68266;
    int64_t mainzisegmap_68266_total_runtime;
    int mainzisegmap_68266_runs;
    CUfunction mainzisegmap_68538;
    int64_t mainzisegmap_68538_total_runtime;
    int mainzisegmap_68538_runs;
    CUfunction mainzisegmap_69694;
    int64_t mainzisegmap_69694_total_runtime;
    int mainzisegmap_69694_runs;
    CUfunction mainzisegmap_69713;
    int64_t mainzisegmap_69713_total_runtime;
    int mainzisegmap_69713_runs;
    CUfunction mainzisegmap_69725;
    int64_t mainzisegmap_69725_total_runtime;
    int mainzisegmap_69725_runs;
    CUfunction mainzisegmap_69745;
    int64_t mainzisegmap_69745_total_runtime;
    int mainzisegmap_69745_runs;
    CUfunction mainzisegmap_69946;
    int64_t mainzisegmap_69946_total_runtime;
    int mainzisegmap_69946_runs;
    CUfunction mainzisegmap_70099;
    int64_t mainzisegmap_70099_total_runtime;
    int mainzisegmap_70099_runs;
    CUfunction mainzisegmap_70429;
    int64_t mainzisegmap_70429_total_runtime;
    int mainzisegmap_70429_runs;
    CUfunction mainzisegmap_71733;
    int64_t mainzisegmap_71733_total_runtime;
    int mainzisegmap_71733_runs;
    CUfunction mainzisegmap_71752;
    int64_t mainzisegmap_71752_total_runtime;
    int mainzisegmap_71752_runs;
    CUfunction mainzisegmap_71764;
    int64_t mainzisegmap_71764_total_runtime;
    int mainzisegmap_71764_runs;
    CUfunction mainzisegmap_71784;
    int64_t mainzisegmap_71784_total_runtime;
    int mainzisegmap_71784_runs;
    CUfunction mainzisegmap_72017;
    int64_t mainzisegmap_72017_total_runtime;
    int mainzisegmap_72017_runs;
    CUfunction mainzisegmap_72182;
    int64_t mainzisegmap_72182_total_runtime;
    int mainzisegmap_72182_runs;
    CUfunction mainzisegmap_72718;
    int64_t mainzisegmap_72718_total_runtime;
    int mainzisegmap_72718_runs;
    CUfunction mainzisegmap_72737;
    int64_t mainzisegmap_72737_total_runtime;
    int mainzisegmap_72737_runs;
    CUfunction mainzisegmap_72749;
    int64_t mainzisegmap_72749_total_runtime;
    int mainzisegmap_72749_runs;
    CUfunction mainzisegmap_72769;
    int64_t mainzisegmap_72769_total_runtime;
    int mainzisegmap_72769_runs;
    CUfunction mainzisegmap_73385;
    int64_t mainzisegmap_73385_total_runtime;
    int mainzisegmap_73385_runs;
    CUfunction mainzisegmap_73404;
    int64_t mainzisegmap_73404_total_runtime;
    int mainzisegmap_73404_runs;
    CUfunction mainzisegmap_73416;
    int64_t mainzisegmap_73416_total_runtime;
    int mainzisegmap_73416_runs;
    CUfunction mainzisegmap_73436;
    int64_t mainzisegmap_73436_total_runtime;
    int mainzisegmap_73436_runs;
    CUfunction mainzisegmap_74142;
    int64_t mainzisegmap_74142_total_runtime;
    int mainzisegmap_74142_runs;
    CUfunction mainzisegmap_74161;
    int64_t mainzisegmap_74161_total_runtime;
    int mainzisegmap_74161_runs;
    CUfunction mainzisegmap_74173;
    int64_t mainzisegmap_74173_total_runtime;
    int mainzisegmap_74173_runs;
    CUfunction mainzisegmap_74193;
    int64_t mainzisegmap_74193_total_runtime;
    int mainzisegmap_74193_runs;
    CUfunction mainzisegmap_74555;
    int64_t mainzisegmap_74555_total_runtime;
    int mainzisegmap_74555_runs;
    CUfunction mainzisegmap_intragroup_72785;
    int64_t mainzisegmap_intragroup_72785_total_runtime;
    int mainzisegmap_intragroup_72785_runs;
    CUfunction mainzisegmap_intragroup_73453;
    int64_t mainzisegmap_intragroup_73453_total_runtime;
    int mainzisegmap_intragroup_73453_runs;
    CUfunction mainzisegmap_intragroup_74210;
    int64_t mainzisegmap_intragroup_74210_total_runtime;
    int mainzisegmap_intragroup_74210_runs;
    CUfunction mainzisegmap_intragroup_74758;
    int64_t mainzisegmap_intragroup_74758_total_runtime;
    int mainzisegmap_intragroup_74758_runs;
    CUfunction mainzisegmap_intragroup_75312;
    int64_t mainzisegmap_intragroup_75312_total_runtime;
    int mainzisegmap_intragroup_75312_runs;
    CUfunction mainzisegmap_intragroup_75983;
    int64_t mainzisegmap_intragroup_75983_total_runtime;
    int mainzisegmap_intragroup_75983_runs;
    CUfunction mainzisegred_large_68229;
    int64_t mainzisegred_large_68229_total_runtime;
    int mainzisegred_large_68229_runs;
    CUfunction mainzisegred_large_68279;
    int64_t mainzisegred_large_68279_total_runtime;
    int mainzisegred_large_68279_runs;
    CUfunction mainzisegred_large_70052;
    int64_t mainzisegred_large_70052_total_runtime;
    int mainzisegred_large_70052_runs;
    CUfunction mainzisegred_large_70122;
    int64_t mainzisegred_large_70122_total_runtime;
    int mainzisegred_large_70122_runs;
    CUfunction mainzisegred_large_72125;
    int64_t mainzisegred_large_72125_total_runtime;
    int mainzisegred_large_72125_runs;
    CUfunction mainzisegred_large_72224;
    int64_t mainzisegred_large_72224_total_runtime;
    int mainzisegred_large_72224_runs;
    CUfunction mainzisegred_small_68229;
    int64_t mainzisegred_small_68229_total_runtime;
    int mainzisegred_small_68229_runs;
    CUfunction mainzisegred_small_68279;
    int64_t mainzisegred_small_68279_total_runtime;
    int mainzisegred_small_68279_runs;
    CUfunction mainzisegred_small_70052;
    int64_t mainzisegred_small_70052_total_runtime;
    int mainzisegred_small_70052_runs;
    CUfunction mainzisegred_small_70122;
    int64_t mainzisegred_small_70122_total_runtime;
    int mainzisegred_small_70122_runs;
    CUfunction mainzisegred_small_72125;
    int64_t mainzisegred_small_72125_total_runtime;
    int mainzisegred_small_72125_runs;
    CUfunction mainzisegred_small_72224;
    int64_t mainzisegred_small_72224_total_runtime;
    int mainzisegred_small_72224_runs;
    CUfunction mainzisegscan_67850;
    int64_t mainzisegscan_67850_total_runtime;
    int mainzisegscan_67850_runs;
    CUfunction mainzisegscan_69641;
    int64_t mainzisegscan_69641_total_runtime;
    int mainzisegscan_69641_runs;
    CUfunction mainzisegscan_71680;
    int64_t mainzisegscan_71680_total_runtime;
    int mainzisegscan_71680_runs;
    CUfunction mainzisegscan_72665;
    int64_t mainzisegscan_72665_total_runtime;
    int mainzisegscan_72665_runs;
    CUfunction mainzisegscan_73332;
    int64_t mainzisegscan_73332_total_runtime;
    int mainzisegscan_73332_runs;
    CUfunction mainzisegscan_74089;
    int64_t mainzisegscan_74089_total_runtime;
    int mainzisegscan_74089_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) *
                                  (2 + 1)));
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_f32zireplicate_78275,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_f32zireplicate_78275"));
    ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime = 0;
    ctx->builtinzhreplicate_f32zireplicate_78275_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_i64zireplicate_78439,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_i64zireplicate_78439"));
    ctx->builtinzhreplicate_i64zireplicate_78439_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_78439_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_i8zireplicate_78334,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_i8zireplicate_78334"));
    ctx->builtinzhreplicate_i8zireplicate_78334_total_runtime = 0;
    ctx->builtinzhreplicate_i8zireplicate_78334_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f32,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f32"));
    ctx->gpu_map_transpose_f32_total_runtime = 0;
    ctx->gpu_map_transpose_f32_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f32_low_height,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f32_low_height"));
    ctx->gpu_map_transpose_f32_low_height_total_runtime = 0;
    ctx->gpu_map_transpose_f32_low_height_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f32_low_width,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f32_low_width"));
    ctx->gpu_map_transpose_f32_low_width_total_runtime = 0;
    ctx->gpu_map_transpose_f32_low_width_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f32_small,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f32_small"));
    ctx->gpu_map_transpose_f32_small_total_runtime = 0;
    ctx->gpu_map_transpose_f32_small_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_66881,
                                           ctx->cuda.module,
                                           "mainzisegmap_66881"));
    ctx->mainzisegmap_66881_total_runtime = 0;
    ctx->mainzisegmap_66881_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_67903,
                                           ctx->cuda.module,
                                           "mainzisegmap_67903"));
    ctx->mainzisegmap_67903_total_runtime = 0;
    ctx->mainzisegmap_67903_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_67922,
                                           ctx->cuda.module,
                                           "mainzisegmap_67922"));
    ctx->mainzisegmap_67922_total_runtime = 0;
    ctx->mainzisegmap_67922_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_67934,
                                           ctx->cuda.module,
                                           "mainzisegmap_67934"));
    ctx->mainzisegmap_67934_total_runtime = 0;
    ctx->mainzisegmap_67934_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_67954,
                                           ctx->cuda.module,
                                           "mainzisegmap_67954"));
    ctx->mainzisegmap_67954_total_runtime = 0;
    ctx->mainzisegmap_67954_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_68125,
                                           ctx->cuda.module,
                                           "mainzisegmap_68125"));
    ctx->mainzisegmap_68125_total_runtime = 0;
    ctx->mainzisegmap_68125_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_68266,
                                           ctx->cuda.module,
                                           "mainzisegmap_68266"));
    ctx->mainzisegmap_68266_total_runtime = 0;
    ctx->mainzisegmap_68266_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_68538,
                                           ctx->cuda.module,
                                           "mainzisegmap_68538"));
    ctx->mainzisegmap_68538_total_runtime = 0;
    ctx->mainzisegmap_68538_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_69694,
                                           ctx->cuda.module,
                                           "mainzisegmap_69694"));
    ctx->mainzisegmap_69694_total_runtime = 0;
    ctx->mainzisegmap_69694_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_69713,
                                           ctx->cuda.module,
                                           "mainzisegmap_69713"));
    ctx->mainzisegmap_69713_total_runtime = 0;
    ctx->mainzisegmap_69713_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_69725,
                                           ctx->cuda.module,
                                           "mainzisegmap_69725"));
    ctx->mainzisegmap_69725_total_runtime = 0;
    ctx->mainzisegmap_69725_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_69745,
                                           ctx->cuda.module,
                                           "mainzisegmap_69745"));
    ctx->mainzisegmap_69745_total_runtime = 0;
    ctx->mainzisegmap_69745_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_69946,
                                           ctx->cuda.module,
                                           "mainzisegmap_69946"));
    ctx->mainzisegmap_69946_total_runtime = 0;
    ctx->mainzisegmap_69946_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_70099,
                                           ctx->cuda.module,
                                           "mainzisegmap_70099"));
    ctx->mainzisegmap_70099_total_runtime = 0;
    ctx->mainzisegmap_70099_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_70429,
                                           ctx->cuda.module,
                                           "mainzisegmap_70429"));
    ctx->mainzisegmap_70429_total_runtime = 0;
    ctx->mainzisegmap_70429_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_71733,
                                           ctx->cuda.module,
                                           "mainzisegmap_71733"));
    ctx->mainzisegmap_71733_total_runtime = 0;
    ctx->mainzisegmap_71733_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_71752,
                                           ctx->cuda.module,
                                           "mainzisegmap_71752"));
    ctx->mainzisegmap_71752_total_runtime = 0;
    ctx->mainzisegmap_71752_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_71764,
                                           ctx->cuda.module,
                                           "mainzisegmap_71764"));
    ctx->mainzisegmap_71764_total_runtime = 0;
    ctx->mainzisegmap_71764_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_71784,
                                           ctx->cuda.module,
                                           "mainzisegmap_71784"));
    ctx->mainzisegmap_71784_total_runtime = 0;
    ctx->mainzisegmap_71784_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_72017,
                                           ctx->cuda.module,
                                           "mainzisegmap_72017"));
    ctx->mainzisegmap_72017_total_runtime = 0;
    ctx->mainzisegmap_72017_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_72182,
                                           ctx->cuda.module,
                                           "mainzisegmap_72182"));
    ctx->mainzisegmap_72182_total_runtime = 0;
    ctx->mainzisegmap_72182_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_72718,
                                           ctx->cuda.module,
                                           "mainzisegmap_72718"));
    ctx->mainzisegmap_72718_total_runtime = 0;
    ctx->mainzisegmap_72718_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_72737,
                                           ctx->cuda.module,
                                           "mainzisegmap_72737"));
    ctx->mainzisegmap_72737_total_runtime = 0;
    ctx->mainzisegmap_72737_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_72749,
                                           ctx->cuda.module,
                                           "mainzisegmap_72749"));
    ctx->mainzisegmap_72749_total_runtime = 0;
    ctx->mainzisegmap_72749_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_72769,
                                           ctx->cuda.module,
                                           "mainzisegmap_72769"));
    ctx->mainzisegmap_72769_total_runtime = 0;
    ctx->mainzisegmap_72769_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_73385,
                                           ctx->cuda.module,
                                           "mainzisegmap_73385"));
    ctx->mainzisegmap_73385_total_runtime = 0;
    ctx->mainzisegmap_73385_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_73404,
                                           ctx->cuda.module,
                                           "mainzisegmap_73404"));
    ctx->mainzisegmap_73404_total_runtime = 0;
    ctx->mainzisegmap_73404_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_73416,
                                           ctx->cuda.module,
                                           "mainzisegmap_73416"));
    ctx->mainzisegmap_73416_total_runtime = 0;
    ctx->mainzisegmap_73416_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_73436,
                                           ctx->cuda.module,
                                           "mainzisegmap_73436"));
    ctx->mainzisegmap_73436_total_runtime = 0;
    ctx->mainzisegmap_73436_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_74142,
                                           ctx->cuda.module,
                                           "mainzisegmap_74142"));
    ctx->mainzisegmap_74142_total_runtime = 0;
    ctx->mainzisegmap_74142_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_74161,
                                           ctx->cuda.module,
                                           "mainzisegmap_74161"));
    ctx->mainzisegmap_74161_total_runtime = 0;
    ctx->mainzisegmap_74161_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_74173,
                                           ctx->cuda.module,
                                           "mainzisegmap_74173"));
    ctx->mainzisegmap_74173_total_runtime = 0;
    ctx->mainzisegmap_74173_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_74193,
                                           ctx->cuda.module,
                                           "mainzisegmap_74193"));
    ctx->mainzisegmap_74193_total_runtime = 0;
    ctx->mainzisegmap_74193_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_74555,
                                           ctx->cuda.module,
                                           "mainzisegmap_74555"));
    ctx->mainzisegmap_74555_total_runtime = 0;
    ctx->mainzisegmap_74555_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_72785,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_72785"));
    ctx->mainzisegmap_intragroup_72785_total_runtime = 0;
    ctx->mainzisegmap_intragroup_72785_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_73453,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_73453"));
    ctx->mainzisegmap_intragroup_73453_total_runtime = 0;
    ctx->mainzisegmap_intragroup_73453_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_74210,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_74210"));
    ctx->mainzisegmap_intragroup_74210_total_runtime = 0;
    ctx->mainzisegmap_intragroup_74210_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_74758,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_74758"));
    ctx->mainzisegmap_intragroup_74758_total_runtime = 0;
    ctx->mainzisegmap_intragroup_74758_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_75312,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_75312"));
    ctx->mainzisegmap_intragroup_75312_total_runtime = 0;
    ctx->mainzisegmap_intragroup_75312_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_75983,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_75983"));
    ctx->mainzisegmap_intragroup_75983_total_runtime = 0;
    ctx->mainzisegmap_intragroup_75983_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_68229,
                                           ctx->cuda.module,
                                           "mainzisegred_large_68229"));
    ctx->mainzisegred_large_68229_total_runtime = 0;
    ctx->mainzisegred_large_68229_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_68279,
                                           ctx->cuda.module,
                                           "mainzisegred_large_68279"));
    ctx->mainzisegred_large_68279_total_runtime = 0;
    ctx->mainzisegred_large_68279_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_70052,
                                           ctx->cuda.module,
                                           "mainzisegred_large_70052"));
    ctx->mainzisegred_large_70052_total_runtime = 0;
    ctx->mainzisegred_large_70052_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_70122,
                                           ctx->cuda.module,
                                           "mainzisegred_large_70122"));
    ctx->mainzisegred_large_70122_total_runtime = 0;
    ctx->mainzisegred_large_70122_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_72125,
                                           ctx->cuda.module,
                                           "mainzisegred_large_72125"));
    ctx->mainzisegred_large_72125_total_runtime = 0;
    ctx->mainzisegred_large_72125_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_72224,
                                           ctx->cuda.module,
                                           "mainzisegred_large_72224"));
    ctx->mainzisegred_large_72224_total_runtime = 0;
    ctx->mainzisegred_large_72224_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_68229,
                                           ctx->cuda.module,
                                           "mainzisegred_small_68229"));
    ctx->mainzisegred_small_68229_total_runtime = 0;
    ctx->mainzisegred_small_68229_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_68279,
                                           ctx->cuda.module,
                                           "mainzisegred_small_68279"));
    ctx->mainzisegred_small_68279_total_runtime = 0;
    ctx->mainzisegred_small_68279_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_70052,
                                           ctx->cuda.module,
                                           "mainzisegred_small_70052"));
    ctx->mainzisegred_small_70052_total_runtime = 0;
    ctx->mainzisegred_small_70052_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_70122,
                                           ctx->cuda.module,
                                           "mainzisegred_small_70122"));
    ctx->mainzisegred_small_70122_total_runtime = 0;
    ctx->mainzisegred_small_70122_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_72125,
                                           ctx->cuda.module,
                                           "mainzisegred_small_72125"));
    ctx->mainzisegred_small_72125_total_runtime = 0;
    ctx->mainzisegred_small_72125_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_72224,
                                           ctx->cuda.module,
                                           "mainzisegred_small_72224"));
    ctx->mainzisegred_small_72224_total_runtime = 0;
    ctx->mainzisegred_small_72224_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_67850,
                                           ctx->cuda.module,
                                           "mainzisegscan_67850"));
    ctx->mainzisegscan_67850_total_runtime = 0;
    ctx->mainzisegscan_67850_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_69641,
                                           ctx->cuda.module,
                                           "mainzisegscan_69641"));
    ctx->mainzisegscan_69641_total_runtime = 0;
    ctx->mainzisegscan_69641_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_71680,
                                           ctx->cuda.module,
                                           "mainzisegscan_71680"));
    ctx->mainzisegscan_71680_total_runtime = 0;
    ctx->mainzisegscan_71680_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_72665,
                                           ctx->cuda.module,
                                           "mainzisegscan_72665"));
    ctx->mainzisegscan_72665_total_runtime = 0;
    ctx->mainzisegscan_72665_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_73332,
                                           ctx->cuda.module,
                                           "mainzisegscan_73332"));
    ctx->mainzisegscan_73332_total_runtime = 0;
    ctx->mainzisegscan_73332_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_74089,
                                           ctx->cuda.module,
                                           "mainzisegscan_74089"));
    ctx->mainzisegscan_74089_total_runtime = 0;
    ctx->mainzisegscan_74089_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_78322.references = NULL;
        ctx->mainziid_counter_mem_78322.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_78322.mem, (1 >
                                                                             0 ? 1 : 1) *
                                      sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_78322.mem,
                                            mainziid_counter_mem_realtype_80228,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_78572.references = NULL;
        ctx->mainzicounter_mem_78572.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_78572.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_78572.mem,
                                            mainzicounter_mem_realtype_80303,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_78654.references = NULL;
        ctx->mainzicounter_mem_78654.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_78654.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_78654.mem,
                                            mainzicounter_mem_realtype_80337,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_78737.references = NULL;
        ctx->mainziid_counter_mem_78737.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_78737.mem, (1 >
                                                                             0 ? 1 : 1) *
                                      sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_78737.mem,
                                            mainziid_counter_mem_realtype_80367,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_78999.references = NULL;
        ctx->mainzicounter_mem_78999.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_78999.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_78999.mem,
                                            mainzicounter_mem_realtype_80449,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_79101.references = NULL;
        ctx->mainzicounter_mem_79101.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_79101.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_79101.mem,
                                            mainzicounter_mem_realtype_80500,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_79192.references = NULL;
        ctx->mainziid_counter_mem_79192.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_79192.mem, (1 >
                                                                             0 ? 1 : 1) *
                                      sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_79192.mem,
                                            mainziid_counter_mem_realtype_80536,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_79486.references = NULL;
        ctx->mainzicounter_mem_79486.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_79486.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_79486.mem,
                                            mainzicounter_mem_realtype_80624,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_79600.references = NULL;
        ctx->mainzicounter_mem_79600.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_79600.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_79600.mem,
                                            mainzicounter_mem_realtype_80689,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_79647.references = NULL;
        ctx->mainziid_counter_mem_79647.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_79647.mem, (1 >
                                                                             0 ? 1 : 1) *
                                      sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_79647.mem,
                                            mainziid_counter_mem_realtype_80715,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_79816.references = NULL;
        ctx->mainziid_counter_mem_79816.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_79816.mem, (1 >
                                                                             0 ? 1 : 1) *
                                      sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_79816.mem,
                                            mainziid_counter_mem_realtype_80771,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_79991.references = NULL;
        ctx->mainziid_counter_mem_79991.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_79991.mem, (1 >
                                                                             0 ? 1 : 1) *
                                      sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_79991.mem,
                                            mainziid_counter_mem_realtype_80836,
                                            1 * sizeof(int32_t)));
    }
    ctx->tuning_params.builtinzhreplicate_f32zigroup_sizze_78278 =
        &cfg->tuning_params[0];
    ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_78442 =
        &cfg->tuning_params[1];
    ctx->tuning_params.builtinzhreplicate_i8zigroup_sizze_78337 =
        &cfg->tuning_params[2];
    ctx->tuning_params.mainzisegmap_group_sizze_66697 = &cfg->tuning_params[3];
    ctx->tuning_params.mainzisegmap_group_sizze_67289 = &cfg->tuning_params[4];
    ctx->tuning_params.mainzisegmap_group_sizze_67347 = &cfg->tuning_params[5];
    ctx->tuning_params.mainzisegmap_group_sizze_67661 = &cfg->tuning_params[6];
    ctx->tuning_params.mainzisegmap_group_sizze_67686 = &cfg->tuning_params[7];
    ctx->tuning_params.mainzisegmap_group_sizze_67712 = &cfg->tuning_params[8];
    ctx->tuning_params.mainzisegmap_group_sizze_67738 = &cfg->tuning_params[9];
    ctx->tuning_params.mainzisegmap_group_sizze_68324 = &cfg->tuning_params[10];
    ctx->tuning_params.mainzisegmap_group_sizze_69026 = &cfg->tuning_params[11];
    ctx->tuning_params.mainzisegmap_group_sizze_69101 = &cfg->tuning_params[12];
    ctx->tuning_params.mainzisegmap_group_sizze_69452 = &cfg->tuning_params[13];
    ctx->tuning_params.mainzisegmap_group_sizze_69477 = &cfg->tuning_params[14];
    ctx->tuning_params.mainzisegmap_group_sizze_69503 = &cfg->tuning_params[15];
    ctx->tuning_params.mainzisegmap_group_sizze_69529 = &cfg->tuning_params[16];
    ctx->tuning_params.mainzisegmap_group_sizze_70183 = &cfg->tuning_params[17];
    ctx->tuning_params.mainzisegmap_group_sizze_70998 = &cfg->tuning_params[18];
    ctx->tuning_params.mainzisegmap_group_sizze_71100 = &cfg->tuning_params[19];
    ctx->tuning_params.mainzisegmap_group_sizze_71491 = &cfg->tuning_params[20];
    ctx->tuning_params.mainzisegmap_group_sizze_71516 = &cfg->tuning_params[21];
    ctx->tuning_params.mainzisegmap_group_sizze_71542 = &cfg->tuning_params[22];
    ctx->tuning_params.mainzisegmap_group_sizze_71568 = &cfg->tuning_params[23];
    ctx->tuning_params.mainzisegmap_group_sizze_72476 = &cfg->tuning_params[24];
    ctx->tuning_params.mainzisegmap_group_sizze_72501 = &cfg->tuning_params[25];
    ctx->tuning_params.mainzisegmap_group_sizze_72527 = &cfg->tuning_params[26];
    ctx->tuning_params.mainzisegmap_group_sizze_72553 = &cfg->tuning_params[27];
    ctx->tuning_params.mainzisegmap_group_sizze_73143 = &cfg->tuning_params[28];
    ctx->tuning_params.mainzisegmap_group_sizze_73168 = &cfg->tuning_params[29];
    ctx->tuning_params.mainzisegmap_group_sizze_73194 = &cfg->tuning_params[30];
    ctx->tuning_params.mainzisegmap_group_sizze_73220 = &cfg->tuning_params[31];
    ctx->tuning_params.mainzisegmap_group_sizze_73900 = &cfg->tuning_params[32];
    ctx->tuning_params.mainzisegmap_group_sizze_73925 = &cfg->tuning_params[33];
    ctx->tuning_params.mainzisegmap_group_sizze_73951 = &cfg->tuning_params[34];
    ctx->tuning_params.mainzisegmap_group_sizze_73977 = &cfg->tuning_params[35];
    ctx->tuning_params.mainzisegmap_group_sizze_74432 = &cfg->tuning_params[36];
    ctx->tuning_params.mainzisegmap_num_groups_66699 = &cfg->tuning_params[37];
    ctx->tuning_params.mainzisegmap_num_groups_68326 = &cfg->tuning_params[38];
    ctx->tuning_params.mainzisegmap_num_groups_70185 = &cfg->tuning_params[39];
    ctx->tuning_params.mainzisegred_group_sizze_67234 = &cfg->tuning_params[40];
    ctx->tuning_params.mainzisegred_group_sizze_67302 = &cfg->tuning_params[41];
    ctx->tuning_params.mainzisegred_group_sizze_68953 = &cfg->tuning_params[42];
    ctx->tuning_params.mainzisegred_group_sizze_69048 = &cfg->tuning_params[43];
    ctx->tuning_params.mainzisegred_group_sizze_70912 = &cfg->tuning_params[44];
    ctx->tuning_params.mainzisegred_group_sizze_71039 = &cfg->tuning_params[45];
    ctx->tuning_params.mainzisegred_num_groups_67236 = &cfg->tuning_params[46];
    ctx->tuning_params.mainzisegred_num_groups_67304 = &cfg->tuning_params[47];
    ctx->tuning_params.mainzisegred_num_groups_68955 = &cfg->tuning_params[48];
    ctx->tuning_params.mainzisegred_num_groups_69050 = &cfg->tuning_params[49];
    ctx->tuning_params.mainzisegred_num_groups_70914 = &cfg->tuning_params[50];
    ctx->tuning_params.mainzisegred_num_groups_71041 = &cfg->tuning_params[51];
    ctx->tuning_params.mainzisegscan_group_sizze_67824 =
        &cfg->tuning_params[52];
    ctx->tuning_params.mainzisegscan_group_sizze_69615 =
        &cfg->tuning_params[53];
    ctx->tuning_params.mainzisegscan_group_sizze_71654 =
        &cfg->tuning_params[54];
    ctx->tuning_params.mainzisegscan_group_sizze_72639 =
        &cfg->tuning_params[55];
    ctx->tuning_params.mainzisegscan_group_sizze_73306 =
        &cfg->tuning_params[56];
    ctx->tuning_params.mainzisegscan_group_sizze_74063 =
        &cfg->tuning_params[57];
    ctx->tuning_params.mainzisegscan_num_groups_67826 = &cfg->tuning_params[58];
    ctx->tuning_params.mainzisegscan_num_groups_69617 = &cfg->tuning_params[59];
    ctx->tuning_params.mainzisegscan_num_groups_71656 = &cfg->tuning_params[60];
    ctx->tuning_params.mainzisegscan_num_groups_72641 = &cfg->tuning_params[61];
    ctx->tuning_params.mainzisegscan_num_groups_73308 = &cfg->tuning_params[62];
    ctx->tuning_params.mainzisegscan_num_groups_74065 = &cfg->tuning_params[63];
    ctx->tuning_params.mainzisuff_outer_par_0 = &cfg->tuning_params[64];
    ctx->tuning_params.mainzisuff_outer_par_1 = &cfg->tuning_params[65];
    ctx->tuning_params.mainzisuff_outer_par_2 = &cfg->tuning_params[66];
    ctx->tuning_params.mainzisuff_outer_par_3 = &cfg->tuning_params[67];
    ctx->tuning_params.mainzisuff_outer_par_4 = &cfg->tuning_params[68];
    ctx->tuning_params.mainzisuff_outer_par_5 = &cfg->tuning_params[69];
    ctx->tuning_params.mainzitile_sizze_74752 = &cfg->tuning_params[70];
    ctx->tuning_params.mainzitile_sizze_75306 = &cfg->tuning_params[71];
    ctx->tuning_params.mainzitile_sizze_75977 = &cfg->tuning_params[72];
    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[2 + 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  loess.fut:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 1:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 37:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 38:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 39:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 40:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 41:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 43:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 44:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 45:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 46:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 47:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 48:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 49:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\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:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\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:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 52:
                {
                    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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 53:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 54:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 55:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 56:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459: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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 57:
                {
                    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:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 58:
                {
                    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:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 59:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 60:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:535:27-33\n   #1  loess.fut:548: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:545:3-549:9\n   #6  loess.fut:608:13-59\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:607:5-609:29\n   #10 loess.fut:572:1-611:26\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 61:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-37\n   #1  loess.fut:548: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:545:3-549:9\n   #6  loess.fut:608:13-59\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:607:5-609:29\n   #10 loess.fut:572:1-611:26\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_f32.replicate_78275 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f32zireplicate_78275_runs,
                    (long) ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime /
                    (ctx->builtinzhreplicate_f32zireplicate_78275_runs !=
                     0 ? ctx->builtinzhreplicate_f32zireplicate_78275_runs : 1),
                    (long) ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f32zireplicate_78275_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_78439 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_78439_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_78439_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_78439_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_78439_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_78439_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_78439_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_78439_runs;
        str_builder(&builder,
                    "builtin#replicate_i8.replicate_78334  ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i8zireplicate_78334_runs,
                    (long) ctx->builtinzhreplicate_i8zireplicate_78334_total_runtime /
                    (ctx->builtinzhreplicate_i8zireplicate_78334_runs !=
                     0 ? ctx->builtinzhreplicate_i8zireplicate_78334_runs : 1),
                    (long) ctx->builtinzhreplicate_i8zireplicate_78334_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i8zireplicate_78334_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i8zireplicate_78334_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32                 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_runs,
                    (long) ctx->gpu_map_transpose_f32_total_runtime /
                    (ctx->gpu_map_transpose_f32_runs !=
                     0 ? ctx->gpu_map_transpose_f32_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_f32_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32_low_height      ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_low_height_runs,
                    (long) ctx->gpu_map_transpose_f32_low_height_total_runtime /
                    (ctx->gpu_map_transpose_f32_low_height_runs !=
                     0 ? ctx->gpu_map_transpose_f32_low_height_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_low_height_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_f32_low_height_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_low_height_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32_low_width       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_low_width_runs,
                    (long) ctx->gpu_map_transpose_f32_low_width_total_runtime /
                    (ctx->gpu_map_transpose_f32_low_width_runs !=
                     0 ? ctx->gpu_map_transpose_f32_low_width_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_low_width_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_f32_low_width_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_low_width_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32_small           ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_small_runs,
                    (long) ctx->gpu_map_transpose_f32_small_total_runtime /
                    (ctx->gpu_map_transpose_f32_small_runs !=
                     0 ? ctx->gpu_map_transpose_f32_small_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_small_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_f32_small_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_small_runs;
        str_builder(&builder,
                    "main.segmap_66881                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_66881_runs,
                    (long) ctx->mainzisegmap_66881_total_runtime /
                    (ctx->mainzisegmap_66881_runs !=
                     0 ? ctx->mainzisegmap_66881_runs : 1),
                    (long) ctx->mainzisegmap_66881_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_66881_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_66881_runs;
        str_builder(&builder,
                    "main.segmap_67903                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67903_runs,
                    (long) ctx->mainzisegmap_67903_total_runtime /
                    (ctx->mainzisegmap_67903_runs !=
                     0 ? ctx->mainzisegmap_67903_runs : 1),
                    (long) ctx->mainzisegmap_67903_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67903_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67903_runs;
        str_builder(&builder,
                    "main.segmap_67922                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67922_runs,
                    (long) ctx->mainzisegmap_67922_total_runtime /
                    (ctx->mainzisegmap_67922_runs !=
                     0 ? ctx->mainzisegmap_67922_runs : 1),
                    (long) ctx->mainzisegmap_67922_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67922_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67922_runs;
        str_builder(&builder,
                    "main.segmap_67934                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67934_runs,
                    (long) ctx->mainzisegmap_67934_total_runtime /
                    (ctx->mainzisegmap_67934_runs !=
                     0 ? ctx->mainzisegmap_67934_runs : 1),
                    (long) ctx->mainzisegmap_67934_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67934_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67934_runs;
        str_builder(&builder,
                    "main.segmap_67954                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67954_runs,
                    (long) ctx->mainzisegmap_67954_total_runtime /
                    (ctx->mainzisegmap_67954_runs !=
                     0 ? ctx->mainzisegmap_67954_runs : 1),
                    (long) ctx->mainzisegmap_67954_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67954_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67954_runs;
        str_builder(&builder,
                    "main.segmap_68125                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_68125_runs,
                    (long) ctx->mainzisegmap_68125_total_runtime /
                    (ctx->mainzisegmap_68125_runs !=
                     0 ? ctx->mainzisegmap_68125_runs : 1),
                    (long) ctx->mainzisegmap_68125_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_68125_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_68125_runs;
        str_builder(&builder,
                    "main.segmap_68266                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_68266_runs,
                    (long) ctx->mainzisegmap_68266_total_runtime /
                    (ctx->mainzisegmap_68266_runs !=
                     0 ? ctx->mainzisegmap_68266_runs : 1),
                    (long) ctx->mainzisegmap_68266_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_68266_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_68266_runs;
        str_builder(&builder,
                    "main.segmap_68538                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_68538_runs,
                    (long) ctx->mainzisegmap_68538_total_runtime /
                    (ctx->mainzisegmap_68538_runs !=
                     0 ? ctx->mainzisegmap_68538_runs : 1),
                    (long) ctx->mainzisegmap_68538_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_68538_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_68538_runs;
        str_builder(&builder,
                    "main.segmap_69694                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69694_runs,
                    (long) ctx->mainzisegmap_69694_total_runtime /
                    (ctx->mainzisegmap_69694_runs !=
                     0 ? ctx->mainzisegmap_69694_runs : 1),
                    (long) ctx->mainzisegmap_69694_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69694_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69694_runs;
        str_builder(&builder,
                    "main.segmap_69713                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69713_runs,
                    (long) ctx->mainzisegmap_69713_total_runtime /
                    (ctx->mainzisegmap_69713_runs !=
                     0 ? ctx->mainzisegmap_69713_runs : 1),
                    (long) ctx->mainzisegmap_69713_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69713_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69713_runs;
        str_builder(&builder,
                    "main.segmap_69725                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69725_runs,
                    (long) ctx->mainzisegmap_69725_total_runtime /
                    (ctx->mainzisegmap_69725_runs !=
                     0 ? ctx->mainzisegmap_69725_runs : 1),
                    (long) ctx->mainzisegmap_69725_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69725_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69725_runs;
        str_builder(&builder,
                    "main.segmap_69745                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69745_runs,
                    (long) ctx->mainzisegmap_69745_total_runtime /
                    (ctx->mainzisegmap_69745_runs !=
                     0 ? ctx->mainzisegmap_69745_runs : 1),
                    (long) ctx->mainzisegmap_69745_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69745_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69745_runs;
        str_builder(&builder,
                    "main.segmap_69946                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69946_runs,
                    (long) ctx->mainzisegmap_69946_total_runtime /
                    (ctx->mainzisegmap_69946_runs !=
                     0 ? ctx->mainzisegmap_69946_runs : 1),
                    (long) ctx->mainzisegmap_69946_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69946_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69946_runs;
        str_builder(&builder,
                    "main.segmap_70099                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_70099_runs,
                    (long) ctx->mainzisegmap_70099_total_runtime /
                    (ctx->mainzisegmap_70099_runs !=
                     0 ? ctx->mainzisegmap_70099_runs : 1),
                    (long) ctx->mainzisegmap_70099_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_70099_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_70099_runs;
        str_builder(&builder,
                    "main.segmap_70429                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_70429_runs,
                    (long) ctx->mainzisegmap_70429_total_runtime /
                    (ctx->mainzisegmap_70429_runs !=
                     0 ? ctx->mainzisegmap_70429_runs : 1),
                    (long) ctx->mainzisegmap_70429_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_70429_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_70429_runs;
        str_builder(&builder,
                    "main.segmap_71733                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71733_runs,
                    (long) ctx->mainzisegmap_71733_total_runtime /
                    (ctx->mainzisegmap_71733_runs !=
                     0 ? ctx->mainzisegmap_71733_runs : 1),
                    (long) ctx->mainzisegmap_71733_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71733_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71733_runs;
        str_builder(&builder,
                    "main.segmap_71752                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71752_runs,
                    (long) ctx->mainzisegmap_71752_total_runtime /
                    (ctx->mainzisegmap_71752_runs !=
                     0 ? ctx->mainzisegmap_71752_runs : 1),
                    (long) ctx->mainzisegmap_71752_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71752_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71752_runs;
        str_builder(&builder,
                    "main.segmap_71764                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71764_runs,
                    (long) ctx->mainzisegmap_71764_total_runtime /
                    (ctx->mainzisegmap_71764_runs !=
                     0 ? ctx->mainzisegmap_71764_runs : 1),
                    (long) ctx->mainzisegmap_71764_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71764_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71764_runs;
        str_builder(&builder,
                    "main.segmap_71784                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71784_runs,
                    (long) ctx->mainzisegmap_71784_total_runtime /
                    (ctx->mainzisegmap_71784_runs !=
                     0 ? ctx->mainzisegmap_71784_runs : 1),
                    (long) ctx->mainzisegmap_71784_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71784_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71784_runs;
        str_builder(&builder,
                    "main.segmap_72017                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72017_runs,
                    (long) ctx->mainzisegmap_72017_total_runtime /
                    (ctx->mainzisegmap_72017_runs !=
                     0 ? ctx->mainzisegmap_72017_runs : 1),
                    (long) ctx->mainzisegmap_72017_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72017_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72017_runs;
        str_builder(&builder,
                    "main.segmap_72182                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72182_runs,
                    (long) ctx->mainzisegmap_72182_total_runtime /
                    (ctx->mainzisegmap_72182_runs !=
                     0 ? ctx->mainzisegmap_72182_runs : 1),
                    (long) ctx->mainzisegmap_72182_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72182_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72182_runs;
        str_builder(&builder,
                    "main.segmap_72718                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72718_runs,
                    (long) ctx->mainzisegmap_72718_total_runtime /
                    (ctx->mainzisegmap_72718_runs !=
                     0 ? ctx->mainzisegmap_72718_runs : 1),
                    (long) ctx->mainzisegmap_72718_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72718_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72718_runs;
        str_builder(&builder,
                    "main.segmap_72737                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72737_runs,
                    (long) ctx->mainzisegmap_72737_total_runtime /
                    (ctx->mainzisegmap_72737_runs !=
                     0 ? ctx->mainzisegmap_72737_runs : 1),
                    (long) ctx->mainzisegmap_72737_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72737_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72737_runs;
        str_builder(&builder,
                    "main.segmap_72749                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72749_runs,
                    (long) ctx->mainzisegmap_72749_total_runtime /
                    (ctx->mainzisegmap_72749_runs !=
                     0 ? ctx->mainzisegmap_72749_runs : 1),
                    (long) ctx->mainzisegmap_72749_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72749_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72749_runs;
        str_builder(&builder,
                    "main.segmap_72769                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72769_runs,
                    (long) ctx->mainzisegmap_72769_total_runtime /
                    (ctx->mainzisegmap_72769_runs !=
                     0 ? ctx->mainzisegmap_72769_runs : 1),
                    (long) ctx->mainzisegmap_72769_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72769_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72769_runs;
        str_builder(&builder,
                    "main.segmap_73385                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73385_runs,
                    (long) ctx->mainzisegmap_73385_total_runtime /
                    (ctx->mainzisegmap_73385_runs !=
                     0 ? ctx->mainzisegmap_73385_runs : 1),
                    (long) ctx->mainzisegmap_73385_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73385_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73385_runs;
        str_builder(&builder,
                    "main.segmap_73404                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73404_runs,
                    (long) ctx->mainzisegmap_73404_total_runtime /
                    (ctx->mainzisegmap_73404_runs !=
                     0 ? ctx->mainzisegmap_73404_runs : 1),
                    (long) ctx->mainzisegmap_73404_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73404_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73404_runs;
        str_builder(&builder,
                    "main.segmap_73416                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73416_runs,
                    (long) ctx->mainzisegmap_73416_total_runtime /
                    (ctx->mainzisegmap_73416_runs !=
                     0 ? ctx->mainzisegmap_73416_runs : 1),
                    (long) ctx->mainzisegmap_73416_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73416_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73416_runs;
        str_builder(&builder,
                    "main.segmap_73436                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73436_runs,
                    (long) ctx->mainzisegmap_73436_total_runtime /
                    (ctx->mainzisegmap_73436_runs !=
                     0 ? ctx->mainzisegmap_73436_runs : 1),
                    (long) ctx->mainzisegmap_73436_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73436_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73436_runs;
        str_builder(&builder,
                    "main.segmap_74142                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74142_runs,
                    (long) ctx->mainzisegmap_74142_total_runtime /
                    (ctx->mainzisegmap_74142_runs !=
                     0 ? ctx->mainzisegmap_74142_runs : 1),
                    (long) ctx->mainzisegmap_74142_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74142_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74142_runs;
        str_builder(&builder,
                    "main.segmap_74161                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74161_runs,
                    (long) ctx->mainzisegmap_74161_total_runtime /
                    (ctx->mainzisegmap_74161_runs !=
                     0 ? ctx->mainzisegmap_74161_runs : 1),
                    (long) ctx->mainzisegmap_74161_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74161_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74161_runs;
        str_builder(&builder,
                    "main.segmap_74173                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74173_runs,
                    (long) ctx->mainzisegmap_74173_total_runtime /
                    (ctx->mainzisegmap_74173_runs !=
                     0 ? ctx->mainzisegmap_74173_runs : 1),
                    (long) ctx->mainzisegmap_74173_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74173_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74173_runs;
        str_builder(&builder,
                    "main.segmap_74193                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74193_runs,
                    (long) ctx->mainzisegmap_74193_total_runtime /
                    (ctx->mainzisegmap_74193_runs !=
                     0 ? ctx->mainzisegmap_74193_runs : 1),
                    (long) ctx->mainzisegmap_74193_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74193_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74193_runs;
        str_builder(&builder,
                    "main.segmap_74555                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74555_runs,
                    (long) ctx->mainzisegmap_74555_total_runtime /
                    (ctx->mainzisegmap_74555_runs !=
                     0 ? ctx->mainzisegmap_74555_runs : 1),
                    (long) ctx->mainzisegmap_74555_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74555_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74555_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_72785          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_72785_runs,
                    (long) ctx->mainzisegmap_intragroup_72785_total_runtime /
                    (ctx->mainzisegmap_intragroup_72785_runs !=
                     0 ? ctx->mainzisegmap_intragroup_72785_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_72785_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_72785_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_72785_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_73453          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_73453_runs,
                    (long) ctx->mainzisegmap_intragroup_73453_total_runtime /
                    (ctx->mainzisegmap_intragroup_73453_runs !=
                     0 ? ctx->mainzisegmap_intragroup_73453_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_73453_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_73453_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_73453_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_74210          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_74210_runs,
                    (long) ctx->mainzisegmap_intragroup_74210_total_runtime /
                    (ctx->mainzisegmap_intragroup_74210_runs !=
                     0 ? ctx->mainzisegmap_intragroup_74210_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_74210_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_74210_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_74210_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_74758          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_74758_runs,
                    (long) ctx->mainzisegmap_intragroup_74758_total_runtime /
                    (ctx->mainzisegmap_intragroup_74758_runs !=
                     0 ? ctx->mainzisegmap_intragroup_74758_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_74758_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_74758_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_74758_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_75312          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_75312_runs,
                    (long) ctx->mainzisegmap_intragroup_75312_total_runtime /
                    (ctx->mainzisegmap_intragroup_75312_runs !=
                     0 ? ctx->mainzisegmap_intragroup_75312_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_75312_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_75312_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_75312_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_75983          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_75983_runs,
                    (long) ctx->mainzisegmap_intragroup_75983_total_runtime /
                    (ctx->mainzisegmap_intragroup_75983_runs !=
                     0 ? ctx->mainzisegmap_intragroup_75983_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_75983_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_75983_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_75983_runs;
        str_builder(&builder,
                    "main.segred_large_68229               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_68229_runs,
                    (long) ctx->mainzisegred_large_68229_total_runtime /
                    (ctx->mainzisegred_large_68229_runs !=
                     0 ? ctx->mainzisegred_large_68229_runs : 1),
                    (long) ctx->mainzisegred_large_68229_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_68229_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_68229_runs;
        str_builder(&builder,
                    "main.segred_large_68279               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_68279_runs,
                    (long) ctx->mainzisegred_large_68279_total_runtime /
                    (ctx->mainzisegred_large_68279_runs !=
                     0 ? ctx->mainzisegred_large_68279_runs : 1),
                    (long) ctx->mainzisegred_large_68279_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_68279_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_68279_runs;
        str_builder(&builder,
                    "main.segred_large_70052               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_70052_runs,
                    (long) ctx->mainzisegred_large_70052_total_runtime /
                    (ctx->mainzisegred_large_70052_runs !=
                     0 ? ctx->mainzisegred_large_70052_runs : 1),
                    (long) ctx->mainzisegred_large_70052_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_70052_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_70052_runs;
        str_builder(&builder,
                    "main.segred_large_70122               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_70122_runs,
                    (long) ctx->mainzisegred_large_70122_total_runtime /
                    (ctx->mainzisegred_large_70122_runs !=
                     0 ? ctx->mainzisegred_large_70122_runs : 1),
                    (long) ctx->mainzisegred_large_70122_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_70122_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_70122_runs;
        str_builder(&builder,
                    "main.segred_large_72125               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_72125_runs,
                    (long) ctx->mainzisegred_large_72125_total_runtime /
                    (ctx->mainzisegred_large_72125_runs !=
                     0 ? ctx->mainzisegred_large_72125_runs : 1),
                    (long) ctx->mainzisegred_large_72125_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_72125_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_72125_runs;
        str_builder(&builder,
                    "main.segred_large_72224               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_72224_runs,
                    (long) ctx->mainzisegred_large_72224_total_runtime /
                    (ctx->mainzisegred_large_72224_runs !=
                     0 ? ctx->mainzisegred_large_72224_runs : 1),
                    (long) ctx->mainzisegred_large_72224_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_72224_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_72224_runs;
        str_builder(&builder,
                    "main.segred_small_68229               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_68229_runs,
                    (long) ctx->mainzisegred_small_68229_total_runtime /
                    (ctx->mainzisegred_small_68229_runs !=
                     0 ? ctx->mainzisegred_small_68229_runs : 1),
                    (long) ctx->mainzisegred_small_68229_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_68229_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_68229_runs;
        str_builder(&builder,
                    "main.segred_small_68279               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_68279_runs,
                    (long) ctx->mainzisegred_small_68279_total_runtime /
                    (ctx->mainzisegred_small_68279_runs !=
                     0 ? ctx->mainzisegred_small_68279_runs : 1),
                    (long) ctx->mainzisegred_small_68279_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_68279_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_68279_runs;
        str_builder(&builder,
                    "main.segred_small_70052               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_70052_runs,
                    (long) ctx->mainzisegred_small_70052_total_runtime /
                    (ctx->mainzisegred_small_70052_runs !=
                     0 ? ctx->mainzisegred_small_70052_runs : 1),
                    (long) ctx->mainzisegred_small_70052_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_70052_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_70052_runs;
        str_builder(&builder,
                    "main.segred_small_70122               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_70122_runs,
                    (long) ctx->mainzisegred_small_70122_total_runtime /
                    (ctx->mainzisegred_small_70122_runs !=
                     0 ? ctx->mainzisegred_small_70122_runs : 1),
                    (long) ctx->mainzisegred_small_70122_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_70122_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_70122_runs;
        str_builder(&builder,
                    "main.segred_small_72125               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_72125_runs,
                    (long) ctx->mainzisegred_small_72125_total_runtime /
                    (ctx->mainzisegred_small_72125_runs !=
                     0 ? ctx->mainzisegred_small_72125_runs : 1),
                    (long) ctx->mainzisegred_small_72125_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_72125_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_72125_runs;
        str_builder(&builder,
                    "main.segred_small_72224               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_72224_runs,
                    (long) ctx->mainzisegred_small_72224_total_runtime /
                    (ctx->mainzisegred_small_72224_runs !=
                     0 ? ctx->mainzisegred_small_72224_runs : 1),
                    (long) ctx->mainzisegred_small_72224_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_72224_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_72224_runs;
        str_builder(&builder,
                    "main.segscan_67850                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_67850_runs,
                    (long) ctx->mainzisegscan_67850_total_runtime /
                    (ctx->mainzisegscan_67850_runs !=
                     0 ? ctx->mainzisegscan_67850_runs : 1),
                    (long) ctx->mainzisegscan_67850_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_67850_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_67850_runs;
        str_builder(&builder,
                    "main.segscan_69641                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_69641_runs,
                    (long) ctx->mainzisegscan_69641_total_runtime /
                    (ctx->mainzisegscan_69641_runs !=
                     0 ? ctx->mainzisegscan_69641_runs : 1),
                    (long) ctx->mainzisegscan_69641_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_69641_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_69641_runs;
        str_builder(&builder,
                    "main.segscan_71680                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_71680_runs,
                    (long) ctx->mainzisegscan_71680_total_runtime /
                    (ctx->mainzisegscan_71680_runs !=
                     0 ? ctx->mainzisegscan_71680_runs : 1),
                    (long) ctx->mainzisegscan_71680_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_71680_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_71680_runs;
        str_builder(&builder,
                    "main.segscan_72665                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_72665_runs,
                    (long) ctx->mainzisegscan_72665_total_runtime /
                    (ctx->mainzisegscan_72665_runs !=
                     0 ? ctx->mainzisegscan_72665_runs : 1),
                    (long) ctx->mainzisegscan_72665_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_72665_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_72665_runs;
        str_builder(&builder,
                    "main.segscan_73332                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_73332_runs,
                    (long) ctx->mainzisegscan_73332_total_runtime /
                    (ctx->mainzisegscan_73332_runs !=
                     0 ? ctx->mainzisegscan_73332_runs : 1),
                    (long) ctx->mainzisegscan_73332_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_73332_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_73332_runs;
        str_builder(&builder,
                    "main.segscan_74089                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_74089_runs,
                    (long) ctx->mainzisegscan_74089_total_runtime /
                    (ctx->mainzisegscan_74089_runs !=
                     0 ? ctx->mainzisegscan_74089_runs : 1),
                    (long) ctx->mainzisegscan_74089_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_74089_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_74089_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_f32(struct futhark_context *ctx,
                                                 struct memblock_device destmem_0,
                                                 int32_t destoffset_1,
                                                 struct memblock_device srcmem_2,
                                                 int32_t srcoffset_3,
                                                 int32_t num_arrays_4,
                                                 int32_t x_elems_5,
                                                 int32_t y_elems_6);
static int futrts_builtinzhreplicate_f32(struct futhark_context *ctx,
                                         struct memblock_device mem_78271,
                                         int32_t num_elems_78272,
                                         float val_78273);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_78435,
                                         int32_t num_elems_78436,
                                         int64_t val_78437);
static int futrts_builtinzhreplicate_i8(struct futhark_context *ctx,
                                        struct memblock_device mem_78330,
                                        int32_t num_elems_78331,
                                        int8_t val_78332);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_80217,
                             struct memblock_device Y_mem_76976,
                             int64_t m_65343, int64_t n_65344, int64_t q_65346,
                             int64_t degree_65347, int64_t jump_65348,
                             int64_t jump_threshold_65349,
                             int64_t q_threshold_65350);

static int init_constants(struct futhark_context *ctx)
{
    (void) ctx;
    
    int err = 0;
    
    
  cleanup:
    return err;
}
static int free_constants(struct futhark_context *ctx)
{
    (void) ctx;
    return 0;
}
struct futhark_f32_2d {
    struct memblock_device mem;
    int64_t shape[2];
};
struct futhark_f32_2d *futhark_new_f32_2d(struct futhark_context *ctx, const
                                          float *data, int64_t dim0,
                                          int64_t dim1)
{
    struct futhark_f32_2d *bad = NULL;
    struct futhark_f32_2d *arr =
                          (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    arr->mem.references = NULL;
    if (memblock_alloc_device(ctx, &arr->mem, dim0 * dim1 * 4, "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) * 4));
        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_f32_2d *futhark_new_raw_f32_2d(struct futhark_context *ctx, const
                                              CUdeviceptr data, int64_t offset,
                                              int64_t dim0, int64_t dim1)
{
    struct futhark_f32_2d *bad = NULL;
    struct futhark_f32_2d *arr =
                          (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    arr->mem.references = NULL;
    if (memblock_alloc_device(ctx, &arr->mem, dim0 * dim1 * 4, "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) * 4));
        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_f32_2d(struct futhark_context *ctx, struct futhark_f32_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_f32_2d(struct futhark_context *ctx,
                          struct futhark_f32_2d *arr, float *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]) * 4));
        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_f32_2d(struct futhark_context *ctx,
                                      struct futhark_f32_2d *arr)
{
    (void) ctx;
    return arr->mem.mem;
}
const int64_t *futhark_shape_f32_2d(struct futhark_context *ctx,
                                    struct futhark_f32_2d *arr)
{
    (void) ctx;
    return arr->shape;
}

static int futrts_builtinzhgpu_map_transpose_f32(struct futhark_context *ctx,
                                                 struct memblock_device destmem_0,
                                                 int32_t destoffset_1,
                                                 struct memblock_device srcmem_2,
                                                 int32_t srcoffset_3,
                                                 int32_t num_arrays_4,
                                                 int32_t x_elems_5,
                                                 int32_t y_elems_6)
{
    (void) ctx;
    
    int err = 0;
    
    if (!(num_arrays_4 == 0 || (x_elems_5 == 0 || y_elems_6 == 0))) {
        int32_t muly_8 = squot32(16, x_elems_5);
        int32_t mulx_7 = squot32(16, y_elems_6);
        
        if (num_arrays_4 == 1 && (x_elems_5 == 1 || y_elems_6 == 1)) {
            {
                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 * 4)));
                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_80180 = (int64_t) 1088;
                CUdeviceptr kernel_arg_80182 = destmem_0.mem;
                CUdeviceptr kernel_arg_80183 = srcmem_2.mem;
                unsigned int shared_offset_80181 = 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_80177[] = {&perm[0], &perm[1], &perm[2],
                                                 &shared_offset_80181,
                                                 &destoffset_1, &srcoffset_3,
                                                 &num_arrays_4, &x_elems_5,
                                                 &y_elems_6, &mulx_7, &muly_8,
                                                 &kernel_arg_80182,
                                                 &kernel_arg_80183};
                    int64_t time_start_80178 = 0, time_end_80179 = 0;
                    
                    if (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_f32_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_80180 +
                                                                        (8 -
                                                                         shared_sizze_80180 %
                                                                         8) %
                                                                        8)));
                        time_start_80178 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->gpu_map_transpose_f32_low_width_runs,
                                                  &ctx->gpu_map_transpose_f32_low_width_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f32_low_width,
                                                          grid[0], grid[1],
                                                          grid[2], 16, 16, 1,
                                                          0 +
                                                          (shared_sizze_80180 +
                                                           (8 -
                                                            shared_sizze_80180 %
                                                            8) % 8), NULL,
                                                          kernel_args_80177,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80179 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f32_low_width",
                                time_end_80179 - time_start_80178);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    unsigned int shared_sizze_80187 = (int64_t) 1088;
                    CUdeviceptr kernel_arg_80189 = destmem_0.mem;
                    CUdeviceptr kernel_arg_80190 = srcmem_2.mem;
                    unsigned int shared_offset_80188 = 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_80184[] = {&perm[0], &perm[1],
                                                     &perm[2],
                                                     &shared_offset_80188,
                                                     &destoffset_1,
                                                     &srcoffset_3,
                                                     &num_arrays_4, &x_elems_5,
                                                     &y_elems_6, &mulx_7,
                                                     &muly_8, &kernel_arg_80189,
                                                     &kernel_arg_80190};
                        int64_t time_start_80185 = 0, time_end_80186 = 0;
                        
                        if (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_f32_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_80187 +
                                                          (8 -
                                                           shared_sizze_80187 %
                                                           8) % 8)));
                            time_start_80185 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->gpu_map_transpose_f32_low_height_runs,
                                                      &ctx->gpu_map_transpose_f32_low_height_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f32_low_height,
                                                              grid[0], grid[1],
                                                              grid[2], 16, 16,
                                                              1, 0 +
                                                              (shared_sizze_80187 +
                                                               (8 -
                                                                shared_sizze_80187 %
                                                                8) % 8), NULL,
                                                              kernel_args_80184,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80186 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f32_low_height",
                                    time_end_80186 - time_start_80185);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        unsigned int shared_sizze_80194 = (int64_t) 1;
                        CUdeviceptr kernel_arg_80196 = destmem_0.mem;
                        CUdeviceptr kernel_arg_80197 = srcmem_2.mem;
                        unsigned int shared_offset_80195 = 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_80191[] = {&shared_offset_80195,
                                                         &destoffset_1,
                                                         &srcoffset_3,
                                                         &num_arrays_4,
                                                         &x_elems_5, &y_elems_6,
                                                         &mulx_7, &muly_8,
                                                         &kernel_arg_80196,
                                                         &kernel_arg_80197};
                            int64_t time_start_80192 = 0, time_end_80193 = 0;
                            
                            if (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_f32_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_80194 +
                                                          (8 -
                                                           shared_sizze_80194 %
                                                           8) % 8)));
                                time_start_80192 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->gpu_map_transpose_f32_small_runs,
                                                          &ctx->gpu_map_transpose_f32_small_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f32_small,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2], 256,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80194 +
                                                                   (8 -
                                                                    shared_sizze_80194 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80191,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80193 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f32_small",
                                        time_end_80193 - time_start_80192);
                            }
                        }
                    } else {
                        unsigned int shared_sizze_80201 = (int64_t) 4224;
                        CUdeviceptr kernel_arg_80203 = destmem_0.mem;
                        CUdeviceptr kernel_arg_80204 = srcmem_2.mem;
                        unsigned int shared_offset_80202 = 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_80198[] = {&perm[0], &perm[1],
                                                         &perm[2],
                                                         &shared_offset_80202,
                                                         &destoffset_1,
                                                         &srcoffset_3,
                                                         &num_arrays_4,
                                                         &x_elems_5, &y_elems_6,
                                                         &mulx_7, &muly_8,
                                                         &kernel_arg_80203,
                                                         &kernel_arg_80204};
                            int64_t time_start_80199 = 0, time_end_80200 = 0;
                            
                            if (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_f32",
                                        (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_80201 +
                                                                    (8 -
                                                                     shared_sizze_80201 %
                                                                     8) % 8)));
                                time_start_80199 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->gpu_map_transpose_f32_runs,
                                                          &ctx->gpu_map_transpose_f32_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f32,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2], 32,
                                                                  8, 1, 0 +
                                                                  (shared_sizze_80201 +
                                                                   (8 -
                                                                    shared_sizze_80201 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80198,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80200 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f32",
                                        time_end_80200 - time_start_80199);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f32(struct futhark_context *ctx,
                                         struct memblock_device mem_78271,
                                         int32_t num_elems_78272,
                                         float val_78273)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_78278;
    
    group_sizze_78278 =
        *ctx->tuning_params.builtinzhreplicate_f32zigroup_sizze_78278;
    
    int64_t num_groups_78279 = sdiv_up64(num_elems_78272, group_sizze_78278);
    CUdeviceptr kernel_arg_80208 = mem_78271.mem;
    
    if ((((((1 && num_groups_78279 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_78278 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[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_78279;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_80205[] = {&num_elems_78272, &val_78273,
                                     &kernel_arg_80208};
        int64_t time_start_80206 = 0, time_end_80207 = 0;
        
        if (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_f32.replicate_78275",
                    (long) num_groups_78279, (long) 1, (long) 1,
                    (long) group_sizze_78278, (long) 1, (long) 1, (int) 0);
            time_start_80206 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_f32zireplicate_78275_runs,
                                      &ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_f32zireplicate_78275,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_78278, 1, 1, 0, NULL,
                                              kernel_args_80205, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_80207 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_f32.replicate_78275", time_end_80207 -
                    time_start_80206);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_78435,
                                         int32_t num_elems_78436,
                                         int64_t val_78437)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_78442;
    
    group_sizze_78442 =
        *ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_78442;
    
    int64_t num_groups_78443 = sdiv_up64(num_elems_78436, group_sizze_78442);
    CUdeviceptr kernel_arg_80212 = mem_78435.mem;
    
    if ((((((1 && num_groups_78443 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_78442 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[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_78443;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_80209[] = {&num_elems_78436, &val_78437,
                                     &kernel_arg_80212};
        int64_t time_start_80210 = 0, time_end_80211 = 0;
        
        if (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_78439",
                    (long) num_groups_78443, (long) 1, (long) 1,
                    (long) group_sizze_78442, (long) 1, (long) 1, (int) 0);
            time_start_80210 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_i64zireplicate_78439_runs,
                                      &ctx->builtinzhreplicate_i64zireplicate_78439_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_i64zireplicate_78439,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_78442, 1, 1, 0, NULL,
                                              kernel_args_80209, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_80211 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_78439", time_end_80211 -
                    time_start_80210);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i8(struct futhark_context *ctx,
                                        struct memblock_device mem_78330,
                                        int32_t num_elems_78331,
                                        int8_t val_78332)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_78337;
    
    group_sizze_78337 =
        *ctx->tuning_params.builtinzhreplicate_i8zigroup_sizze_78337;
    
    int64_t num_groups_78338 = sdiv_up64(num_elems_78331, group_sizze_78337);
    CUdeviceptr kernel_arg_80216 = mem_78330.mem;
    
    if ((((((1 && num_groups_78338 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_78337 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[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_78338;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_80213[] = {&num_elems_78331, &val_78332,
                                     &kernel_arg_80216};
        int64_t time_start_80214 = 0, time_end_80215 = 0;
        
        if (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_78334",
                    (long) num_groups_78338, (long) 1, (long) 1,
                    (long) group_sizze_78337, (long) 1, (long) 1, (int) 0);
            time_start_80214 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_i8zireplicate_78334_runs,
                                      &ctx->builtinzhreplicate_i8zireplicate_78334_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_i8zireplicate_78334,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_78337, 1, 1, 0, NULL,
                                              kernel_args_80213, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_80215 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_i8.replicate_78334", time_end_80215 -
                    time_start_80214);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_80217,
                             struct memblock_device Y_mem_76976,
                             int64_t m_65343, int64_t n_65344, int64_t q_65346,
                             int64_t degree_65347, int64_t jump_65348,
                             int64_t jump_threshold_65349,
                             int64_t q_threshold_65350)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device mem_out_78270;
    
    mem_out_78270.references = NULL;
    
    bool cond_65351 = jump_65348 == (int64_t) 1;
    int64_t n_m_65352;
    
    if (cond_65351) {
        n_m_65352 = n_65344;
    } else {
        bool zzero_65353 = jump_65348 == (int64_t) 0;
        bool nonzzero_65354 = !zzero_65353;
        bool nonzzero_cert_65355;
        
        if (!nonzzero_65354) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  loess.fut:579:38-45\n   #1  loess.fut:572:1-611:26\n");
            if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_65356 = sdiv64(n_65344, jump_65348);
        int64_t n_m_f_res_65357 = add64((int64_t) 1, x_65356);
        
        n_m_65352 = n_m_f_res_65357;
    }
    
    int64_t i_65358 = sub64(n_65344, (int64_t) 1);
    bool x_65359 = sle64((int64_t) 0, i_65358);
    bool y_65360 = slt64(i_65358, n_65344);
    bool bounds_check_65361 = x_65359 && y_65360;
    bool index_certs_65362;
    
    if (!bounds_check_65361) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_65358,
                               "] out of bounds for array of shape [",
                               (long long) n_65344, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  loess.fut:584:5-54\n   #3  loess.fut:572:1-611:26\n");
        if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t min_res_65364 = smin64(n_65344, q_65346);
    bool bounds_invalid_upwards_65365 = slt64(n_m_65352, (int64_t) 0);
    bool valid_65366 = !bounds_invalid_upwards_65365;
    bool range_valid_c_65367;
    
    if (!valid_65366) {
        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_m_65352, " 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:442:3-469:10\n   #4  loess.fut:502:15-61\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n");
        if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_65369 = slt64((int64_t) 1, min_res_65364);
    float i64_res_65370 = sitofp_i64_f32(q_65346);
    bool cond_65371 = slt64(jump_65348, jump_threshold_65349);
    bool cond_f_res_65372 = slt64(q_threshold_65350, q_65346);
    bool x_65373 = !cond_65371;
    bool y_65374 = cond_f_res_65372 && x_65373;
    bool cond_65375 = cond_65371 || y_65374;
    struct memblock_device ext_mem_77996;
    
    ext_mem_77996.references = NULL;
    
    struct memblock_device ext_mem_77995;
    
    ext_mem_77995.references = NULL;
    if (cond_65375) {
        bool match_lit_65378 = (int64_t) 0 == degree_65347;
        int64_t binop_x_76977 = m_65343 * n_m_65352;
        int64_t binop_y_76978 = (int64_t) 4 * binop_x_76977;
        int64_t bytes_76979 = smax64((int64_t) 0, binop_y_76978);
        struct memblock_device ext_mem_77824;
        
        ext_mem_77824.references = NULL;
        
        struct memblock_device ext_mem_77823;
        
        ext_mem_77823.references = NULL;
        if (match_lit_65378) {
            struct memblock_device mem_76980;
            
            mem_76980.references = NULL;
            if (memblock_alloc_device(ctx, &mem_76980, bytes_76979,
                                      "mem_76980")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_f32(ctx, mem_76980, m_65343 *
                                              n_m_65352, 0.0F) != 0) {
                if (memblock_unref_device(ctx, &mem_76980, "mem_76980") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77823,
                                          "ext_mem_77823") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77824,
                                          "ext_mem_77824") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_66693;
            
            suff_outer_par_66693 = *ctx->tuning_params.mainzisuff_outer_par_0 <=
                m_65343;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_0", (long) m_65343,
                        suff_outer_par_66693 ? "true" : "false");
            
            int64_t segmap_group_sizze_66876;
            
            segmap_group_sizze_66876 =
                *ctx->tuning_params.mainzisegmap_group_sizze_66697;
            
            int64_t num_groups_66877;
            int32_t max_num_groups_78283;
            
            max_num_groups_78283 =
                *ctx->tuning_params.mainzisegmap_num_groups_66699;
            num_groups_66877 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(m_65343,
                                                                    segmap_group_sizze_66876),
                                                          sext_i32_i64(max_num_groups_78283))));
            
            int64_t nest_sizze_67843 = m_65343 * n_65344;
            int64_t segscan_group_sizze_67844;
            
            segscan_group_sizze_67844 =
                *ctx->tuning_params.mainzisegscan_group_sizze_67824;
            
            int64_t num_groups_67845;
            int32_t max_num_groups_78284;
            
            max_num_groups_78284 =
                *ctx->tuning_params.mainzisegscan_num_groups_67826;
            num_groups_67845 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(nest_sizze_67843,
                                                                    segscan_group_sizze_67844),
                                                          sext_i32_i64(max_num_groups_78284))));
            
            int64_t segmap_group_sizze_67897;
            
            segmap_group_sizze_67897 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67738;
            
            int64_t segmap_group_sizze_67917;
            
            segmap_group_sizze_67917 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67712;
            
            int64_t segmap_group_sizze_67927;
            
            segmap_group_sizze_67927 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67686;
            
            int64_t nest_sizze_67948 = m_65343 * q_65346;
            int64_t segmap_group_sizze_67949;
            
            segmap_group_sizze_67949 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67661;
            
            bool suff_outer_par_67966;
            
            suff_outer_par_67966 = *ctx->tuning_params.mainzisuff_outer_par_1 <=
                binop_x_76977;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_1", (long) binop_x_76977,
                        suff_outer_par_67966 ? "true" : "false");
            
            int64_t segmap_group_sizze_68118;
            
            segmap_group_sizze_68118 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67347;
            
            int64_t nest_sizze_68221 = q_65346 * binop_x_76977;
            int64_t segred_group_sizze_68222;
            
            segred_group_sizze_68222 =
                *ctx->tuning_params.mainzisegred_group_sizze_67302;
            
            int64_t num_groups_68223;
            int32_t max_num_groups_78285;
            
            max_num_groups_78285 =
                *ctx->tuning_params.mainzisegred_num_groups_67304;
            num_groups_68223 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(nest_sizze_68221,
                                                                    segred_group_sizze_68222),
                                                          sext_i32_i64(max_num_groups_78285))));
            
            int64_t segmap_group_sizze_68261;
            
            segmap_group_sizze_68261 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67289;
            
            int64_t segred_group_sizze_68272;
            
            segred_group_sizze_68272 =
                *ctx->tuning_params.mainzisegred_group_sizze_67234;
            
            int64_t num_groups_68273;
            int32_t max_num_groups_78286;
            
            max_num_groups_78286 =
                *ctx->tuning_params.mainzisegred_num_groups_67236;
            num_groups_68273 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(nest_sizze_68221,
                                                                    segred_group_sizze_68272),
                                                          sext_i32_i64(max_num_groups_78286))));
            
            int64_t tile_sizze_74753;
            
            tile_sizze_74753 = *ctx->tuning_params.mainzitile_sizze_74752;
            
            int64_t group_sizze_74754 = tile_sizze_74753 * tile_sizze_74753;
            int64_t bytes_76982 = (int64_t) 4 * nest_sizze_67843;
            int64_t binop_y_76985 = (int64_t) 8 * n_65344;
            int64_t bytes_76986 = smax64((int64_t) 0, binop_y_76985);
            int64_t binop_y_77000 = (int64_t) 4 * n_65344;
            int64_t bytes_77001 = smax64((int64_t) 0, binop_y_77000);
            int64_t binop_y_77045 = (int64_t) 4 * q_65346;
            int64_t bytes_77046 = smax64((int64_t) 0, binop_y_77045);
            int64_t binop_y_77060 = (int64_t) 4 * n_m_65352;
            int64_t bytes_77061 = smax64((int64_t) 0, binop_y_77060);
            int64_t binop_y_77080 = (int64_t) 8 * nest_sizze_67843;
            int64_t bytes_77081 = smax64((int64_t) 0, binop_y_77080);
            int64_t bytes_77085 = smax64((int64_t) 0, bytes_76982);
            int64_t binop_y_77098 = (int64_t) 8 * m_65343;
            int64_t bytes_77099 = smax64((int64_t) 0, binop_y_77098);
            int64_t binop_y_77107 = (int64_t) 4 * m_65343;
            int64_t bytes_77108 = smax64((int64_t) 0, binop_y_77107);
            int64_t binop_y_77112 = (int64_t) 4 * nest_sizze_67948;
            int64_t bytes_77113 = smax64((int64_t) 0, binop_y_77112);
            int64_t bytes_77118 = (int64_t) 8 * group_sizze_74754;
            int64_t bytes_77127 = (int64_t) 4 * group_sizze_74754;
            int64_t bytes_77137 = smax64((int64_t) 0, bytes_77127);
            int64_t binop_x_78009 = (int64_t) 4 * tile_sizze_74753;
            int64_t sizze_78010 = tile_sizze_74753 * binop_x_78009;
            int64_t binop_y_77164 = (int64_t) 8 * binop_x_76977;
            int64_t bytes_77165 = smax64((int64_t) 0, binop_y_77164);
            int64_t binop_x_78075 = (int64_t) 4 * tile_sizze_74753;
            int64_t num_bytes_78076 = tile_sizze_74753 * binop_x_78075;
            int64_t maxSubHelper_78134 = umax64(sizze_78010, num_bytes_78076);
            int64_t num_threads_78201 = segmap_group_sizze_66876 *
                    num_groups_66877;
            int64_t total_sizze_78202 = bytes_77061 * num_threads_78201;
            int64_t total_sizze_78203 = bytes_77046 * num_threads_78201;
            int64_t total_sizze_78204 = bytes_76986 * num_threads_78201;
            int64_t total_sizze_78205 = bytes_76986 * num_threads_78201;
            int64_t total_sizze_78206 = bytes_77001 * num_threads_78201;
            struct memblock_device ext_mem_77196;
            
            ext_mem_77196.references = NULL;
            
            int32_t local_memory_capacity_78691;
            
            local_memory_capacity_78691 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0, sext_i32_i64(local_memory_capacity_78691)) &&
                suff_outer_par_66693) {
                struct memblock_device mem_76983;
                
                mem_76983.references = NULL;
                if (memblock_alloc_device(ctx, &mem_76983, bytes_76982,
                                          "mem_76983")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_76983,
                                                          (int64_t) 0,
                                                          Y_mem_76976,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_65344,
                                                          m_65343) != 0) {
                    if (memblock_unref_device(ctx, &mem_76983, "mem_76983") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77077;
                
                mem_77077.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77077, binop_y_76978,
                                          "mem_77077")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78129;
                
                color_78129.references = NULL;
                if (memblock_alloc_device(ctx, &color_78129, total_sizze_78202,
                                          "color_78129")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78130;
                
                color_78130.references = NULL;
                if (memblock_alloc_device(ctx, &color_78130, total_sizze_78203,
                                          "color_78130")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78131;
                
                color_78131.references = NULL;
                if (memblock_alloc_device(ctx, &color_78131, total_sizze_78204,
                                          "color_78131")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78132;
                
                color_78132.references = NULL;
                if (memblock_alloc_device(ctx, &color_78132, total_sizze_78205,
                                          "color_78132")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78133;
                
                color_78133.references = NULL;
                if (memblock_alloc_device(ctx, &color_78133, total_sizze_78206,
                                          "color_78133")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80221 = mem_76983.mem;
                CUdeviceptr kernel_arg_80222 = mem_77077.mem;
                CUdeviceptr kernel_arg_80223 = color_78129.mem;
                CUdeviceptr kernel_arg_80224 = color_78130.mem;
                CUdeviceptr kernel_arg_80225 = color_78131.mem;
                CUdeviceptr kernel_arg_80226 = color_78132.mem;
                CUdeviceptr kernel_arg_80227 = color_78133.mem;
                
                if ((((((1 && num_groups_66877 != 0) && 1 != 0) && 1 != 0) &&
                      segmap_group_sizze_66876 != 0) && 1 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_66877;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80218[] = {&ctx->global_failure,
                                                 &ctx->failure_is_an_option,
                                                 &ctx->global_failure_args,
                                                 &m_65343, &n_65344, &q_65346,
                                                 &jump_65348, &n_m_65352,
                                                 &i_65358, &x_65359,
                                                 &min_res_65364,
                                                 &loop_cond_65369,
                                                 &i64_res_65370,
                                                 &num_groups_66877,
                                                 &num_threads_78201,
                                                 &kernel_arg_80221,
                                                 &kernel_arg_80222,
                                                 &kernel_arg_80223,
                                                 &kernel_arg_80224,
                                                 &kernel_arg_80225,
                                                 &kernel_arg_80226,
                                                 &kernel_arg_80227};
                    int64_t time_start_80219 = 0, time_end_80220 = 0;
                    
                    if (ctx->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_66881", (long) num_groups_66877,
                                (long) 1, (long) 1,
                                (long) segmap_group_sizze_66876, (long) 1,
                                (long) 1, (int) 0);
                        time_start_80219 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_66881_runs,
                                                  &ctx->mainzisegmap_66881_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_66881,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_66876,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80218,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80220 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_66881", time_end_80220 -
                                time_start_80219);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_76983, "mem_76983") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78129, "color_78129") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78130, "color_78130") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78131, "color_78131") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78132, "color_78132") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78133, "color_78133") !=
                    0)
                    return 1;
                
                struct memblock_device mem_77194;
                
                mem_77194.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77194, bytes_76979,
                                          "mem_77194")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77194,
                                                          (int64_t) 0,
                                                          mem_77077,
                                                          (int64_t) 0,
                                                          (int64_t) 1, m_65343,
                                                          n_m_65352) != 0) {
                    if (memblock_unref_device(ctx, &mem_77194, "mem_77194") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78133,
                                              "color_78133") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78132,
                                              "color_78132") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78131,
                                              "color_78131") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78130,
                                              "color_78130") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78129,
                                              "color_78129") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77077, "mem_77077") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76983, "mem_76983") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_77077, "mem_77077") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77196, &mem_77194,
                                        "mem_77194") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77194, "mem_77194") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78133, "color_78133") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78132, "color_78132") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78131, "color_78131") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78130, "color_78130") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78129, "color_78129") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77077, "mem_77077") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_76983, "mem_76983") != 0)
                    return 1;
            } else {
                struct memblock_device mem_77082;
                
                mem_77082.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77082, bytes_77081,
                                          "mem_77082")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 0, m_65343 * n_65344)) {
                    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_78320 = sdiv_up64(m_65343 * n_65344,
                                                         segscan_group_sizze_67844 *
                                                         (int64_t) 11) *
                            segscan_group_sizze_67844;
                    int64_t numGroups_78321 = sdiv_up64(m_65343 * n_65344,
                                                        segscan_group_sizze_67844 *
                                                        (int64_t) 11);
                    struct memblock_device mainziid_counter_mem_78322 =
                                           ctx->mainziid_counter_mem_78322;
                    struct memblock_device status_flags_mem_78324;
                    
                    status_flags_mem_78324.references = NULL;
                    if (memblock_alloc_device(ctx, &status_flags_mem_78324,
                                              numGroups_78321,
                                              "status_flags_mem_78324")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device aggregates_mem_78326;
                    
                    aggregates_mem_78326.references = NULL;
                    if (memblock_alloc_device(ctx, &aggregates_mem_78326,
                                              (int64_t) 8 * numGroups_78321,
                                              "aggregates_mem_78326")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device incprefixes_mem_78328;
                    
                    incprefixes_mem_78328.references = NULL;
                    if (memblock_alloc_device(ctx, &incprefixes_mem_78328,
                                              (int64_t) 8 * numGroups_78321,
                                              "incprefixes_mem_78328")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i8(ctx,
                                                     status_flags_mem_78324,
                                                     numGroups_78321,
                                                     (int8_t) 0) != 0) {
                        if (memblock_unref_device(ctx, &incprefixes_mem_78328,
                                                  "incprefixes_mem_78328") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &aggregates_mem_78326,
                                                  "aggregates_mem_78326") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &status_flags_mem_78324,
                                                  "status_flags_mem_78324") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77082,
                                                  "mem_77082") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77196,
                                                  "ext_mem_77196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_76980,
                                                  "mem_76980") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    unsigned int shared_sizze_80232 =
                                 smax64(smax64((int64_t) 288, (int64_t) 8 *
                                               segscan_group_sizze_67844),
                                        (int64_t) 11 *
                                        segscan_group_sizze_67844 *
                                        (int64_t) 8);
                    CUdeviceptr kernel_arg_80234 = Y_mem_76976.mem;
                    CUdeviceptr kernel_arg_80235 = mem_77082.mem;
                    CUdeviceptr kernel_arg_80236 =
                                mainziid_counter_mem_78322.mem;
                    CUdeviceptr kernel_arg_80237 = status_flags_mem_78324.mem;
                    CUdeviceptr kernel_arg_80238 = aggregates_mem_78326.mem;
                    CUdeviceptr kernel_arg_80239 = incprefixes_mem_78328.mem;
                    unsigned int shared_offset_80233 = 0;
                    
                    if ((((((1 && sdiv_up64(m_65343 * n_65344,
                                            segscan_group_sizze_67844 *
                                            (int64_t) 11) != 0) && 1 != 0) &&
                           1 != 0) && segscan_group_sizze_67844 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_65343 * n_65344,
                                                  segscan_group_sizze_67844 *
                                                  (int64_t) 11);
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80229[] = {&ctx->global_failure,
                                                     &shared_offset_80233,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80234,
                                                     &kernel_arg_80235,
                                                     &kernel_arg_80236,
                                                     &kernel_arg_80237,
                                                     &kernel_arg_80238,
                                                     &kernel_arg_80239};
                        int64_t time_start_80230 = 0, time_end_80231 = 0;
                        
                        if (ctx->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_67850",
                                    (long) sdiv_up64(m_65343 * n_65344,
                                                     segscan_group_sizze_67844 *
                                                     (int64_t) 11), (long) 1,
                                    (long) 1, (long) segscan_group_sizze_67844,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_80232 +
                                                                (8 -
                                                                 shared_sizze_80232 %
                                                                 8) % 8)));
                            time_start_80230 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegscan_67850_runs,
                                                      &ctx->mainzisegscan_67850_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_67850,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segscan_group_sizze_67844,
                                                              1, 1, 0 +
                                                              (shared_sizze_80232 +
                                                               (8 -
                                                                shared_sizze_80232 %
                                                                8) % 8), NULL,
                                                              kernel_args_80229,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80231 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segscan_67850", time_end_80231 -
                                    time_start_80230);
                        }
                    }
                    if (memblock_unref_device(ctx, &incprefixes_mem_78328,
                                              "incprefixes_mem_78328") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_78326,
                                              "aggregates_mem_78326") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_78324,
                                              "status_flags_mem_78324") != 0)
                        return 1;
                }
                
                struct memblock_device mem_77086;
                
                mem_77086.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77086, bytes_77085,
                                          "mem_77086")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_f32(ctx, mem_77086, m_65343 *
                                                  n_65344, 0.0F) != 0) {
                    if (memblock_unref_device(ctx, &mem_77086, "mem_77086") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77082, "mem_77082") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77090;
                
                mem_77090.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77090, bytes_77081,
                                          "mem_77090")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i64(ctx, mem_77090, m_65343 *
                                                  n_65344, (int64_t) -1) != 0) {
                    if (memblock_unref_device(ctx, &mem_77090, "mem_77090") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77086, "mem_77086") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77082, "mem_77082") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t segmap_usable_groups_67898 = sdiv_up64(nest_sizze_67843,
                                                               segmap_group_sizze_67897);
                
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80243 = Y_mem_76976.mem;
                CUdeviceptr kernel_arg_80244 = mem_77082.mem;
                CUdeviceptr kernel_arg_80245 = mem_77086.mem;
                CUdeviceptr kernel_arg_80246 = mem_77090.mem;
                
                if ((((((1 && segmap_usable_groups_67898 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_67897 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_67898;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80240[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &kernel_arg_80243,
                                                 &kernel_arg_80244,
                                                 &kernel_arg_80245,
                                                 &kernel_arg_80246};
                    int64_t time_start_80241 = 0, time_end_80242 = 0;
                    
                    if (ctx->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_67903",
                                (long) segmap_usable_groups_67898, (long) 1,
                                (long) 1, (long) segmap_group_sizze_67897,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80241 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_67903_runs,
                                                  &ctx->mainzisegmap_67903_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_67903,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_67897,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80240,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80242 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_67903", time_end_80242 -
                                time_start_80241);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_67918 = sdiv_up64(nest_sizze_67843,
                                                               segmap_group_sizze_67917);
                struct memblock_device mem_77096;
                
                mem_77096.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77096, bytes_77081,
                                          "mem_77096")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80250 = mem_77090.mem;
                CUdeviceptr kernel_arg_80251 = mem_77096.mem;
                
                if ((((((1 && segmap_usable_groups_67918 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_67917 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_67918;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80247[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &kernel_arg_80250,
                                                 &kernel_arg_80251};
                    int64_t time_start_80248 = 0, time_end_80249 = 0;
                    
                    if (ctx->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_67922",
                                (long) segmap_usable_groups_67918, (long) 1,
                                (long) 1, (long) segmap_group_sizze_67917,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80248 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_67922_runs,
                                                  &ctx->mainzisegmap_67922_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_67922,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_67917,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80247,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80249 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_67922", time_end_80249 -
                                time_start_80248);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_67928 = sdiv_up64(m_65343,
                                                               segmap_group_sizze_67927);
                struct memblock_device mem_77100;
                
                mem_77100.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77100, bytes_77099,
                                          "mem_77100")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77103;
                
                mem_77103.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77103, bytes_77099,
                                          "mem_77103")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77106;
                
                mem_77106.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77106, bytes_77099,
                                          "mem_77106")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77109;
                
                mem_77109.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77109, bytes_77108,
                                          "mem_77109")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80255 = mem_77082.mem;
                CUdeviceptr kernel_arg_80256 = mem_77100.mem;
                CUdeviceptr kernel_arg_80257 = mem_77103.mem;
                CUdeviceptr kernel_arg_80258 = mem_77106.mem;
                CUdeviceptr kernel_arg_80259 = mem_77109.mem;
                
                if ((((((1 && segmap_usable_groups_67928 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_67927 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_67928;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80252[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &q_65346, &i_65358,
                                                 &min_res_65364, &i64_res_65370,
                                                 &kernel_arg_80255,
                                                 &kernel_arg_80256,
                                                 &kernel_arg_80257,
                                                 &kernel_arg_80258,
                                                 &kernel_arg_80259};
                    int64_t time_start_80253 = 0, time_end_80254 = 0;
                    
                    if (ctx->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_67934",
                                (long) segmap_usable_groups_67928, (long) 1,
                                (long) 1, (long) segmap_group_sizze_67927,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80253 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_67934_runs,
                                                  &ctx->mainzisegmap_67934_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_67934,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_67927,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80252,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80254 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_67934", time_end_80254 -
                                time_start_80253);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_67950 = sdiv_up64(nest_sizze_67948,
                                                               segmap_group_sizze_67949);
                struct memblock_device mem_77114;
                
                mem_77114.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77114, bytes_77113,
                                          "mem_77114")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80263 = mem_77082.mem;
                CUdeviceptr kernel_arg_80264 = mem_77114.mem;
                
                if ((((((1 && segmap_usable_groups_67950 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_67949 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_67950;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80260[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &q_65346, &i_65358,
                                                 &kernel_arg_80263,
                                                 &kernel_arg_80264};
                    int64_t time_start_80261 = 0, time_end_80262 = 0;
                    
                    if (ctx->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_67954",
                                (long) segmap_usable_groups_67950, (long) 1,
                                (long) 1, (long) segmap_group_sizze_67949,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80261 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_67954_runs,
                                                  &ctx->mainzisegmap_67954_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_67954,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_67949,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80260,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80262 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_67954", time_end_80262 -
                                time_start_80261);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device ext_mem_77190;
                
                ext_mem_77190.references = NULL;
                
                int32_t local_memory_capacity_78690;
                
                local_memory_capacity_78690 = ctx->cuda.max_shared_memory;
                if (sle64(bytes_77137 + srem64((int64_t) 8 - srem64(bytes_77137,
                                                                    (int64_t) 8),
                                               (int64_t) 8),
                          sext_i32_i64(local_memory_capacity_78690)) &&
                    suff_outer_par_67966) {
                    int64_t num_groups_x_74755 = sdiv_up64(m_65343,
                                                           tile_sizze_74753);
                    int64_t num_groups_y_74756 = sdiv_up64(n_m_65352,
                                                           tile_sizze_74753);
                    int64_t num_groups_top_74757 = num_groups_x_74755 *
                            num_groups_y_74756;
                    int64_t num_whole_tiles_74888 = squot64(q_65346,
                                                            tile_sizze_74753);
                    int64_t residual_input_75084 = srem64(q_65346,
                                                          tile_sizze_74753);
                    bool cond_75085 = residual_input_75084 == (int64_t) 0;
                    struct memblock_device mem_77161;
                    
                    mem_77161.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77161, bytes_76979,
                                              "mem_77161")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_80268 = bytes_77137;
                    CUdeviceptr kernel_arg_80270 = mem_77082.mem;
                    CUdeviceptr kernel_arg_80271 = mem_77086.mem;
                    CUdeviceptr kernel_arg_80272 = mem_77090.mem;
                    CUdeviceptr kernel_arg_80273 = mem_77096.mem;
                    CUdeviceptr kernel_arg_80274 = mem_77100.mem;
                    CUdeviceptr kernel_arg_80275 = mem_77103.mem;
                    CUdeviceptr kernel_arg_80276 = mem_77106.mem;
                    CUdeviceptr kernel_arg_80277 = mem_77109.mem;
                    CUdeviceptr kernel_arg_80278 = mem_77114.mem;
                    CUdeviceptr kernel_arg_80279 = mem_77161.mem;
                    unsigned int shared_offset_80269 = 0;
                    
                    if ((((((1 && num_groups_top_74757 != 0) && 1 != 0) && 1 !=
                           0) && group_sizze_74754 != 0) && 1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_top_74757;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80265[] = {&ctx->global_failure,
                                                     &ctx->failure_is_an_option,
                                                     &ctx->global_failure_args,
                                                     &shared_offset_80269,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &jump_65348,
                                                     &n_m_65352, &i_65358,
                                                     &x_65359, &min_res_65364,
                                                     &loop_cond_65369,
                                                     &num_groups_x_74755,
                                                     &num_groups_y_74756,
                                                     &num_whole_tiles_74888,
                                                     &residual_input_75084,
                                                     &cond_75085,
                                                     &kernel_arg_80270,
                                                     &kernel_arg_80271,
                                                     &kernel_arg_80272,
                                                     &kernel_arg_80273,
                                                     &kernel_arg_80274,
                                                     &kernel_arg_80275,
                                                     &kernel_arg_80276,
                                                     &kernel_arg_80277,
                                                     &kernel_arg_80278,
                                                     &kernel_arg_80279};
                        int64_t time_start_80266 = 0, time_end_80267 = 0;
                        
                        if (ctx->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_74758",
                                    (long) num_groups_top_74757, (long) 1,
                                    (long) 1, (long) group_sizze_74754,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_80268 +
                                                                (8 -
                                                                 shared_sizze_80268 %
                                                                 8) % 8)));
                            time_start_80266 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_74758_runs,
                                                      &ctx->mainzisegmap_intragroup_74758_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_74758,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              group_sizze_74754,
                                                              1, 1, 0 +
                                                              (shared_sizze_80268 +
                                                               (8 -
                                                                shared_sizze_80268 %
                                                                8) % 8), NULL,
                                                              kernel_args_80265,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80267 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_74758",
                                    time_end_80267 - time_start_80266);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_77190, &mem_77161,
                                            "mem_77161") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77161, "mem_77161") !=
                        0)
                        return 1;
                } else {
                    int64_t segmap_usable_groups_68119 =
                            sdiv_up64(binop_x_76977, segmap_group_sizze_68118);
                    struct memblock_device mem_77166;
                    
                    mem_77166.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77166, bytes_77165,
                                              "mem_77166")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77170;
                    
                    mem_77170.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77170, bytes_77165,
                                              "mem_77170")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77174;
                    
                    mem_77174.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77174, bytes_76979,
                                              "mem_77174")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80283 = mem_77090.mem;
                    CUdeviceptr kernel_arg_80284 = mem_77096.mem;
                    CUdeviceptr kernel_arg_80285 = mem_77100.mem;
                    CUdeviceptr kernel_arg_80286 = mem_77103.mem;
                    CUdeviceptr kernel_arg_80287 = mem_77106.mem;
                    CUdeviceptr kernel_arg_80288 = mem_77109.mem;
                    CUdeviceptr kernel_arg_80289 = mem_77166.mem;
                    CUdeviceptr kernel_arg_80290 = mem_77170.mem;
                    CUdeviceptr kernel_arg_80291 = mem_77174.mem;
                    
                    if ((((((1 && segmap_usable_groups_68119 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_68118 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_68119;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80280[] = {&ctx->global_failure,
                                                     &ctx->failure_is_an_option,
                                                     &ctx->global_failure_args,
                                                     &m_65343, &n_65344,
                                                     &jump_65348, &n_m_65352,
                                                     &i_65358, &x_65359,
                                                     &min_res_65364,
                                                     &loop_cond_65369,
                                                     &kernel_arg_80283,
                                                     &kernel_arg_80284,
                                                     &kernel_arg_80285,
                                                     &kernel_arg_80286,
                                                     &kernel_arg_80287,
                                                     &kernel_arg_80288,
                                                     &kernel_arg_80289,
                                                     &kernel_arg_80290,
                                                     &kernel_arg_80291};
                        int64_t time_start_80281 = 0, time_end_80282 = 0;
                        
                        if (ctx->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_68125",
                                    (long) segmap_usable_groups_68119, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_68118,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80281 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_68125_runs,
                                                      &ctx->mainzisegmap_68125_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_68125,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_68118,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80280,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80282 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_68125", time_end_80282 -
                                    time_start_80281);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77166, "mem_77166") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77179;
                    
                    mem_77179.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77179, bytes_76979,
                                              "mem_77179")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(q_65346 * (int64_t) 2,
                              segred_group_sizze_68222)) {
                        int64_t segment_sizze_nonzzero_78536 =
                                smax64((int64_t) 1, q_65346);
                        int64_t num_threads_78537 = num_groups_68223 *
                                segred_group_sizze_68222;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_68222,
                                                        segment_sizze_nonzzero_78536),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                       n_m_65352,
                                                                       squot64(segred_group_sizze_68222,
                                                                               segment_sizze_nonzzero_78536))),
                                    '\n');
                        
                        unsigned int shared_sizze_80295 = (int64_t) 4 *
                                     segred_group_sizze_68222;
                        CUdeviceptr kernel_arg_80297 = mem_77082.mem;
                        CUdeviceptr kernel_arg_80298 = mem_77090.mem;
                        CUdeviceptr kernel_arg_80299 = mem_77114.mem;
                        CUdeviceptr kernel_arg_80300 = mem_77170.mem;
                        CUdeviceptr kernel_arg_80301 = mem_77174.mem;
                        CUdeviceptr kernel_arg_80302 = mem_77179.mem;
                        unsigned int shared_offset_80296 = 0;
                        
                        if ((((((1 && num_groups_68223 != 0) && 1 != 0) && 1 !=
                               0) && segred_group_sizze_68222 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_68223;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80292[] = {&ctx->global_failure,
                                                         &shared_offset_80296,
                                                         &m_65343, &n_65344,
                                                         &q_65346, &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &num_groups_68223,
                                                         &segment_sizze_nonzzero_78536,
                                                         &kernel_arg_80297,
                                                         &kernel_arg_80298,
                                                         &kernel_arg_80299,
                                                         &kernel_arg_80300,
                                                         &kernel_arg_80301,
                                                         &kernel_arg_80302};
                            int64_t time_start_80293 = 0, time_end_80294 = 0;
                            
                            if (ctx->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_68229",
                                        (long) num_groups_68223, (long) 1,
                                        (long) 1,
                                        (long) segred_group_sizze_68222,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80295 +
                                                                    (8 -
                                                                     shared_sizze_80295 %
                                                                     8) % 8)));
                                time_start_80293 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegred_small_68229_runs,
                                                          &ctx->mainzisegred_small_68229_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_68229,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segred_group_sizze_68222,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80295 +
                                                                   (8 -
                                                                    shared_sizze_80295 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80292,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80294 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segred_small_68229",
                                        time_end_80294 - time_start_80293);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_78565 =
                                sdiv_up64(num_groups_68223, smax64((int64_t) 1,
                                                                   m_65343 *
                                                                   n_m_65352));
                        int64_t elements_per_thread_78566 = sdiv_up64(q_65346,
                                                                      segred_group_sizze_68222 *
                                                                      groups_per_segment_78565);
                        int64_t virt_num_groups_78567 =
                                groups_per_segment_78565 * (m_65343 *
                                                            n_m_65352);
                        int64_t num_threads_78568 = num_groups_68223 *
                                segred_group_sizze_68222;
                        int64_t threads_per_segment_78569 =
                                groups_per_segment_78565 *
                                segred_group_sizze_68222;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_78567, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_68223, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_68222, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_78566,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_78565, '\n');
                        
                        struct memblock_device segred_tmp_mem_78570;
                        
                        segred_tmp_mem_78570.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_78570,
                                                  (int64_t) 4 *
                                                  virt_num_groups_78567,
                                                  "segred_tmp_mem_78570")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_78572 =
                                               ctx->mainzicounter_mem_78572;
                        unsigned int shared_sizze_80307 = 1;
                        unsigned int shared_sizze_80309 = (int64_t) 4 *
                                     segred_group_sizze_68222;
                        CUdeviceptr kernel_arg_80311 = mem_77082.mem;
                        CUdeviceptr kernel_arg_80312 = mem_77090.mem;
                        CUdeviceptr kernel_arg_80313 = mem_77114.mem;
                        CUdeviceptr kernel_arg_80314 = mem_77170.mem;
                        CUdeviceptr kernel_arg_80315 = mem_77174.mem;
                        CUdeviceptr kernel_arg_80316 = mem_77179.mem;
                        CUdeviceptr kernel_arg_80317 = segred_tmp_mem_78570.mem;
                        CUdeviceptr kernel_arg_80318 =
                                    mainzicounter_mem_78572.mem;
                        unsigned int shared_offset_80308 = 0;
                        unsigned int shared_offset_80310 = 0 +
                                     (shared_sizze_80307 + (8 -
                                                            shared_sizze_80307 %
                                                            8) % 8);
                        
                        if ((((((1 && num_groups_68223 != 0) && 1 != 0) && 1 !=
                               0) && segred_group_sizze_68222 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_68223;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80304[] = {&ctx->global_failure,
                                                         &shared_offset_80308,
                                                         &shared_offset_80310,
                                                         &m_65343, &n_65344,
                                                         &q_65346, &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &num_groups_68223,
                                                         &groups_per_segment_78565,
                                                         &elements_per_thread_78566,
                                                         &virt_num_groups_78567,
                                                         &threads_per_segment_78569,
                                                         &kernel_arg_80311,
                                                         &kernel_arg_80312,
                                                         &kernel_arg_80313,
                                                         &kernel_arg_80314,
                                                         &kernel_arg_80315,
                                                         &kernel_arg_80316,
                                                         &kernel_arg_80317,
                                                         &kernel_arg_80318};
                            int64_t time_start_80305 = 0, time_end_80306 = 0;
                            
                            if (ctx->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_68229",
                                        (long) num_groups_68223, (long) 1,
                                        (long) 1,
                                        (long) segred_group_sizze_68222,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80307 +
                                                                    (8 -
                                                                     shared_sizze_80307 %
                                                                     8) % 8) +
                                                                   (shared_sizze_80309 +
                                                                    (8 -
                                                                     shared_sizze_80309 %
                                                                     8) % 8)));
                                time_start_80305 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegred_large_68229_runs,
                                                          &ctx->mainzisegred_large_68229_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_68229,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segred_group_sizze_68222,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80307 +
                                                                   (8 -
                                                                    shared_sizze_80307 %
                                                                    8) % 8) +
                                                                  (shared_sizze_80309 +
                                                                   (8 -
                                                                    shared_sizze_80309 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80304,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80306 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segred_large_68229",
                                        time_end_80306 - time_start_80305);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_78570,
                                                  "segred_tmp_mem_78570") != 0)
                            return 1;
                    }
                    
                    int64_t segmap_usable_groups_68262 =
                            sdiv_up64(binop_x_76977, segmap_group_sizze_68261);
                    struct memblock_device mem_77184;
                    
                    mem_77184.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77184, bytes_76979,
                                              "mem_77184")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80322 = mem_77179.mem;
                    CUdeviceptr kernel_arg_80323 = mem_77184.mem;
                    
                    if ((((((1 && segmap_usable_groups_68262 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_68261 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_68262;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80319[] = {&ctx->global_failure,
                                                     &m_65343, &n_m_65352,
                                                     &kernel_arg_80322,
                                                     &kernel_arg_80323};
                        int64_t time_start_80320 = 0, time_end_80321 = 0;
                        
                        if (ctx->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_68266",
                                    (long) segmap_usable_groups_68262, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_68261,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80320 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_68266_runs,
                                                      &ctx->mainzisegmap_68266_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_68266,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_68261,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80319,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80321 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_68266", time_end_80321 -
                                    time_start_80320);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77179, "mem_77179") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77189;
                    
                    mem_77189.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77189, bytes_76979,
                                              "mem_77189")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(q_65346 * (int64_t) 2,
                              segred_group_sizze_68272)) {
                        int64_t segment_sizze_nonzzero_78618 =
                                smax64((int64_t) 1, q_65346);
                        int64_t num_threads_78619 = num_groups_68273 *
                                segred_group_sizze_68272;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_68272,
                                                        segment_sizze_nonzzero_78618),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                       n_m_65352,
                                                                       squot64(segred_group_sizze_68272,
                                                                               segment_sizze_nonzzero_78618))),
                                    '\n');
                        
                        unsigned int shared_sizze_80327 = (int64_t) 4 *
                                     segred_group_sizze_68272;
                        CUdeviceptr kernel_arg_80329 = mem_77082.mem;
                        CUdeviceptr kernel_arg_80330 = mem_77086.mem;
                        CUdeviceptr kernel_arg_80331 = mem_77090.mem;
                        CUdeviceptr kernel_arg_80332 = mem_77114.mem;
                        CUdeviceptr kernel_arg_80333 = mem_77170.mem;
                        CUdeviceptr kernel_arg_80334 = mem_77174.mem;
                        CUdeviceptr kernel_arg_80335 = mem_77184.mem;
                        CUdeviceptr kernel_arg_80336 = mem_77189.mem;
                        unsigned int shared_offset_80328 = 0;
                        
                        if ((((((1 && num_groups_68273 != 0) && 1 != 0) && 1 !=
                               0) && segred_group_sizze_68272 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_68273;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80324[] = {&ctx->global_failure,
                                                         &shared_offset_80328,
                                                         &m_65343, &n_65344,
                                                         &q_65346, &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &num_groups_68273,
                                                         &segment_sizze_nonzzero_78618,
                                                         &kernel_arg_80329,
                                                         &kernel_arg_80330,
                                                         &kernel_arg_80331,
                                                         &kernel_arg_80332,
                                                         &kernel_arg_80333,
                                                         &kernel_arg_80334,
                                                         &kernel_arg_80335,
                                                         &kernel_arg_80336};
                            int64_t time_start_80325 = 0, time_end_80326 = 0;
                            
                            if (ctx->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_68279",
                                        (long) num_groups_68273, (long) 1,
                                        (long) 1,
                                        (long) segred_group_sizze_68272,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80327 +
                                                                    (8 -
                                                                     shared_sizze_80327 %
                                                                     8) % 8)));
                                time_start_80325 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegred_small_68279_runs,
                                                          &ctx->mainzisegred_small_68279_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_68279,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segred_group_sizze_68272,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80327 +
                                                                   (8 -
                                                                    shared_sizze_80327 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80324,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80326 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segred_small_68279",
                                        time_end_80326 - time_start_80325);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_78647 =
                                sdiv_up64(num_groups_68273, smax64((int64_t) 1,
                                                                   m_65343 *
                                                                   n_m_65352));
                        int64_t elements_per_thread_78648 = sdiv_up64(q_65346,
                                                                      segred_group_sizze_68272 *
                                                                      groups_per_segment_78647);
                        int64_t virt_num_groups_78649 =
                                groups_per_segment_78647 * (m_65343 *
                                                            n_m_65352);
                        int64_t num_threads_78650 = num_groups_68273 *
                                segred_group_sizze_68272;
                        int64_t threads_per_segment_78651 =
                                groups_per_segment_78647 *
                                segred_group_sizze_68272;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_78649, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_68273, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_68272, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_78648,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_78647, '\n');
                        
                        struct memblock_device segred_tmp_mem_78652;
                        
                        segred_tmp_mem_78652.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_78652,
                                                  (int64_t) 4 *
                                                  virt_num_groups_78649,
                                                  "segred_tmp_mem_78652")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_78654 =
                                               ctx->mainzicounter_mem_78654;
                        unsigned int shared_sizze_80341 = 1;
                        unsigned int shared_sizze_80343 = (int64_t) 4 *
                                     segred_group_sizze_68272;
                        CUdeviceptr kernel_arg_80345 = mem_77082.mem;
                        CUdeviceptr kernel_arg_80346 = mem_77086.mem;
                        CUdeviceptr kernel_arg_80347 = mem_77090.mem;
                        CUdeviceptr kernel_arg_80348 = mem_77114.mem;
                        CUdeviceptr kernel_arg_80349 = mem_77170.mem;
                        CUdeviceptr kernel_arg_80350 = mem_77174.mem;
                        CUdeviceptr kernel_arg_80351 = mem_77184.mem;
                        CUdeviceptr kernel_arg_80352 = mem_77189.mem;
                        CUdeviceptr kernel_arg_80353 = segred_tmp_mem_78652.mem;
                        CUdeviceptr kernel_arg_80354 =
                                    mainzicounter_mem_78654.mem;
                        unsigned int shared_offset_80342 = 0;
                        unsigned int shared_offset_80344 = 0 +
                                     (shared_sizze_80341 + (8 -
                                                            shared_sizze_80341 %
                                                            8) % 8);
                        
                        if ((((((1 && num_groups_68273 != 0) && 1 != 0) && 1 !=
                               0) && segred_group_sizze_68272 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_68273;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80338[] = {&ctx->global_failure,
                                                         &shared_offset_80342,
                                                         &shared_offset_80344,
                                                         &m_65343, &n_65344,
                                                         &q_65346, &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &num_groups_68273,
                                                         &groups_per_segment_78647,
                                                         &elements_per_thread_78648,
                                                         &virt_num_groups_78649,
                                                         &threads_per_segment_78651,
                                                         &kernel_arg_80345,
                                                         &kernel_arg_80346,
                                                         &kernel_arg_80347,
                                                         &kernel_arg_80348,
                                                         &kernel_arg_80349,
                                                         &kernel_arg_80350,
                                                         &kernel_arg_80351,
                                                         &kernel_arg_80352,
                                                         &kernel_arg_80353,
                                                         &kernel_arg_80354};
                            int64_t time_start_80339 = 0, time_end_80340 = 0;
                            
                            if (ctx->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_68279",
                                        (long) num_groups_68273, (long) 1,
                                        (long) 1,
                                        (long) segred_group_sizze_68272,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80341 +
                                                                    (8 -
                                                                     shared_sizze_80341 %
                                                                     8) % 8) +
                                                                   (shared_sizze_80343 +
                                                                    (8 -
                                                                     shared_sizze_80343 %
                                                                     8) % 8)));
                                time_start_80339 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegred_large_68279_runs,
                                                          &ctx->mainzisegred_large_68279_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_68279,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segred_group_sizze_68272,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80341 +
                                                                   (8 -
                                                                    shared_sizze_80341 %
                                                                    8) % 8) +
                                                                  (shared_sizze_80343 +
                                                                   (8 -
                                                                    shared_sizze_80343 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80338,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80340 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segred_large_68279",
                                        time_end_80340 - time_start_80339);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_78652,
                                                  "segred_tmp_mem_78652") != 0)
                            return 1;
                    }
                    if (memblock_unref_device(ctx, &mem_77170, "mem_77170") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77174, "mem_77174") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77184, "mem_77184") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77190, &mem_77189,
                                            "mem_77189") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77189, "mem_77189") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77184, "mem_77184") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77179, "mem_77179") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77174, "mem_77174") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77170, "mem_77170") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77166, "mem_77166") !=
                        0)
                        return 1;
                }
                if (memblock_unref_device(ctx, &mem_77082, "mem_77082") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77086, "mem_77086") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77090, "mem_77090") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77096, "mem_77096") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77100, "mem_77100") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77103, "mem_77103") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77106, "mem_77106") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77109, "mem_77109") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77114, "mem_77114") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77196, &ext_mem_77190,
                                        "ext_mem_77190") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77190,
                                          "ext_mem_77190") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77114, "mem_77114") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77109, "mem_77109") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77106, "mem_77106") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77103, "mem_77103") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77100, "mem_77100") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77096, "mem_77096") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77090, "mem_77090") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77086, "mem_77086") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77082, "mem_77082") != 0)
                    return 1;
            }
            if (memblock_set_device(ctx, &ext_mem_77824, &ext_mem_77196,
                                    "ext_mem_77196") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77823, &mem_76980,
                                    "mem_76980") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77196, "ext_mem_77196") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_76980, "mem_76980") != 0)
                return 1;
        } else {
            bool match_lit_65557 = (int64_t) 1 == degree_65347;
            struct memblock_device ext_mem_77822;
            
            ext_mem_77822.references = NULL;
            
            struct memblock_device ext_mem_77821;
            
            ext_mem_77821.references = NULL;
            if (match_lit_65557) {
                bool suff_outer_par_68320;
                
                suff_outer_par_68320 =
                    *ctx->tuning_params.mainzisuff_outer_par_2 <= m_65343;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_2", (long) m_65343,
                            suff_outer_par_68320 ? "true" : "false");
                
                int64_t segmap_group_sizze_68532;
                
                segmap_group_sizze_68532 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_68324;
                
                int64_t num_groups_68533;
                int32_t max_num_groups_78692;
                
                max_num_groups_78692 =
                    *ctx->tuning_params.mainzisegmap_num_groups_68326;
                num_groups_68533 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(m_65343,
                                                                        segmap_group_sizze_68532),
                                                              sext_i32_i64(max_num_groups_78692))));
                
                int64_t nest_sizze_69634 = m_65343 * n_65344;
                int64_t segscan_group_sizze_69635;
                
                segscan_group_sizze_69635 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_69615;
                
                int64_t num_groups_69636;
                int32_t max_num_groups_78693;
                
                max_num_groups_78693 =
                    *ctx->tuning_params.mainzisegscan_num_groups_69617;
                num_groups_69636 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_69634,
                                                                        segscan_group_sizze_69635),
                                                              sext_i32_i64(max_num_groups_78693))));
                
                int64_t segmap_group_sizze_69688;
                
                segmap_group_sizze_69688 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69529;
                
                int64_t segmap_group_sizze_69708;
                
                segmap_group_sizze_69708 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69503;
                
                int64_t segmap_group_sizze_69718;
                
                segmap_group_sizze_69718 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69477;
                
                int64_t nest_sizze_69739 = m_65343 * q_65346;
                int64_t segmap_group_sizze_69740;
                
                segmap_group_sizze_69740 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69452;
                
                bool suff_outer_par_69757;
                
                suff_outer_par_69757 =
                    *ctx->tuning_params.mainzisuff_outer_par_3 <= binop_x_76977;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_3", (long) binop_x_76977,
                            suff_outer_par_69757 ? "true" : "false");
                
                int64_t segmap_group_sizze_69939;
                
                segmap_group_sizze_69939 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69101;
                
                int64_t nest_sizze_70042 = q_65346 * binop_x_76977;
                int64_t segred_group_sizze_70043;
                
                segred_group_sizze_70043 =
                    *ctx->tuning_params.mainzisegred_group_sizze_69048;
                
                int64_t num_groups_70044;
                int32_t max_num_groups_78694;
                
                max_num_groups_78694 =
                    *ctx->tuning_params.mainzisegred_num_groups_69050;
                num_groups_70044 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_70042,
                                                                        segred_group_sizze_70043),
                                                              sext_i32_i64(max_num_groups_78694))));
                
                int64_t segmap_group_sizze_70092;
                
                segmap_group_sizze_70092 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69026;
                
                int64_t segred_group_sizze_70114;
                
                segred_group_sizze_70114 =
                    *ctx->tuning_params.mainzisegred_group_sizze_68953;
                
                int64_t num_groups_70115;
                int32_t max_num_groups_78695;
                
                max_num_groups_78695 =
                    *ctx->tuning_params.mainzisegred_num_groups_68955;
                num_groups_70115 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_70042,
                                                                        segred_group_sizze_70114),
                                                              sext_i32_i64(max_num_groups_78695))));
                
                int64_t tile_sizze_75307;
                
                tile_sizze_75307 = *ctx->tuning_params.mainzitile_sizze_75306;
                
                int64_t group_sizze_75308 = tile_sizze_75307 * tile_sizze_75307;
                int64_t bytes_77198 = (int64_t) 4 * nest_sizze_69634;
                int64_t binop_y_77201 = (int64_t) 8 * n_65344;
                int64_t bytes_77202 = smax64((int64_t) 0, binop_y_77201);
                int64_t binop_y_77216 = (int64_t) 4 * n_65344;
                int64_t bytes_77217 = smax64((int64_t) 0, binop_y_77216);
                int64_t binop_y_77261 = (int64_t) 4 * q_65346;
                int64_t bytes_77262 = smax64((int64_t) 0, binop_y_77261);
                int64_t binop_y_77276 = (int64_t) 4 * n_m_65352;
                int64_t bytes_77277 = smax64((int64_t) 0, binop_y_77276);
                int64_t binop_y_77314 = (int64_t) 8 * nest_sizze_69634;
                int64_t bytes_77315 = smax64((int64_t) 0, binop_y_77314);
                int64_t bytes_77319 = smax64((int64_t) 0, bytes_77198);
                int64_t binop_y_77332 = (int64_t) 8 * m_65343;
                int64_t bytes_77333 = smax64((int64_t) 0, binop_y_77332);
                int64_t binop_y_77341 = (int64_t) 4 * m_65343;
                int64_t bytes_77342 = smax64((int64_t) 0, binop_y_77341);
                int64_t binop_y_77346 = (int64_t) 4 * nest_sizze_69739;
                int64_t bytes_77347 = smax64((int64_t) 0, binop_y_77346);
                int64_t bytes_77352 = (int64_t) 8 * group_sizze_75308;
                int64_t bytes_77361 = (int64_t) 4 * group_sizze_75308;
                int64_t bytes_77379 = smax64((int64_t) 0, bytes_77361);
                int64_t binop_x_78019 = (int64_t) 4 * tile_sizze_75307;
                int64_t sizze_78020 = tile_sizze_75307 * binop_x_78019;
                int64_t binop_y_77429 = (int64_t) 8 * binop_x_76977;
                int64_t bytes_77430 = smax64((int64_t) 0, binop_y_77429);
                int64_t binop_x_78081 = (int64_t) 4 * tile_sizze_75307;
                int64_t num_bytes_78082 = tile_sizze_75307 * binop_x_78081;
                int64_t binop_x_78086 = (int64_t) 4 * tile_sizze_75307;
                int64_t num_bytes_78087 = tile_sizze_75307 * binop_x_78086;
                int64_t binop_x_78091 = (int64_t) 4 * tile_sizze_75307;
                int64_t num_bytes_78092 = tile_sizze_75307 * binop_x_78091;
                int64_t maxSubHelper_78148 = umax64(bytes_77361, sizze_78020);
                int64_t maxSubHelper_78149 = umax64(num_bytes_78092,
                                                    maxSubHelper_78148);
                int64_t maxSubHelper_78150 = umax64(bytes_77361, sizze_78020);
                int64_t maxSubHelper_78151 = umax64(num_bytes_78087,
                                                    maxSubHelper_78150);
                int64_t maxSubHelper_78152 = umax64(sizze_78020,
                                                    num_bytes_78082);
                int64_t num_threads_78217 = segmap_group_sizze_68532 *
                        num_groups_68533;
                int64_t total_sizze_78218 = bytes_77277 * num_threads_78217;
                int64_t total_sizze_78219 = bytes_77277 * num_threads_78217;
                int64_t total_sizze_78220 = bytes_77262 * num_threads_78217;
                int64_t total_sizze_78221 = bytes_77202 * num_threads_78217;
                int64_t total_sizze_78222 = bytes_77202 * num_threads_78217;
                int64_t total_sizze_78223 = bytes_77217 * num_threads_78217;
                struct memblock_device ext_mem_77488;
                
                ext_mem_77488.references = NULL;
                
                struct memblock_device ext_mem_77487;
                
                ext_mem_77487.references = NULL;
                
                int32_t local_memory_capacity_79144;
                
                local_memory_capacity_79144 = ctx->cuda.max_shared_memory;
                if (sle64((int64_t) 0,
                          sext_i32_i64(local_memory_capacity_79144)) &&
                    suff_outer_par_68320) {
                    struct memblock_device mem_77199;
                    
                    mem_77199.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77199, bytes_77198,
                                              "mem_77199")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77199,
                                                              (int64_t) 0,
                                                              Y_mem_76976,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              n_65344,
                                                              m_65343) != 0) {
                        if (memblock_unref_device(ctx, &mem_77199,
                                                  "mem_77199") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77308;
                    
                    mem_77308.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77308, binop_y_76978,
                                              "mem_77308")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77311;
                    
                    mem_77311.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77311, binop_y_76978,
                                              "mem_77311")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78142;
                    
                    color_78142.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78142,
                                              total_sizze_78218,
                                              "color_78142")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78143;
                    
                    color_78143.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78143,
                                              total_sizze_78219,
                                              "color_78143")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78144;
                    
                    color_78144.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78144,
                                              total_sizze_78220,
                                              "color_78144")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78145;
                    
                    color_78145.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78145,
                                              total_sizze_78221,
                                              "color_78145")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78146;
                    
                    color_78146.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78146,
                                              total_sizze_78222,
                                              "color_78146")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78147;
                    
                    color_78147.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78147,
                                              total_sizze_78223,
                                              "color_78147")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80358 = mem_77199.mem;
                    CUdeviceptr kernel_arg_80359 = mem_77308.mem;
                    CUdeviceptr kernel_arg_80360 = mem_77311.mem;
                    CUdeviceptr kernel_arg_80361 = color_78142.mem;
                    CUdeviceptr kernel_arg_80362 = color_78143.mem;
                    CUdeviceptr kernel_arg_80363 = color_78144.mem;
                    CUdeviceptr kernel_arg_80364 = color_78145.mem;
                    CUdeviceptr kernel_arg_80365 = color_78146.mem;
                    CUdeviceptr kernel_arg_80366 = color_78147.mem;
                    
                    if ((((((1 && num_groups_68533 != 0) && 1 != 0) && 1 !=
                           0) && segmap_group_sizze_68532 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_68533;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80355[] = {&ctx->global_failure,
                                                     &ctx->failure_is_an_option,
                                                     &ctx->global_failure_args,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &jump_65348,
                                                     &n_m_65352, &i_65358,
                                                     &x_65359, &min_res_65364,
                                                     &loop_cond_65369,
                                                     &i64_res_65370,
                                                     &num_groups_68533,
                                                     &num_threads_78217,
                                                     &kernel_arg_80358,
                                                     &kernel_arg_80359,
                                                     &kernel_arg_80360,
                                                     &kernel_arg_80361,
                                                     &kernel_arg_80362,
                                                     &kernel_arg_80363,
                                                     &kernel_arg_80364,
                                                     &kernel_arg_80365,
                                                     &kernel_arg_80366};
                        int64_t time_start_80356 = 0, time_end_80357 = 0;
                        
                        if (ctx->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_68538",
                                    (long) num_groups_68533, (long) 1, (long) 1,
                                    (long) segmap_group_sizze_68532, (long) 1,
                                    (long) 1, (int) 0);
                            time_start_80356 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_68538_runs,
                                                      &ctx->mainzisegmap_68538_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_68538,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_68532,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80355,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80357 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_68538", time_end_80357 -
                                    time_start_80356);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77199, "mem_77199") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78142,
                                              "color_78142") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78143,
                                              "color_78143") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78144,
                                              "color_78144") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78145,
                                              "color_78145") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78146,
                                              "color_78146") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78147,
                                              "color_78147") != 0)
                        return 1;
                    
                    struct memblock_device mem_77480;
                    
                    mem_77480.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77480, bytes_76979,
                                              "mem_77480")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77480,
                                                              (int64_t) 0,
                                                              mem_77308,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77480,
                                                  "mem_77480") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78147,
                                                  "color_78147") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78146,
                                                  "color_78146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78145,
                                                  "color_78145") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78144,
                                                  "color_78144") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78143,
                                                  "color_78143") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78142,
                                                  "color_78142") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77311,
                                                  "mem_77311") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77308,
                                                  "mem_77308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77199,
                                                  "mem_77199") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77308, "mem_77308") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77485;
                    
                    mem_77485.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77485, bytes_76979,
                                              "mem_77485")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77485,
                                                              (int64_t) 0,
                                                              mem_77311,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77485,
                                                  "mem_77485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77480,
                                                  "mem_77480") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78147,
                                                  "color_78147") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78146,
                                                  "color_78146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78145,
                                                  "color_78145") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78144,
                                                  "color_78144") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78143,
                                                  "color_78143") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78142,
                                                  "color_78142") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77311,
                                                  "mem_77311") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77308,
                                                  "mem_77308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77199,
                                                  "mem_77199") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77311, "mem_77311") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77488, &mem_77480,
                                            "mem_77480") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77487, &mem_77485,
                                            "mem_77485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77485, "mem_77485") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77480, "mem_77480") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78147,
                                              "color_78147") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78146,
                                              "color_78146") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78145,
                                              "color_78145") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78144,
                                              "color_78144") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78143,
                                              "color_78143") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78142,
                                              "color_78142") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77311, "mem_77311") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77308, "mem_77308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77199, "mem_77199") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_77316;
                    
                    mem_77316.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77316, bytes_77315,
                                              "mem_77316")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_65343 * n_65344)) {
                        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_78735 = sdiv_up64(m_65343 * n_65344,
                                                             segscan_group_sizze_69635 *
                                                             (int64_t) 11) *
                                segscan_group_sizze_69635;
                        int64_t numGroups_78736 = sdiv_up64(m_65343 * n_65344,
                                                            segscan_group_sizze_69635 *
                                                            (int64_t) 11);
                        struct memblock_device mainziid_counter_mem_78737 =
                                               ctx->mainziid_counter_mem_78737;
                        struct memblock_device status_flags_mem_78739;
                        
                        status_flags_mem_78739.references = NULL;
                        if (memblock_alloc_device(ctx, &status_flags_mem_78739,
                                                  numGroups_78736,
                                                  "status_flags_mem_78739")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device aggregates_mem_78741;
                        
                        aggregates_mem_78741.references = NULL;
                        if (memblock_alloc_device(ctx, &aggregates_mem_78741,
                                                  (int64_t) 8 * numGroups_78736,
                                                  "aggregates_mem_78741")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device incprefixes_mem_78743;
                        
                        incprefixes_mem_78743.references = NULL;
                        if (memblock_alloc_device(ctx, &incprefixes_mem_78743,
                                                  (int64_t) 8 * numGroups_78736,
                                                  "incprefixes_mem_78743")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhreplicate_i8(ctx,
                                                         status_flags_mem_78739,
                                                         numGroups_78736,
                                                         (int8_t) 0) != 0) {
                            if (memblock_unref_device(ctx,
                                                      &incprefixes_mem_78743,
                                                      "incprefixes_mem_78743") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &aggregates_mem_78741,
                                                      "aggregates_mem_78741") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &status_flags_mem_78739,
                                                      "status_flags_mem_78739") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_77316,
                                                      "mem_77316") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77487,
                                                      "ext_mem_77487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77488,
                                                      "ext_mem_77488") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77821,
                                                      "ext_mem_77821") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77822,
                                                      "ext_mem_77822") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77823,
                                                      "ext_mem_77823") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77824,
                                                      "ext_mem_77824") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77995,
                                                      "ext_mem_77995") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77996,
                                                      "ext_mem_77996") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_78270,
                                                      "mem_out_78270") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        unsigned int shared_sizze_80371 =
                                     smax64(smax64((int64_t) 288, (int64_t) 8 *
                                                   segscan_group_sizze_69635),
                                            (int64_t) 11 *
                                            segscan_group_sizze_69635 *
                                            (int64_t) 8);
                        CUdeviceptr kernel_arg_80373 = Y_mem_76976.mem;
                        CUdeviceptr kernel_arg_80374 = mem_77316.mem;
                        CUdeviceptr kernel_arg_80375 =
                                    mainziid_counter_mem_78737.mem;
                        CUdeviceptr kernel_arg_80376 =
                                    status_flags_mem_78739.mem;
                        CUdeviceptr kernel_arg_80377 = aggregates_mem_78741.mem;
                        CUdeviceptr kernel_arg_80378 =
                                    incprefixes_mem_78743.mem;
                        unsigned int shared_offset_80372 = 0;
                        
                        if ((((((1 && sdiv_up64(m_65343 * n_65344,
                                                segscan_group_sizze_69635 *
                                                (int64_t) 11) != 0) && 1 !=
                                0) && 1 != 0) && segscan_group_sizze_69635 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_65343 * n_65344,
                                                      segscan_group_sizze_69635 *
                                                      (int64_t) 11);
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80368[] = {&ctx->global_failure,
                                                         &shared_offset_80372,
                                                         &m_65343, &n_65344,
                                                         &kernel_arg_80373,
                                                         &kernel_arg_80374,
                                                         &kernel_arg_80375,
                                                         &kernel_arg_80376,
                                                         &kernel_arg_80377,
                                                         &kernel_arg_80378};
                            int64_t time_start_80369 = 0, time_end_80370 = 0;
                            
                            if (ctx->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_69641",
                                        (long) sdiv_up64(m_65343 * n_65344,
                                                         segscan_group_sizze_69635 *
                                                         (int64_t) 11),
                                        (long) 1, (long) 1,
                                        (long) segscan_group_sizze_69635,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80371 +
                                                                    (8 -
                                                                     shared_sizze_80371 %
                                                                     8) % 8)));
                                time_start_80369 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegscan_69641_runs,
                                                          &ctx->mainzisegscan_69641_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_69641,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segscan_group_sizze_69635,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80371 +
                                                                   (8 -
                                                                    shared_sizze_80371 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80368,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80370 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segscan_69641", time_end_80370 -
                                        time_start_80369);
                            }
                        }
                        if (memblock_unref_device(ctx, &incprefixes_mem_78743,
                                                  "incprefixes_mem_78743") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &aggregates_mem_78741,
                                                  "aggregates_mem_78741") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &status_flags_mem_78739,
                                                  "status_flags_mem_78739") !=
                            0)
                            return 1;
                    }
                    
                    struct memblock_device mem_77320;
                    
                    mem_77320.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77320, bytes_77319,
                                              "mem_77320")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_77320, m_65343 *
                                                      n_65344, 0.0F) != 0) {
                        if (memblock_unref_device(ctx, &mem_77320,
                                                  "mem_77320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77316,
                                                  "mem_77316") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77324;
                    
                    mem_77324.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77324, bytes_77315,
                                              "mem_77324")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i64(ctx, mem_77324, m_65343 *
                                                      n_65344, (int64_t) -1) !=
                        0) {
                        if (memblock_unref_device(ctx, &mem_77324,
                                                  "mem_77324") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77320,
                                                  "mem_77320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77316,
                                                  "mem_77316") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_usable_groups_69689 =
                            sdiv_up64(nest_sizze_69634,
                                      segmap_group_sizze_69688);
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80382 = Y_mem_76976.mem;
                    CUdeviceptr kernel_arg_80383 = mem_77316.mem;
                    CUdeviceptr kernel_arg_80384 = mem_77320.mem;
                    CUdeviceptr kernel_arg_80385 = mem_77324.mem;
                    
                    if ((((((1 && segmap_usable_groups_69689 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_69688 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_69689;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80379[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80382,
                                                     &kernel_arg_80383,
                                                     &kernel_arg_80384,
                                                     &kernel_arg_80385};
                        int64_t time_start_80380 = 0, time_end_80381 = 0;
                        
                        if (ctx->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_69694",
                                    (long) segmap_usable_groups_69689, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_69688,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80380 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_69694_runs,
                                                      &ctx->mainzisegmap_69694_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_69694,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_69688,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80379,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80381 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_69694", time_end_80381 -
                                    time_start_80380);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_69709 =
                            sdiv_up64(nest_sizze_69634,
                                      segmap_group_sizze_69708);
                    struct memblock_device mem_77330;
                    
                    mem_77330.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77330, bytes_77315,
                                              "mem_77330")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80389 = mem_77324.mem;
                    CUdeviceptr kernel_arg_80390 = mem_77330.mem;
                    
                    if ((((((1 && segmap_usable_groups_69709 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_69708 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_69709;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80386[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80389,
                                                     &kernel_arg_80390};
                        int64_t time_start_80387 = 0, time_end_80388 = 0;
                        
                        if (ctx->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_69713",
                                    (long) segmap_usable_groups_69709, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_69708,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80387 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_69713_runs,
                                                      &ctx->mainzisegmap_69713_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_69713,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_69708,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80386,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80388 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_69713", time_end_80388 -
                                    time_start_80387);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_69719 = sdiv_up64(m_65343,
                                                                   segmap_group_sizze_69718);
                    struct memblock_device mem_77334;
                    
                    mem_77334.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77334, bytes_77333,
                                              "mem_77334")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77337;
                    
                    mem_77337.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77337, bytes_77333,
                                              "mem_77337")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77340;
                    
                    mem_77340.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77340, bytes_77333,
                                              "mem_77340")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77343;
                    
                    mem_77343.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77343, bytes_77342,
                                              "mem_77343")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80394 = mem_77316.mem;
                    CUdeviceptr kernel_arg_80395 = mem_77334.mem;
                    CUdeviceptr kernel_arg_80396 = mem_77337.mem;
                    CUdeviceptr kernel_arg_80397 = mem_77340.mem;
                    CUdeviceptr kernel_arg_80398 = mem_77343.mem;
                    
                    if ((((((1 && segmap_usable_groups_69719 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_69718 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_69719;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80391[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &i_65358,
                                                     &min_res_65364,
                                                     &i64_res_65370,
                                                     &kernel_arg_80394,
                                                     &kernel_arg_80395,
                                                     &kernel_arg_80396,
                                                     &kernel_arg_80397,
                                                     &kernel_arg_80398};
                        int64_t time_start_80392 = 0, time_end_80393 = 0;
                        
                        if (ctx->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_69725",
                                    (long) segmap_usable_groups_69719, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_69718,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80392 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_69725_runs,
                                                      &ctx->mainzisegmap_69725_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_69725,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_69718,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80391,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80393 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_69725", time_end_80393 -
                                    time_start_80392);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_69741 =
                            sdiv_up64(nest_sizze_69739,
                                      segmap_group_sizze_69740);
                    struct memblock_device mem_77348;
                    
                    mem_77348.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77348, bytes_77347,
                                              "mem_77348")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80402 = mem_77316.mem;
                    CUdeviceptr kernel_arg_80403 = mem_77348.mem;
                    
                    if ((((((1 && segmap_usable_groups_69741 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_69740 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_69741;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80399[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &i_65358,
                                                     &kernel_arg_80402,
                                                     &kernel_arg_80403};
                        int64_t time_start_80400 = 0, time_end_80401 = 0;
                        
                        if (ctx->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_69745",
                                    (long) segmap_usable_groups_69741, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_69740,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80400 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_69745_runs,
                                                      &ctx->mainzisegmap_69745_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_69745,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_69740,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80399,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80401 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_69745", time_end_80401 -
                                    time_start_80400);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    struct memblock_device ext_mem_77476;
                    
                    ext_mem_77476.references = NULL;
                    
                    struct memblock_device ext_mem_77475;
                    
                    ext_mem_77475.references = NULL;
                    
                    int32_t local_memory_capacity_79143;
                    
                    local_memory_capacity_79143 = ctx->cuda.max_shared_memory;
                    if (sle64(bytes_77379 + srem64((int64_t) 8 -
                                                   srem64(bytes_77379,
                                                          (int64_t) 8),
                                                   (int64_t) 8),
                              sext_i32_i64(local_memory_capacity_79143)) &&
                        suff_outer_par_69757) {
                        int64_t num_groups_x_75309 = sdiv_up64(m_65343,
                                                               tile_sizze_75307);
                        int64_t num_groups_y_75310 = sdiv_up64(n_m_65352,
                                                               tile_sizze_75307);
                        int64_t num_groups_top_75311 = num_groups_x_75309 *
                                num_groups_y_75310;
                        int64_t num_whole_tiles_75442 = squot64(q_65346,
                                                                tile_sizze_75307);
                        int64_t residual_input_75690 = srem64(q_65346,
                                                              tile_sizze_75307);
                        bool cond_75691 = residual_input_75690 == (int64_t) 0;
                        struct memblock_device mem_77422;
                        
                        mem_77422.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77422, bytes_76979,
                                                  "mem_77422")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77426;
                        
                        mem_77426.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77426, bytes_76979,
                                                  "mem_77426")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_80407 = bytes_77379;
                        CUdeviceptr kernel_arg_80409 = mem_77316.mem;
                        CUdeviceptr kernel_arg_80410 = mem_77320.mem;
                        CUdeviceptr kernel_arg_80411 = mem_77324.mem;
                        CUdeviceptr kernel_arg_80412 = mem_77330.mem;
                        CUdeviceptr kernel_arg_80413 = mem_77334.mem;
                        CUdeviceptr kernel_arg_80414 = mem_77337.mem;
                        CUdeviceptr kernel_arg_80415 = mem_77340.mem;
                        CUdeviceptr kernel_arg_80416 = mem_77343.mem;
                        CUdeviceptr kernel_arg_80417 = mem_77348.mem;
                        CUdeviceptr kernel_arg_80418 = mem_77422.mem;
                        CUdeviceptr kernel_arg_80419 = mem_77426.mem;
                        unsigned int shared_offset_80408 = 0;
                        
                        if ((((((1 && num_groups_top_75311 != 0) && 1 != 0) &&
                               1 != 0) && group_sizze_75308 != 0) && 1 != 0) &&
                            1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_top_75311;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80404[] = {&ctx->global_failure,
                                                         &ctx->failure_is_an_option,
                                                         &ctx->global_failure_args,
                                                         &shared_offset_80408,
                                                         &m_65343, &n_65344,
                                                         &q_65346, &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &x_65359,
                                                         &min_res_65364,
                                                         &loop_cond_65369,
                                                         &num_groups_x_75309,
                                                         &num_groups_y_75310,
                                                         &num_whole_tiles_75442,
                                                         &residual_input_75690,
                                                         &cond_75691,
                                                         &kernel_arg_80409,
                                                         &kernel_arg_80410,
                                                         &kernel_arg_80411,
                                                         &kernel_arg_80412,
                                                         &kernel_arg_80413,
                                                         &kernel_arg_80414,
                                                         &kernel_arg_80415,
                                                         &kernel_arg_80416,
                                                         &kernel_arg_80417,
                                                         &kernel_arg_80418,
                                                         &kernel_arg_80419};
                            int64_t time_start_80405 = 0, time_end_80406 = 0;
                            
                            if (ctx->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_75312",
                                        (long) num_groups_top_75311, (long) 1,
                                        (long) 1, (long) group_sizze_75308,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80407 +
                                                                    (8 -
                                                                     shared_sizze_80407 %
                                                                     8) % 8)));
                                time_start_80405 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_75312_runs,
                                                          &ctx->mainzisegmap_intragroup_75312_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_75312,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  group_sizze_75308,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80407 +
                                                                   (8 -
                                                                    shared_sizze_80407 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80404,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80406 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_75312",
                                        time_end_80406 - time_start_80405);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_77476, &mem_77422,
                                                "mem_77422") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77475, &mem_77426,
                                                "mem_77426") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77426,
                                                  "mem_77426") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77422,
                                                  "mem_77422") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_69940 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_69939);
                        struct memblock_device mem_77431;
                        
                        mem_77431.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77431, bytes_77430,
                                                  "mem_77431")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77435;
                        
                        mem_77435.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77435, bytes_77430,
                                                  "mem_77435")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77439;
                        
                        mem_77439.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77439, bytes_76979,
                                                  "mem_77439")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_80423 = mem_77324.mem;
                        CUdeviceptr kernel_arg_80424 = mem_77330.mem;
                        CUdeviceptr kernel_arg_80425 = mem_77334.mem;
                        CUdeviceptr kernel_arg_80426 = mem_77337.mem;
                        CUdeviceptr kernel_arg_80427 = mem_77340.mem;
                        CUdeviceptr kernel_arg_80428 = mem_77343.mem;
                        CUdeviceptr kernel_arg_80429 = mem_77431.mem;
                        CUdeviceptr kernel_arg_80430 = mem_77435.mem;
                        CUdeviceptr kernel_arg_80431 = mem_77439.mem;
                        
                        if ((((((1 && segmap_usable_groups_69940 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_69939 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_69940;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80420[] = {&ctx->global_failure,
                                                         &ctx->failure_is_an_option,
                                                         &ctx->global_failure_args,
                                                         &m_65343, &n_65344,
                                                         &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &x_65359,
                                                         &min_res_65364,
                                                         &loop_cond_65369,
                                                         &kernel_arg_80423,
                                                         &kernel_arg_80424,
                                                         &kernel_arg_80425,
                                                         &kernel_arg_80426,
                                                         &kernel_arg_80427,
                                                         &kernel_arg_80428,
                                                         &kernel_arg_80429,
                                                         &kernel_arg_80430,
                                                         &kernel_arg_80431};
                            int64_t time_start_80421 = 0, time_end_80422 = 0;
                            
                            if (ctx->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_69946",
                                        (long) segmap_usable_groups_69940,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_69939,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_80421 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_69946_runs,
                                                          &ctx->mainzisegmap_69946_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_69946,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_69939,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_80420,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80422 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_69946", time_end_80422 -
                                        time_start_80421);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77431,
                                                  "mem_77431") != 0)
                            return 1;
                        
                        struct memblock_device mem_77444;
                        
                        mem_77444.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77444, bytes_76979,
                                                  "mem_77444")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77448;
                        
                        mem_77448.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77448, bytes_76979,
                                                  "mem_77448")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77452;
                        
                        mem_77452.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77452, bytes_76979,
                                                  "mem_77452")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_70043)) {
                            int64_t segment_sizze_nonzzero_78947 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_78948 = num_groups_70044 *
                                    segred_group_sizze_70043;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_70043,
                                                            segment_sizze_nonzzero_78947),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_70043,
                                                                                   segment_sizze_nonzzero_78947))),
                                        '\n');
                            
                            unsigned int shared_sizze_80435 = (int64_t) 4 *
                                         segred_group_sizze_70043;
                            unsigned int shared_sizze_80437 = (int64_t) 4 *
                                         segred_group_sizze_70043;
                            unsigned int shared_sizze_80439 = (int64_t) 4 *
                                         segred_group_sizze_70043;
                            CUdeviceptr kernel_arg_80441 = mem_77316.mem;
                            CUdeviceptr kernel_arg_80442 = mem_77324.mem;
                            CUdeviceptr kernel_arg_80443 = mem_77348.mem;
                            CUdeviceptr kernel_arg_80444 = mem_77435.mem;
                            CUdeviceptr kernel_arg_80445 = mem_77439.mem;
                            CUdeviceptr kernel_arg_80446 = mem_77444.mem;
                            CUdeviceptr kernel_arg_80447 = mem_77448.mem;
                            CUdeviceptr kernel_arg_80448 = mem_77452.mem;
                            unsigned int shared_offset_80436 = 0;
                            unsigned int shared_offset_80438 = 0 +
                                         (shared_sizze_80435 + (8 -
                                                                shared_sizze_80435 %
                                                                8) % 8);
                            unsigned int shared_offset_80440 = 0 +
                                         (shared_sizze_80435 + (8 -
                                                                shared_sizze_80435 %
                                                                8) % 8) +
                                         (shared_sizze_80437 + (8 -
                                                                shared_sizze_80437 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_70044 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_70043 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_70044;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80432[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80436,
                                      &shared_offset_80438,
                                      &shared_offset_80440, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_70044,
                                      &segment_sizze_nonzzero_78947,
                                      &kernel_arg_80441, &kernel_arg_80442,
                                      &kernel_arg_80443, &kernel_arg_80444,
                                      &kernel_arg_80445, &kernel_arg_80446,
                                      &kernel_arg_80447, &kernel_arg_80448};
                                int64_t time_start_80433 = 0, time_end_80434 =
                                        0;
                                
                                if (ctx->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_70052",
                                            (long) num_groups_70044, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_70043,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80435 +
                                                                        (8 -
                                                                         shared_sizze_80435 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80437 +
                                                                        (8 -
                                                                         shared_sizze_80437 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80439 +
                                                                        (8 -
                                                                         shared_sizze_80439 %
                                                                         8) %
                                                                        8)));
                                    time_start_80433 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_small_70052_runs,
                                                              &ctx->mainzisegred_small_70052_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_70052,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_70043,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80435 +
                                                                       (8 -
                                                                        shared_sizze_80435 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80437 +
                                                                       (8 -
                                                                        shared_sizze_80437 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80439 +
                                                                       (8 -
                                                                        shared_sizze_80439 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80432,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80434 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_small_70052",
                                            time_end_80434 - time_start_80433);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_78988 =
                                    sdiv_up64(num_groups_70044,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_78989 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_70043 *
                                              groups_per_segment_78988);
                            int64_t virt_num_groups_78990 =
                                    groups_per_segment_78988 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_78991 = num_groups_70044 *
                                    segred_group_sizze_70043;
                            int64_t threads_per_segment_78992 =
                                    groups_per_segment_78988 *
                                    segred_group_sizze_70043;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_78990,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_70044, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_70043,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_78989,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_78988,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_78993;
                            
                            segred_tmp_mem_78993.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_78993,
                                                      (int64_t) 4 *
                                                      virt_num_groups_78990,
                                                      "segred_tmp_mem_78993")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_78995;
                            
                            segred_tmp_mem_78995.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_78995,
                                                      (int64_t) 4 *
                                                      virt_num_groups_78990,
                                                      "segred_tmp_mem_78995")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_78997;
                            
                            segred_tmp_mem_78997.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_78997,
                                                      (int64_t) 4 *
                                                      virt_num_groups_78990,
                                                      "segred_tmp_mem_78997")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_78999 =
                                                   ctx->mainzicounter_mem_78999;
                            unsigned int shared_sizze_80453 = 1;
                            unsigned int shared_sizze_80455 = (int64_t) 4 *
                                         segred_group_sizze_70043;
                            unsigned int shared_sizze_80457 = (int64_t) 4 *
                                         segred_group_sizze_70043;
                            unsigned int shared_sizze_80459 = (int64_t) 4 *
                                         segred_group_sizze_70043;
                            CUdeviceptr kernel_arg_80461 = mem_77316.mem;
                            CUdeviceptr kernel_arg_80462 = mem_77324.mem;
                            CUdeviceptr kernel_arg_80463 = mem_77348.mem;
                            CUdeviceptr kernel_arg_80464 = mem_77435.mem;
                            CUdeviceptr kernel_arg_80465 = mem_77439.mem;
                            CUdeviceptr kernel_arg_80466 = mem_77444.mem;
                            CUdeviceptr kernel_arg_80467 = mem_77448.mem;
                            CUdeviceptr kernel_arg_80468 = mem_77452.mem;
                            CUdeviceptr kernel_arg_80469 =
                                        segred_tmp_mem_78993.mem;
                            CUdeviceptr kernel_arg_80470 =
                                        segred_tmp_mem_78995.mem;
                            CUdeviceptr kernel_arg_80471 =
                                        segred_tmp_mem_78997.mem;
                            CUdeviceptr kernel_arg_80472 =
                                        mainzicounter_mem_78999.mem;
                            unsigned int shared_offset_80454 = 0;
                            unsigned int shared_offset_80456 = 0 +
                                         (shared_sizze_80453 + (8 -
                                                                shared_sizze_80453 %
                                                                8) % 8);
                            unsigned int shared_offset_80458 = 0 +
                                         (shared_sizze_80453 + (8 -
                                                                shared_sizze_80453 %
                                                                8) % 8) +
                                         (shared_sizze_80455 + (8 -
                                                                shared_sizze_80455 %
                                                                8) % 8);
                            unsigned int shared_offset_80460 = 0 +
                                         (shared_sizze_80453 + (8 -
                                                                shared_sizze_80453 %
                                                                8) % 8) +
                                         (shared_sizze_80455 + (8 -
                                                                shared_sizze_80455 %
                                                                8) % 8) +
                                         (shared_sizze_80457 + (8 -
                                                                shared_sizze_80457 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_70044 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_70043 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_70044;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80450[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80454,
                                      &shared_offset_80456,
                                      &shared_offset_80458,
                                      &shared_offset_80460, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_70044,
                                      &groups_per_segment_78988,
                                      &elements_per_thread_78989,
                                      &virt_num_groups_78990,
                                      &threads_per_segment_78992,
                                      &kernel_arg_80461, &kernel_arg_80462,
                                      &kernel_arg_80463, &kernel_arg_80464,
                                      &kernel_arg_80465, &kernel_arg_80466,
                                      &kernel_arg_80467, &kernel_arg_80468,
                                      &kernel_arg_80469, &kernel_arg_80470,
                                      &kernel_arg_80471, &kernel_arg_80472};
                                int64_t time_start_80451 = 0, time_end_80452 =
                                        0;
                                
                                if (ctx->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_70052",
                                            (long) num_groups_70044, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_70043,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80453 +
                                                                        (8 -
                                                                         shared_sizze_80453 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80455 +
                                                                        (8 -
                                                                         shared_sizze_80455 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80457 +
                                                                        (8 -
                                                                         shared_sizze_80457 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80459 +
                                                                        (8 -
                                                                         shared_sizze_80459 %
                                                                         8) %
                                                                        8)));
                                    time_start_80451 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_large_70052_runs,
                                                              &ctx->mainzisegred_large_70052_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_70052,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_70043,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80453 +
                                                                       (8 -
                                                                        shared_sizze_80453 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80455 +
                                                                       (8 -
                                                                        shared_sizze_80455 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80457 +
                                                                       (8 -
                                                                        shared_sizze_80457 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80459 +
                                                                       (8 -
                                                                        shared_sizze_80459 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80450,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80452 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_large_70052",
                                            time_end_80452 - time_start_80451);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_78997,
                                                      "segred_tmp_mem_78997") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_78995,
                                                      "segred_tmp_mem_78995") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_78993,
                                                      "segred_tmp_mem_78993") !=
                                0)
                                return 1;
                        }
                        
                        int64_t segmap_usable_groups_70093 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_70092);
                        struct memblock_device mem_77457;
                        
                        mem_77457.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77457, bytes_76979,
                                                  "mem_77457")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77461;
                        
                        mem_77461.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77461, bytes_76979,
                                                  "mem_77461")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77465;
                        
                        mem_77465.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77465, bytes_76979,
                                                  "mem_77465")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_80476 = mem_77444.mem;
                        CUdeviceptr kernel_arg_80477 = mem_77448.mem;
                        CUdeviceptr kernel_arg_80478 = mem_77452.mem;
                        CUdeviceptr kernel_arg_80479 = mem_77457.mem;
                        CUdeviceptr kernel_arg_80480 = mem_77461.mem;
                        CUdeviceptr kernel_arg_80481 = mem_77465.mem;
                        
                        if ((((((1 && segmap_usable_groups_70093 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_70092 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_70093;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80473[] = {&ctx->global_failure,
                                                         &m_65343, &n_m_65352,
                                                         &kernel_arg_80476,
                                                         &kernel_arg_80477,
                                                         &kernel_arg_80478,
                                                         &kernel_arg_80479,
                                                         &kernel_arg_80480,
                                                         &kernel_arg_80481};
                            int64_t time_start_80474 = 0, time_end_80475 = 0;
                            
                            if (ctx->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_70099",
                                        (long) segmap_usable_groups_70093,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_70092,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_80474 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_70099_runs,
                                                          &ctx->mainzisegmap_70099_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_70099,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_70092,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_80473,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80475 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_70099", time_end_80475 -
                                        time_start_80474);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77444,
                                                  "mem_77444") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77448,
                                                  "mem_77448") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77452,
                                                  "mem_77452") != 0)
                            return 1;
                        
                        struct memblock_device mem_77470;
                        
                        mem_77470.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77470, bytes_76979,
                                                  "mem_77470")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77474;
                        
                        mem_77474.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77474, bytes_76979,
                                                  "mem_77474")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_70114)) {
                            int64_t segment_sizze_nonzzero_79057 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_79058 = num_groups_70115 *
                                    segred_group_sizze_70114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_70114,
                                                            segment_sizze_nonzzero_79057),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_70114,
                                                                                   segment_sizze_nonzzero_79057))),
                                        '\n');
                            
                            unsigned int shared_sizze_80485 = (int64_t) 4 *
                                         segred_group_sizze_70114;
                            unsigned int shared_sizze_80487 = (int64_t) 4 *
                                         segred_group_sizze_70114;
                            CUdeviceptr kernel_arg_80489 = mem_77316.mem;
                            CUdeviceptr kernel_arg_80490 = mem_77320.mem;
                            CUdeviceptr kernel_arg_80491 = mem_77324.mem;
                            CUdeviceptr kernel_arg_80492 = mem_77348.mem;
                            CUdeviceptr kernel_arg_80493 = mem_77435.mem;
                            CUdeviceptr kernel_arg_80494 = mem_77439.mem;
                            CUdeviceptr kernel_arg_80495 = mem_77457.mem;
                            CUdeviceptr kernel_arg_80496 = mem_77461.mem;
                            CUdeviceptr kernel_arg_80497 = mem_77465.mem;
                            CUdeviceptr kernel_arg_80498 = mem_77470.mem;
                            CUdeviceptr kernel_arg_80499 = mem_77474.mem;
                            unsigned int shared_offset_80486 = 0;
                            unsigned int shared_offset_80488 = 0 +
                                         (shared_sizze_80485 + (8 -
                                                                shared_sizze_80485 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_70115 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_70114 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_70115;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80482[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80486,
                                      &shared_offset_80488, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_70115,
                                      &segment_sizze_nonzzero_79057,
                                      &kernel_arg_80489, &kernel_arg_80490,
                                      &kernel_arg_80491, &kernel_arg_80492,
                                      &kernel_arg_80493, &kernel_arg_80494,
                                      &kernel_arg_80495, &kernel_arg_80496,
                                      &kernel_arg_80497, &kernel_arg_80498,
                                      &kernel_arg_80499};
                                int64_t time_start_80483 = 0, time_end_80484 =
                                        0;
                                
                                if (ctx->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_70122",
                                            (long) num_groups_70115, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_70114,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80485 +
                                                                        (8 -
                                                                         shared_sizze_80485 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80487 +
                                                                        (8 -
                                                                         shared_sizze_80487 %
                                                                         8) %
                                                                        8)));
                                    time_start_80483 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_small_70122_runs,
                                                              &ctx->mainzisegred_small_70122_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_70122,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_70114,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80485 +
                                                                       (8 -
                                                                        shared_sizze_80485 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80487 +
                                                                       (8 -
                                                                        shared_sizze_80487 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80482,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80484 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_small_70122",
                                            time_end_80484 - time_start_80483);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_79092 =
                                    sdiv_up64(num_groups_70115,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_79093 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_70114 *
                                              groups_per_segment_79092);
                            int64_t virt_num_groups_79094 =
                                    groups_per_segment_79092 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_79095 = num_groups_70115 *
                                    segred_group_sizze_70114;
                            int64_t threads_per_segment_79096 =
                                    groups_per_segment_79092 *
                                    segred_group_sizze_70114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_79094,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_70115, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_70114,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_79093,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_79092,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_79097;
                            
                            segred_tmp_mem_79097.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79097,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79094,
                                                      "segred_tmp_mem_79097")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79099;
                            
                            segred_tmp_mem_79099.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79099,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79094,
                                                      "segred_tmp_mem_79099")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_79101 =
                                                   ctx->mainzicounter_mem_79101;
                            unsigned int shared_sizze_80504 = 1;
                            unsigned int shared_sizze_80506 = (int64_t) 4 *
                                         segred_group_sizze_70114;
                            unsigned int shared_sizze_80508 = (int64_t) 4 *
                                         segred_group_sizze_70114;
                            CUdeviceptr kernel_arg_80510 = mem_77316.mem;
                            CUdeviceptr kernel_arg_80511 = mem_77320.mem;
                            CUdeviceptr kernel_arg_80512 = mem_77324.mem;
                            CUdeviceptr kernel_arg_80513 = mem_77348.mem;
                            CUdeviceptr kernel_arg_80514 = mem_77435.mem;
                            CUdeviceptr kernel_arg_80515 = mem_77439.mem;
                            CUdeviceptr kernel_arg_80516 = mem_77457.mem;
                            CUdeviceptr kernel_arg_80517 = mem_77461.mem;
                            CUdeviceptr kernel_arg_80518 = mem_77465.mem;
                            CUdeviceptr kernel_arg_80519 = mem_77470.mem;
                            CUdeviceptr kernel_arg_80520 = mem_77474.mem;
                            CUdeviceptr kernel_arg_80521 =
                                        segred_tmp_mem_79097.mem;
                            CUdeviceptr kernel_arg_80522 =
                                        segred_tmp_mem_79099.mem;
                            CUdeviceptr kernel_arg_80523 =
                                        mainzicounter_mem_79101.mem;
                            unsigned int shared_offset_80505 = 0;
                            unsigned int shared_offset_80507 = 0 +
                                         (shared_sizze_80504 + (8 -
                                                                shared_sizze_80504 %
                                                                8) % 8);
                            unsigned int shared_offset_80509 = 0 +
                                         (shared_sizze_80504 + (8 -
                                                                shared_sizze_80504 %
                                                                8) % 8) +
                                         (shared_sizze_80506 + (8 -
                                                                shared_sizze_80506 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_70115 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_70114 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_70115;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80501[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80505,
                                      &shared_offset_80507,
                                      &shared_offset_80509, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_70115,
                                      &groups_per_segment_79092,
                                      &elements_per_thread_79093,
                                      &virt_num_groups_79094,
                                      &threads_per_segment_79096,
                                      &kernel_arg_80510, &kernel_arg_80511,
                                      &kernel_arg_80512, &kernel_arg_80513,
                                      &kernel_arg_80514, &kernel_arg_80515,
                                      &kernel_arg_80516, &kernel_arg_80517,
                                      &kernel_arg_80518, &kernel_arg_80519,
                                      &kernel_arg_80520, &kernel_arg_80521,
                                      &kernel_arg_80522, &kernel_arg_80523};
                                int64_t time_start_80502 = 0, time_end_80503 =
                                        0;
                                
                                if (ctx->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_70122",
                                            (long) num_groups_70115, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_70114,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80504 +
                                                                        (8 -
                                                                         shared_sizze_80504 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80506 +
                                                                        (8 -
                                                                         shared_sizze_80506 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80508 +
                                                                        (8 -
                                                                         shared_sizze_80508 %
                                                                         8) %
                                                                        8)));
                                    time_start_80502 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_large_70122_runs,
                                                              &ctx->mainzisegred_large_70122_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_70122,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_70114,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80504 +
                                                                       (8 -
                                                                        shared_sizze_80504 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80506 +
                                                                       (8 -
                                                                        shared_sizze_80506 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80508 +
                                                                       (8 -
                                                                        shared_sizze_80508 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80501,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80503 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_large_70122",
                                            time_end_80503 - time_start_80502);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79099,
                                                      "segred_tmp_mem_79099") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79097,
                                                      "segred_tmp_mem_79097") !=
                                0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_77435,
                                                  "mem_77435") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77439,
                                                  "mem_77439") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77457,
                                                  "mem_77457") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77461,
                                                  "mem_77461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77465,
                                                  "mem_77465") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77476, &mem_77470,
                                                "mem_77470") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77475, &mem_77474,
                                                "mem_77474") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77474,
                                                  "mem_77474") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77470,
                                                  "mem_77470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77465,
                                                  "mem_77465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77461,
                                                  "mem_77461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77457,
                                                  "mem_77457") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77452,
                                                  "mem_77452") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77448,
                                                  "mem_77448") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77444,
                                                  "mem_77444") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77439,
                                                  "mem_77439") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77435,
                                                  "mem_77435") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77431,
                                                  "mem_77431") != 0)
                            return 1;
                    }
                    if (memblock_unref_device(ctx, &mem_77316, "mem_77316") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77320, "mem_77320") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77324, "mem_77324") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77330, "mem_77330") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77334, "mem_77334") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77337, "mem_77337") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77340, "mem_77340") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77343, "mem_77343") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77348, "mem_77348") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77488, &ext_mem_77476,
                                            "ext_mem_77476") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77487, &ext_mem_77475,
                                            "ext_mem_77475") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77475,
                                              "ext_mem_77475") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77476,
                                              "ext_mem_77476") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77348, "mem_77348") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77343, "mem_77343") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77340, "mem_77340") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77337, "mem_77337") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77334, "mem_77334") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77330, "mem_77330") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77324, "mem_77324") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77320, "mem_77320") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77316, "mem_77316") !=
                        0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_77822, &ext_mem_77488,
                                        "ext_mem_77488") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77821, &ext_mem_77487,
                                        "ext_mem_77487") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77487,
                                          "ext_mem_77487") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77488,
                                          "ext_mem_77488") != 0)
                    return 1;
            } else {
                bool suff_outer_par_70179;
                
                suff_outer_par_70179 =
                    *ctx->tuning_params.mainzisuff_outer_par_4 <= m_65343;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_4", (long) m_65343,
                            suff_outer_par_70179 ? "true" : "false");
                
                int64_t segmap_group_sizze_70423;
                
                segmap_group_sizze_70423 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_70183;
                
                int64_t num_groups_70424;
                int32_t max_num_groups_79145;
                
                max_num_groups_79145 =
                    *ctx->tuning_params.mainzisegmap_num_groups_70185;
                num_groups_70424 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(m_65343,
                                                                        segmap_group_sizze_70423),
                                                              sext_i32_i64(max_num_groups_79145))));
                
                int64_t nest_sizze_71673 = m_65343 * n_65344;
                int64_t segscan_group_sizze_71674;
                
                segscan_group_sizze_71674 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_71654;
                
                int64_t num_groups_71675;
                int32_t max_num_groups_79146;
                
                max_num_groups_79146 =
                    *ctx->tuning_params.mainzisegscan_num_groups_71656;
                num_groups_71675 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_71673,
                                                                        segscan_group_sizze_71674),
                                                              sext_i32_i64(max_num_groups_79146))));
                
                int64_t segmap_group_sizze_71727;
                
                segmap_group_sizze_71727 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71568;
                
                int64_t segmap_group_sizze_71747;
                
                segmap_group_sizze_71747 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71542;
                
                int64_t segmap_group_sizze_71757;
                
                segmap_group_sizze_71757 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71516;
                
                int64_t nest_sizze_71778 = m_65343 * q_65346;
                int64_t segmap_group_sizze_71779;
                
                segmap_group_sizze_71779 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71491;
                
                bool suff_outer_par_71796;
                
                suff_outer_par_71796 =
                    *ctx->tuning_params.mainzisuff_outer_par_5 <= binop_x_76977;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_5", (long) binop_x_76977,
                            suff_outer_par_71796 ? "true" : "false");
                
                int64_t segmap_group_sizze_72010;
                
                segmap_group_sizze_72010 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71100;
                
                int64_t nest_sizze_72113 = q_65346 * binop_x_76977;
                int64_t segred_group_sizze_72114;
                
                segred_group_sizze_72114 =
                    *ctx->tuning_params.mainzisegred_group_sizze_71039;
                
                int64_t num_groups_72115;
                int32_t max_num_groups_79147;
                
                max_num_groups_79147 =
                    *ctx->tuning_params.mainzisegred_num_groups_71041;
                num_groups_72115 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_72113,
                                                                        segred_group_sizze_72114),
                                                              sext_i32_i64(max_num_groups_79147))));
                
                int64_t segmap_group_sizze_72173;
                
                segmap_group_sizze_72173 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_70998;
                
                int64_t segred_group_sizze_72216;
                
                segred_group_sizze_72216 =
                    *ctx->tuning_params.mainzisegred_group_sizze_70912;
                
                int64_t num_groups_72217;
                int32_t max_num_groups_79148;
                
                max_num_groups_79148 =
                    *ctx->tuning_params.mainzisegred_num_groups_70914;
                num_groups_72217 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_72113,
                                                                        segred_group_sizze_72216),
                                                              sext_i32_i64(max_num_groups_79148))));
                
                int64_t tile_sizze_75978;
                
                tile_sizze_75978 = *ctx->tuning_params.mainzitile_sizze_75977;
                
                int64_t group_sizze_75979 = tile_sizze_75978 * tile_sizze_75978;
                int64_t bytes_77490 = (int64_t) 4 * nest_sizze_71673;
                int64_t binop_y_77493 = (int64_t) 8 * n_65344;
                int64_t bytes_77494 = smax64((int64_t) 0, binop_y_77493);
                int64_t binop_y_77508 = (int64_t) 4 * n_65344;
                int64_t bytes_77509 = smax64((int64_t) 0, binop_y_77508);
                int64_t binop_y_77553 = (int64_t) 4 * q_65346;
                int64_t bytes_77554 = smax64((int64_t) 0, binop_y_77553);
                int64_t binop_y_77568 = (int64_t) 4 * n_m_65352;
                int64_t bytes_77569 = smax64((int64_t) 0, binop_y_77568);
                int64_t binop_y_77606 = (int64_t) 8 * nest_sizze_71673;
                int64_t bytes_77607 = smax64((int64_t) 0, binop_y_77606);
                int64_t bytes_77611 = smax64((int64_t) 0, bytes_77490);
                int64_t binop_y_77624 = (int64_t) 8 * m_65343;
                int64_t bytes_77625 = smax64((int64_t) 0, binop_y_77624);
                int64_t binop_y_77633 = (int64_t) 4 * m_65343;
                int64_t bytes_77634 = smax64((int64_t) 0, binop_y_77633);
                int64_t binop_y_77638 = (int64_t) 4 * nest_sizze_71778;
                int64_t bytes_77639 = smax64((int64_t) 0, binop_y_77638);
                int64_t bytes_77644 = (int64_t) 8 * group_sizze_75979;
                int64_t bytes_77653 = (int64_t) 4 * group_sizze_75979;
                int64_t bytes_77679 = smax64((int64_t) 0, bytes_77653);
                int64_t binop_x_78041 = (int64_t) 4 * tile_sizze_75978;
                int64_t sizze_78042 = tile_sizze_75978 * binop_x_78041;
                int64_t binop_y_77745 = (int64_t) 8 * binop_x_76977;
                int64_t bytes_77746 = smax64((int64_t) 0, binop_y_77745);
                int64_t binop_x_78099 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78100 = tile_sizze_75978 * binop_x_78099;
                int64_t binop_x_78104 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78105 = tile_sizze_75978 * binop_x_78104;
                int64_t binop_x_78109 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78110 = tile_sizze_75978 * binop_x_78109;
                int64_t binop_x_78114 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78115 = tile_sizze_75978 * binop_x_78114;
                int64_t binop_x_78119 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78120 = tile_sizze_75978 * binop_x_78119;
                int64_t maxSubHelper_78170 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78171 = umax64(num_bytes_78120,
                                                    maxSubHelper_78170);
                int64_t maxSubHelper_78172 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78173 = umax64(num_bytes_78115,
                                                    maxSubHelper_78172);
                int64_t maxSubHelper_78174 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78175 = umax64(num_bytes_78110,
                                                    maxSubHelper_78174);
                int64_t maxSubHelper_78176 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78177 = umax64(num_bytes_78105,
                                                    maxSubHelper_78176);
                int64_t maxSubHelper_78178 = umax64(sizze_78042,
                                                    num_bytes_78100);
                int64_t num_threads_78234 = segmap_group_sizze_70423 *
                        num_groups_70424;
                int64_t total_sizze_78235 = bytes_77569 * num_threads_78234;
                int64_t total_sizze_78236 = bytes_77569 * num_threads_78234;
                int64_t total_sizze_78237 = bytes_77554 * num_threads_78234;
                int64_t total_sizze_78238 = bytes_77494 * num_threads_78234;
                int64_t total_sizze_78239 = bytes_77494 * num_threads_78234;
                int64_t total_sizze_78240 = bytes_77509 * num_threads_78234;
                struct memblock_device ext_mem_77820;
                
                ext_mem_77820.references = NULL;
                
                struct memblock_device ext_mem_77819;
                
                ext_mem_77819.references = NULL;
                
                int32_t local_memory_capacity_79643;
                
                local_memory_capacity_79643 = ctx->cuda.max_shared_memory;
                if (sle64((int64_t) 0,
                          sext_i32_i64(local_memory_capacity_79643)) &&
                    suff_outer_par_70179) {
                    struct memblock_device mem_77491;
                    
                    mem_77491.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77491, bytes_77490,
                                              "mem_77491")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77491,
                                                              (int64_t) 0,
                                                              Y_mem_76976,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              n_65344,
                                                              m_65343) != 0) {
                        if (memblock_unref_device(ctx, &mem_77491,
                                                  "mem_77491") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77600;
                    
                    mem_77600.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77600, binop_y_76978,
                                              "mem_77600")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77603;
                    
                    mem_77603.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77603, binop_y_76978,
                                              "mem_77603")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78164;
                    
                    color_78164.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78164,
                                              total_sizze_78235,
                                              "color_78164")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78165;
                    
                    color_78165.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78165,
                                              total_sizze_78236,
                                              "color_78165")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78166;
                    
                    color_78166.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78166,
                                              total_sizze_78237,
                                              "color_78166")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78167;
                    
                    color_78167.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78167,
                                              total_sizze_78238,
                                              "color_78167")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78168;
                    
                    color_78168.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78168,
                                              total_sizze_78239,
                                              "color_78168")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78169;
                    
                    color_78169.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78169,
                                              total_sizze_78240,
                                              "color_78169")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80527 = mem_77491.mem;
                    CUdeviceptr kernel_arg_80528 = mem_77600.mem;
                    CUdeviceptr kernel_arg_80529 = mem_77603.mem;
                    CUdeviceptr kernel_arg_80530 = color_78164.mem;
                    CUdeviceptr kernel_arg_80531 = color_78165.mem;
                    CUdeviceptr kernel_arg_80532 = color_78166.mem;
                    CUdeviceptr kernel_arg_80533 = color_78167.mem;
                    CUdeviceptr kernel_arg_80534 = color_78168.mem;
                    CUdeviceptr kernel_arg_80535 = color_78169.mem;
                    
                    if ((((((1 && num_groups_70424 != 0) && 1 != 0) && 1 !=
                           0) && segmap_group_sizze_70423 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_70424;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80524[] = {&ctx->global_failure,
                                                     &ctx->failure_is_an_option,
                                                     &ctx->global_failure_args,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &jump_65348,
                                                     &n_m_65352, &i_65358,
                                                     &x_65359, &min_res_65364,
                                                     &loop_cond_65369,
                                                     &i64_res_65370,
                                                     &num_groups_70424,
                                                     &num_threads_78234,
                                                     &kernel_arg_80527,
                                                     &kernel_arg_80528,
                                                     &kernel_arg_80529,
                                                     &kernel_arg_80530,
                                                     &kernel_arg_80531,
                                                     &kernel_arg_80532,
                                                     &kernel_arg_80533,
                                                     &kernel_arg_80534,
                                                     &kernel_arg_80535};
                        int64_t time_start_80525 = 0, time_end_80526 = 0;
                        
                        if (ctx->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_70429",
                                    (long) num_groups_70424, (long) 1, (long) 1,
                                    (long) segmap_group_sizze_70423, (long) 1,
                                    (long) 1, (int) 0);
                            time_start_80525 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_70429_runs,
                                                      &ctx->mainzisegmap_70429_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_70429,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_70423,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80524,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80526 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_70429", time_end_80526 -
                                    time_start_80525);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77491, "mem_77491") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78164,
                                              "color_78164") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78165,
                                              "color_78165") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78166,
                                              "color_78166") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78167,
                                              "color_78167") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78168,
                                              "color_78168") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78169,
                                              "color_78169") != 0)
                        return 1;
                    
                    struct memblock_device mem_77812;
                    
                    mem_77812.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77812, bytes_76979,
                                              "mem_77812")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77812,
                                                              (int64_t) 0,
                                                              mem_77600,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77812,
                                                  "mem_77812") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78169,
                                                  "color_78169") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78168,
                                                  "color_78168") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78167,
                                                  "color_78167") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78166,
                                                  "color_78166") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78165,
                                                  "color_78165") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78164,
                                                  "color_78164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77603,
                                                  "mem_77603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77600,
                                                  "mem_77600") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77491,
                                                  "mem_77491") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77600, "mem_77600") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77817;
                    
                    mem_77817.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77817, bytes_76979,
                                              "mem_77817")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77817,
                                                              (int64_t) 0,
                                                              mem_77603,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77817,
                                                  "mem_77817") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77812,
                                                  "mem_77812") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78169,
                                                  "color_78169") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78168,
                                                  "color_78168") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78167,
                                                  "color_78167") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78166,
                                                  "color_78166") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78165,
                                                  "color_78165") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78164,
                                                  "color_78164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77603,
                                                  "mem_77603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77600,
                                                  "mem_77600") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77491,
                                                  "mem_77491") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77603, "mem_77603") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77820, &mem_77812,
                                            "mem_77812") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77819, &mem_77817,
                                            "mem_77817") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77817, "mem_77817") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77812, "mem_77812") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78169,
                                              "color_78169") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78168,
                                              "color_78168") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78167,
                                              "color_78167") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78166,
                                              "color_78166") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78165,
                                              "color_78165") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78164,
                                              "color_78164") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77603, "mem_77603") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77600, "mem_77600") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77491, "mem_77491") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_77608;
                    
                    mem_77608.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77608, bytes_77607,
                                              "mem_77608")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_65343 * n_65344)) {
                        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_79190 = sdiv_up64(m_65343 * n_65344,
                                                             segscan_group_sizze_71674 *
                                                             (int64_t) 11) *
                                segscan_group_sizze_71674;
                        int64_t numGroups_79191 = sdiv_up64(m_65343 * n_65344,
                                                            segscan_group_sizze_71674 *
                                                            (int64_t) 11);
                        struct memblock_device mainziid_counter_mem_79192 =
                                               ctx->mainziid_counter_mem_79192;
                        struct memblock_device status_flags_mem_79194;
                        
                        status_flags_mem_79194.references = NULL;
                        if (memblock_alloc_device(ctx, &status_flags_mem_79194,
                                                  numGroups_79191,
                                                  "status_flags_mem_79194")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device aggregates_mem_79196;
                        
                        aggregates_mem_79196.references = NULL;
                        if (memblock_alloc_device(ctx, &aggregates_mem_79196,
                                                  (int64_t) 8 * numGroups_79191,
                                                  "aggregates_mem_79196")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device incprefixes_mem_79198;
                        
                        incprefixes_mem_79198.references = NULL;
                        if (memblock_alloc_device(ctx, &incprefixes_mem_79198,
                                                  (int64_t) 8 * numGroups_79191,
                                                  "incprefixes_mem_79198")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhreplicate_i8(ctx,
                                                         status_flags_mem_79194,
                                                         numGroups_79191,
                                                         (int8_t) 0) != 0) {
                            if (memblock_unref_device(ctx,
                                                      &incprefixes_mem_79198,
                                                      "incprefixes_mem_79198") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &aggregates_mem_79196,
                                                      "aggregates_mem_79196") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &status_flags_mem_79194,
                                                      "status_flags_mem_79194") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_77608,
                                                      "mem_77608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77819,
                                                      "ext_mem_77819") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77820,
                                                      "ext_mem_77820") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77821,
                                                      "ext_mem_77821") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77822,
                                                      "ext_mem_77822") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77823,
                                                      "ext_mem_77823") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77824,
                                                      "ext_mem_77824") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77995,
                                                      "ext_mem_77995") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_77996,
                                                      "ext_mem_77996") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_78270,
                                                      "mem_out_78270") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        unsigned int shared_sizze_80540 =
                                     smax64(smax64((int64_t) 288, (int64_t) 8 *
                                                   segscan_group_sizze_71674),
                                            (int64_t) 11 *
                                            segscan_group_sizze_71674 *
                                            (int64_t) 8);
                        CUdeviceptr kernel_arg_80542 = Y_mem_76976.mem;
                        CUdeviceptr kernel_arg_80543 = mem_77608.mem;
                        CUdeviceptr kernel_arg_80544 =
                                    mainziid_counter_mem_79192.mem;
                        CUdeviceptr kernel_arg_80545 =
                                    status_flags_mem_79194.mem;
                        CUdeviceptr kernel_arg_80546 = aggregates_mem_79196.mem;
                        CUdeviceptr kernel_arg_80547 =
                                    incprefixes_mem_79198.mem;
                        unsigned int shared_offset_80541 = 0;
                        
                        if ((((((1 && sdiv_up64(m_65343 * n_65344,
                                                segscan_group_sizze_71674 *
                                                (int64_t) 11) != 0) && 1 !=
                                0) && 1 != 0) && segscan_group_sizze_71674 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_65343 * n_65344,
                                                      segscan_group_sizze_71674 *
                                                      (int64_t) 11);
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80537[] = {&ctx->global_failure,
                                                         &shared_offset_80541,
                                                         &m_65343, &n_65344,
                                                         &kernel_arg_80542,
                                                         &kernel_arg_80543,
                                                         &kernel_arg_80544,
                                                         &kernel_arg_80545,
                                                         &kernel_arg_80546,
                                                         &kernel_arg_80547};
                            int64_t time_start_80538 = 0, time_end_80539 = 0;
                            
                            if (ctx->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_71680",
                                        (long) sdiv_up64(m_65343 * n_65344,
                                                         segscan_group_sizze_71674 *
                                                         (int64_t) 11),
                                        (long) 1, (long) 1,
                                        (long) segscan_group_sizze_71674,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80540 +
                                                                    (8 -
                                                                     shared_sizze_80540 %
                                                                     8) % 8)));
                                time_start_80538 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegscan_71680_runs,
                                                          &ctx->mainzisegscan_71680_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_71680,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segscan_group_sizze_71674,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80540 +
                                                                   (8 -
                                                                    shared_sizze_80540 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80537,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80539 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segscan_71680", time_end_80539 -
                                        time_start_80538);
                            }
                        }
                        if (memblock_unref_device(ctx, &incprefixes_mem_79198,
                                                  "incprefixes_mem_79198") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &aggregates_mem_79196,
                                                  "aggregates_mem_79196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &status_flags_mem_79194,
                                                  "status_flags_mem_79194") !=
                            0)
                            return 1;
                    }
                    
                    struct memblock_device mem_77612;
                    
                    mem_77612.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77612, bytes_77611,
                                              "mem_77612")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_77612, m_65343 *
                                                      n_65344, 0.0F) != 0) {
                        if (memblock_unref_device(ctx, &mem_77612,
                                                  "mem_77612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77608,
                                                  "mem_77608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77616;
                    
                    mem_77616.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77616, bytes_77607,
                                              "mem_77616")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i64(ctx, mem_77616, m_65343 *
                                                      n_65344, (int64_t) -1) !=
                        0) {
                        if (memblock_unref_device(ctx, &mem_77616,
                                                  "mem_77616") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77612,
                                                  "mem_77612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77608,
                                                  "mem_77608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_usable_groups_71728 =
                            sdiv_up64(nest_sizze_71673,
                                      segmap_group_sizze_71727);
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80551 = Y_mem_76976.mem;
                    CUdeviceptr kernel_arg_80552 = mem_77608.mem;
                    CUdeviceptr kernel_arg_80553 = mem_77612.mem;
                    CUdeviceptr kernel_arg_80554 = mem_77616.mem;
                    
                    if ((((((1 && segmap_usable_groups_71728 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_71727 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_71728;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80548[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80551,
                                                     &kernel_arg_80552,
                                                     &kernel_arg_80553,
                                                     &kernel_arg_80554};
                        int64_t time_start_80549 = 0, time_end_80550 = 0;
                        
                        if (ctx->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_71733",
                                    (long) segmap_usable_groups_71728, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_71727,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80549 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_71733_runs,
                                                      &ctx->mainzisegmap_71733_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_71733,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_71727,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80548,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80550 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_71733", time_end_80550 -
                                    time_start_80549);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_71748 =
                            sdiv_up64(nest_sizze_71673,
                                      segmap_group_sizze_71747);
                    struct memblock_device mem_77622;
                    
                    mem_77622.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77622, bytes_77607,
                                              "mem_77622")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80558 = mem_77616.mem;
                    CUdeviceptr kernel_arg_80559 = mem_77622.mem;
                    
                    if ((((((1 && segmap_usable_groups_71748 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_71747 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_71748;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80555[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80558,
                                                     &kernel_arg_80559};
                        int64_t time_start_80556 = 0, time_end_80557 = 0;
                        
                        if (ctx->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_71752",
                                    (long) segmap_usable_groups_71748, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_71747,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80556 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_71752_runs,
                                                      &ctx->mainzisegmap_71752_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_71752,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_71747,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80555,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80557 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_71752", time_end_80557 -
                                    time_start_80556);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_71758 = sdiv_up64(m_65343,
                                                                   segmap_group_sizze_71757);
                    struct memblock_device mem_77626;
                    
                    mem_77626.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77626, bytes_77625,
                                              "mem_77626")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77629;
                    
                    mem_77629.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77629, bytes_77625,
                                              "mem_77629")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77632;
                    
                    mem_77632.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77632, bytes_77625,
                                              "mem_77632")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77635;
                    
                    mem_77635.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77635, bytes_77634,
                                              "mem_77635")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80563 = mem_77608.mem;
                    CUdeviceptr kernel_arg_80564 = mem_77626.mem;
                    CUdeviceptr kernel_arg_80565 = mem_77629.mem;
                    CUdeviceptr kernel_arg_80566 = mem_77632.mem;
                    CUdeviceptr kernel_arg_80567 = mem_77635.mem;
                    
                    if ((((((1 && segmap_usable_groups_71758 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_71757 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_71758;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80560[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &i_65358,
                                                     &min_res_65364,
                                                     &i64_res_65370,
                                                     &kernel_arg_80563,
                                                     &kernel_arg_80564,
                                                     &kernel_arg_80565,
                                                     &kernel_arg_80566,
                                                     &kernel_arg_80567};
                        int64_t time_start_80561 = 0, time_end_80562 = 0;
                        
                        if (ctx->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_71764",
                                    (long) segmap_usable_groups_71758, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_71757,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80561 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_71764_runs,
                                                      &ctx->mainzisegmap_71764_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_71764,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_71757,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80560,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80562 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_71764", time_end_80562 -
                                    time_start_80561);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_71780 =
                            sdiv_up64(nest_sizze_71778,
                                      segmap_group_sizze_71779);
                    struct memblock_device mem_77640;
                    
                    mem_77640.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77640, bytes_77639,
                                              "mem_77640")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_80571 = mem_77608.mem;
                    CUdeviceptr kernel_arg_80572 = mem_77640.mem;
                    
                    if ((((((1 && segmap_usable_groups_71780 != 0) && 1 != 0) &&
                           1 != 0) && segmap_group_sizze_71779 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_71780;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80568[] = {&ctx->global_failure,
                                                     &m_65343, &n_65344,
                                                     &q_65346, &i_65358,
                                                     &kernel_arg_80571,
                                                     &kernel_arg_80572};
                        int64_t time_start_80569 = 0, time_end_80570 = 0;
                        
                        if (ctx->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_71784",
                                    (long) segmap_usable_groups_71780, (long) 1,
                                    (long) 1, (long) segmap_group_sizze_71779,
                                    (long) 1, (long) 1, (int) 0);
                            time_start_80569 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_71784_runs,
                                                      &ctx->mainzisegmap_71784_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_71784,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_71779,
                                                              1, 1, 0, NULL,
                                                              kernel_args_80568,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80570 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_71784", time_end_80570 -
                                    time_start_80569);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    struct memblock_device ext_mem_77808;
                    
                    ext_mem_77808.references = NULL;
                    
                    struct memblock_device ext_mem_77807;
                    
                    ext_mem_77807.references = NULL;
                    
                    int32_t local_memory_capacity_79642;
                    
                    local_memory_capacity_79642 = ctx->cuda.max_shared_memory;
                    if (sle64(bytes_77679 + srem64((int64_t) 8 -
                                                   srem64(bytes_77679,
                                                          (int64_t) 8),
                                                   (int64_t) 8),
                              sext_i32_i64(local_memory_capacity_79642)) &&
                        suff_outer_par_71796) {
                        int64_t num_groups_x_75980 = sdiv_up64(m_65343,
                                                               tile_sizze_75978);
                        int64_t num_groups_y_75981 = sdiv_up64(n_m_65352,
                                                               tile_sizze_75978);
                        int64_t num_groups_top_75982 = num_groups_x_75980 *
                                num_groups_y_75981;
                        int64_t num_whole_tiles_76113 = squot64(q_65346,
                                                                tile_sizze_75978);
                        int64_t residual_input_76413 = srem64(q_65346,
                                                              tile_sizze_75978);
                        bool cond_76414 = residual_input_76413 == (int64_t) 0;
                        struct memblock_device mem_77738;
                        
                        mem_77738.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77738, bytes_76979,
                                                  "mem_77738")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77742;
                        
                        mem_77742.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77742, bytes_76979,
                                                  "mem_77742")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_80576 = bytes_77679;
                        CUdeviceptr kernel_arg_80578 = mem_77608.mem;
                        CUdeviceptr kernel_arg_80579 = mem_77612.mem;
                        CUdeviceptr kernel_arg_80580 = mem_77616.mem;
                        CUdeviceptr kernel_arg_80581 = mem_77622.mem;
                        CUdeviceptr kernel_arg_80582 = mem_77626.mem;
                        CUdeviceptr kernel_arg_80583 = mem_77629.mem;
                        CUdeviceptr kernel_arg_80584 = mem_77632.mem;
                        CUdeviceptr kernel_arg_80585 = mem_77635.mem;
                        CUdeviceptr kernel_arg_80586 = mem_77640.mem;
                        CUdeviceptr kernel_arg_80587 = mem_77738.mem;
                        CUdeviceptr kernel_arg_80588 = mem_77742.mem;
                        unsigned int shared_offset_80577 = 0;
                        
                        if ((((((1 && num_groups_top_75982 != 0) && 1 != 0) &&
                               1 != 0) && group_sizze_75979 != 0) && 1 != 0) &&
                            1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_top_75982;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80573[] = {&ctx->global_failure,
                                                         &ctx->failure_is_an_option,
                                                         &ctx->global_failure_args,
                                                         &shared_offset_80577,
                                                         &m_65343, &n_65344,
                                                         &q_65346, &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &x_65359,
                                                         &min_res_65364,
                                                         &loop_cond_65369,
                                                         &num_groups_x_75980,
                                                         &num_groups_y_75981,
                                                         &num_whole_tiles_76113,
                                                         &residual_input_76413,
                                                         &cond_76414,
                                                         &kernel_arg_80578,
                                                         &kernel_arg_80579,
                                                         &kernel_arg_80580,
                                                         &kernel_arg_80581,
                                                         &kernel_arg_80582,
                                                         &kernel_arg_80583,
                                                         &kernel_arg_80584,
                                                         &kernel_arg_80585,
                                                         &kernel_arg_80586,
                                                         &kernel_arg_80587,
                                                         &kernel_arg_80588};
                            int64_t time_start_80574 = 0, time_end_80575 = 0;
                            
                            if (ctx->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_75983",
                                        (long) num_groups_top_75982, (long) 1,
                                        (long) 1, (long) group_sizze_75979,
                                        (long) 1, (long) 1, (int) (0 +
                                                                   (shared_sizze_80576 +
                                                                    (8 -
                                                                     shared_sizze_80576 %
                                                                     8) % 8)));
                                time_start_80574 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_75983_runs,
                                                          &ctx->mainzisegmap_intragroup_75983_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_75983,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  group_sizze_75979,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_80576 +
                                                                   (8 -
                                                                    shared_sizze_80576 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_80573,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80575 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_75983",
                                        time_end_80575 - time_start_80574);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_77808, &mem_77738,
                                                "mem_77738") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77807, &mem_77742,
                                                "mem_77742") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77742,
                                                  "mem_77742") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77738,
                                                  "mem_77738") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_72011 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_72010);
                        struct memblock_device mem_77747;
                        
                        mem_77747.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77747, bytes_77746,
                                                  "mem_77747")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77751;
                        
                        mem_77751.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77751, bytes_77746,
                                                  "mem_77751")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77755;
                        
                        mem_77755.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77755, bytes_76979,
                                                  "mem_77755")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_80592 = mem_77616.mem;
                        CUdeviceptr kernel_arg_80593 = mem_77622.mem;
                        CUdeviceptr kernel_arg_80594 = mem_77626.mem;
                        CUdeviceptr kernel_arg_80595 = mem_77629.mem;
                        CUdeviceptr kernel_arg_80596 = mem_77632.mem;
                        CUdeviceptr kernel_arg_80597 = mem_77635.mem;
                        CUdeviceptr kernel_arg_80598 = mem_77747.mem;
                        CUdeviceptr kernel_arg_80599 = mem_77751.mem;
                        CUdeviceptr kernel_arg_80600 = mem_77755.mem;
                        
                        if ((((((1 && segmap_usable_groups_72011 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_72010 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_72011;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80589[] = {&ctx->global_failure,
                                                         &ctx->failure_is_an_option,
                                                         &ctx->global_failure_args,
                                                         &m_65343, &n_65344,
                                                         &jump_65348,
                                                         &n_m_65352, &i_65358,
                                                         &x_65359,
                                                         &min_res_65364,
                                                         &loop_cond_65369,
                                                         &kernel_arg_80592,
                                                         &kernel_arg_80593,
                                                         &kernel_arg_80594,
                                                         &kernel_arg_80595,
                                                         &kernel_arg_80596,
                                                         &kernel_arg_80597,
                                                         &kernel_arg_80598,
                                                         &kernel_arg_80599,
                                                         &kernel_arg_80600};
                            int64_t time_start_80590 = 0, time_end_80591 = 0;
                            
                            if (ctx->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_72017",
                                        (long) segmap_usable_groups_72011,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_72010,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_80590 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_72017_runs,
                                                          &ctx->mainzisegmap_72017_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_72017,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_72010,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_80589,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80591 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_72017", time_end_80591 -
                                        time_start_80590);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77747,
                                                  "mem_77747") != 0)
                            return 1;
                        
                        struct memblock_device mem_77760;
                        
                        mem_77760.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77760, bytes_76979,
                                                  "mem_77760")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77764;
                        
                        mem_77764.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77764, bytes_76979,
                                                  "mem_77764")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77768;
                        
                        mem_77768.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77768, bytes_76979,
                                                  "mem_77768")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77772;
                        
                        mem_77772.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77772, bytes_76979,
                                                  "mem_77772")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77776;
                        
                        mem_77776.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77776, bytes_76979,
                                                  "mem_77776")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_72114)) {
                            int64_t segment_sizze_nonzzero_79418 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_79419 = num_groups_72115 *
                                    segred_group_sizze_72114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_72114,
                                                            segment_sizze_nonzzero_79418),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_72114,
                                                                                   segment_sizze_nonzzero_79418))),
                                        '\n');
                            
                            unsigned int shared_sizze_80604 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80606 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80608 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80610 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80612 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            CUdeviceptr kernel_arg_80614 = mem_77608.mem;
                            CUdeviceptr kernel_arg_80615 = mem_77616.mem;
                            CUdeviceptr kernel_arg_80616 = mem_77640.mem;
                            CUdeviceptr kernel_arg_80617 = mem_77751.mem;
                            CUdeviceptr kernel_arg_80618 = mem_77755.mem;
                            CUdeviceptr kernel_arg_80619 = mem_77760.mem;
                            CUdeviceptr kernel_arg_80620 = mem_77764.mem;
                            CUdeviceptr kernel_arg_80621 = mem_77768.mem;
                            CUdeviceptr kernel_arg_80622 = mem_77772.mem;
                            CUdeviceptr kernel_arg_80623 = mem_77776.mem;
                            unsigned int shared_offset_80605 = 0;
                            unsigned int shared_offset_80607 = 0 +
                                         (shared_sizze_80604 + (8 -
                                                                shared_sizze_80604 %
                                                                8) % 8);
                            unsigned int shared_offset_80609 = 0 +
                                         (shared_sizze_80604 + (8 -
                                                                shared_sizze_80604 %
                                                                8) % 8) +
                                         (shared_sizze_80606 + (8 -
                                                                shared_sizze_80606 %
                                                                8) % 8);
                            unsigned int shared_offset_80611 = 0 +
                                         (shared_sizze_80604 + (8 -
                                                                shared_sizze_80604 %
                                                                8) % 8) +
                                         (shared_sizze_80606 + (8 -
                                                                shared_sizze_80606 %
                                                                8) % 8) +
                                         (shared_sizze_80608 + (8 -
                                                                shared_sizze_80608 %
                                                                8) % 8);
                            unsigned int shared_offset_80613 = 0 +
                                         (shared_sizze_80604 + (8 -
                                                                shared_sizze_80604 %
                                                                8) % 8) +
                                         (shared_sizze_80606 + (8 -
                                                                shared_sizze_80606 %
                                                                8) % 8) +
                                         (shared_sizze_80608 + (8 -
                                                                shared_sizze_80608 %
                                                                8) % 8) +
                                         (shared_sizze_80610 + (8 -
                                                                shared_sizze_80610 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_72115 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_72114 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_72115;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80601[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80605,
                                      &shared_offset_80607,
                                      &shared_offset_80609,
                                      &shared_offset_80611,
                                      &shared_offset_80613, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_72115,
                                      &segment_sizze_nonzzero_79418,
                                      &kernel_arg_80614, &kernel_arg_80615,
                                      &kernel_arg_80616, &kernel_arg_80617,
                                      &kernel_arg_80618, &kernel_arg_80619,
                                      &kernel_arg_80620, &kernel_arg_80621,
                                      &kernel_arg_80622, &kernel_arg_80623};
                                int64_t time_start_80602 = 0, time_end_80603 =
                                        0;
                                
                                if (ctx->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_72125",
                                            (long) num_groups_72115, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_72114,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80604 +
                                                                        (8 -
                                                                         shared_sizze_80604 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80606 +
                                                                        (8 -
                                                                         shared_sizze_80606 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80608 +
                                                                        (8 -
                                                                         shared_sizze_80608 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80610 +
                                                                        (8 -
                                                                         shared_sizze_80610 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80612 +
                                                                        (8 -
                                                                         shared_sizze_80612 %
                                                                         8) %
                                                                        8)));
                                    time_start_80602 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_small_72125_runs,
                                                              &ctx->mainzisegred_small_72125_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_72125,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_72114,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80604 +
                                                                       (8 -
                                                                        shared_sizze_80604 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80606 +
                                                                       (8 -
                                                                        shared_sizze_80606 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80608 +
                                                                       (8 -
                                                                        shared_sizze_80608 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80610 +
                                                                       (8 -
                                                                        shared_sizze_80610 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80612 +
                                                                       (8 -
                                                                        shared_sizze_80612 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80601,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80603 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_small_72125",
                                            time_end_80603 - time_start_80602);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_79471 =
                                    sdiv_up64(num_groups_72115,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_79472 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_72114 *
                                              groups_per_segment_79471);
                            int64_t virt_num_groups_79473 =
                                    groups_per_segment_79471 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_79474 = num_groups_72115 *
                                    segred_group_sizze_72114;
                            int64_t threads_per_segment_79475 =
                                    groups_per_segment_79471 *
                                    segred_group_sizze_72114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_79473,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_72115, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_72114,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_79472,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_79471,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_79476;
                            
                            segred_tmp_mem_79476.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79476,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79473,
                                                      "segred_tmp_mem_79476")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79478;
                            
                            segred_tmp_mem_79478.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79478,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79473,
                                                      "segred_tmp_mem_79478")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79480;
                            
                            segred_tmp_mem_79480.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79480,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79473,
                                                      "segred_tmp_mem_79480")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79482;
                            
                            segred_tmp_mem_79482.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79482,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79473,
                                                      "segred_tmp_mem_79482")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79484;
                            
                            segred_tmp_mem_79484.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79484,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79473,
                                                      "segred_tmp_mem_79484")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_79486 =
                                                   ctx->mainzicounter_mem_79486;
                            unsigned int shared_sizze_80628 = 1;
                            unsigned int shared_sizze_80630 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80632 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80634 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80636 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            unsigned int shared_sizze_80638 = (int64_t) 4 *
                                         segred_group_sizze_72114;
                            CUdeviceptr kernel_arg_80640 = mem_77608.mem;
                            CUdeviceptr kernel_arg_80641 = mem_77616.mem;
                            CUdeviceptr kernel_arg_80642 = mem_77640.mem;
                            CUdeviceptr kernel_arg_80643 = mem_77751.mem;
                            CUdeviceptr kernel_arg_80644 = mem_77755.mem;
                            CUdeviceptr kernel_arg_80645 = mem_77760.mem;
                            CUdeviceptr kernel_arg_80646 = mem_77764.mem;
                            CUdeviceptr kernel_arg_80647 = mem_77768.mem;
                            CUdeviceptr kernel_arg_80648 = mem_77772.mem;
                            CUdeviceptr kernel_arg_80649 = mem_77776.mem;
                            CUdeviceptr kernel_arg_80650 =
                                        segred_tmp_mem_79476.mem;
                            CUdeviceptr kernel_arg_80651 =
                                        segred_tmp_mem_79478.mem;
                            CUdeviceptr kernel_arg_80652 =
                                        segred_tmp_mem_79480.mem;
                            CUdeviceptr kernel_arg_80653 =
                                        segred_tmp_mem_79482.mem;
                            CUdeviceptr kernel_arg_80654 =
                                        segred_tmp_mem_79484.mem;
                            CUdeviceptr kernel_arg_80655 =
                                        mainzicounter_mem_79486.mem;
                            unsigned int shared_offset_80629 = 0;
                            unsigned int shared_offset_80631 = 0 +
                                         (shared_sizze_80628 + (8 -
                                                                shared_sizze_80628 %
                                                                8) % 8);
                            unsigned int shared_offset_80633 = 0 +
                                         (shared_sizze_80628 + (8 -
                                                                shared_sizze_80628 %
                                                                8) % 8) +
                                         (shared_sizze_80630 + (8 -
                                                                shared_sizze_80630 %
                                                                8) % 8);
                            unsigned int shared_offset_80635 = 0 +
                                         (shared_sizze_80628 + (8 -
                                                                shared_sizze_80628 %
                                                                8) % 8) +
                                         (shared_sizze_80630 + (8 -
                                                                shared_sizze_80630 %
                                                                8) % 8) +
                                         (shared_sizze_80632 + (8 -
                                                                shared_sizze_80632 %
                                                                8) % 8);
                            unsigned int shared_offset_80637 = 0 +
                                         (shared_sizze_80628 + (8 -
                                                                shared_sizze_80628 %
                                                                8) % 8) +
                                         (shared_sizze_80630 + (8 -
                                                                shared_sizze_80630 %
                                                                8) % 8) +
                                         (shared_sizze_80632 + (8 -
                                                                shared_sizze_80632 %
                                                                8) % 8) +
                                         (shared_sizze_80634 + (8 -
                                                                shared_sizze_80634 %
                                                                8) % 8);
                            unsigned int shared_offset_80639 = 0 +
                                         (shared_sizze_80628 + (8 -
                                                                shared_sizze_80628 %
                                                                8) % 8) +
                                         (shared_sizze_80630 + (8 -
                                                                shared_sizze_80630 %
                                                                8) % 8) +
                                         (shared_sizze_80632 + (8 -
                                                                shared_sizze_80632 %
                                                                8) % 8) +
                                         (shared_sizze_80634 + (8 -
                                                                shared_sizze_80634 %
                                                                8) % 8) +
                                         (shared_sizze_80636 + (8 -
                                                                shared_sizze_80636 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_72115 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_72114 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_72115;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80625[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80629,
                                      &shared_offset_80631,
                                      &shared_offset_80633,
                                      &shared_offset_80635,
                                      &shared_offset_80637,
                                      &shared_offset_80639, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_72115,
                                      &groups_per_segment_79471,
                                      &elements_per_thread_79472,
                                      &virt_num_groups_79473,
                                      &threads_per_segment_79475,
                                      &kernel_arg_80640, &kernel_arg_80641,
                                      &kernel_arg_80642, &kernel_arg_80643,
                                      &kernel_arg_80644, &kernel_arg_80645,
                                      &kernel_arg_80646, &kernel_arg_80647,
                                      &kernel_arg_80648, &kernel_arg_80649,
                                      &kernel_arg_80650, &kernel_arg_80651,
                                      &kernel_arg_80652, &kernel_arg_80653,
                                      &kernel_arg_80654, &kernel_arg_80655};
                                int64_t time_start_80626 = 0, time_end_80627 =
                                        0;
                                
                                if (ctx->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_72125",
                                            (long) num_groups_72115, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_72114,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80628 +
                                                                        (8 -
                                                                         shared_sizze_80628 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80630 +
                                                                        (8 -
                                                                         shared_sizze_80630 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80632 +
                                                                        (8 -
                                                                         shared_sizze_80632 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80634 +
                                                                        (8 -
                                                                         shared_sizze_80634 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80636 +
                                                                        (8 -
                                                                         shared_sizze_80636 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80638 +
                                                                        (8 -
                                                                         shared_sizze_80638 %
                                                                         8) %
                                                                        8)));
                                    time_start_80626 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_large_72125_runs,
                                                              &ctx->mainzisegred_large_72125_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_72125,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_72114,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80628 +
                                                                       (8 -
                                                                        shared_sizze_80628 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80630 +
                                                                       (8 -
                                                                        shared_sizze_80630 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80632 +
                                                                       (8 -
                                                                        shared_sizze_80632 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80634 +
                                                                       (8 -
                                                                        shared_sizze_80634 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80636 +
                                                                       (8 -
                                                                        shared_sizze_80636 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80638 +
                                                                       (8 -
                                                                        shared_sizze_80638 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80625,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80627 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_large_72125",
                                            time_end_80627 - time_start_80626);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79484,
                                                      "segred_tmp_mem_79484") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79482,
                                                      "segred_tmp_mem_79482") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79480,
                                                      "segred_tmp_mem_79480") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79478,
                                                      "segred_tmp_mem_79478") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79476,
                                                      "segred_tmp_mem_79476") !=
                                0)
                                return 1;
                        }
                        
                        int64_t segmap_usable_groups_72174 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_72173);
                        struct memblock_device mem_77781;
                        
                        mem_77781.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77781, bytes_76979,
                                                  "mem_77781")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77785;
                        
                        mem_77785.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77785, bytes_76979,
                                                  "mem_77785")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77789;
                        
                        mem_77789.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77789, bytes_76979,
                                                  "mem_77789")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77793;
                        
                        mem_77793.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77793, bytes_76979,
                                                  "mem_77793")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77797;
                        
                        mem_77797.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77797, bytes_76979,
                                                  "mem_77797")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_80659 = mem_77760.mem;
                        CUdeviceptr kernel_arg_80660 = mem_77764.mem;
                        CUdeviceptr kernel_arg_80661 = mem_77768.mem;
                        CUdeviceptr kernel_arg_80662 = mem_77772.mem;
                        CUdeviceptr kernel_arg_80663 = mem_77776.mem;
                        CUdeviceptr kernel_arg_80664 = mem_77781.mem;
                        CUdeviceptr kernel_arg_80665 = mem_77785.mem;
                        CUdeviceptr kernel_arg_80666 = mem_77789.mem;
                        CUdeviceptr kernel_arg_80667 = mem_77793.mem;
                        CUdeviceptr kernel_arg_80668 = mem_77797.mem;
                        
                        if ((((((1 && segmap_usable_groups_72174 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_72173 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[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_72174;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_80656[] = {&ctx->global_failure,
                                                         &m_65343, &n_m_65352,
                                                         &kernel_arg_80659,
                                                         &kernel_arg_80660,
                                                         &kernel_arg_80661,
                                                         &kernel_arg_80662,
                                                         &kernel_arg_80663,
                                                         &kernel_arg_80664,
                                                         &kernel_arg_80665,
                                                         &kernel_arg_80666,
                                                         &kernel_arg_80667,
                                                         &kernel_arg_80668};
                            int64_t time_start_80657 = 0, time_end_80658 = 0;
                            
                            if (ctx->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_72182",
                                        (long) segmap_usable_groups_72174,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_72173,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_80657 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_72182_runs,
                                                          &ctx->mainzisegmap_72182_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_72182,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_72173,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_80656,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_80658 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_72182", time_end_80658 -
                                        time_start_80657);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77760,
                                                  "mem_77760") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77764,
                                                  "mem_77764") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77768,
                                                  "mem_77768") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77772,
                                                  "mem_77772") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77776,
                                                  "mem_77776") != 0)
                            return 1;
                        
                        struct memblock_device mem_77802;
                        
                        mem_77802.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77802, bytes_76979,
                                                  "mem_77802")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77806;
                        
                        mem_77806.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77806, bytes_76979,
                                                  "mem_77806")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_72216)) {
                            int64_t segment_sizze_nonzzero_79556 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_79557 = num_groups_72217 *
                                    segred_group_sizze_72216;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_72216,
                                                            segment_sizze_nonzzero_79556),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_72216,
                                                                                   segment_sizze_nonzzero_79556))),
                                        '\n');
                            
                            unsigned int shared_sizze_80672 = (int64_t) 4 *
                                         segred_group_sizze_72216;
                            unsigned int shared_sizze_80674 = (int64_t) 4 *
                                         segred_group_sizze_72216;
                            CUdeviceptr kernel_arg_80676 = mem_77608.mem;
                            CUdeviceptr kernel_arg_80677 = mem_77612.mem;
                            CUdeviceptr kernel_arg_80678 = mem_77616.mem;
                            CUdeviceptr kernel_arg_80679 = mem_77640.mem;
                            CUdeviceptr kernel_arg_80680 = mem_77751.mem;
                            CUdeviceptr kernel_arg_80681 = mem_77755.mem;
                            CUdeviceptr kernel_arg_80682 = mem_77781.mem;
                            CUdeviceptr kernel_arg_80683 = mem_77785.mem;
                            CUdeviceptr kernel_arg_80684 = mem_77789.mem;
                            CUdeviceptr kernel_arg_80685 = mem_77793.mem;
                            CUdeviceptr kernel_arg_80686 = mem_77797.mem;
                            CUdeviceptr kernel_arg_80687 = mem_77802.mem;
                            CUdeviceptr kernel_arg_80688 = mem_77806.mem;
                            unsigned int shared_offset_80673 = 0;
                            unsigned int shared_offset_80675 = 0 +
                                         (shared_sizze_80672 + (8 -
                                                                shared_sizze_80672 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_72217 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_72216 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_72217;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80669[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80673,
                                      &shared_offset_80675, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_72217,
                                      &segment_sizze_nonzzero_79556,
                                      &kernel_arg_80676, &kernel_arg_80677,
                                      &kernel_arg_80678, &kernel_arg_80679,
                                      &kernel_arg_80680, &kernel_arg_80681,
                                      &kernel_arg_80682, &kernel_arg_80683,
                                      &kernel_arg_80684, &kernel_arg_80685,
                                      &kernel_arg_80686, &kernel_arg_80687,
                                      &kernel_arg_80688};
                                int64_t time_start_80670 = 0, time_end_80671 =
                                        0;
                                
                                if (ctx->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_72224",
                                            (long) num_groups_72217, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_72216,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80672 +
                                                                        (8 -
                                                                         shared_sizze_80672 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80674 +
                                                                        (8 -
                                                                         shared_sizze_80674 %
                                                                         8) %
                                                                        8)));
                                    time_start_80670 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_small_72224_runs,
                                                              &ctx->mainzisegred_small_72224_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_72224,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_72216,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80672 +
                                                                       (8 -
                                                                        shared_sizze_80672 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80674 +
                                                                       (8 -
                                                                        shared_sizze_80674 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80669,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80671 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_small_72224",
                                            time_end_80671 - time_start_80670);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_79591 =
                                    sdiv_up64(num_groups_72217,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_79592 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_72216 *
                                              groups_per_segment_79591);
                            int64_t virt_num_groups_79593 =
                                    groups_per_segment_79591 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_79594 = num_groups_72217 *
                                    segred_group_sizze_72216;
                            int64_t threads_per_segment_79595 =
                                    groups_per_segment_79591 *
                                    segred_group_sizze_72216;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_79593,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_72217, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_72216,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_79592,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_79591,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_79596;
                            
                            segred_tmp_mem_79596.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79596,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79593,
                                                      "segred_tmp_mem_79596")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79598;
                            
                            segred_tmp_mem_79598.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79598,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79593,
                                                      "segred_tmp_mem_79598")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_79600 =
                                                   ctx->mainzicounter_mem_79600;
                            unsigned int shared_sizze_80693 = 1;
                            unsigned int shared_sizze_80695 = (int64_t) 4 *
                                         segred_group_sizze_72216;
                            unsigned int shared_sizze_80697 = (int64_t) 4 *
                                         segred_group_sizze_72216;
                            CUdeviceptr kernel_arg_80699 = mem_77608.mem;
                            CUdeviceptr kernel_arg_80700 = mem_77612.mem;
                            CUdeviceptr kernel_arg_80701 = mem_77616.mem;
                            CUdeviceptr kernel_arg_80702 = mem_77640.mem;
                            CUdeviceptr kernel_arg_80703 = mem_77751.mem;
                            CUdeviceptr kernel_arg_80704 = mem_77755.mem;
                            CUdeviceptr kernel_arg_80705 = mem_77781.mem;
                            CUdeviceptr kernel_arg_80706 = mem_77785.mem;
                            CUdeviceptr kernel_arg_80707 = mem_77789.mem;
                            CUdeviceptr kernel_arg_80708 = mem_77793.mem;
                            CUdeviceptr kernel_arg_80709 = mem_77797.mem;
                            CUdeviceptr kernel_arg_80710 = mem_77802.mem;
                            CUdeviceptr kernel_arg_80711 = mem_77806.mem;
                            CUdeviceptr kernel_arg_80712 =
                                        segred_tmp_mem_79596.mem;
                            CUdeviceptr kernel_arg_80713 =
                                        segred_tmp_mem_79598.mem;
                            CUdeviceptr kernel_arg_80714 =
                                        mainzicounter_mem_79600.mem;
                            unsigned int shared_offset_80694 = 0;
                            unsigned int shared_offset_80696 = 0 +
                                         (shared_sizze_80693 + (8 -
                                                                shared_sizze_80693 %
                                                                8) % 8);
                            unsigned int shared_offset_80698 = 0 +
                                         (shared_sizze_80693 + (8 -
                                                                shared_sizze_80693 %
                                                                8) % 8) +
                                         (shared_sizze_80695 + (8 -
                                                                shared_sizze_80695 %
                                                                8) % 8);
                            
                            if ((((((1 && num_groups_72217 != 0) && 1 != 0) &&
                                   1 != 0) && segred_group_sizze_72216 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[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_72217;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_80690[] =
                                     {&ctx->global_failure,
                                      &shared_offset_80694,
                                      &shared_offset_80696,
                                      &shared_offset_80698, &m_65343, &n_65344,
                                      &q_65346, &jump_65348, &n_m_65352,
                                      &i_65358, &num_groups_72217,
                                      &groups_per_segment_79591,
                                      &elements_per_thread_79592,
                                      &virt_num_groups_79593,
                                      &threads_per_segment_79595,
                                      &kernel_arg_80699, &kernel_arg_80700,
                                      &kernel_arg_80701, &kernel_arg_80702,
                                      &kernel_arg_80703, &kernel_arg_80704,
                                      &kernel_arg_80705, &kernel_arg_80706,
                                      &kernel_arg_80707, &kernel_arg_80708,
                                      &kernel_arg_80709, &kernel_arg_80710,
                                      &kernel_arg_80711, &kernel_arg_80712,
                                      &kernel_arg_80713, &kernel_arg_80714};
                                int64_t time_start_80691 = 0, time_end_80692 =
                                        0;
                                
                                if (ctx->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_72224",
                                            (long) num_groups_72217, (long) 1,
                                            (long) 1,
                                            (long) segred_group_sizze_72216,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80693 +
                                                                        (8 -
                                                                         shared_sizze_80693 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80695 +
                                                                        (8 -
                                                                         shared_sizze_80695 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80697 +
                                                                        (8 -
                                                                         shared_sizze_80697 %
                                                                         8) %
                                                                        8)));
                                    time_start_80691 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegred_large_72224_runs,
                                                              &ctx->mainzisegred_large_72224_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_72224,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segred_group_sizze_72216,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_80693 +
                                                                       (8 -
                                                                        shared_sizze_80693 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80695 +
                                                                       (8 -
                                                                        shared_sizze_80695 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_80697 +
                                                                       (8 -
                                                                        shared_sizze_80697 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_80690,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_80692 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segred_large_72224",
                                            time_end_80692 - time_start_80691);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79598,
                                                      "segred_tmp_mem_79598") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79596,
                                                      "segred_tmp_mem_79596") !=
                                0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_77751,
                                                  "mem_77751") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77755,
                                                  "mem_77755") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77781,
                                                  "mem_77781") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77785,
                                                  "mem_77785") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77789,
                                                  "mem_77789") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77793,
                                                  "mem_77793") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77797,
                                                  "mem_77797") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77808, &mem_77802,
                                                "mem_77802") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77807, &mem_77806,
                                                "mem_77806") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77806,
                                                  "mem_77806") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77802,
                                                  "mem_77802") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77797,
                                                  "mem_77797") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77793,
                                                  "mem_77793") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77789,
                                                  "mem_77789") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77785,
                                                  "mem_77785") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77781,
                                                  "mem_77781") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77776,
                                                  "mem_77776") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77772,
                                                  "mem_77772") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77768,
                                                  "mem_77768") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77764,
                                                  "mem_77764") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77760,
                                                  "mem_77760") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77755,
                                                  "mem_77755") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77751,
                                                  "mem_77751") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77747,
                                                  "mem_77747") != 0)
                            return 1;
                    }
                    if (memblock_unref_device(ctx, &mem_77608, "mem_77608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77612, "mem_77612") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77616, "mem_77616") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77622, "mem_77622") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77626, "mem_77626") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77629, "mem_77629") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77632, "mem_77632") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77635, "mem_77635") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77640, "mem_77640") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77820, &ext_mem_77808,
                                            "ext_mem_77808") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77819, &ext_mem_77807,
                                            "ext_mem_77807") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77807,
                                              "ext_mem_77807") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77808,
                                              "ext_mem_77808") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77640, "mem_77640") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77635, "mem_77635") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77632, "mem_77632") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77629, "mem_77629") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77626, "mem_77626") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77622, "mem_77622") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77616, "mem_77616") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77612, "mem_77612") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77608, "mem_77608") !=
                        0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_77822, &ext_mem_77820,
                                        "ext_mem_77820") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77821, &ext_mem_77819,
                                        "ext_mem_77819") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77819,
                                          "ext_mem_77819") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77820,
                                          "ext_mem_77820") != 0)
                    return 1;
            }
            if (memblock_set_device(ctx, &ext_mem_77824, &ext_mem_77822,
                                    "ext_mem_77822") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77823, &ext_mem_77821,
                                    "ext_mem_77821") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77821, "ext_mem_77821") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77822, "ext_mem_77822") !=
                0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_77996, &ext_mem_77824,
                                "ext_mem_77824") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_77995, &ext_mem_77823,
                                "ext_mem_77823") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77823, "ext_mem_77823") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77824, "ext_mem_77824") != 0)
            return 1;
    } else {
        bool match_lit_66002 = (int64_t) 0 == degree_65347;
        int64_t binop_x_77825 = m_65343 * n_m_65352;
        int64_t binop_y_77826 = (int64_t) 4 * binop_x_77825;
        int64_t bytes_77827 = smax64((int64_t) 0, binop_y_77826);
        int64_t binop_x_77830 = m_65343 * n_65344;
        int64_t binop_y_77831 = (int64_t) 8 * binop_x_77830;
        int64_t bytes_77832 = smax64((int64_t) 0, binop_y_77831);
        int64_t binop_y_77835 = (int64_t) 4 * binop_x_77830;
        int64_t bytes_77836 = smax64((int64_t) 0, binop_y_77835);
        int64_t binop_y_77849 = (int64_t) 8 * m_65343;
        int64_t bytes_77850 = smax64((int64_t) 0, binop_y_77849);
        int64_t binop_y_77858 = (int64_t) 4 * m_65343;
        int64_t bytes_77859 = smax64((int64_t) 0, binop_y_77858);
        int64_t binop_x_77862 = m_65343 * q_65346;
        int64_t binop_y_77863 = (int64_t) 4 * binop_x_77862;
        int64_t bytes_77864 = smax64((int64_t) 0, binop_y_77863);
        int64_t binop_y_77868 = (int64_t) 4 * q_65346;
        int64_t bytes_77869 = smax64((int64_t) 0, binop_y_77868);
        struct memblock_device ext_mem_77994;
        
        ext_mem_77994.references = NULL;
        
        struct memblock_device ext_mem_77993;
        
        ext_mem_77993.references = NULL;
        if (match_lit_66002) {
            struct memblock_device mem_77828;
            
            mem_77828.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77828, bytes_77827,
                                      "mem_77828")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_f32(ctx, mem_77828, m_65343 *
                                              n_m_65352, 0.0F) != 0) {
                if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77993,
                                          "ext_mem_77993") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77994,
                                          "ext_mem_77994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segscan_group_sizze_72659;
            
            segscan_group_sizze_72659 =
                *ctx->tuning_params.mainzisegscan_group_sizze_72639;
            
            int64_t num_groups_72660;
            int32_t max_num_groups_79644;
            
            max_num_groups_79644 =
                *ctx->tuning_params.mainzisegscan_num_groups_72641;
            num_groups_72660 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(binop_x_77830,
                                                                    segscan_group_sizze_72659),
                                                          sext_i32_i64(max_num_groups_79644))));
            
            struct memblock_device mem_77833;
            
            mem_77833.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77833, bytes_77832,
                                      "mem_77833")) {
                err = 1;
                goto cleanup;
            }
            if (slt64((int64_t) 0, m_65343 * n_65344)) {
                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_79645 = sdiv_up64(m_65343 * n_65344,
                                                     segscan_group_sizze_72659 *
                                                     (int64_t) 11) *
                        segscan_group_sizze_72659;
                int64_t numGroups_79646 = sdiv_up64(m_65343 * n_65344,
                                                    segscan_group_sizze_72659 *
                                                    (int64_t) 11);
                struct memblock_device mainziid_counter_mem_79647 =
                                       ctx->mainziid_counter_mem_79647;
                struct memblock_device status_flags_mem_79649;
                
                status_flags_mem_79649.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_79649,
                                          numGroups_79646,
                                          "status_flags_mem_79649")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_79651;
                
                aggregates_mem_79651.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_79651,
                                          (int64_t) 8 * numGroups_79646,
                                          "aggregates_mem_79651")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_79653;
                
                incprefixes_mem_79653.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_79653,
                                          (int64_t) 8 * numGroups_79646,
                                          "incprefixes_mem_79653")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_79649,
                                                 numGroups_79646, (int8_t) 0) !=
                    0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_79653,
                                              "incprefixes_mem_79653") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_79651,
                                              "aggregates_mem_79651") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_79649,
                                              "status_flags_mem_79649") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77833, "mem_77833") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77828, "mem_77828") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_80719 = smax64(smax64((int64_t) 288,
                                                                (int64_t) 8 *
                                                                segscan_group_sizze_72659),
                                                         (int64_t) 11 *
                                                         segscan_group_sizze_72659 *
                                                         (int64_t) 8);
                CUdeviceptr kernel_arg_80721 = Y_mem_76976.mem;
                CUdeviceptr kernel_arg_80722 = mem_77833.mem;
                CUdeviceptr kernel_arg_80723 = mainziid_counter_mem_79647.mem;
                CUdeviceptr kernel_arg_80724 = status_flags_mem_79649.mem;
                CUdeviceptr kernel_arg_80725 = aggregates_mem_79651.mem;
                CUdeviceptr kernel_arg_80726 = incprefixes_mem_79653.mem;
                unsigned int shared_offset_80720 = 0;
                
                if ((((((1 && sdiv_up64(m_65343 * n_65344,
                                        segscan_group_sizze_72659 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_72659 != 0) && 1 != 0) && 1 !=
                    0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_65343 * n_65344,
                                              segscan_group_sizze_72659 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80716[] = {&ctx->global_failure,
                                                 &shared_offset_80720, &m_65343,
                                                 &n_65344, &kernel_arg_80721,
                                                 &kernel_arg_80722,
                                                 &kernel_arg_80723,
                                                 &kernel_arg_80724,
                                                 &kernel_arg_80725,
                                                 &kernel_arg_80726};
                    int64_t time_start_80717 = 0, time_end_80718 = 0;
                    
                    if (ctx->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_72665", (long) sdiv_up64(m_65343 *
                                                                       n_65344,
                                                                       segscan_group_sizze_72659 *
                                                                       (int64_t) 11),
                                (long) 1, (long) 1,
                                (long) segscan_group_sizze_72659, (long) 1,
                                (long) 1, (int) (0 + (shared_sizze_80719 + (8 -
                                                                            shared_sizze_80719 %
                                                                            8) %
                                                      8)));
                        time_start_80717 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_72665_runs,
                                                  &ctx->mainzisegscan_72665_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_72665,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_72659,
                                                          1, 1, 0 +
                                                          (shared_sizze_80719 +
                                                           (8 -
                                                            shared_sizze_80719 %
                                                            8) % 8), NULL,
                                                          kernel_args_80716,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80718 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_72665", time_end_80718 -
                                time_start_80717);
                    }
                }
                if (memblock_unref_device(ctx, &incprefixes_mem_79653,
                                          "incprefixes_mem_79653") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_79651,
                                          "aggregates_mem_79651") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_79649,
                                          "status_flags_mem_79649") != 0)
                    return 1;
            }
            
            struct memblock_device mem_77837;
            
            mem_77837.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77837, bytes_77836,
                                      "mem_77837")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_f32(ctx, mem_77837, m_65343 * n_65344,
                                              0.0F) != 0) {
                if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77993,
                                          "ext_mem_77993") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77994,
                                          "ext_mem_77994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77841;
            
            mem_77841.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77841, bytes_77832,
                                      "mem_77841")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i64(ctx, mem_77841, m_65343 * n_65344,
                                              (int64_t) -1) != 0) {
                if (memblock_unref_device(ctx, &mem_77841, "mem_77841") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77993,
                                          "ext_mem_77993") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77994,
                                          "ext_mem_77994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segmap_group_sizze_72712;
            
            segmap_group_sizze_72712 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72553;
            
            int64_t segmap_usable_groups_72713 = sdiv_up64(binop_x_77830,
                                                           segmap_group_sizze_72712);
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_80730 = Y_mem_76976.mem;
            CUdeviceptr kernel_arg_80731 = mem_77833.mem;
            CUdeviceptr kernel_arg_80732 = mem_77837.mem;
            CUdeviceptr kernel_arg_80733 = mem_77841.mem;
            
            if ((((((1 && segmap_usable_groups_72713 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_72712 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[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_72713;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_80727[] = {&ctx->global_failure, &m_65343,
                                             &n_65344, &kernel_arg_80730,
                                             &kernel_arg_80731,
                                             &kernel_arg_80732,
                                             &kernel_arg_80733};
                int64_t time_start_80728 = 0, time_end_80729 = 0;
                
                if (ctx->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_72718",
                            (long) segmap_usable_groups_72713, (long) 1,
                            (long) 1, (long) segmap_group_sizze_72712, (long) 1,
                            (long) 1, (int) 0);
                    time_start_80728 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_72718_runs,
                                              &ctx->mainzisegmap_72718_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_72718,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_72712,
                                                      1, 1, 0, NULL,
                                                      kernel_args_80727, NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_80729 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_72718", time_end_80729 -
                            time_start_80728);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_72732;
            
            segmap_group_sizze_72732 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72527;
            
            int64_t segmap_usable_groups_72733 = sdiv_up64(binop_x_77830,
                                                           segmap_group_sizze_72732);
            struct memblock_device mem_77847;
            
            mem_77847.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77847, bytes_77832,
                                      "mem_77847")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_80737 = mem_77841.mem;
            CUdeviceptr kernel_arg_80738 = mem_77847.mem;
            
            if ((((((1 && segmap_usable_groups_72733 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_72732 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[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_72733;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_80734[] = {&ctx->global_failure, &m_65343,
                                             &n_65344, &kernel_arg_80737,
                                             &kernel_arg_80738};
                int64_t time_start_80735 = 0, time_end_80736 = 0;
                
                if (ctx->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_72737",
                            (long) segmap_usable_groups_72733, (long) 1,
                            (long) 1, (long) segmap_group_sizze_72732, (long) 1,
                            (long) 1, (int) 0);
                    time_start_80735 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_72737_runs,
                                              &ctx->mainzisegmap_72737_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_72737,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_72732,
                                                      1, 1, 0, NULL,
                                                      kernel_args_80734, NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_80736 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_72737", time_end_80736 -
                            time_start_80735);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_72742;
            
            segmap_group_sizze_72742 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72501;
            
            int64_t segmap_usable_groups_72743 = sdiv_up64(m_65343,
                                                           segmap_group_sizze_72742);
            struct memblock_device mem_77851;
            
            mem_77851.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77851, bytes_77850,
                                      "mem_77851")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77854;
            
            mem_77854.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77854, bytes_77850,
                                      "mem_77854")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77857;
            
            mem_77857.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77857, bytes_77850,
                                      "mem_77857")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77860;
            
            mem_77860.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77860, bytes_77859,
                                      "mem_77860")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_80742 = mem_77833.mem;
            CUdeviceptr kernel_arg_80743 = mem_77851.mem;
            CUdeviceptr kernel_arg_80744 = mem_77854.mem;
            CUdeviceptr kernel_arg_80745 = mem_77857.mem;
            CUdeviceptr kernel_arg_80746 = mem_77860.mem;
            
            if ((((((1 && segmap_usable_groups_72743 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_72742 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[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_72743;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_80739[] = {&ctx->global_failure, &m_65343,
                                             &n_65344, &q_65346, &i_65358,
                                             &min_res_65364, &i64_res_65370,
                                             &kernel_arg_80742,
                                             &kernel_arg_80743,
                                             &kernel_arg_80744,
                                             &kernel_arg_80745,
                                             &kernel_arg_80746};
                int64_t time_start_80740 = 0, time_end_80741 = 0;
                
                if (ctx->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_72749",
                            (long) segmap_usable_groups_72743, (long) 1,
                            (long) 1, (long) segmap_group_sizze_72742, (long) 1,
                            (long) 1, (int) 0);
                    time_start_80740 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_72749_runs,
                                              &ctx->mainzisegmap_72749_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_72749,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_72742,
                                                      1, 1, 0, NULL,
                                                      kernel_args_80739, NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_80741 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_72749", time_end_80741 -
                            time_start_80740);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_72764;
            
            segmap_group_sizze_72764 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72476;
            
            int64_t segmap_usable_groups_72765 = sdiv_up64(binop_x_77862,
                                                           segmap_group_sizze_72764);
            struct memblock_device mem_77865;
            
            mem_77865.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77865, bytes_77864,
                                      "mem_77865")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_80750 = mem_77833.mem;
            CUdeviceptr kernel_arg_80751 = mem_77865.mem;
            
            if ((((((1 && segmap_usable_groups_72765 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_72764 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[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_72765;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_80747[] = {&ctx->global_failure, &m_65343,
                                             &n_65344, &q_65346, &i_65358,
                                             &kernel_arg_80750,
                                             &kernel_arg_80751};
                int64_t time_start_80748 = 0, time_end_80749 = 0;
                
                if (ctx->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_72769",
                            (long) segmap_usable_groups_72765, (long) 1,
                            (long) 1, (long) segmap_group_sizze_72764, (long) 1,
                            (long) 1, (int) 0);
                    time_start_80748 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_72769_runs,
                                              &ctx->mainzisegmap_72769_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_72769,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_72764,
                                                      1, 1, 0, NULL,
                                                      kernel_args_80747, NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_80749 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_72769", time_end_80749 -
                            time_start_80748);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device mem_77875;
            
            mem_77875.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77875, bytes_77827,
                                      "mem_77875")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            unsigned int shared_sizze_80755 = (int64_t) 4 * q_65346;
            unsigned int shared_sizze_80757 = (int64_t) 4 * q_65346;
            unsigned int shared_sizze_80759 = bytes_77869;
            CUdeviceptr kernel_arg_80761 = mem_77833.mem;
            CUdeviceptr kernel_arg_80762 = mem_77837.mem;
            CUdeviceptr kernel_arg_80763 = mem_77841.mem;
            CUdeviceptr kernel_arg_80764 = mem_77847.mem;
            CUdeviceptr kernel_arg_80765 = mem_77851.mem;
            CUdeviceptr kernel_arg_80766 = mem_77854.mem;
            CUdeviceptr kernel_arg_80767 = mem_77857.mem;
            CUdeviceptr kernel_arg_80768 = mem_77860.mem;
            CUdeviceptr kernel_arg_80769 = mem_77865.mem;
            CUdeviceptr kernel_arg_80770 = mem_77875.mem;
            unsigned int shared_offset_80756 = 0;
            unsigned int shared_offset_80758 = 0 + (shared_sizze_80755 + (8 -
                                                                          shared_sizze_80755 %
                                                                          8) %
                                                    8);
            unsigned int shared_offset_80760 = 0 + (shared_sizze_80755 + (8 -
                                                                          shared_sizze_80755 %
                                                                          8) %
                                                    8) + (shared_sizze_80757 +
                                                          (8 -
                                                           shared_sizze_80757 %
                                                           8) % 8);
            
            if ((((((1 && binop_x_77825 != 0) && 1 != 0) && 1 != 0) &&
                  q_65346 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[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_77825;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_80752[] = {&ctx->global_failure,
                                             &ctx->failure_is_an_option,
                                             &ctx->global_failure_args,
                                             &shared_offset_80756,
                                             &shared_offset_80758,
                                             &shared_offset_80760, &m_65343,
                                             &n_65344, &q_65346, &jump_65348,
                                             &n_m_65352, &i_65358, &x_65359,
                                             &min_res_65364, &loop_cond_65369,
                                             &kernel_arg_80761,
                                             &kernel_arg_80762,
                                             &kernel_arg_80763,
                                             &kernel_arg_80764,
                                             &kernel_arg_80765,
                                             &kernel_arg_80766,
                                             &kernel_arg_80767,
                                             &kernel_arg_80768,
                                             &kernel_arg_80769,
                                             &kernel_arg_80770};
                int64_t time_start_80753 = 0, time_end_80754 = 0;
                
                if (ctx->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_72785",
                            (long) binop_x_77825, (long) 1, (long) 1,
                            (long) q_65346, (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_80755 +
                                                                        (8 -
                                                                         shared_sizze_80755 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80757 +
                                                                        (8 -
                                                                         shared_sizze_80757 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_80759 +
                                                                        (8 -
                                                                         shared_sizze_80759 %
                                                                         8) %
                                                                        8)));
                    time_start_80753 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_intragroup_72785_runs,
                                              &ctx->mainzisegmap_intragroup_72785_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_72785,
                                                      grid[0], grid[1], grid[2],
                                                      q_65346, 1, 1, 0 +
                                                      (shared_sizze_80755 + (8 -
                                                                             shared_sizze_80755 %
                                                                             8) %
                                                       8) +
                                                      (shared_sizze_80757 + (8 -
                                                                             shared_sizze_80757 %
                                                                             8) %
                                                       8) +
                                                      (shared_sizze_80759 + (8 -
                                                                             shared_sizze_80759 %
                                                                             8) %
                                                       8), NULL,
                                                      kernel_args_80752, NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_80754 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_72785", time_end_80754 -
                            time_start_80753);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77841, "mem_77841") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77847, "mem_77847") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77851, "mem_77851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77854, "mem_77854") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77857, "mem_77857") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77860, "mem_77860") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77865, "mem_77865") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77994, &mem_77875,
                                    "mem_77875") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77993, &mem_77828,
                                    "mem_77828") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77875, "mem_77875") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77865, "mem_77865") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77860, "mem_77860") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77857, "mem_77857") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77854, "mem_77854") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77851, "mem_77851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77847, "mem_77847") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77841, "mem_77841") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                return 1;
        } else {
            bool match_lit_66168 = (int64_t) 1 == degree_65347;
            struct memblock_device ext_mem_77992;
            
            ext_mem_77992.references = NULL;
            
            struct memblock_device ext_mem_77991;
            
            ext_mem_77991.references = NULL;
            if (match_lit_66168) {
                int64_t segscan_group_sizze_73326;
                
                segscan_group_sizze_73326 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_73306;
                
                int64_t num_groups_73327;
                int32_t max_num_groups_79813;
                
                max_num_groups_79813 =
                    *ctx->tuning_params.mainzisegscan_num_groups_73308;
                num_groups_73327 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(binop_x_77830,
                                                                        segscan_group_sizze_73326),
                                                              sext_i32_i64(max_num_groups_79813))));
                
                struct memblock_device mem_77880;
                
                mem_77880.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77880, bytes_77832,
                                          "mem_77880")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 0, m_65343 * n_65344)) {
                    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_79814 = sdiv_up64(m_65343 * n_65344,
                                                         segscan_group_sizze_73326 *
                                                         (int64_t) 11) *
                            segscan_group_sizze_73326;
                    int64_t numGroups_79815 = sdiv_up64(m_65343 * n_65344,
                                                        segscan_group_sizze_73326 *
                                                        (int64_t) 11);
                    struct memblock_device mainziid_counter_mem_79816 =
                                           ctx->mainziid_counter_mem_79816;
                    struct memblock_device status_flags_mem_79818;
                    
                    status_flags_mem_79818.references = NULL;
                    if (memblock_alloc_device(ctx, &status_flags_mem_79818,
                                              numGroups_79815,
                                              "status_flags_mem_79818")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device aggregates_mem_79820;
                    
                    aggregates_mem_79820.references = NULL;
                    if (memblock_alloc_device(ctx, &aggregates_mem_79820,
                                              (int64_t) 8 * numGroups_79815,
                                              "aggregates_mem_79820")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device incprefixes_mem_79822;
                    
                    incprefixes_mem_79822.references = NULL;
                    if (memblock_alloc_device(ctx, &incprefixes_mem_79822,
                                              (int64_t) 8 * numGroups_79815,
                                              "incprefixes_mem_79822")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i8(ctx,
                                                     status_flags_mem_79818,
                                                     numGroups_79815,
                                                     (int8_t) 0) != 0) {
                        if (memblock_unref_device(ctx, &incprefixes_mem_79822,
                                                  "incprefixes_mem_79822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &aggregates_mem_79820,
                                                  "aggregates_mem_79820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &status_flags_mem_79818,
                                                  "status_flags_mem_79818") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77880,
                                                  "mem_77880") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77991,
                                                  "ext_mem_77991") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77992,
                                                  "ext_mem_77992") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77993,
                                                  "ext_mem_77993") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77994,
                                                  "ext_mem_77994") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    unsigned int shared_sizze_80775 =
                                 smax64(smax64((int64_t) 288, (int64_t) 8 *
                                               segscan_group_sizze_73326),
                                        (int64_t) 11 *
                                        segscan_group_sizze_73326 *
                                        (int64_t) 8);
                    CUdeviceptr kernel_arg_80777 = Y_mem_76976.mem;
                    CUdeviceptr kernel_arg_80778 = mem_77880.mem;
                    CUdeviceptr kernel_arg_80779 =
                                mainziid_counter_mem_79816.mem;
                    CUdeviceptr kernel_arg_80780 = status_flags_mem_79818.mem;
                    CUdeviceptr kernel_arg_80781 = aggregates_mem_79820.mem;
                    CUdeviceptr kernel_arg_80782 = incprefixes_mem_79822.mem;
                    unsigned int shared_offset_80776 = 0;
                    
                    if ((((((1 && sdiv_up64(m_65343 * n_65344,
                                            segscan_group_sizze_73326 *
                                            (int64_t) 11) != 0) && 1 != 0) &&
                           1 != 0) && segscan_group_sizze_73326 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_65343 * n_65344,
                                                  segscan_group_sizze_73326 *
                                                  (int64_t) 11);
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80772[] = {&ctx->global_failure,
                                                     &shared_offset_80776,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80777,
                                                     &kernel_arg_80778,
                                                     &kernel_arg_80779,
                                                     &kernel_arg_80780,
                                                     &kernel_arg_80781,
                                                     &kernel_arg_80782};
                        int64_t time_start_80773 = 0, time_end_80774 = 0;
                        
                        if (ctx->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_73332",
                                    (long) sdiv_up64(m_65343 * n_65344,
                                                     segscan_group_sizze_73326 *
                                                     (int64_t) 11), (long) 1,
                                    (long) 1, (long) segscan_group_sizze_73326,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_80775 +
                                                                (8 -
                                                                 shared_sizze_80775 %
                                                                 8) % 8)));
                            time_start_80773 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegscan_73332_runs,
                                                      &ctx->mainzisegscan_73332_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_73332,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segscan_group_sizze_73326,
                                                              1, 1, 0 +
                                                              (shared_sizze_80775 +
                                                               (8 -
                                                                shared_sizze_80775 %
                                                                8) % 8), NULL,
                                                              kernel_args_80772,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80774 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segscan_73332", time_end_80774 -
                                    time_start_80773);
                        }
                    }
                    if (memblock_unref_device(ctx, &incprefixes_mem_79822,
                                              "incprefixes_mem_79822") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_79820,
                                              "aggregates_mem_79820") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_79818,
                                              "status_flags_mem_79818") != 0)
                        return 1;
                }
                
                struct memblock_device mem_77884;
                
                mem_77884.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77884, bytes_77836,
                                          "mem_77884")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_f32(ctx, mem_77884, m_65343 *
                                                  n_65344, 0.0F) != 0) {
                    if (memblock_unref_device(ctx, &mem_77884, "mem_77884") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77880, "mem_77880") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77888;
                
                mem_77888.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77888, bytes_77832,
                                          "mem_77888")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i64(ctx, mem_77888, m_65343 *
                                                  n_65344, (int64_t) -1) != 0) {
                    if (memblock_unref_device(ctx, &mem_77888, "mem_77888") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77884, "mem_77884") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77880, "mem_77880") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t segmap_group_sizze_73379;
                
                segmap_group_sizze_73379 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73220;
                
                int64_t segmap_usable_groups_73380 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_73379);
                
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80786 = Y_mem_76976.mem;
                CUdeviceptr kernel_arg_80787 = mem_77880.mem;
                CUdeviceptr kernel_arg_80788 = mem_77884.mem;
                CUdeviceptr kernel_arg_80789 = mem_77888.mem;
                
                if ((((((1 && segmap_usable_groups_73380 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_73379 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_73380;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80783[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &kernel_arg_80786,
                                                 &kernel_arg_80787,
                                                 &kernel_arg_80788,
                                                 &kernel_arg_80789};
                    int64_t time_start_80784 = 0, time_end_80785 = 0;
                    
                    if (ctx->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_73385",
                                (long) segmap_usable_groups_73380, (long) 1,
                                (long) 1, (long) segmap_group_sizze_73379,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80784 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_73385_runs,
                                                  &ctx->mainzisegmap_73385_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_73385,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_73379,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80783,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80785 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_73385", time_end_80785 -
                                time_start_80784);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_73399;
                
                segmap_group_sizze_73399 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73194;
                
                int64_t segmap_usable_groups_73400 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_73399);
                struct memblock_device mem_77894;
                
                mem_77894.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77894, bytes_77832,
                                          "mem_77894")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80793 = mem_77888.mem;
                CUdeviceptr kernel_arg_80794 = mem_77894.mem;
                
                if ((((((1 && segmap_usable_groups_73400 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_73399 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_73400;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80790[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &kernel_arg_80793,
                                                 &kernel_arg_80794};
                    int64_t time_start_80791 = 0, time_end_80792 = 0;
                    
                    if (ctx->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_73404",
                                (long) segmap_usable_groups_73400, (long) 1,
                                (long) 1, (long) segmap_group_sizze_73399,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80791 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_73404_runs,
                                                  &ctx->mainzisegmap_73404_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_73404,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_73399,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80790,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80792 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_73404", time_end_80792 -
                                time_start_80791);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_73409;
                
                segmap_group_sizze_73409 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73168;
                
                int64_t segmap_usable_groups_73410 = sdiv_up64(m_65343,
                                                               segmap_group_sizze_73409);
                struct memblock_device mem_77898;
                
                mem_77898.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77898, bytes_77850,
                                          "mem_77898")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77901;
                
                mem_77901.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77901, bytes_77850,
                                          "mem_77901")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77904;
                
                mem_77904.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77904, bytes_77850,
                                          "mem_77904")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77907;
                
                mem_77907.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77907, bytes_77859,
                                          "mem_77907")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80798 = mem_77880.mem;
                CUdeviceptr kernel_arg_80799 = mem_77898.mem;
                CUdeviceptr kernel_arg_80800 = mem_77901.mem;
                CUdeviceptr kernel_arg_80801 = mem_77904.mem;
                CUdeviceptr kernel_arg_80802 = mem_77907.mem;
                
                if ((((((1 && segmap_usable_groups_73410 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_73409 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_73410;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80795[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &q_65346, &i_65358,
                                                 &min_res_65364, &i64_res_65370,
                                                 &kernel_arg_80798,
                                                 &kernel_arg_80799,
                                                 &kernel_arg_80800,
                                                 &kernel_arg_80801,
                                                 &kernel_arg_80802};
                    int64_t time_start_80796 = 0, time_end_80797 = 0;
                    
                    if (ctx->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_73416",
                                (long) segmap_usable_groups_73410, (long) 1,
                                (long) 1, (long) segmap_group_sizze_73409,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80796 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_73416_runs,
                                                  &ctx->mainzisegmap_73416_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_73416,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_73409,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80795,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80797 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_73416", time_end_80797 -
                                time_start_80796);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_73431;
                
                segmap_group_sizze_73431 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73143;
                
                int64_t segmap_usable_groups_73432 = sdiv_up64(binop_x_77862,
                                                               segmap_group_sizze_73431);
                struct memblock_device mem_77912;
                
                mem_77912.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77912, bytes_77864,
                                          "mem_77912")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80806 = mem_77880.mem;
                CUdeviceptr kernel_arg_80807 = mem_77912.mem;
                
                if ((((((1 && segmap_usable_groups_73432 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_73431 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_73432;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80803[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &q_65346, &i_65358,
                                                 &kernel_arg_80806,
                                                 &kernel_arg_80807};
                    int64_t time_start_80804 = 0, time_end_80805 = 0;
                    
                    if (ctx->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_73436",
                                (long) segmap_usable_groups_73432, (long) 1,
                                (long) 1, (long) segmap_group_sizze_73431,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80804 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_73436_runs,
                                                  &ctx->mainzisegmap_73436_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_73436,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_73431,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80803,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80805 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_73436", time_end_80805 -
                                time_start_80804);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device mem_77925;
                
                mem_77925.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77925, bytes_77827,
                                          "mem_77925")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77929;
                
                mem_77929.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77929, bytes_77827,
                                          "mem_77929")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                unsigned int shared_sizze_80811 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80813 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80815 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80817 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80819 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80821 = bytes_77869;
                unsigned int shared_sizze_80823 = bytes_77869;
                CUdeviceptr kernel_arg_80825 = mem_77880.mem;
                CUdeviceptr kernel_arg_80826 = mem_77884.mem;
                CUdeviceptr kernel_arg_80827 = mem_77888.mem;
                CUdeviceptr kernel_arg_80828 = mem_77894.mem;
                CUdeviceptr kernel_arg_80829 = mem_77898.mem;
                CUdeviceptr kernel_arg_80830 = mem_77901.mem;
                CUdeviceptr kernel_arg_80831 = mem_77904.mem;
                CUdeviceptr kernel_arg_80832 = mem_77907.mem;
                CUdeviceptr kernel_arg_80833 = mem_77912.mem;
                CUdeviceptr kernel_arg_80834 = mem_77925.mem;
                CUdeviceptr kernel_arg_80835 = mem_77929.mem;
                unsigned int shared_offset_80812 = 0;
                unsigned int shared_offset_80814 = 0 + (shared_sizze_80811 +
                                                        (8 -
                                                         shared_sizze_80811 %
                                                         8) % 8);
                unsigned int shared_offset_80816 = 0 + (shared_sizze_80811 +
                                                        (8 -
                                                         shared_sizze_80811 %
                                                         8) % 8) +
                             (shared_sizze_80813 + (8 - shared_sizze_80813 %
                                                    8) % 8);
                unsigned int shared_offset_80818 = 0 + (shared_sizze_80811 +
                                                        (8 -
                                                         shared_sizze_80811 %
                                                         8) % 8) +
                             (shared_sizze_80813 + (8 - shared_sizze_80813 %
                                                    8) % 8) +
                             (shared_sizze_80815 + (8 - shared_sizze_80815 %
                                                    8) % 8);
                unsigned int shared_offset_80820 = 0 + (shared_sizze_80811 +
                                                        (8 -
                                                         shared_sizze_80811 %
                                                         8) % 8) +
                             (shared_sizze_80813 + (8 - shared_sizze_80813 %
                                                    8) % 8) +
                             (shared_sizze_80815 + (8 - shared_sizze_80815 %
                                                    8) % 8) +
                             (shared_sizze_80817 + (8 - shared_sizze_80817 %
                                                    8) % 8);
                unsigned int shared_offset_80822 = 0 + (shared_sizze_80811 +
                                                        (8 -
                                                         shared_sizze_80811 %
                                                         8) % 8) +
                             (shared_sizze_80813 + (8 - shared_sizze_80813 %
                                                    8) % 8) +
                             (shared_sizze_80815 + (8 - shared_sizze_80815 %
                                                    8) % 8) +
                             (shared_sizze_80817 + (8 - shared_sizze_80817 %
                                                    8) % 8) +
                             (shared_sizze_80819 + (8 - shared_sizze_80819 %
                                                    8) % 8);
                unsigned int shared_offset_80824 = 0 + (shared_sizze_80811 +
                                                        (8 -
                                                         shared_sizze_80811 %
                                                         8) % 8) +
                             (shared_sizze_80813 + (8 - shared_sizze_80813 %
                                                    8) % 8) +
                             (shared_sizze_80815 + (8 - shared_sizze_80815 %
                                                    8) % 8) +
                             (shared_sizze_80817 + (8 - shared_sizze_80817 %
                                                    8) % 8) +
                             (shared_sizze_80819 + (8 - shared_sizze_80819 %
                                                    8) % 8) +
                             (shared_sizze_80821 + (8 - shared_sizze_80821 %
                                                    8) % 8);
                
                if ((((((1 && binop_x_77825 != 0) && 1 != 0) && 1 != 0) &&
                      q_65346 != 0) && 1 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_77825;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80808[] = {&ctx->global_failure,
                                                 &ctx->failure_is_an_option,
                                                 &ctx->global_failure_args,
                                                 &shared_offset_80812,
                                                 &shared_offset_80814,
                                                 &shared_offset_80816,
                                                 &shared_offset_80818,
                                                 &shared_offset_80820,
                                                 &shared_offset_80822,
                                                 &shared_offset_80824, &m_65343,
                                                 &n_65344, &q_65346,
                                                 &jump_65348, &n_m_65352,
                                                 &i_65358, &x_65359,
                                                 &min_res_65364,
                                                 &loop_cond_65369,
                                                 &kernel_arg_80825,
                                                 &kernel_arg_80826,
                                                 &kernel_arg_80827,
                                                 &kernel_arg_80828,
                                                 &kernel_arg_80829,
                                                 &kernel_arg_80830,
                                                 &kernel_arg_80831,
                                                 &kernel_arg_80832,
                                                 &kernel_arg_80833,
                                                 &kernel_arg_80834,
                                                 &kernel_arg_80835};
                    int64_t time_start_80809 = 0, time_end_80810 = 0;
                    
                    if (ctx->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_73453",
                                (long) binop_x_77825, (long) 1, (long) 1,
                                (long) q_65346, (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_80811 +
                                                                            (8 -
                                                                             shared_sizze_80811 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80813 +
                                                                            (8 -
                                                                             shared_sizze_80813 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80815 +
                                                                            (8 -
                                                                             shared_sizze_80815 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80817 +
                                                                            (8 -
                                                                             shared_sizze_80817 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80819 +
                                                                            (8 -
                                                                             shared_sizze_80819 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80821 +
                                                                            (8 -
                                                                             shared_sizze_80821 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80823 +
                                                                            (8 -
                                                                             shared_sizze_80823 %
                                                                             8) %
                                                                            8)));
                        time_start_80809 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_intragroup_73453_runs,
                                                  &ctx->mainzisegmap_intragroup_73453_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_73453,
                                                          grid[0], grid[1],
                                                          grid[2], q_65346, 1,
                                                          1, 0 +
                                                          (shared_sizze_80811 +
                                                           (8 -
                                                            shared_sizze_80811 %
                                                            8) % 8) +
                                                          (shared_sizze_80813 +
                                                           (8 -
                                                            shared_sizze_80813 %
                                                            8) % 8) +
                                                          (shared_sizze_80815 +
                                                           (8 -
                                                            shared_sizze_80815 %
                                                            8) % 8) +
                                                          (shared_sizze_80817 +
                                                           (8 -
                                                            shared_sizze_80817 %
                                                            8) % 8) +
                                                          (shared_sizze_80819 +
                                                           (8 -
                                                            shared_sizze_80819 %
                                                            8) % 8) +
                                                          (shared_sizze_80821 +
                                                           (8 -
                                                            shared_sizze_80821 %
                                                            8) % 8) +
                                                          (shared_sizze_80823 +
                                                           (8 -
                                                            shared_sizze_80823 %
                                                            8) % 8), NULL,
                                                          kernel_args_80808,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80810 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_73453", time_end_80810 -
                                time_start_80809);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_77880, "mem_77880") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77884, "mem_77884") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77888, "mem_77888") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77894, "mem_77894") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77898, "mem_77898") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77901, "mem_77901") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77904, "mem_77904") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77907, "mem_77907") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77912, "mem_77912") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77992, &mem_77925,
                                        "mem_77925") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77991, &mem_77929,
                                        "mem_77929") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77929, "mem_77929") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77925, "mem_77925") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77912, "mem_77912") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77907, "mem_77907") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77904, "mem_77904") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77901, "mem_77901") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77898, "mem_77898") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77894, "mem_77894") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77888, "mem_77888") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77884, "mem_77884") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77880, "mem_77880") != 0)
                    return 1;
            } else {
                int64_t segscan_group_sizze_74083;
                
                segscan_group_sizze_74083 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_74063;
                
                int64_t num_groups_74084;
                int32_t max_num_groups_79988;
                
                max_num_groups_79988 =
                    *ctx->tuning_params.mainzisegscan_num_groups_74065;
                num_groups_74084 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(binop_x_77830,
                                                                        segscan_group_sizze_74083),
                                                              sext_i32_i64(max_num_groups_79988))));
                
                struct memblock_device mem_77934;
                
                mem_77934.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77934, bytes_77832,
                                          "mem_77934")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 0, m_65343 * n_65344)) {
                    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_79989 = sdiv_up64(m_65343 * n_65344,
                                                         segscan_group_sizze_74083 *
                                                         (int64_t) 11) *
                            segscan_group_sizze_74083;
                    int64_t numGroups_79990 = sdiv_up64(m_65343 * n_65344,
                                                        segscan_group_sizze_74083 *
                                                        (int64_t) 11);
                    struct memblock_device mainziid_counter_mem_79991 =
                                           ctx->mainziid_counter_mem_79991;
                    struct memblock_device status_flags_mem_79993;
                    
                    status_flags_mem_79993.references = NULL;
                    if (memblock_alloc_device(ctx, &status_flags_mem_79993,
                                              numGroups_79990,
                                              "status_flags_mem_79993")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device aggregates_mem_79995;
                    
                    aggregates_mem_79995.references = NULL;
                    if (memblock_alloc_device(ctx, &aggregates_mem_79995,
                                              (int64_t) 8 * numGroups_79990,
                                              "aggregates_mem_79995")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device incprefixes_mem_79997;
                    
                    incprefixes_mem_79997.references = NULL;
                    if (memblock_alloc_device(ctx, &incprefixes_mem_79997,
                                              (int64_t) 8 * numGroups_79990,
                                              "incprefixes_mem_79997")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i8(ctx,
                                                     status_flags_mem_79993,
                                                     numGroups_79990,
                                                     (int8_t) 0) != 0) {
                        if (memblock_unref_device(ctx, &incprefixes_mem_79997,
                                                  "incprefixes_mem_79997") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &aggregates_mem_79995,
                                                  "aggregates_mem_79995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &status_flags_mem_79993,
                                                  "status_flags_mem_79993") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77934,
                                                  "mem_77934") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77991,
                                                  "ext_mem_77991") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77992,
                                                  "ext_mem_77992") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77993,
                                                  "ext_mem_77993") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77994,
                                                  "ext_mem_77994") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    unsigned int shared_sizze_80840 =
                                 smax64(smax64((int64_t) 288, (int64_t) 8 *
                                               segscan_group_sizze_74083),
                                        (int64_t) 11 *
                                        segscan_group_sizze_74083 *
                                        (int64_t) 8);
                    CUdeviceptr kernel_arg_80842 = Y_mem_76976.mem;
                    CUdeviceptr kernel_arg_80843 = mem_77934.mem;
                    CUdeviceptr kernel_arg_80844 =
                                mainziid_counter_mem_79991.mem;
                    CUdeviceptr kernel_arg_80845 = status_flags_mem_79993.mem;
                    CUdeviceptr kernel_arg_80846 = aggregates_mem_79995.mem;
                    CUdeviceptr kernel_arg_80847 = incprefixes_mem_79997.mem;
                    unsigned int shared_offset_80841 = 0;
                    
                    if ((((((1 && sdiv_up64(m_65343 * n_65344,
                                            segscan_group_sizze_74083 *
                                            (int64_t) 11) != 0) && 1 != 0) &&
                           1 != 0) && segscan_group_sizze_74083 != 0) && 1 !=
                         0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[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_65343 * n_65344,
                                                  segscan_group_sizze_74083 *
                                                  (int64_t) 11);
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_80837[] = {&ctx->global_failure,
                                                     &shared_offset_80841,
                                                     &m_65343, &n_65344,
                                                     &kernel_arg_80842,
                                                     &kernel_arg_80843,
                                                     &kernel_arg_80844,
                                                     &kernel_arg_80845,
                                                     &kernel_arg_80846,
                                                     &kernel_arg_80847};
                        int64_t time_start_80838 = 0, time_end_80839 = 0;
                        
                        if (ctx->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_74089",
                                    (long) sdiv_up64(m_65343 * n_65344,
                                                     segscan_group_sizze_74083 *
                                                     (int64_t) 11), (long) 1,
                                    (long) 1, (long) segscan_group_sizze_74083,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_80840 +
                                                                (8 -
                                                                 shared_sizze_80840 %
                                                                 8) % 8)));
                            time_start_80838 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegscan_74089_runs,
                                                      &ctx->mainzisegscan_74089_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_74089,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segscan_group_sizze_74083,
                                                              1, 1, 0 +
                                                              (shared_sizze_80840 +
                                                               (8 -
                                                                shared_sizze_80840 %
                                                                8) % 8), NULL,
                                                              kernel_args_80837,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_80839 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segscan_74089", time_end_80839 -
                                    time_start_80838);
                        }
                    }
                    if (memblock_unref_device(ctx, &incprefixes_mem_79997,
                                              "incprefixes_mem_79997") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_79995,
                                              "aggregates_mem_79995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_79993,
                                              "status_flags_mem_79993") != 0)
                        return 1;
                }
                
                struct memblock_device mem_77938;
                
                mem_77938.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77938, bytes_77836,
                                          "mem_77938")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_f32(ctx, mem_77938, m_65343 *
                                                  n_65344, 0.0F) != 0) {
                    if (memblock_unref_device(ctx, &mem_77938, "mem_77938") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77934, "mem_77934") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77942;
                
                mem_77942.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77942, bytes_77832,
                                          "mem_77942")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i64(ctx, mem_77942, m_65343 *
                                                  n_65344, (int64_t) -1) != 0) {
                    if (memblock_unref_device(ctx, &mem_77942, "mem_77942") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77938, "mem_77938") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77934, "mem_77934") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t segmap_group_sizze_74136;
                
                segmap_group_sizze_74136 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73977;
                
                int64_t segmap_usable_groups_74137 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_74136);
                
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80851 = Y_mem_76976.mem;
                CUdeviceptr kernel_arg_80852 = mem_77934.mem;
                CUdeviceptr kernel_arg_80853 = mem_77938.mem;
                CUdeviceptr kernel_arg_80854 = mem_77942.mem;
                
                if ((((((1 && segmap_usable_groups_74137 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_74136 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_74137;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80848[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &kernel_arg_80851,
                                                 &kernel_arg_80852,
                                                 &kernel_arg_80853,
                                                 &kernel_arg_80854};
                    int64_t time_start_80849 = 0, time_end_80850 = 0;
                    
                    if (ctx->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_74142",
                                (long) segmap_usable_groups_74137, (long) 1,
                                (long) 1, (long) segmap_group_sizze_74136,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80849 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_74142_runs,
                                                  &ctx->mainzisegmap_74142_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_74142,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_74136,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80848,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80850 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_74142", time_end_80850 -
                                time_start_80849);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_74156;
                
                segmap_group_sizze_74156 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73951;
                
                int64_t segmap_usable_groups_74157 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_74156);
                struct memblock_device mem_77948;
                
                mem_77948.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77948, bytes_77832,
                                          "mem_77948")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80858 = mem_77942.mem;
                CUdeviceptr kernel_arg_80859 = mem_77948.mem;
                
                if ((((((1 && segmap_usable_groups_74157 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_74156 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_74157;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80855[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &kernel_arg_80858,
                                                 &kernel_arg_80859};
                    int64_t time_start_80856 = 0, time_end_80857 = 0;
                    
                    if (ctx->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_74161",
                                (long) segmap_usable_groups_74157, (long) 1,
                                (long) 1, (long) segmap_group_sizze_74156,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80856 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_74161_runs,
                                                  &ctx->mainzisegmap_74161_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_74161,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_74156,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80855,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80857 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_74161", time_end_80857 -
                                time_start_80856);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_74166;
                
                segmap_group_sizze_74166 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73925;
                
                int64_t segmap_usable_groups_74167 = sdiv_up64(m_65343,
                                                               segmap_group_sizze_74166);
                struct memblock_device mem_77952;
                
                mem_77952.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77952, bytes_77850,
                                          "mem_77952")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77955;
                
                mem_77955.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77955, bytes_77850,
                                          "mem_77955")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77958;
                
                mem_77958.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77958, bytes_77850,
                                          "mem_77958")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77961;
                
                mem_77961.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77961, bytes_77859,
                                          "mem_77961")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80863 = mem_77934.mem;
                CUdeviceptr kernel_arg_80864 = mem_77952.mem;
                CUdeviceptr kernel_arg_80865 = mem_77955.mem;
                CUdeviceptr kernel_arg_80866 = mem_77958.mem;
                CUdeviceptr kernel_arg_80867 = mem_77961.mem;
                
                if ((((((1 && segmap_usable_groups_74167 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_74166 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_74167;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80860[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &q_65346, &i_65358,
                                                 &min_res_65364, &i64_res_65370,
                                                 &kernel_arg_80863,
                                                 &kernel_arg_80864,
                                                 &kernel_arg_80865,
                                                 &kernel_arg_80866,
                                                 &kernel_arg_80867};
                    int64_t time_start_80861 = 0, time_end_80862 = 0;
                    
                    if (ctx->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_74173",
                                (long) segmap_usable_groups_74167, (long) 1,
                                (long) 1, (long) segmap_group_sizze_74166,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80861 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_74173_runs,
                                                  &ctx->mainzisegmap_74173_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_74173,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_74166,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80860,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80862 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_74173", time_end_80862 -
                                time_start_80861);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_74188;
                
                segmap_group_sizze_74188 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73900;
                
                int64_t segmap_usable_groups_74189 = sdiv_up64(binop_x_77862,
                                                               segmap_group_sizze_74188);
                struct memblock_device mem_77966;
                
                mem_77966.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77966, bytes_77864,
                                          "mem_77966")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_80871 = mem_77934.mem;
                CUdeviceptr kernel_arg_80872 = mem_77966.mem;
                
                if ((((((1 && segmap_usable_groups_74189 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_74188 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_74189;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80868[] = {&ctx->global_failure, &m_65343,
                                                 &n_65344, &q_65346, &i_65358,
                                                 &kernel_arg_80871,
                                                 &kernel_arg_80872};
                    int64_t time_start_80869 = 0, time_end_80870 = 0;
                    
                    if (ctx->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_74193",
                                (long) segmap_usable_groups_74189, (long) 1,
                                (long) 1, (long) segmap_group_sizze_74188,
                                (long) 1, (long) 1, (int) 0);
                        time_start_80869 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_74193_runs,
                                                  &ctx->mainzisegmap_74193_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_74193,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_74188,
                                                          1, 1, 0, NULL,
                                                          kernel_args_80868,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80870 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_74193", time_end_80870 -
                                time_start_80869);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device mem_77986;
                
                mem_77986.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77986, bytes_77827,
                                          "mem_77986")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77990;
                
                mem_77990.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77990, bytes_77827,
                                          "mem_77990")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                unsigned int shared_sizze_80876 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80878 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80880 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80882 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80884 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80886 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80888 = (int64_t) 4 * q_65346;
                unsigned int shared_sizze_80890 = bytes_77869;
                unsigned int shared_sizze_80892 = bytes_77869;
                unsigned int shared_sizze_80894 = bytes_77869;
                unsigned int shared_sizze_80896 = bytes_77869;
                CUdeviceptr kernel_arg_80898 = mem_77934.mem;
                CUdeviceptr kernel_arg_80899 = mem_77938.mem;
                CUdeviceptr kernel_arg_80900 = mem_77942.mem;
                CUdeviceptr kernel_arg_80901 = mem_77948.mem;
                CUdeviceptr kernel_arg_80902 = mem_77952.mem;
                CUdeviceptr kernel_arg_80903 = mem_77955.mem;
                CUdeviceptr kernel_arg_80904 = mem_77958.mem;
                CUdeviceptr kernel_arg_80905 = mem_77961.mem;
                CUdeviceptr kernel_arg_80906 = mem_77966.mem;
                CUdeviceptr kernel_arg_80907 = mem_77986.mem;
                CUdeviceptr kernel_arg_80908 = mem_77990.mem;
                unsigned int shared_offset_80877 = 0;
                unsigned int shared_offset_80879 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8);
                unsigned int shared_offset_80881 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8);
                unsigned int shared_offset_80883 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8);
                unsigned int shared_offset_80885 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8);
                unsigned int shared_offset_80887 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8) +
                             (shared_sizze_80884 + (8 - shared_sizze_80884 %
                                                    8) % 8);
                unsigned int shared_offset_80889 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8) +
                             (shared_sizze_80884 + (8 - shared_sizze_80884 %
                                                    8) % 8) +
                             (shared_sizze_80886 + (8 - shared_sizze_80886 %
                                                    8) % 8);
                unsigned int shared_offset_80891 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8) +
                             (shared_sizze_80884 + (8 - shared_sizze_80884 %
                                                    8) % 8) +
                             (shared_sizze_80886 + (8 - shared_sizze_80886 %
                                                    8) % 8) +
                             (shared_sizze_80888 + (8 - shared_sizze_80888 %
                                                    8) % 8);
                unsigned int shared_offset_80893 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8) +
                             (shared_sizze_80884 + (8 - shared_sizze_80884 %
                                                    8) % 8) +
                             (shared_sizze_80886 + (8 - shared_sizze_80886 %
                                                    8) % 8) +
                             (shared_sizze_80888 + (8 - shared_sizze_80888 %
                                                    8) % 8) +
                             (shared_sizze_80890 + (8 - shared_sizze_80890 %
                                                    8) % 8);
                unsigned int shared_offset_80895 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8) +
                             (shared_sizze_80884 + (8 - shared_sizze_80884 %
                                                    8) % 8) +
                             (shared_sizze_80886 + (8 - shared_sizze_80886 %
                                                    8) % 8) +
                             (shared_sizze_80888 + (8 - shared_sizze_80888 %
                                                    8) % 8) +
                             (shared_sizze_80890 + (8 - shared_sizze_80890 %
                                                    8) % 8) +
                             (shared_sizze_80892 + (8 - shared_sizze_80892 %
                                                    8) % 8);
                unsigned int shared_offset_80897 = 0 + (shared_sizze_80876 +
                                                        (8 -
                                                         shared_sizze_80876 %
                                                         8) % 8) +
                             (shared_sizze_80878 + (8 - shared_sizze_80878 %
                                                    8) % 8) +
                             (shared_sizze_80880 + (8 - shared_sizze_80880 %
                                                    8) % 8) +
                             (shared_sizze_80882 + (8 - shared_sizze_80882 %
                                                    8) % 8) +
                             (shared_sizze_80884 + (8 - shared_sizze_80884 %
                                                    8) % 8) +
                             (shared_sizze_80886 + (8 - shared_sizze_80886 %
                                                    8) % 8) +
                             (shared_sizze_80888 + (8 - shared_sizze_80888 %
                                                    8) % 8) +
                             (shared_sizze_80890 + (8 - shared_sizze_80890 %
                                                    8) % 8) +
                             (shared_sizze_80892 + (8 - shared_sizze_80892 %
                                                    8) % 8) +
                             (shared_sizze_80894 + (8 - shared_sizze_80894 %
                                                    8) % 8);
                
                if ((((((1 && binop_x_77825 != 0) && 1 != 0) && 1 != 0) &&
                      q_65346 != 0) && 1 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[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_77825;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_80873[] = {&ctx->global_failure,
                                                 &ctx->failure_is_an_option,
                                                 &ctx->global_failure_args,
                                                 &shared_offset_80877,
                                                 &shared_offset_80879,
                                                 &shared_offset_80881,
                                                 &shared_offset_80883,
                                                 &shared_offset_80885,
                                                 &shared_offset_80887,
                                                 &shared_offset_80889,
                                                 &shared_offset_80891,
                                                 &shared_offset_80893,
                                                 &shared_offset_80895,
                                                 &shared_offset_80897, &m_65343,
                                                 &n_65344, &q_65346,
                                                 &jump_65348, &n_m_65352,
                                                 &i_65358, &x_65359,
                                                 &min_res_65364,
                                                 &loop_cond_65369,
                                                 &kernel_arg_80898,
                                                 &kernel_arg_80899,
                                                 &kernel_arg_80900,
                                                 &kernel_arg_80901,
                                                 &kernel_arg_80902,
                                                 &kernel_arg_80903,
                                                 &kernel_arg_80904,
                                                 &kernel_arg_80905,
                                                 &kernel_arg_80906,
                                                 &kernel_arg_80907,
                                                 &kernel_arg_80908};
                    int64_t time_start_80874 = 0, time_end_80875 = 0;
                    
                    if (ctx->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_74210",
                                (long) binop_x_77825, (long) 1, (long) 1,
                                (long) q_65346, (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_80876 +
                                                                            (8 -
                                                                             shared_sizze_80876 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80878 +
                                                                            (8 -
                                                                             shared_sizze_80878 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80880 +
                                                                            (8 -
                                                                             shared_sizze_80880 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80882 +
                                                                            (8 -
                                                                             shared_sizze_80882 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80884 +
                                                                            (8 -
                                                                             shared_sizze_80884 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80886 +
                                                                            (8 -
                                                                             shared_sizze_80886 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80888 +
                                                                            (8 -
                                                                             shared_sizze_80888 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80890 +
                                                                            (8 -
                                                                             shared_sizze_80890 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80892 +
                                                                            (8 -
                                                                             shared_sizze_80892 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80894 +
                                                                            (8 -
                                                                             shared_sizze_80894 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_80896 +
                                                                            (8 -
                                                                             shared_sizze_80896 %
                                                                             8) %
                                                                            8)));
                        time_start_80874 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_intragroup_74210_runs,
                                                  &ctx->mainzisegmap_intragroup_74210_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_74210,
                                                          grid[0], grid[1],
                                                          grid[2], q_65346, 1,
                                                          1, 0 +
                                                          (shared_sizze_80876 +
                                                           (8 -
                                                            shared_sizze_80876 %
                                                            8) % 8) +
                                                          (shared_sizze_80878 +
                                                           (8 -
                                                            shared_sizze_80878 %
                                                            8) % 8) +
                                                          (shared_sizze_80880 +
                                                           (8 -
                                                            shared_sizze_80880 %
                                                            8) % 8) +
                                                          (shared_sizze_80882 +
                                                           (8 -
                                                            shared_sizze_80882 %
                                                            8) % 8) +
                                                          (shared_sizze_80884 +
                                                           (8 -
                                                            shared_sizze_80884 %
                                                            8) % 8) +
                                                          (shared_sizze_80886 +
                                                           (8 -
                                                            shared_sizze_80886 %
                                                            8) % 8) +
                                                          (shared_sizze_80888 +
                                                           (8 -
                                                            shared_sizze_80888 %
                                                            8) % 8) +
                                                          (shared_sizze_80890 +
                                                           (8 -
                                                            shared_sizze_80890 %
                                                            8) % 8) +
                                                          (shared_sizze_80892 +
                                                           (8 -
                                                            shared_sizze_80892 %
                                                            8) % 8) +
                                                          (shared_sizze_80894 +
                                                           (8 -
                                                            shared_sizze_80894 %
                                                            8) % 8) +
                                                          (shared_sizze_80896 +
                                                           (8 -
                                                            shared_sizze_80896 %
                                                            8) % 8), NULL,
                                                          kernel_args_80873,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_80875 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_74210", time_end_80875 -
                                time_start_80874);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_77934, "mem_77934") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77938, "mem_77938") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77942, "mem_77942") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77948, "mem_77948") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77952, "mem_77952") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77955, "mem_77955") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77958, "mem_77958") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77961, "mem_77961") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77966, "mem_77966") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77992, &mem_77986,
                                        "mem_77986") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77991, &mem_77990,
                                        "mem_77990") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77990, "mem_77990") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77986, "mem_77986") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77966, "mem_77966") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77961, "mem_77961") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77958, "mem_77958") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77955, "mem_77955") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77952, "mem_77952") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77948, "mem_77948") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77942, "mem_77942") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77938, "mem_77938") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77934, "mem_77934") != 0)
                    return 1;
            }
            if (memblock_set_device(ctx, &ext_mem_77994, &ext_mem_77992,
                                    "ext_mem_77992") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77993, &ext_mem_77991,
                                    "ext_mem_77991") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77991, "ext_mem_77991") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77992, "ext_mem_77992") !=
                0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_77996, &ext_mem_77994,
                                "ext_mem_77994") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_77995, &ext_mem_77993,
                                "ext_mem_77993") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77993, "ext_mem_77993") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77994, "ext_mem_77994") != 0)
            return 1;
    }
    
    bool cond_66632 = slt64((int64_t) 1, jump_65348);
    int64_t ext_78003;
    
    if (cond_66632) {
        ext_78003 = n_65344;
    } else {
        ext_78003 = n_m_65352;
    }
    
    int64_t binop_x_77998 = m_65343 * n_65344;
    int64_t binop_y_77999 = (int64_t) 4 * binop_x_77998;
    int64_t bytes_78000 = smax64((int64_t) 0, binop_y_77999);
    struct memblock_device ext_mem_78002;
    
    ext_mem_78002.references = NULL;
    if (cond_66632) {
        bool zzero_66634 = jump_65348 == (int64_t) 0;
        bool nonzzero_66635 = !zzero_66634;
        bool nonzzero_cert_66636;
        
        if (!nonzzero_66635) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  loess.fut:546: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:545:3-549:9\n   #5  loess.fut:608:13-59\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:607:5-609:29\n   #9  loess.fut:572:1-611:26\n");
            if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t y_66637 = sub64(n_m_65352, (int64_t) 1);
        int64_t segmap_group_sizze_74550;
        
        segmap_group_sizze_74550 =
            *ctx->tuning_params.mainzisegmap_group_sizze_74432;
        
        int64_t segmap_usable_groups_74551 = sdiv_up64(binop_x_77998,
                                                       segmap_group_sizze_74550);
        struct memblock_device mem_78001;
        
        mem_78001.references = NULL;
        if (memblock_alloc_device(ctx, &mem_78001, bytes_78000, "mem_78001")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_80912 = ext_mem_77995.mem;
        CUdeviceptr kernel_arg_80913 = ext_mem_77996.mem;
        CUdeviceptr kernel_arg_80914 = mem_78001.mem;
        
        if ((((((1 && segmap_usable_groups_74551 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_74550 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[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_74551;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_80909[] = {&ctx->global_failure,
                                         &ctx->failure_is_an_option,
                                         &ctx->global_failure_args, &m_65343,
                                         &n_65344, &jump_65348, &n_m_65352,
                                         &i_65358, &y_66637, &kernel_arg_80912,
                                         &kernel_arg_80913, &kernel_arg_80914};
            int64_t time_start_80910 = 0, time_end_80911 = 0;
            
            if (ctx->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_74555", (long) segmap_usable_groups_74551,
                        (long) 1, (long) 1, (long) segmap_group_sizze_74550,
                        (long) 1, (long) 1, (int) 0);
                time_start_80910 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_74555_runs,
                                          &ctx->mainzisegmap_74555_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_74555,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_74550, 1,
                                                  1, 0, NULL, kernel_args_80909,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_80911 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_74555", time_end_80911 - time_start_80910);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_78002, &mem_78001, "mem_78001") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_78001, "mem_78001") != 0)
            return 1;
    } else {
        bool dim_match_66689 = n_65344 == n_m_65352;
        bool empty_or_match_cert_66690;
        
        if (!dim_match_66689) {
            ctx->error =
                msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                          "Value of (core language) shape (",
                          (long long) m_65343, ", ", (long long) n_m_65352,
                          ") cannot match shape of type `[",
                          (long long) m_65343, "][", (long long) n_65344,
                          "]f32`.",
                          "-> #0  loess.fut:611:5-26\n   #1  loess.fut:572:1-611:26\n");
            if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        if (memblock_set_device(ctx, &ext_mem_78002, &ext_mem_77996,
                                "ext_mem_77996") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") != 0)
        return 1;
    
    struct memblock_device mem_78007;
    
    mem_78007.references = NULL;
    if (memblock_alloc_device(ctx, &mem_78007, bytes_78000, "mem_78007")) {
        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_78007.mem + (int64_t) 0,
                                        ext_mem_78002.mem + (int64_t) 0,
                                        m_65343 * n_65344 * (int64_t) 4));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
    }
    if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_78270, &mem_78007, "mem_78007") != 0)
        return 1;
    (*mem_out_p_80217).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_80217, &mem_out_78270,
                            "mem_out_78270") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_78007, "mem_78007") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") != 0)
        return 1;
    
  cleanup:
    { }
    return err;
}

int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f32_2d **out0, const
                       struct futhark_f32_2d *in0, const int64_t in1, const
                       int64_t in2, const int64_t in3, const int64_t in4, const
                       int64_t in5)
{
    struct memblock_device Y_mem_76976;
    
    Y_mem_76976.references = NULL;
    
    int64_t m_65343;
    int64_t n_65344;
    int64_t q_65346;
    int64_t degree_65347;
    int64_t jump_65348;
    int64_t jump_threshold_65349;
    int64_t q_threshold_65350;
    struct memblock_device mem_out_78270;
    
    mem_out_78270.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    Y_mem_76976 = in0->mem;
    m_65343 = in0->shape[0];
    n_65344 = in0->shape[1];
    q_65346 = in1;
    degree_65347 = in2;
    jump_65348 = in3;
    jump_threshold_65349 = in4;
    q_threshold_65350 = in5;
    if (!(m_65343 == in0->shape[0] && n_65344 == 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_78270, Y_mem_76976, m_65343,
                                n_65344, q_65346, degree_65347, jump_65348,
                                jump_threshold_65349, q_threshold_65350);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out0)->mem = mem_out_78270;
            (*out0)->shape[0] = m_65343;
            (*out0)->shape[1] = n_65344;
        }
    }
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    lock_unlock(&ctx->lock);
    return ret;
}
  
