// Generated by Futhark 0.20.0
// git: 5cc4d4b (Tue Jul 6 11:53:53 2021 -0700)
#ifndef _GNU_SOURCE
#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

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#include <float.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_set_debugging(struct futhark_context_config *cfg,
                                          int flag);
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int flag);
struct futhark_context;
struct futhark_context *futhark_context_new(struct futhark_context_config *cfg);
void futhark_context_free(struct futhark_context *ctx);
int futhark_context_config_set_size(struct futhark_context_config *cfg, const
                                    char *size_name, size_t size_value);
int futhark_get_num_sizes(void);
const char *futhark_get_size_name(int);
const char *futhark_get_size_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
                                              char *data, int 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);
char *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,
                       struct futhark_f32_2d **out1,
                       struct futhark_f32_2d **out2, 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, const int64_t in6, const int64_t in7, const
                       int64_t in8, const int64_t in9, const int64_t in10, const
                       int64_t in11);

// 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_c
#ifdef __cplusplus
}
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <stdint.h>
#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, ...) {
  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, msg...) check_err(err, 0, __func__, __LINE__, msg)
#define CHECK_ERRNO(err, msg...) check_err(err, 1, __func__, __LINE__, msg)

// 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) {
  size_t start = ftell(f);
  fseek(f, 0, SEEK_END);
  size_t src_size = ftell(f)-start;
  fseek(f, start, SEEK_SET);
  unsigned char *s = (unsigned char*) malloc(src_size + 1);
  if (fread(s, 1, src_size, f) != src_size) {
    free(s);
    s = NULL;
  } else {
    s[src_size] = '\0';
  }

  if (size) {
    *size = 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 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>

// 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.

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 x << y;
}
static inline uint16_t shl16(uint16_t x, uint16_t y)
{
    return 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 int8_t pow8(int8_t x, int8_t y)
{
    int8_t res = 1, rem = y;
    
    while (rem != 0) {
        if (rem & 1)
            res *= x;
        rem >>= 1;
        x *= x;
    }
    return res;
}
static inline int16_t pow16(int16_t x, int16_t y)
{
    int16_t res = 1, rem = y;
    
    while (rem != 0) {
        if (rem & 1)
            res *= x;
        rem >>= 1;
        x *= x;
    }
    return res;
}
static inline int32_t pow32(int32_t x, int32_t y)
{
    int32_t res = 1, rem = y;
    
    while (rem != 0) {
        if (rem & 1)
            res *= x;
        rem >>= 1;
        x *= x;
    }
    return res;
}
static inline int64_t pow64(int64_t x, int64_t y)
{
    int64_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)
#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
static int32_t futrts_popc8(int8_t x)
{
    int c = 0;
    
    for (; x; ++c)
        x &= x - 1;
    return c;
}
static int32_t futrts_popc16(int16_t x)
{
    int c = 0;
    
    for (; x; ++c)
        x &= x - 1;
    return c;
}
static int32_t futrts_popc32(int32_t x)
{
    int c = 0;
    
    for (; x; ++c)
        x &= x - 1;
    return c;
}
static int32_t futrts_popc64(int64_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
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
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
static int32_t futrts_clzz8(int8_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
static int32_t futrts_clzz16(int16_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
static int32_t futrts_clzz32(int32_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
static int32_t futrts_clzz64(int64_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
#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
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(x);
}
static int32_t futrts_ctzz64(int64_t x)
{
    return x == 0 ? 64 : __builtin_ctzll(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 float fmin32(float x, float y)
{
    return fmin(x, y);
}
static inline float fmax32(float x, float y)
{
    return fmax(x, y);
}
static inline float fpow32(float x, float y)
{
    return pow(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;
}
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 double fmin64(double x, double y)
{
    return fmin(x, y);
}
static inline double fmax64(double x, double y)
{
    return fmax(x, y);
}
static inline double fpow64(double x, double y)
{
    return pow(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 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;
}
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
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);
}
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);
}
#ifdef __OPENCL_VERSION__
static inline double futrts_lerp64(double v0, double v1, double t)
{
    return mix(v0, v1, t);
}
static inline double futrts_mad64(double a, double b, double c)
{
    return mad(a, b, c);
}
#else
static inline double futrts_lerp64(double v0, double v1, double t)
{
    return v0 + (v1 - v0) * t;
}
static inline double futrts_mad64(double a, double b, double c)
{
    return a * b + c;
}
#endif
static int init_constants(struct futhark_context *);
static int free_constants(struct futhark_context *);
struct memblock {
    int *references;
    char *mem;
    int64_t size;
    const char *desc;
};
struct futhark_context_config {
    int debugging;
};
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->debugging = 0;
    return cfg;
}
void futhark_context_config_free(struct futhark_context_config *cfg)
{
    free(cfg);
}
void futhark_context_config_set_debugging(struct futhark_context_config *cfg,
                                          int detail)
{
    cfg->debugging = detail;
}
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int detail)
{
    /* Does nothing for this backend. */
    (void) cfg;
    (void) detail;
}
struct futhark_context {
    int detail_memory;
    int debugging;
    int profiling;
    int logging;
    lock_t lock;
    char *error;
    FILE *log;
    int profiling_paused;
    int64_t peak_mem_usage_default;
    int64_t cur_mem_usage_default;
    struct {
        int dummy;
    } constants;
};
struct futhark_context *futhark_context_new(struct futhark_context_config *cfg)
{
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    ctx->detail_memory = cfg->debugging;
    ctx->debugging = cfg->debugging;
    ctx->profiling = cfg->debugging;
    ctx->logging = cfg->debugging;
    ctx->error = NULL;
    ctx->log = stderr;
    create_lock(&ctx->lock);
    ctx->peak_mem_usage_default = 0;
    ctx->cur_mem_usage_default = 0;
    init_constants(ctx);
    return ctx;
}
void futhark_context_free(struct futhark_context *ctx)
{
    free_constants(ctx);
    free_lock(&ctx->lock);
    free(ctx);
}
int futhark_context_sync(struct futhark_context *ctx)
{
    (void) ctx;
    return 0;
}
static const char *size_names[0];
static const char *size_vars[0];
static const char *size_classes[0];
int futhark_context_config_set_size(struct futhark_context_config *cfg, const
                                    char *size_name, size_t size_value)
{
    (void) cfg;
    (void) size_name;
    (void) size_value;
    return 1;
}
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 = (char *) malloc(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_num_sizes(void)
{
    return sizeof(size_names) / sizeof(size_names[0]);
}
const char *futhark_get_size_name(int i)
{
    return size_names[i];
}
const char *futhark_get_size_class(int i)
{
    return size_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) {
        { }
    }
    if (ctx->profiling) { }
    return builder.str;
}
char *futhark_context_get_error(struct futhark_context *ctx)
{
    char *error = ctx->error;
    
    ctx->error = NULL;
    return error;
}
void futhark_context_set_logging_file(struct futhark_context *ctx, FILE *f)
{
    ctx->log = f;
}
void futhark_context_pause_profiling(struct futhark_context *ctx)
{
    ctx->profiling_paused = 1;
}
void futhark_context_unpause_profiling(struct futhark_context *ctx)
{
    ctx->profiling_paused = 0;
}
int futhark_context_clear_caches(struct futhark_context *ctx)
{
    lock_lock(&ctx->lock);
    ctx->peak_mem_usage_default = 0;
    lock_unlock(&ctx->lock);
    return ctx->error != NULL;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock *out_mem_p_120614,
                             struct memblock *out_mem_p_120615,
                             struct memblock *out_mem_p_120616,
                             struct memblock Y_mem_117613, int64_t m_114533,
                             int64_t n_114534, int64_t n_p_114536,
                             int64_t t_window_114537, int64_t l_window_114538,
                             int64_t t_degree_114539, int64_t l_degree_114540,
                             int64_t t_jump_114541, int64_t l_jump_114542,
                             int64_t inner_114543, int64_t outer_114544,
                             int64_t jump_threshold_114545,
                             int64_t max_group_sizze_114546);
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 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);
    arr->mem.references = NULL;
    if (memblock_alloc(ctx, &arr->mem, (size_t) (dim0 * dim1) * 4, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    memmove(arr->mem.mem + 0, data + 0, (size_t) (dim0 * dim1) * 4);
    lock_unlock(&ctx->lock);
    return arr;
}
struct futhark_f32_2d *futhark_new_raw_f32_2d(struct futhark_context *ctx, const
                                              char *data, int 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);
    arr->mem.references = NULL;
    if (memblock_alloc(ctx, &arr->mem, (size_t) (dim0 * dim1) * 4, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    memmove(arr->mem.mem + 0, data + offset, (size_t) (dim0 * dim1) * 4);
    lock_unlock(&ctx->lock);
    return arr;
}
int futhark_free_f32_2d(struct futhark_context *ctx, struct futhark_f32_2d *arr)
{
    lock_lock(&ctx->lock);
    if (memblock_unref(ctx, &arr->mem, "arr->mem") != 0)
        return 1;
    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);
    memmove(data + 0, arr->mem.mem + 0, (size_t) (arr->shape[0] *
                                                  arr->shape[1]) * 4);
    lock_unlock(&ctx->lock);
    return 0;
}
char *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_entry_main(struct futhark_context *ctx,
                             struct memblock *out_mem_p_120614,
                             struct memblock *out_mem_p_120615,
                             struct memblock *out_mem_p_120616,
                             struct memblock Y_mem_117613, int64_t m_114533,
                             int64_t n_114534, int64_t n_p_114536,
                             int64_t t_window_114537, int64_t l_window_114538,
                             int64_t t_degree_114539, int64_t l_degree_114540,
                             int64_t t_jump_114541, int64_t l_jump_114542,
                             int64_t inner_114543, int64_t outer_114544,
                             int64_t jump_threshold_114545,
                             int64_t max_group_sizze_114546)
{
    (void) ctx;
    
    int err = 0;
    size_t mem_117617_cached_sizze_120617 = 0;
    char *mem_117617 = NULL;
    size_t mem_117620_cached_sizze_120618 = 0;
    char *mem_117620 = NULL;
    size_t mem_117640_cached_sizze_120619 = 0;
    char *mem_117640 = NULL;
    size_t mem_117655_cached_sizze_120620 = 0;
    char *mem_117655 = NULL;
    size_t mem_117691_cached_sizze_120621 = 0;
    char *mem_117691 = NULL;
    size_t mem_117735_cached_sizze_120622 = 0;
    char *mem_117735 = NULL;
    size_t mem_117779_cached_sizze_120623 = 0;
    char *mem_117779 = NULL;
    size_t mem_117823_cached_sizze_120624 = 0;
    char *mem_117823 = NULL;
    size_t mem_117827_cached_sizze_120625 = 0;
    char *mem_117827 = NULL;
    size_t mem_117850_cached_sizze_120626 = 0;
    char *mem_117850 = NULL;
    size_t mem_117853_cached_sizze_120627 = 0;
    char *mem_117853 = NULL;
    size_t mem_117941_cached_sizze_120628 = 0;
    char *mem_117941 = NULL;
    size_t mem_117945_cached_sizze_120629 = 0;
    char *mem_117945 = NULL;
    size_t mem_117968_cached_sizze_120630 = 0;
    char *mem_117968 = NULL;
    size_t mem_117971_cached_sizze_120631 = 0;
    char *mem_117971 = NULL;
    size_t mem_118113_cached_sizze_120632 = 0;
    char *mem_118113 = NULL;
    size_t mem_118157_cached_sizze_120633 = 0;
    char *mem_118157 = NULL;
    size_t mem_118201_cached_sizze_120634 = 0;
    char *mem_118201 = NULL;
    size_t mem_118245_cached_sizze_120635 = 0;
    char *mem_118245 = NULL;
    size_t mem_118258_cached_sizze_120636 = 0;
    char *mem_118258 = NULL;
    size_t mem_118273_cached_sizze_120637 = 0;
    char *mem_118273 = NULL;
    size_t mem_118288_cached_sizze_120638 = 0;
    char *mem_118288 = NULL;
    size_t mem_118312_cached_sizze_120639 = 0;
    char *mem_118312 = NULL;
    size_t mem_118316_cached_sizze_120640 = 0;
    char *mem_118316 = NULL;
    size_t mem_118684_cached_sizze_120641 = 0;
    char *mem_118684 = NULL;
    size_t mem_118768_cached_sizze_120642 = 0;
    char *mem_118768 = NULL;
    size_t mem_118771_cached_sizze_120643 = 0;
    char *mem_118771 = NULL;
    size_t mem_118886_cached_sizze_120644 = 0;
    char *mem_118886 = NULL;
    size_t mem_118889_cached_sizze_120645 = 0;
    char *mem_118889 = NULL;
    size_t mem_118916_cached_sizze_120646 = 0;
    char *mem_118916 = NULL;
    size_t mem_118919_cached_sizze_120647 = 0;
    char *mem_118919 = NULL;
    size_t mem_119129_cached_sizze_120648 = 0;
    char *mem_119129 = NULL;
    size_t mem_119142_cached_sizze_120649 = 0;
    char *mem_119142 = NULL;
    size_t mem_119472_cached_sizze_120650 = 0;
    char *mem_119472 = NULL;
    size_t mem_119556_cached_sizze_120651 = 0;
    char *mem_119556 = NULL;
    size_t mem_119559_cached_sizze_120652 = 0;
    char *mem_119559 = NULL;
    size_t mem_119674_cached_sizze_120653 = 0;
    char *mem_119674 = NULL;
    size_t mem_119677_cached_sizze_120654 = 0;
    char *mem_119677 = NULL;
    size_t mem_119704_cached_sizze_120655 = 0;
    char *mem_119704 = NULL;
    size_t mem_119707_cached_sizze_120656 = 0;
    char *mem_119707 = NULL;
    size_t mem_119889_cached_sizze_120657 = 0;
    char *mem_119889 = NULL;
    size_t mem_119933_cached_sizze_120658 = 0;
    char *mem_119933 = NULL;
    size_t mem_119977_cached_sizze_120659 = 0;
    char *mem_119977 = NULL;
    size_t mem_119998_cached_sizze_120660 = 0;
    char *mem_119998 = NULL;
    size_t mem_120001_cached_sizze_120661 = 0;
    char *mem_120001 = NULL;
    size_t mem_120004_cached_sizze_120662 = 0;
    char *mem_120004 = NULL;
    size_t mem_120007_cached_sizze_120663 = 0;
    char *mem_120007 = NULL;
    size_t mem_120010_cached_sizze_120664 = 0;
    char *mem_120010 = NULL;
    size_t mem_120073_cached_sizze_120665 = 0;
    char *mem_120073 = NULL;
    size_t mem_120104_cached_sizze_120666 = 0;
    char *mem_120104 = NULL;
    size_t mem_120107_cached_sizze_120667 = 0;
    char *mem_120107 = NULL;
    size_t mem_120110_cached_sizze_120668 = 0;
    char *mem_120110 = NULL;
    size_t mem_120224_cached_sizze_120669 = 0;
    char *mem_120224 = NULL;
    struct memblock out_mem_120373;
    
    out_mem_120373.references = NULL;
    
    struct memblock out_mem_120374;
    
    out_mem_120374.references = NULL;
    
    struct memblock out_mem_120375;
    
    out_mem_120375.references = NULL;
    
    bool assert_cond_114547 = sle64((int64_t) 4, n_p_114536);
    bool assert_c_114548;
    
    if (!assert_cond_114547) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (n_p >= 4)",
                               "-> #0  stl.fut:90:13-33\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t x_114549 = smod64(t_window_114537, (int64_t) 2);
    bool assert_cond_114550 = x_114549 == (int64_t) 1;
    bool assert_c_114551;
    
    if (!assert_cond_114550) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:5:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:92:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114552 = slt64((int64_t) 0, t_window_114537);
    bool assert_c_114553;
    
    if (!assert_cond_114552) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:2:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:92:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t x_114554 = smod64(l_window_114538, (int64_t) 2);
    bool assert_cond_114555 = x_114554 == (int64_t) 1;
    bool assert_c_114556;
    
    if (!assert_cond_114555) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:5:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:93:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114557 = slt64((int64_t) 0, l_window_114538);
    bool assert_c_114558;
    
    if (!assert_cond_114557) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:2:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:93:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool cond_114559 = sle64((int64_t) 0, t_degree_114539);
    bool assert_cond_t_res_114560 = sle64(t_degree_114539, (int64_t) 2);
    bool x_114561 = cond_114559 && assert_cond_t_res_114560;
    bool assert_c_114562;
    
    if (!x_114561) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:8:3-29\n   #1  stl.fut:95:18-35\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool cond_114563 = sle64((int64_t) 0, l_degree_114540);
    bool assert_cond_t_res_114564 = sle64(l_degree_114540, (int64_t) 2);
    bool x_114565 = cond_114563 && assert_cond_t_res_114564;
    bool assert_c_114566;
    
    if (!x_114565) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:8:3-29\n   #1  stl.fut:96:18-35\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114567 = sle64((int64_t) 0, t_jump_114541);
    bool assert_c_114568;
    
    if (!assert_cond_114567) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0)",
                               "-> #0  utils.fut:14:3-19\n   #1  stl.fut:98:16-34\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114569 = sle64((int64_t) 0, l_jump_114542);
    bool assert_c_114570;
    
    if (!assert_cond_114569) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0)",
                               "-> #0  utils.fut:14:3-19\n   #1  stl.fut:99:16-34\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114571 = slt64((int64_t) 0, inner_114543);
    bool assert_c_114572;
    
    if (!assert_cond_114571) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:2:3-18\n   #1  stl.fut:101:15-29\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114573 = sle64((int64_t) 0, outer_114544);
    bool assert_c_114574;
    
    if (!assert_cond_114573) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0)",
                               "-> #0  utils.fut:14:3-19\n   #1  stl.fut:102:15-32\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    float i64_res_114575 = sitofp_i64_f32(n_114534);
    float i64_res_114576 = sitofp_i64_f32(n_p_114536);
    float binop_p_114577 = i64_res_114575 / i64_res_114576;
    float defunc_0_f_res_114578;
    
    defunc_0_f_res_114578 = futrts_ceil32(binop_p_114577);
    
    int64_t defunc_0_f_res_114579 = fptosi_f32_i64(defunc_0_f_res_114578);
    int64_t css_chunk_len_114580 = add64((int64_t) 2, defunc_0_f_res_114579);
    int64_t y_114581 = mul64((int64_t) 2, n_p_114536);
    int64_t C_len_114582 = add64(n_114534, y_114581);
    bool cond_114583 = l_jump_114542 == (int64_t) 1;
    int64_t l_n_m_114584;
    
    if (cond_114583) {
        l_n_m_114584 = n_114534;
    } else {
        bool zzero_114585 = l_jump_114542 == (int64_t) 0;
        bool nonzzero_114586 = !zzero_114585;
        bool nonzzero_cert_114587;
        
        if (!nonzzero_114586) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:110:42-51\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
            if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                return 1;
            if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                return 1;
            if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                return 1;
            return 1;
        }
        
        int64_t x_114588 = sdiv64(n_114534, l_jump_114542);
        int64_t l_n_m_f_res_114589 = add64((int64_t) 1, x_114588);
        
        l_n_m_114584 = l_n_m_f_res_114589;
    }
    
    bool cond_114590 = t_jump_114541 == (int64_t) 1;
    int64_t t_n_m_114591;
    
    if (cond_114590) {
        t_n_m_114591 = n_114534;
    } else {
        bool zzero_114592 = t_jump_114541 == (int64_t) 0;
        bool nonzzero_114593 = !zzero_114592;
        bool nonzzero_cert_114594;
        
        if (!nonzzero_114593) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:114:42-51\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
            if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                return 1;
            if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                return 1;
            if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                return 1;
            return 1;
        }
        
        int64_t x_114595 = sdiv64(n_114534, t_jump_114541);
        int64_t t_n_m_f_res_114596 = add64((int64_t) 1, x_114595);
        
        t_n_m_114591 = t_n_m_f_res_114596;
    }
    
    float x_114597 = i64_res_114575 / 2.0F;
    float floor_arg_114598 = 1.0F + x_114597;
    float floor_res_114599;
    
    floor_res_114599 = futrts_floor32(floor_arg_114598);
    
    int64_t defunc_0_f_res_114600 = fptosi_f32_i64(floor_res_114599);
    int64_t x_114601 = sub64(n_114534, defunc_0_f_res_114600);
    int64_t mid2_114602 = add64((int64_t) 1, x_114601);
    bool cond_114603 = defunc_0_f_res_114600 == mid2_114602;
    int64_t stl_res_114604;
    int64_t stl_res_114605;
    
    if (cond_114603) {
        int64_t stl_res_t_res_114606 = sub64(defunc_0_f_res_114600,
                                             (int64_t) 1);
        
        stl_res_114604 = stl_res_t_res_114606;
        stl_res_114605 = defunc_0_f_res_114600;
    } else {
        int64_t min_res_114607 = smin64(defunc_0_f_res_114600, mid2_114602);
        int64_t stl_res_f_res_114608 = sub64(min_res_114607, (int64_t) 1);
        int64_t max_res_114609 = smax64(defunc_0_f_res_114600, mid2_114602);
        
        stl_res_114604 = stl_res_f_res_114608;
        stl_res_114605 = max_res_114609;
    }
    
    int64_t i_114610 = sub64(n_114534, (int64_t) 1);
    bool x_114611 = sle64((int64_t) 0, i_114610);
    bool y_114612 = slt64(i_114610, n_114534);
    bool bounds_check_114613 = x_114611 && y_114612;
    bool index_certs_114614;
    
    if (!bounds_check_114613) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", i_114610,
                               "] out of bounds for array of shape [", n_114534,
                               "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:38:13-20\n   #2  stl.fut:128:31-49\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t binop_x_117615 = m_114533 * n_114534;
    int64_t binop_y_117616 = (int64_t) 8 * binop_x_117615;
    int64_t bytes_117614 = smax64((int64_t) 0, binop_y_117616);
    
    if (mem_117617_cached_sizze_120617 < (size_t) bytes_117614) {
        mem_117617 = realloc(mem_117617, bytes_117614);
        mem_117617_cached_sizze_120617 = bytes_117614;
    }
    
    int64_t binop_y_117619 = (int64_t) 8 * m_114533;
    int64_t bytes_117618 = smax64((int64_t) 0, binop_y_117619);
    
    if (mem_117620_cached_sizze_120618 < (size_t) bytes_117618) {
        mem_117620 = realloc(mem_117620, bytes_117618);
        mem_117620_cached_sizze_120618 = bytes_117618;
    }
    
    int64_t binop_y_117639 = (int64_t) 8 * n_114534;
    int64_t bytes_117638 = smax64((int64_t) 0, binop_y_117639);
    
    if (mem_117640_cached_sizze_120619 < (size_t) bytes_117638) {
        mem_117640 = realloc(mem_117640, bytes_117638);
        mem_117640_cached_sizze_120619 = bytes_117638;
    }
    if (mem_117655_cached_sizze_120620 < (size_t) bytes_117638) {
        mem_117655 = realloc(mem_117655, bytes_117638);
        mem_117655_cached_sizze_120620 = bytes_117638;
    }
    for (int64_t i_120376 = 0; i_120376 < n_114534; i_120376++) {
        ((int64_t *) mem_117655)[i_120376] = (int64_t) -1;
    }
    for (int64_t i_116771 = 0; i_116771 < m_114533; i_116771++) {
        int64_t discard_116760;
        int64_t scanacc_116756 = (int64_t) 0;
        
        for (int64_t i_116758 = 0; i_116758 < n_114534; i_116758++) {
            float x_114623 = ((float *) Y_mem_117613.mem)[i_116771 * n_114534 +
                                                          i_116758];
            bool isnan_res_114624;
            
            isnan_res_114624 = futrts_isnan32(x_114623);
            
            bool defunc_0_p_res_114625 = !isnan_res_114624;
            int64_t defunc_0_f_res_114626 =
                    btoi_bool_i64(defunc_0_p_res_114625);
            int64_t defunc_1_op_res_114622 = add64(defunc_0_f_res_114626,
                                                   scanacc_116756);
            
            ((int64_t *) mem_117640)[i_116758] = defunc_1_op_res_114622;
            
            int64_t scanacc_tmp_120379 = defunc_1_op_res_114622;
            
            scanacc_116756 = scanacc_tmp_120379;
        }
        discard_116760 = scanacc_116756;
        memmove(mem_117617 + i_116771 * n_114534 * (int64_t) 8, mem_117655 +
                (int64_t) 0, n_114534 * (int64_t) 8);
        for (int64_t write_iter_116761 = 0; write_iter_116761 < n_114534;
             write_iter_116761++) {
            float write_iv_116763 = ((float *) Y_mem_117613.mem)[i_116771 *
                                                                 n_114534 +
                                                                 write_iter_116761];
            int64_t write_iv_116764 =
                    ((int64_t *) mem_117640)[write_iter_116761];
            bool isnan_res_114633;
            
            isnan_res_114633 = futrts_isnan32(write_iv_116763);
            
            bool defunc_0_p_res_114634 = !isnan_res_114633;
            int64_t defunc_1_f_res_114635;
            
            if (defunc_0_p_res_114634) {
                int64_t defunc_1_f_res_t_res_114636 = sub64(write_iv_116764,
                                                            (int64_t) 1);
                
                defunc_1_f_res_114635 = defunc_1_f_res_t_res_114636;
            } else {
                defunc_1_f_res_114635 = (int64_t) -1;
            }
            if ((sle64((int64_t) 0, i_116771) && slt64(i_116771, m_114533)) &&
                (sle64((int64_t) 0, defunc_1_f_res_114635) &&
                 slt64(defunc_1_f_res_114635, n_114534))) {
                ((int64_t *) mem_117617)[i_116771 * n_114534 +
                                         defunc_1_f_res_114635] =
                    write_iter_116761;
            }
        }
        memmove(mem_117620 + i_116771 * (int64_t) 8, mem_117640 + i_114610 *
                (int64_t) 8, (int64_t) 8);
    }
    
    int64_t binop_y_117690 = (int64_t) 4 * binop_x_117615;
    int64_t bytes_117688 = smax64((int64_t) 0, binop_y_117690);
    
    if (mem_117691_cached_sizze_120621 < (size_t) bytes_117688) {
        mem_117691 = realloc(mem_117691, bytes_117688);
        mem_117691_cached_sizze_120621 = bytes_117688;
    }
    for (int64_t i_116780 = 0; i_116780 < m_114533; i_116780++) {
        for (int64_t i_116776 = 0; i_116776 < n_114534; i_116776++) {
            int64_t x_114642 = ((int64_t *) mem_117617)[i_116780 * n_114534 +
                                                        i_116776];
            float i64_res_114643 = sitofp_i64_f32(x_114642);
            
            ((float *) mem_117691)[i_116780 * n_114534 + i_116776] =
                i64_res_114643;
        }
    }
    
    bool bounds_invalid_upwards_114645 = slt64(n_p_114536, (int64_t) 0);
    bool valid_114646 = !bounds_invalid_upwards_114645;
    bool range_valid_c_114647;
    
    if (!valid_114646) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               n_p_114536, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:134:5-144:14\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool bounds_invalid_upwards_114649 = slt64(css_chunk_len_114580,
                                               (int64_t) 0);
    bool valid_114650 = !bounds_invalid_upwards_114649;
    bool range_valid_c_114651;
    
    if (!valid_114650) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               css_chunk_len_114580, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:137:16-143:39\n   #3  /prelude/soacs.fut:59:3-10\n   #4  /prelude/array.fut:195:3-17\n   #5  stl.fut:134:5-144:14\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t binop_x_117733 = n_p_114536 * css_chunk_len_114580;
    int64_t binop_y_117734 = (int64_t) 8 * binop_x_117733;
    int64_t bytes_117732 = smax64((int64_t) 0, binop_y_117734);
    
    if (mem_117735_cached_sizze_120622 < (size_t) bytes_117732) {
        mem_117735 = realloc(mem_117735, bytes_117732);
        mem_117735_cached_sizze_120622 = bytes_117732;
    }
    for (int64_t i_116788 = 0; i_116788 < n_p_114536; i_116788++) {
        for (int64_t i_116784 = 0; i_116784 < css_chunk_len_114580;
             i_116784++) {
            int64_t y_114657 = mul64(n_p_114536, i_116784);
            int64_t res_idx_114658 = add64(y_114657, i_116788);
            bool cond_114659 = slt64(i_114610, res_idx_114658);
            int64_t defunc_0_f_res_114660;
            
            if (cond_114659) {
                defunc_0_f_res_114660 = (int64_t) -1;
            } else {
                defunc_0_f_res_114660 = res_idx_114658;
            }
            ((int64_t *) mem_117735)[i_116788 * css_chunk_len_114580 +
                                     i_116784] = defunc_0_f_res_114660;
        }
    }
    
    int64_t binop_x_117777 = m_114533 * n_p_114536;
    int64_t binop_y_117778 = (int64_t) 4 * binop_x_117777;
    int64_t bytes_117776 = smax64((int64_t) 0, binop_y_117778);
    
    if (mem_117779_cached_sizze_120623 < (size_t) bytes_117776) {
        mem_117779 = realloc(mem_117779, bytes_117776);
        mem_117779_cached_sizze_120623 = bytes_117776;
    }
    for (int64_t i_116798 = 0; i_116798 < m_114533; i_116798++) {
        for (int64_t i_116794 = 0; i_116794 < n_p_114536; i_116794++) {
            float defunc_2_reduce_res_114666;
            float redout_116790 = 0.0F;
            
            for (int64_t i_116791 = 0; i_116791 < css_chunk_len_114580;
                 i_116791++) {
                int64_t x_114670 = ((int64_t *) mem_117735)[i_116794 *
                                                            css_chunk_len_114580 +
                                                            i_116791];
                bool cond_114671 = sle64((int64_t) 0, x_114670);
                float defunc_0_f_res_114672;
                
                if (cond_114671) {
                    bool y_114673 = slt64(x_114670, n_114534);
                    bool bounds_check_114674 = cond_114671 && y_114673;
                    bool index_certs_114675;
                    
                    if (!bounds_check_114674) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", x_114670,
                                      "] out of bounds for array of shape [",
                                      n_114534, "].",
                                      "-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:152:30-55\n   #3  stl.fut:150:13-159:26\n   #4  stl.fut:148:5-160:11\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
                        if (memblock_unref(ctx, &out_mem_120375,
                                           "out_mem_120375") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120374,
                                           "out_mem_120374") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120373,
                                           "out_mem_120373") != 0)
                            return 1;
                        return 1;
                    }
                    
                    float defunc_0_f_res_t_res_114676 =
                          ((float *) Y_mem_117613.mem)[i_116798 * n_114534 +
                                                       x_114670];
                    
                    defunc_0_f_res_114672 = defunc_0_f_res_t_res_114676;
                } else {
                    defunc_0_f_res_114672 = NAN;
                }
                
                bool isnan_res_114677;
                
                isnan_res_114677 = futrts_isnan32(defunc_0_f_res_114672);
                
                float defunc_0_f_res_114678;
                
                if (isnan_res_114677) {
                    defunc_0_f_res_114678 = 0.0F;
                } else {
                    defunc_0_f_res_114678 = 1.0F;
                }
                
                float defunc_1_op_res_114669 = defunc_0_f_res_114678 +
                      redout_116790;
                float redout_tmp_120388 = defunc_1_op_res_114669;
                
                redout_116790 = redout_tmp_120388;
            }
            defunc_2_reduce_res_114666 = redout_116790;
            
            bool sub_series_is_not_all_nan_114679 = 0.0F <
                 defunc_2_reduce_res_114666;
            bool assert_c_114680;
            
            if (!sub_series_is_not_all_nan_114679) {
                ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                       "Assertion is false: sub_series_is_not_all_nan",
                                       "-> #0  stl.fut:157:34-75\n   #1  stl.fut:150:13-159:26\n   #2  stl.fut:148:5-160:11\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            ((float *) mem_117779)[i_116798 * n_p_114536 + i_116794] =
                defunc_2_reduce_res_114666;
        }
    }
    
    int64_t min_res_114683 = smin64(n_114534, l_window_114538);
    bool bounds_invalid_upwards_114684 = slt64(l_n_m_114584, (int64_t) 0);
    bool valid_114685 = !bounds_invalid_upwards_114684;
    bool range_valid_c_114686;
    
    if (!valid_114685) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               l_n_m_114584, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  loess.fut:335:3-373:7\n   #3  loess.fut:400:15-58\n   #4  stl.fut:166:13-65\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:164:5-167:26\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool empty_slice_114688 = min_res_114683 == (int64_t) 0;
    int64_t m_114689 = sub64(min_res_114683, (int64_t) 1);
    float i64_res_114690 = sitofp_i64_f32(l_window_114538);
    int64_t binop_x_117821 = m_114533 * l_n_m_114584;
    int64_t binop_y_117822 = (int64_t) 8 * binop_x_117821;
    int64_t bytes_117820 = smax64((int64_t) 0, binop_y_117822);
    
    if (mem_117823_cached_sizze_120624 < (size_t) bytes_117820) {
        mem_117823 = realloc(mem_117823, bytes_117820);
        mem_117823_cached_sizze_120624 = bytes_117820;
    }
    
    int64_t binop_y_117826 = (int64_t) 4 * binop_x_117821;
    int64_t bytes_117824 = smax64((int64_t) 0, binop_y_117826);
    
    if (mem_117827_cached_sizze_120625 < (size_t) bytes_117824) {
        mem_117827 = realloc(mem_117827, bytes_117824);
        mem_117827_cached_sizze_120625 = bytes_117824;
    }
    
    int64_t binop_y_117849 = (int64_t) 8 * n_114534;
    int64_t bytes_117848 = smax64((int64_t) 0, binop_y_117849);
    
    if (mem_117850_cached_sizze_120626 < (size_t) bytes_117848) {
        mem_117850 = realloc(mem_117850, bytes_117848);
        mem_117850_cached_sizze_120626 = bytes_117848;
    }
    if (mem_117853_cached_sizze_120627 < (size_t) bytes_117848) {
        mem_117853 = realloc(mem_117853, bytes_117848);
        mem_117853_cached_sizze_120627 = bytes_117848;
    }
    for (int64_t i_116820 = 0; i_116820 < m_114533; i_116820++) {
        int64_t x_114694 = ((int64_t *) mem_117620)[i_116820];
        
        for (int64_t i_116804 = 0; i_116804 < n_114534; i_116804++) {
            int64_t x_114697 = ((int64_t *) mem_117617)[i_116820 * n_114534 +
                                                        i_116804];
            int64_t defunc_0_f_res_114698 = add64((int64_t) 1, x_114697);
            bool cond_114699 = slt64(defunc_0_f_res_114698, (int64_t) 0);
            int64_t defunc_0_f_res_114700;
            
            if (cond_114699) {
                defunc_0_f_res_114700 = (int64_t) 9223372036854775807;
            } else {
                defunc_0_f_res_114700 = defunc_0_f_res_114698;
            }
            ((int64_t *) mem_117850)[i_116804] = defunc_0_f_res_114700;
            ((int64_t *) mem_117853)[i_116804] = defunc_0_f_res_114698;
        }
        
        int64_t min_arg_114701 = sub64(x_114694, min_res_114683);
        float i64_res_114702 = sitofp_i64_f32(x_114694);
        float x_114703 = i64_res_114690 - i64_res_114702;
        float max_arg_114704 = x_114703 / 2.0F;
        float max_res_114705 = fmax32(0.0F, max_arg_114704);
        
        for (int64_t i_116813 = 0; i_116813 < l_n_m_114584; i_116813++) {
            int64_t min_arg_114709 = mul64(l_jump_114542, i_116813);
            int64_t min_res_114710 = smin64(i_114610, min_arg_114709);
            int64_t defunc_0_g_res_114711 = add64((int64_t) 1, min_res_114710);
            bool nearest_idx_114712;
            int64_t nearest_idx_114713;
            int64_t nearest_idx_114714;
            bool loop_while_114715;
            int64_t low_114716;
            int64_t high_114717;
            
            loop_while_114715 = x_114611;
            low_114716 = (int64_t) 0;
            high_114717 = i_114610;
            while (loop_while_114715) {
                int64_t x_114718 = add64(low_114716, high_114717);
                int64_t mid_114719 = sdiv64(x_114718, (int64_t) 2);
                bool x_114720 = sle64((int64_t) 0, mid_114719);
                bool y_114721 = slt64(mid_114719, n_114534);
                bool bounds_check_114722 = x_114720 && y_114721;
                bool index_certs_114723;
                
                if (!bounds_check_114722) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", mid_114719,
                                  "] out of bounds for array of shape [",
                                  n_114534, "].",
                                  "-> #0  loess.fut:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                    if (memblock_unref(ctx, &out_mem_120375,
                                       "out_mem_120375") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120374,
                                       "out_mem_120374") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120373,
                                       "out_mem_120373") != 0)
                        return 1;
                    return 1;
                }
                
                int64_t x_114724 = ((int64_t *) mem_117850)[mid_114719];
                bool cond_114725 = sle64(defunc_0_g_res_114711, x_114724);
                int64_t loopres_114726;
                int64_t loopres_114727;
                
                if (cond_114725) {
                    int64_t loopres_t_res_114728 = sub64(mid_114719,
                                                         (int64_t) 1);
                    
                    loopres_114726 = low_114716;
                    loopres_114727 = loopres_t_res_114728;
                } else {
                    int64_t loopres_f_res_114729 = add64((int64_t) 1,
                                                         mid_114719);
                    
                    loopres_114726 = loopres_f_res_114729;
                    loopres_114727 = high_114717;
                }
                
                bool loop_cond_114730 = sle64(loopres_114726, loopres_114727);
                bool loop_while_tmp_120395 = loop_cond_114730;
                int64_t low_tmp_120396 = loopres_114726;
                int64_t high_tmp_120397 = loopres_114727;
                
                loop_while_114715 = loop_while_tmp_120395;
                low_114716 = low_tmp_120396;
                high_114717 = high_tmp_120397;
            }
            nearest_idx_114712 = loop_while_114715;
            nearest_idx_114713 = low_114716;
            nearest_idx_114714 = high_114717;
            
            int64_t max_arg_114731 = sub64(nearest_idx_114713, min_res_114683);
            int64_t max_res_114732 = smax64((int64_t) 0, max_arg_114731);
            int64_t j_114733 = add64(min_res_114683, max_res_114732);
            int64_t i_p_m_t_s_114734 = add64(m_114689, max_res_114732);
            bool zzero_leq_i_p_m_t_s_114735 = sle64((int64_t) 0,
                                                    i_p_m_t_s_114734);
            bool i_p_m_t_s_leq_w_114736 = slt64(i_p_m_t_s_114734, n_114534);
            bool zzero_lte_i_114737 = sle64((int64_t) 0, max_res_114732);
            bool i_lte_j_114738 = sle64(max_res_114732, j_114733);
            bool y_114739 = i_p_m_t_s_leq_w_114736 && zzero_lte_i_114737;
            bool y_114740 = zzero_leq_i_p_m_t_s_114735 && y_114739;
            bool y_114741 = i_lte_j_114738 && y_114740;
            bool forwards_ok_114742 = zzero_lte_i_114737 && y_114741;
            bool ok_or_empty_114743 = empty_slice_114688 || forwards_ok_114742;
            bool index_certs_114744;
            
            if (!ok_or_empty_114743) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", max_res_114732, ":", j_114733,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t defunc_2_reduce_res_114746;
            int64_t redout_116807 = (int64_t) 0;
            
            for (int64_t i_116808 = 0; i_116808 < min_res_114683; i_116808++) {
                int64_t slice_117307 = max_res_114732 + i_116808;
                int64_t x_114750 = ((int64_t *) mem_117853)[slice_117307];
                int64_t abs_arg_114751 = sub64(x_114750, defunc_0_g_res_114711);
                int64_t abs_res_114752 = abs(abs_arg_114751);
                int64_t defunc_1_op_res_114749 = add64(abs_res_114752,
                                                       redout_116807);
                int64_t redout_tmp_120398 = defunc_1_op_res_114749;
                
                redout_116807 = redout_tmp_120398;
            }
            defunc_2_reduce_res_114746 = redout_116807;
            
            int64_t idx_114753;
            int64_t idx_114754;
            int64_t idx_114755;
            int64_t idx_114756;
            int64_t best_idx_114758;
            int64_t last_idx_114759;
            int64_t best_sum_114760;
            int64_t curr_sum_114761;
            
            best_idx_114758 = max_res_114732;
            last_idx_114759 = max_res_114732;
            best_sum_114760 = defunc_2_reduce_res_114746;
            curr_sum_114761 = defunc_2_reduce_res_114746;
            for (int64_t j_114757 = 0; j_114757 < min_res_114683; j_114757++) {
                int64_t new_idx_114762 = add64(max_res_114732, j_114757);
                int64_t x_114763 = add64(min_res_114683, new_idx_114762);
                bool cond_114764 = slt64(x_114694, x_114763);
                int64_t new_sum_114765;
                
                if (cond_114764) {
                    new_sum_114765 = (int64_t) 9223372036854775807;
                } else {
                    bool x_114766 = sle64((int64_t) 0, last_idx_114759);
                    bool y_114767 = slt64(last_idx_114759, n_114534);
                    bool bounds_check_114768 = x_114766 && y_114767;
                    bool index_certs_114769;
                    
                    if (!bounds_check_114768) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", last_idx_114759,
                                      "] out of bounds for array of shape [",
                                      n_114534, "].",
                                      "-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                        if (memblock_unref(ctx, &out_mem_120375,
                                           "out_mem_120375") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120374,
                                           "out_mem_120374") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120373,
                                           "out_mem_120373") != 0)
                            return 1;
                        return 1;
                    }
                    
                    int64_t y_114770 =
                            ((int64_t *) mem_117853)[last_idx_114759];
                    int64_t binop_p_114771 = sub64(defunc_0_g_res_114711,
                                                   y_114770);
                    int64_t defunc_0_f_res_114772 = abs(binop_p_114771);
                    int64_t x_114773 = sub64(curr_sum_114761,
                                             defunc_0_f_res_114772);
                    int64_t min_arg_114774 = add64(min_res_114683,
                                                   last_idx_114759);
                    int64_t min_res_114775 = smin64(i_114610, min_arg_114774);
                    bool x_114776 = sle64((int64_t) 0, min_res_114775);
                    bool y_114777 = slt64(min_res_114775, n_114534);
                    bool bounds_check_114778 = x_114776 && y_114777;
                    bool index_certs_114779;
                    
                    if (!bounds_check_114778) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", min_res_114775,
                                      "] out of bounds for array of shape [",
                                      n_114534, "].",
                                      "-> #0  loess.fut:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                        if (memblock_unref(ctx, &out_mem_120375,
                                           "out_mem_120375") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120374,
                                           "out_mem_120374") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120373,
                                           "out_mem_120373") != 0)
                            return 1;
                        return 1;
                    }
                    
                    int64_t y_114780 = ((int64_t *) mem_117853)[min_res_114775];
                    int64_t binop_p_114781 = sub64(defunc_0_g_res_114711,
                                                   y_114780);
                    int64_t defunc_0_f_res_114782 = abs(binop_p_114781);
                    int64_t new_sum_f_res_114783 = add64(x_114773,
                                                         defunc_0_f_res_114782);
                    
                    new_sum_114765 = new_sum_f_res_114783;
                }
                
                bool cond_114784 = sle64(new_sum_114765, best_sum_114760);
                int64_t loopres_114785;
                
                if (cond_114784) {
                    loopres_114785 = new_idx_114762;
                } else {
                    loopres_114785 = best_idx_114758;
                }
                
                int64_t loopres_114786;
                
                if (cond_114784) {
                    loopres_114786 = new_sum_114765;
                } else {
                    loopres_114786 = best_sum_114760;
                }
                
                int64_t best_idx_tmp_120399 = loopres_114785;
                int64_t last_idx_tmp_120400 = new_idx_114762;
                int64_t best_sum_tmp_120401 = loopres_114786;
                int64_t curr_sum_tmp_120402 = new_sum_114765;
                
                best_idx_114758 = best_idx_tmp_120399;
                last_idx_114759 = last_idx_tmp_120400;
                best_sum_114760 = best_sum_tmp_120401;
                curr_sum_114761 = curr_sum_tmp_120402;
            }
            idx_114753 = best_idx_114758;
            idx_114754 = last_idx_114759;
            idx_114755 = best_sum_114760;
            idx_114756 = curr_sum_114761;
            
            int64_t min_res_114787 = smin64(min_arg_114701, idx_114753);
            int64_t x_114788 = add64(min_res_114683, min_res_114787);
            int64_t r_114789 = sub64(x_114788, (int64_t) 1);
            bool x_114790 = sle64((int64_t) 0, r_114789);
            bool y_114791 = slt64(r_114789, n_114534);
            bool bounds_check_114792 = x_114790 && y_114791;
            bool index_certs_114793;
            
            if (!bounds_check_114792) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", r_114789,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  loess.fut:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t x_114794 = ((int64_t *) mem_117617)[i_116820 * n_114534 +
                                                        r_114789];
            int64_t abs_arg_114795 = sub64(x_114794, min_res_114710);
            int64_t abs_res_114796 = abs(abs_arg_114795);
            bool x_114797 = sle64((int64_t) 0, min_res_114787);
            bool y_114798 = slt64(min_res_114787, n_114534);
            bool bounds_check_114799 = x_114797 && y_114798;
            bool index_certs_114800;
            
            if (!bounds_check_114799) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", min_res_114787,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  loess.fut:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t x_114801 = ((int64_t *) mem_117617)[i_116820 * n_114534 +
                                                        min_res_114787];
            int64_t abs_arg_114802 = sub64(x_114801, min_res_114710);
            int64_t abs_res_114803 = abs(abs_arg_114802);
            int64_t max_res_114804 = smax64(abs_res_114796, abs_res_114803);
            float defunc_0_f_res_114805 = sitofp_i64_f32(max_res_114804);
            float defunc_1_f_res_114806 = max_res_114705 +
                  defunc_0_f_res_114805;
            
            ((float *) mem_117827)[i_116820 * l_n_m_114584 + i_116813] =
                defunc_1_f_res_114806;
            ((int64_t *) mem_117823)[i_116820 * l_n_m_114584 + i_116813] =
                min_res_114787;
        }
    }
    
    int64_t min_res_114809 = smin64(n_114534, t_window_114537);
    bool bounds_invalid_upwards_114810 = slt64(t_n_m_114591, (int64_t) 0);
    bool valid_114811 = !bounds_invalid_upwards_114810;
    bool range_valid_c_114812;
    
    if (!valid_114811) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               t_n_m_114591, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  loess.fut:335:3-373:7\n   #3  loess.fut:400:15-58\n   #4  stl.fut:173:13-65\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:171:5-174:26\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool empty_slice_114814 = min_res_114809 == (int64_t) 0;
    int64_t m_114815 = sub64(min_res_114809, (int64_t) 1);
    float i64_res_114816 = sitofp_i64_f32(t_window_114537);
    int64_t binop_x_117939 = m_114533 * t_n_m_114591;
    int64_t binop_y_117940 = (int64_t) 8 * binop_x_117939;
    int64_t bytes_117938 = smax64((int64_t) 0, binop_y_117940);
    
    if (mem_117941_cached_sizze_120628 < (size_t) bytes_117938) {
        mem_117941 = realloc(mem_117941, bytes_117938);
        mem_117941_cached_sizze_120628 = bytes_117938;
    }
    
    int64_t binop_y_117944 = (int64_t) 4 * binop_x_117939;
    int64_t bytes_117942 = smax64((int64_t) 0, binop_y_117944);
    
    if (mem_117945_cached_sizze_120629 < (size_t) bytes_117942) {
        mem_117945 = realloc(mem_117945, bytes_117942);
        mem_117945_cached_sizze_120629 = bytes_117942;
    }
    
    int64_t binop_y_117967 = (int64_t) 8 * n_114534;
    int64_t bytes_117966 = smax64((int64_t) 0, binop_y_117967);
    
    if (mem_117968_cached_sizze_120630 < (size_t) bytes_117966) {
        mem_117968 = realloc(mem_117968, bytes_117966);
        mem_117968_cached_sizze_120630 = bytes_117966;
    }
    if (mem_117971_cached_sizze_120631 < (size_t) bytes_117966) {
        mem_117971 = realloc(mem_117971, bytes_117966);
        mem_117971_cached_sizze_120631 = bytes_117966;
    }
    for (int64_t i_116843 = 0; i_116843 < m_114533; i_116843++) {
        int64_t x_114820 = ((int64_t *) mem_117620)[i_116843];
        
        for (int64_t i_116827 = 0; i_116827 < n_114534; i_116827++) {
            int64_t x_114823 = ((int64_t *) mem_117617)[i_116843 * n_114534 +
                                                        i_116827];
            int64_t defunc_0_f_res_114824 = add64((int64_t) 1, x_114823);
            bool cond_114825 = slt64(defunc_0_f_res_114824, (int64_t) 0);
            int64_t defunc_0_f_res_114826;
            
            if (cond_114825) {
                defunc_0_f_res_114826 = (int64_t) 9223372036854775807;
            } else {
                defunc_0_f_res_114826 = defunc_0_f_res_114824;
            }
            ((int64_t *) mem_117968)[i_116827] = defunc_0_f_res_114826;
            ((int64_t *) mem_117971)[i_116827] = defunc_0_f_res_114824;
        }
        
        int64_t min_arg_114827 = sub64(x_114820, min_res_114809);
        float i64_res_114828 = sitofp_i64_f32(x_114820);
        float x_114829 = i64_res_114816 - i64_res_114828;
        float max_arg_114830 = x_114829 / 2.0F;
        float max_res_114831 = fmax32(0.0F, max_arg_114830);
        
        for (int64_t i_116836 = 0; i_116836 < t_n_m_114591; i_116836++) {
            int64_t min_arg_114835 = mul64(t_jump_114541, i_116836);
            int64_t min_res_114836 = smin64(i_114610, min_arg_114835);
            int64_t defunc_0_g_res_114837 = add64((int64_t) 1, min_res_114836);
            bool nearest_idx_114838;
            int64_t nearest_idx_114839;
            int64_t nearest_idx_114840;
            bool loop_while_114841;
            int64_t low_114842;
            int64_t high_114843;
            
            loop_while_114841 = x_114611;
            low_114842 = (int64_t) 0;
            high_114843 = i_114610;
            while (loop_while_114841) {
                int64_t x_114844 = add64(low_114842, high_114843);
                int64_t mid_114845 = sdiv64(x_114844, (int64_t) 2);
                bool x_114846 = sle64((int64_t) 0, mid_114845);
                bool y_114847 = slt64(mid_114845, n_114534);
                bool bounds_check_114848 = x_114846 && y_114847;
                bool index_certs_114849;
                
                if (!bounds_check_114848) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", mid_114845,
                                  "] out of bounds for array of shape [",
                                  n_114534, "].",
                                  "-> #0  loess.fut:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                    if (memblock_unref(ctx, &out_mem_120375,
                                       "out_mem_120375") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120374,
                                       "out_mem_120374") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120373,
                                       "out_mem_120373") != 0)
                        return 1;
                    return 1;
                }
                
                int64_t x_114850 = ((int64_t *) mem_117968)[mid_114845];
                bool cond_114851 = sle64(defunc_0_g_res_114837, x_114850);
                int64_t loopres_114852;
                int64_t loopres_114853;
                
                if (cond_114851) {
                    int64_t loopres_t_res_114854 = sub64(mid_114845,
                                                         (int64_t) 1);
                    
                    loopres_114852 = low_114842;
                    loopres_114853 = loopres_t_res_114854;
                } else {
                    int64_t loopres_f_res_114855 = add64((int64_t) 1,
                                                         mid_114845);
                    
                    loopres_114852 = loopres_f_res_114855;
                    loopres_114853 = high_114843;
                }
                
                bool loop_cond_114856 = sle64(loopres_114852, loopres_114853);
                bool loop_while_tmp_120409 = loop_cond_114856;
                int64_t low_tmp_120410 = loopres_114852;
                int64_t high_tmp_120411 = loopres_114853;
                
                loop_while_114841 = loop_while_tmp_120409;
                low_114842 = low_tmp_120410;
                high_114843 = high_tmp_120411;
            }
            nearest_idx_114838 = loop_while_114841;
            nearest_idx_114839 = low_114842;
            nearest_idx_114840 = high_114843;
            
            int64_t max_arg_114857 = sub64(nearest_idx_114839, min_res_114809);
            int64_t max_res_114858 = smax64((int64_t) 0, max_arg_114857);
            int64_t j_114859 = add64(min_res_114809, max_res_114858);
            int64_t i_p_m_t_s_114860 = add64(m_114815, max_res_114858);
            bool zzero_leq_i_p_m_t_s_114861 = sle64((int64_t) 0,
                                                    i_p_m_t_s_114860);
            bool i_p_m_t_s_leq_w_114862 = slt64(i_p_m_t_s_114860, n_114534);
            bool zzero_lte_i_114863 = sle64((int64_t) 0, max_res_114858);
            bool i_lte_j_114864 = sle64(max_res_114858, j_114859);
            bool y_114865 = i_p_m_t_s_leq_w_114862 && zzero_lte_i_114863;
            bool y_114866 = zzero_leq_i_p_m_t_s_114861 && y_114865;
            bool y_114867 = i_lte_j_114864 && y_114866;
            bool forwards_ok_114868 = zzero_lte_i_114863 && y_114867;
            bool ok_or_empty_114869 = empty_slice_114814 || forwards_ok_114868;
            bool index_certs_114870;
            
            if (!ok_or_empty_114869) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", max_res_114858, ":", j_114859,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t defunc_2_reduce_res_114872;
            int64_t redout_116830 = (int64_t) 0;
            
            for (int64_t i_116831 = 0; i_116831 < min_res_114809; i_116831++) {
                int64_t slice_117310 = max_res_114858 + i_116831;
                int64_t x_114876 = ((int64_t *) mem_117971)[slice_117310];
                int64_t abs_arg_114877 = sub64(x_114876, defunc_0_g_res_114837);
                int64_t abs_res_114878 = abs(abs_arg_114877);
                int64_t defunc_1_op_res_114875 = add64(abs_res_114878,
                                                       redout_116830);
                int64_t redout_tmp_120412 = defunc_1_op_res_114875;
                
                redout_116830 = redout_tmp_120412;
            }
            defunc_2_reduce_res_114872 = redout_116830;
            
            int64_t idx_114879;
            int64_t idx_114880;
            int64_t idx_114881;
            int64_t idx_114882;
            int64_t best_idx_114884;
            int64_t last_idx_114885;
            int64_t best_sum_114886;
            int64_t curr_sum_114887;
            
            best_idx_114884 = max_res_114858;
            last_idx_114885 = max_res_114858;
            best_sum_114886 = defunc_2_reduce_res_114872;
            curr_sum_114887 = defunc_2_reduce_res_114872;
            for (int64_t j_114883 = 0; j_114883 < min_res_114809; j_114883++) {
                int64_t new_idx_114888 = add64(max_res_114858, j_114883);
                int64_t x_114889 = add64(min_res_114809, new_idx_114888);
                bool cond_114890 = slt64(x_114820, x_114889);
                int64_t new_sum_114891;
                
                if (cond_114890) {
                    new_sum_114891 = (int64_t) 9223372036854775807;
                } else {
                    bool x_114892 = sle64((int64_t) 0, last_idx_114885);
                    bool y_114893 = slt64(last_idx_114885, n_114534);
                    bool bounds_check_114894 = x_114892 && y_114893;
                    bool index_certs_114895;
                    
                    if (!bounds_check_114894) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", last_idx_114885,
                                      "] out of bounds for array of shape [",
                                      n_114534, "].",
                                      "-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                        if (memblock_unref(ctx, &out_mem_120375,
                                           "out_mem_120375") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120374,
                                           "out_mem_120374") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120373,
                                           "out_mem_120373") != 0)
                            return 1;
                        return 1;
                    }
                    
                    int64_t y_114896 =
                            ((int64_t *) mem_117971)[last_idx_114885];
                    int64_t binop_p_114897 = sub64(defunc_0_g_res_114837,
                                                   y_114896);
                    int64_t defunc_0_f_res_114898 = abs(binop_p_114897);
                    int64_t x_114899 = sub64(curr_sum_114887,
                                             defunc_0_f_res_114898);
                    int64_t min_arg_114900 = add64(min_res_114809,
                                                   last_idx_114885);
                    int64_t min_res_114901 = smin64(i_114610, min_arg_114900);
                    bool x_114902 = sle64((int64_t) 0, min_res_114901);
                    bool y_114903 = slt64(min_res_114901, n_114534);
                    bool bounds_check_114904 = x_114902 && y_114903;
                    bool index_certs_114905;
                    
                    if (!bounds_check_114904) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", min_res_114901,
                                      "] out of bounds for array of shape [",
                                      n_114534, "].",
                                      "-> #0  loess.fut:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                        if (memblock_unref(ctx, &out_mem_120375,
                                           "out_mem_120375") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120374,
                                           "out_mem_120374") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120373,
                                           "out_mem_120373") != 0)
                            return 1;
                        return 1;
                    }
                    
                    int64_t y_114906 = ((int64_t *) mem_117971)[min_res_114901];
                    int64_t binop_p_114907 = sub64(defunc_0_g_res_114837,
                                                   y_114906);
                    int64_t defunc_0_f_res_114908 = abs(binop_p_114907);
                    int64_t new_sum_f_res_114909 = add64(x_114899,
                                                         defunc_0_f_res_114908);
                    
                    new_sum_114891 = new_sum_f_res_114909;
                }
                
                bool cond_114910 = sle64(new_sum_114891, best_sum_114886);
                int64_t loopres_114911;
                
                if (cond_114910) {
                    loopres_114911 = new_idx_114888;
                } else {
                    loopres_114911 = best_idx_114884;
                }
                
                int64_t loopres_114912;
                
                if (cond_114910) {
                    loopres_114912 = new_sum_114891;
                } else {
                    loopres_114912 = best_sum_114886;
                }
                
                int64_t best_idx_tmp_120413 = loopres_114911;
                int64_t last_idx_tmp_120414 = new_idx_114888;
                int64_t best_sum_tmp_120415 = loopres_114912;
                int64_t curr_sum_tmp_120416 = new_sum_114891;
                
                best_idx_114884 = best_idx_tmp_120413;
                last_idx_114885 = last_idx_tmp_120414;
                best_sum_114886 = best_sum_tmp_120415;
                curr_sum_114887 = curr_sum_tmp_120416;
            }
            idx_114879 = best_idx_114884;
            idx_114880 = last_idx_114885;
            idx_114881 = best_sum_114886;
            idx_114882 = curr_sum_114887;
            
            int64_t min_res_114913 = smin64(min_arg_114827, idx_114879);
            int64_t x_114914 = add64(min_res_114809, min_res_114913);
            int64_t r_114915 = sub64(x_114914, (int64_t) 1);
            bool x_114916 = sle64((int64_t) 0, r_114915);
            bool y_114917 = slt64(r_114915, n_114534);
            bool bounds_check_114918 = x_114916 && y_114917;
            bool index_certs_114919;
            
            if (!bounds_check_114918) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", r_114915,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  loess.fut:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t x_114920 = ((int64_t *) mem_117617)[i_116843 * n_114534 +
                                                        r_114915];
            int64_t abs_arg_114921 = sub64(x_114920, min_res_114836);
            int64_t abs_res_114922 = abs(abs_arg_114921);
            bool x_114923 = sle64((int64_t) 0, min_res_114913);
            bool y_114924 = slt64(min_res_114913, n_114534);
            bool bounds_check_114925 = x_114923 && y_114924;
            bool index_certs_114926;
            
            if (!bounds_check_114925) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", min_res_114913,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  loess.fut:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t x_114927 = ((int64_t *) mem_117617)[i_116843 * n_114534 +
                                                        min_res_114913];
            int64_t abs_arg_114928 = sub64(x_114927, min_res_114836);
            int64_t abs_res_114929 = abs(abs_arg_114928);
            int64_t max_res_114930 = smax64(abs_res_114922, abs_res_114929);
            float defunc_0_f_res_114931 = sitofp_i64_f32(max_res_114930);
            float defunc_1_f_res_114932 = max_res_114831 +
                  defunc_0_f_res_114931;
            
            ((float *) mem_117945)[i_116843 * t_n_m_114591 + i_116836] =
                defunc_1_f_res_114932;
            ((int64_t *) mem_117941)[i_116843 * t_n_m_114591 + i_116836] =
                min_res_114913;
        }
    }
    
    bool bounds_invalid_upwards_114936 = slt64(binop_x_117615, (int64_t) 0);
    bool valid_114937 = !bounds_invalid_upwards_114936;
    bool range_valid_c_114938;
    
    if (!valid_114937) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               binop_x_117615, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:108:18-23\n   #2  stl.fut:177:20-46\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    struct memblock mem_118059;
    
    mem_118059.references = NULL;
    if (memblock_alloc(ctx, &mem_118059, bytes_117688, "mem_118059")) {
        err = 1;
        goto cleanup;
    }
    for (int64_t i_120417 = 0; i_120417 < m_114533; i_120417++) {
        for (int64_t i_120418 = 0; i_120418 < n_114534; i_120418++) {
            ((float *) mem_118059.mem)[i_120417 * n_114534 + i_120418] = 0.0F;
        }
    }
    
    struct memblock mem_118063;
    
    mem_118063.references = NULL;
    if (memblock_alloc(ctx, &mem_118063, bytes_117688, "mem_118063")) {
        err = 1;
        goto cleanup;
    }
    for (int64_t i_120419 = 0; i_120419 < m_114533; i_120419++) {
        for (int64_t i_120420 = 0; i_120420 < n_114534; i_120420++) {
            ((float *) mem_118063.mem)[i_120419 * n_114534 + i_120420] = 1.0F;
        }
    }
    
    bool cond_114941 = slt64((int64_t) 1, l_jump_114542);
    bool cond_114942 = slt64((int64_t) 1, t_jump_114541);
    int64_t y_114943 = sub64(outer_114544, (int64_t) 1);
    bool loop_nonempty_114944 = slt64((int64_t) 0, outer_114544);
    bool bounds_invalid_upwards_114945 = slt64(C_len_114582, (int64_t) 0);
    bool valid_114946 = !bounds_invalid_upwards_114945;
    bool loop_not_taken_114947 = !assert_cond_114571;
    bool protect_assert_disj_114948 = valid_114946 || loop_not_taken_114947;
    bool loop_not_taken_114949 = !loop_nonempty_114944;
    bool protect_assert_disj_114950 = protect_assert_disj_114948 ||
         loop_not_taken_114949;
    bool range_valid_c_114951;
    
    if (!protect_assert_disj_114950) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               C_len_114582, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:217:21-60\n   #3  stl.fut:215:13-218:24\n   #4  stl.fut:394:3-405:33\n   #5  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool zzero_114953 = n_p_114536 == (int64_t) 0;
    bool nonzzero_114954 = !zzero_114953;
    bool protect_assert_disj_114955 = loop_not_taken_114947 || nonzzero_114954;
    bool protect_assert_disj_114956 = loop_not_taken_114949 ||
         protect_assert_disj_114955;
    bool nonzzero_cert_114957;
    
    if (!protect_assert_disj_114956) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "division by zero",
                               "-> #0  stl.fut:217:52-58\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:217:21-60\n   #4  stl.fut:215:13-218:24\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t x_114958 = add64(n_114534, n_p_114536);
    int64_t lifted_single_ma_arg_114959 = add64((int64_t) 1, x_114958);
    int64_t m_114960 = sub64(n_p_114536, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_114961 = sle64((int64_t) 0, m_114960);
    bool i_p_m_t_s_leq_w_114962 = slt64(m_114960, C_len_114582);
    bool i_lte_j_114963 = sle64((int64_t) 0, n_p_114536);
    bool y_114964 = zzero_leq_i_p_m_t_s_114961 && i_p_m_t_s_leq_w_114962;
    bool y_114965 = i_lte_j_114963 && y_114964;
    bool ok_or_empty_114966 = zzero_114953 || y_114965;
    bool protect_assert_disj_114967 = loop_not_taken_114947 ||
         ok_or_empty_114966;
    bool protect_assert_disj_114968 = loop_not_taken_114949 ||
         protect_assert_disj_114967;
    bool index_certs_114969;
    
    if (!protect_assert_disj_114968) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", n_p_114536,
                               "] out of bounds for array of shape [",
                               C_len_114582, "].",
                               "-> #0  stl.fut:30:24-30\n   #1  stl.fut:43:3-32\n   #2  stl.fut:223:30-50\n   #3  stl.fut:222:23-224:31\n   #4  stl.fut:394:3-405:33\n   #5  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool bounds_invalid_upwards_114970 = slt64(lifted_single_ma_arg_114959,
                                               (int64_t) 0);
    bool valid_114971 = !bounds_invalid_upwards_114970;
    bool protect_assert_disj_114972 = loop_not_taken_114947 || valid_114971;
    bool protect_assert_disj_114973 = loop_not_taken_114949 ||
         protect_assert_disj_114972;
    bool range_valid_c_114974;
    
    if (!protect_assert_disj_114973) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               lifted_single_ma_arg_114959, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:33:9-39:16\n   #3  stl.fut:43:3-32\n   #4  stl.fut:223:30-50\n   #5  stl.fut:222:23-224:31\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t lifted_single_ma_arg_114976 = add64((int64_t) 2, n_114534);
    bool i_p_m_t_s_leq_w_114977 = slt64(m_114960, lifted_single_ma_arg_114959);
    bool y_114978 = zzero_leq_i_p_m_t_s_114961 && i_p_m_t_s_leq_w_114977;
    bool y_114979 = i_lte_j_114963 && y_114978;
    bool ok_or_empty_114980 = zzero_114953 || y_114979;
    bool protect_assert_disj_114981 = loop_not_taken_114947 ||
         ok_or_empty_114980;
    bool protect_assert_disj_114982 = loop_not_taken_114949 ||
         protect_assert_disj_114981;
    bool index_certs_114983;
    
    if (!protect_assert_disj_114982) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", n_p_114536,
                               "] out of bounds for array of shape [",
                               lifted_single_ma_arg_114959, "].",
                               "-> #0  stl.fut:30:24-30\n   #1  /prelude/functional.fut:9:42-44\n   #2  stl.fut:43:3-58\n   #3  stl.fut:223:30-50\n   #4  stl.fut:222:23-224:31\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool bounds_invalid_upwards_114984 = slt64(lifted_single_ma_arg_114976,
                                               (int64_t) 0);
    bool valid_114985 = !bounds_invalid_upwards_114984;
    bool protect_assert_disj_114986 = loop_not_taken_114947 || valid_114985;
    bool protect_assert_disj_114987 = loop_not_taken_114949 ||
         protect_assert_disj_114986;
    bool range_valid_c_114988;
    
    if (!protect_assert_disj_114987) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               lifted_single_ma_arg_114976, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:33:9-39:16\n   #3  /prelude/functional.fut:9:42-44\n   #4  stl.fut:43:3-58\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool i_p_m_t_s_leq_w_114990 = slt64((int64_t) 2,
                                        lifted_single_ma_arg_114976);
    bool protect_assert_disj_114991 = loop_not_taken_114947 ||
         i_p_m_t_s_leq_w_114990;
    bool protect_assert_disj_114992 = loop_not_taken_114949 ||
         protect_assert_disj_114991;
    bool index_certs_114993;
    
    if (!protect_assert_disj_114992) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (int64_t) 3,
                               "] out of bounds for array of shape [",
                               lifted_single_ma_arg_114976, "].",
                               "-> #0  stl.fut:30:24-30\n   #1  /prelude/functional.fut:9:42-44\n   #2  stl.fut:43:3-76\n   #3  stl.fut:223:30-50\n   #4  stl.fut:222:23-224:31\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    bool empty_slice_114994 = n_114534 == (int64_t) 0;
    int64_t i_p_m_t_s_114995 = add64(n_p_114536, i_114610);
    bool zzero_leq_i_p_m_t_s_114996 = sle64((int64_t) 0, i_p_m_t_s_114995);
    bool i_p_m_t_s_leq_w_114997 = slt64(i_p_m_t_s_114995, C_len_114582);
    bool i_lte_j_114998 = sle64(n_p_114536, x_114958);
    bool y_114999 = i_lte_j_114963 && i_p_m_t_s_leq_w_114997;
    bool y_115000 = zzero_leq_i_p_m_t_s_114996 && y_114999;
    bool y_115001 = i_lte_j_114998 && y_115000;
    bool forwards_ok_115002 = i_lte_j_114963 && y_115001;
    bool ok_or_empty_115003 = empty_slice_114994 || forwards_ok_115002;
    bool protect_assert_disj_115004 = loop_not_taken_114947 ||
         ok_or_empty_115003;
    bool protect_assert_disj_115005 = loop_not_taken_114949 ||
         protect_assert_disj_115004;
    bool index_certs_115006;
    
    if (!protect_assert_disj_115005) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", n_p_114536, ":", x_114958,
                               "] out of bounds for array of shape [",
                               C_len_114582, "].",
                               "-> #0  stl.fut:262:35-50\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  stl.fut:260:13-265:26\n   #4  stl.fut:394:3-405:33\n   #5  stl.fut:381:1-405:33\n");
        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
            return 1;
        if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
            return 1;
        return 1;
    }
    
    int64_t j_m_i_115007 = sub64(stl_res_114605, stl_res_114604);
    bool cond_115008 = slt64(l_jump_114542, jump_threshold_114545);
    bool cond_f_res_115009 = slt64(max_group_sizze_114546, l_window_114538);
    bool x_115010 = !cond_115008;
    bool y_115011 = cond_f_res_115009 && x_115010;
    bool cond_115012 = cond_115008 || y_115011;
    bool cond_115013 = slt64(t_jump_114541, jump_threshold_114545);
    bool cond_f_res_115014 = slt64(max_group_sizze_114546, t_window_114537);
    bool x_115015 = !cond_115013;
    bool y_115016 = cond_f_res_115014 && x_115015;
    bool cond_115017 = cond_115013 || y_115016;
    
    if (mem_118113_cached_sizze_120632 < (size_t) bytes_117688) {
        mem_118113 = realloc(mem_118113, bytes_117688);
        mem_118113_cached_sizze_120632 = bytes_117688;
    }
    if (mem_118157_cached_sizze_120633 < (size_t) bytes_117776) {
        mem_118157 = realloc(mem_118157, bytes_117776);
        mem_118157_cached_sizze_120633 = bytes_117776;
    }
    
    int64_t binop_x_118199 = m_114533 * C_len_114582;
    int64_t binop_y_118200 = (int64_t) 4 * binop_x_118199;
    int64_t bytes_118198 = smax64((int64_t) 0, binop_y_118200);
    
    if (mem_118201_cached_sizze_120634 < (size_t) bytes_118198) {
        mem_118201 = realloc(mem_118201, bytes_118198);
        mem_118201_cached_sizze_120634 = bytes_118198;
    }
    if (mem_118245_cached_sizze_120635 < (size_t) bytes_117688) {
        mem_118245 = realloc(mem_118245, bytes_117688);
        mem_118245_cached_sizze_120635 = bytes_117688;
    }
    
    int64_t binop_y_118257 = (int64_t) 4 * lifted_single_ma_arg_114959;
    int64_t bytes_118256 = smax64((int64_t) 0, binop_y_118257);
    
    if (mem_118258_cached_sizze_120636 < (size_t) bytes_118256) {
        mem_118258 = realloc(mem_118258, bytes_118256);
        mem_118258_cached_sizze_120636 = bytes_118256;
    }
    
    int64_t binop_y_118272 = (int64_t) 4 * lifted_single_ma_arg_114976;
    int64_t bytes_118271 = smax64((int64_t) 0, binop_y_118272);
    
    if (mem_118273_cached_sizze_120637 < (size_t) bytes_118271) {
        mem_118273 = realloc(mem_118273, bytes_118271);
        mem_118273_cached_sizze_120637 = bytes_118271;
    }
    
    int64_t binop_y_118287 = (int64_t) 4 * n_114534;
    int64_t bytes_118286 = smax64((int64_t) 0, binop_y_118287);
    
    if (mem_118288_cached_sizze_120638 < (size_t) bytes_118286) {
        mem_118288 = realloc(mem_118288, bytes_118286);
        mem_118288_cached_sizze_120638 = bytes_118286;
    }
    if (mem_118312_cached_sizze_120639 < (size_t) bytes_117688) {
        mem_118312 = realloc(mem_118312, bytes_117688);
        mem_118312_cached_sizze_120639 = bytes_117688;
    }
    if (mem_118316_cached_sizze_120640 < (size_t) bytes_117688) {
        mem_118316 = realloc(mem_118316, bytes_117688);
        mem_118316_cached_sizze_120640 = bytes_117688;
    }
    if (mem_119129_cached_sizze_120648 < (size_t) bytes_117688) {
        mem_119129 = realloc(mem_119129, bytes_117688);
        mem_119129_cached_sizze_120648 = bytes_117688;
    }
    
    int64_t binop_y_119141 = (int64_t) 4 * n_114534;
    int64_t bytes_119140 = smax64((int64_t) 0, binop_y_119141);
    
    if (mem_119142_cached_sizze_120649 < (size_t) bytes_119140) {
        mem_119142 = realloc(mem_119142, bytes_119140);
        mem_119142_cached_sizze_120649 = bytes_119140;
    }
    
    int64_t binop_y_119997 = (int64_t) 8 * n_114534;
    int64_t bytes_119996 = smax64((int64_t) 0, binop_y_119997);
    int64_t binop_y_120009 = (int64_t) 4 * n_114534;
    int64_t bytes_120008 = smax64((int64_t) 0, binop_y_120009);
    int64_t L_l_ixfn_119077;
    
    if (cond_114941) {
        L_l_ixfn_119077 = n_114534;
    } else {
        L_l_ixfn_119077 = l_n_m_114584;
    }
    
    int64_t L_l_ixfn_119078;
    
    if (cond_114941) {
        L_l_ixfn_119078 = n_114534;
    } else {
        L_l_ixfn_119078 = l_n_m_114584;
    }
    
    int64_t trend_l_ixfn_119865;
    
    if (cond_114942) {
        trend_l_ixfn_119865 = n_114534;
    } else {
        trend_l_ixfn_119865 = t_n_m_114591;
    }
    
    int64_t trend_l_ixfn_119866;
    
    if (cond_114942) {
        trend_l_ixfn_119866 = n_114534;
    } else {
        trend_l_ixfn_119866 = t_n_m_114591;
    }
    
    int64_t sizze_115018;
    int64_t stl_res_ixfn_120206;
    int64_t stl_res_ixfn_120208;
    int64_t stl_res_ixfn_120213;
    int64_t stl_res_ixfn_120214;
    int64_t stl_res_ixfn_120215;
    int64_t stl_res_ixfn_120216;
    int64_t stl_res_ixfn_120218;
    int64_t stl_res_ixfn_120219;
    struct memblock stl_res_mem_120204;
    
    stl_res_mem_120204.references = NULL;
    
    struct memblock stl_res_mem_120212;
    
    stl_res_mem_120212.references = NULL;
    
    struct memblock stl_res_mem_120220;
    
    stl_res_mem_120220.references = NULL;
    
    int64_t loopz2081Uz2085Uz2089U_115023;
    struct memblock mem_param_118071;
    
    mem_param_118071.references = NULL;
    
    int64_t ctx_param_ext_118073;
    int64_t ctx_param_ext_118075;
    struct memblock mem_param_118079;
    
    mem_param_118079.references = NULL;
    
    int64_t ctx_param_ext_118080;
    int64_t ctx_param_ext_118081;
    int64_t ctx_param_ext_118082;
    int64_t ctx_param_ext_118083;
    int64_t ctx_param_ext_118085;
    int64_t ctx_param_ext_118086;
    struct memblock mem_param_118087;
    
    mem_param_118087.references = NULL;
    loopz2081Uz2085Uz2089U_115023 = n_114534;
    ctx_param_ext_118073 = n_114534;
    ctx_param_ext_118075 = n_114534;
    ctx_param_ext_118080 = m_114533;
    ctx_param_ext_118081 = n_114534;
    ctx_param_ext_118082 = (int64_t) 0;
    ctx_param_ext_118083 = n_114534;
    ctx_param_ext_118085 = (int64_t) 1;
    ctx_param_ext_118086 = n_114534;
    if (memblock_set(ctx, &mem_param_118071, &mem_118059, "mem_118059") != 0)
        return 1;
    if (memblock_set(ctx, &mem_param_118079, &mem_118059, "mem_118059") != 0)
        return 1;
    if (memblock_set(ctx, &mem_param_118087, &mem_118063, "mem_118063") != 0)
        return 1;
    for (int64_t i_outer_115022 = 0; i_outer_115022 < outer_114544;
         i_outer_115022++) {
        int64_t loopres_ixfn_119879;
        int64_t loopres_ixfn_119881;
        struct memblock loopres_mem_119877;
        
        loopres_mem_119877.references = NULL;
        
        struct memblock loopres_mem_119885;
        
        loopres_mem_119885.references = NULL;
        
        struct memblock mem_param_118101;
        
        mem_param_118101.references = NULL;
        
        int64_t ctx_param_ext_118103;
        int64_t ctx_param_ext_118105;
        struct memblock mem_param_118109;
        
        mem_param_118109.references = NULL;
        ctx_param_ext_118103 = ctx_param_ext_118073;
        ctx_param_ext_118105 = ctx_param_ext_118075;
        if (memblock_set(ctx, &mem_param_118101, &mem_param_118071,
                         "mem_param_118071") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_118109, &mem_param_118079,
                         "mem_param_118079") != 0)
            return 1;
        for (int64_t _i_inner_115029 = 0; _i_inner_115029 < inner_114543;
             _i_inner_115029++) {
            for (int64_t i_116852 = 0; i_116852 < m_114533; i_116852++) {
                for (int64_t i_116848 = 0; i_116848 < n_114534; i_116848++) {
                    float x_115036 = ((float *) Y_mem_117613.mem)[i_116852 *
                                                                  n_114534 +
                                                                  i_116848];
                    float x_115037 = ((float *) mem_param_118109.mem)[i_116852 *
                                                                      ctx_param_ext_118105 +
                                                                      i_116848];
                    float defunc_1_f_res_115038 = x_115036 - x_115037;
                    
                    ((float *) mem_118113)[i_116852 * n_114534 + i_116848] =
                        defunc_1_f_res_115038;
                }
            }
            for (int64_t i_116862 = 0; i_116862 < m_114533; i_116862++) {
                for (int64_t i_116858 = 0; i_116858 < n_p_114536; i_116858++) {
                    float x_115045 = ((float *) mem_117779)[i_116862 *
                                                            n_p_114536 +
                                                            i_116858];
                    float defunc_2_reduce_res_115046;
                    float redout_116854 = 0.0F;
                    
                    for (int64_t i_116855 = 0; i_116855 < css_chunk_len_114580;
                         i_116855++) {
                        int64_t x_115050 = ((int64_t *) mem_117735)[i_116858 *
                                                                    css_chunk_len_114580 +
                                                                    i_116855];
                        bool cond_115051 = sle64((int64_t) 0, x_115050);
                        float defunc_0_f_res_115052;
                        
                        if (cond_115051) {
                            bool y_115053 = slt64(x_115050, n_114534);
                            bool bounds_check_115054 = cond_115051 && y_115053;
                            bool index_certs_115055;
                            
                            if (!bounds_check_115054) {
                                ctx->error =
                                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                              "Index [", x_115050,
                                              "] out of bounds for array of shape [",
                                              n_114534, "].",
                                              "-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:207:38-73\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:205:21-210:44\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:203:13-211:43\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n");
                                if (memblock_unref(ctx, &mem_param_118109,
                                                   "mem_param_118109") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &mem_param_118101,
                                                   "mem_param_118101") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &loopres_mem_119885,
                                                   "loopres_mem_119885") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &loopres_mem_119877,
                                                   "loopres_mem_119877") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &mem_param_118087,
                                                   "mem_param_118087") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &mem_param_118079,
                                                   "mem_param_118079") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &mem_param_118071,
                                                   "mem_param_118071") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &stl_res_mem_120220,
                                                   "stl_res_mem_120220") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &stl_res_mem_120212,
                                                   "stl_res_mem_120212") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &stl_res_mem_120204,
                                                   "stl_res_mem_120204") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &mem_118063,
                                                   "mem_118063") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &mem_118059,
                                                   "mem_118059") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &out_mem_120375,
                                                   "out_mem_120375") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &out_mem_120374,
                                                   "out_mem_120374") != 0)
                                    return 1;
                                if (memblock_unref(ctx, &out_mem_120373,
                                                   "out_mem_120373") != 0)
                                    return 1;
                                return 1;
                            }
                            
                            float defunc_0_f_res_t_res_115056 =
                                  ((float *) mem_118113)[i_116862 * n_114534 +
                                                         x_115050];
                            
                            defunc_0_f_res_115052 = defunc_0_f_res_t_res_115056;
                        } else {
                            defunc_0_f_res_115052 = NAN;
                        }
                        
                        bool isnan_res_115057;
                        
                        isnan_res_115057 =
                            futrts_isnan32(defunc_0_f_res_115052);
                        
                        float defunc_0_f_res_115058;
                        
                        if (isnan_res_115057) {
                            defunc_0_f_res_115058 = 0.0F;
                        } else {
                            defunc_0_f_res_115058 = defunc_0_f_res_115052;
                        }
                        
                        float defunc_1_op_res_115049 = defunc_0_f_res_115058 +
                              redout_116854;
                        float redout_tmp_120446 = defunc_1_op_res_115049;
                        
                        redout_116854 = redout_tmp_120446;
                    }
                    defunc_2_reduce_res_115046 = redout_116854;
                    
                    float defunc_1_f_res_115059 = defunc_2_reduce_res_115046 /
                          x_115045;
                    
                    ((float *) mem_118157)[i_116862 * n_p_114536 + i_116858] =
                        defunc_1_f_res_115059;
                }
            }
            for (int64_t i_116870 = 0; i_116870 < m_114533; i_116870++) {
                for (int64_t i_116866 = 0; i_116866 < C_len_114582;
                     i_116866++) {
                    int64_t i_115065 = smod64(i_116866, n_p_114536);
                    bool x_115066 = sle64((int64_t) 0, i_115065);
                    bool y_115067 = slt64(i_115065, n_p_114536);
                    bool bounds_check_115068 = x_115066 && y_115067;
                    bool index_certs_115069;
                    
                    if (!bounds_check_115068) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", i_115065,
                                      "] out of bounds for array of shape [",
                                      n_p_114536, "].",
                                      "-> #0  stl.fut:217:43-59\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:217:21-60\n   #4  stl.fut:215:13-218:24\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
                        if (memblock_unref(ctx, &mem_param_118109,
                                           "mem_param_118109") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_118101,
                                           "mem_param_118101") != 0)
                            return 1;
                        if (memblock_unref(ctx, &loopres_mem_119885,
                                           "loopres_mem_119885") != 0)
                            return 1;
                        if (memblock_unref(ctx, &loopres_mem_119877,
                                           "loopres_mem_119877") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_118087,
                                           "mem_param_118087") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_118079,
                                           "mem_param_118079") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_118071,
                                           "mem_param_118071") != 0)
                            return 1;
                        if (memblock_unref(ctx, &stl_res_mem_120220,
                                           "stl_res_mem_120220") != 0)
                            return 1;
                        if (memblock_unref(ctx, &stl_res_mem_120212,
                                           "stl_res_mem_120212") != 0)
                            return 1;
                        if (memblock_unref(ctx, &stl_res_mem_120204,
                                           "stl_res_mem_120204") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120375,
                                           "out_mem_120375") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120374,
                                           "out_mem_120374") != 0)
                            return 1;
                        if (memblock_unref(ctx, &out_mem_120373,
                                           "out_mem_120373") != 0)
                            return 1;
                        return 1;
                    }
                    memmove(mem_118201 + (i_116870 * C_len_114582 + i_116866) *
                            (int64_t) 4, mem_118157 + (i_116870 * n_p_114536 +
                                                       i_115065) * (int64_t) 4,
                            (int64_t) 4);
                }
            }
            for (int64_t i_116898 = 0; i_116898 < m_114533; i_116898++) {
                float defunc_2_reduce_res_115076;
                float redout_116872 = 0.0F;
                
                for (int64_t i_116873 = 0; i_116873 < n_p_114536; i_116873++) {
                    float x_115080 = ((float *) mem_118201)[i_116898 *
                                                            C_len_114582 +
                                                            i_116873];
                    float defunc_1_op_res_115079 = x_115080 + redout_116872;
                    float redout_tmp_120450 = defunc_1_op_res_115079;
                    
                    redout_116872 = redout_tmp_120450;
                }
                defunc_2_reduce_res_115076 = redout_116872;
                
                float discard_116879;
                float scanacc_116875 = 0.0F;
                
                for (int64_t i_116877 = 0; i_116877 <
                     lifted_single_ma_arg_114959; i_116877++) {
                    bool cond_115086 = i_116877 == (int64_t) 0;
                    float defunc_0_f_res_115087;
                    
                    if (cond_115086) {
                        float defunc_0_f_res_t_res_115088 =
                              defunc_2_reduce_res_115076 / i64_res_114576;
                        
                        defunc_0_f_res_115087 = defunc_0_f_res_t_res_115088;
                    } else {
                        int64_t x_115089 = add64(n_p_114536, i_116877);
                        int64_t i_115090 = sub64(x_115089, (int64_t) 1);
                        bool x_115091 = sle64((int64_t) 0, i_115090);
                        bool y_115092 = slt64(i_115090, C_len_114582);
                        bool bounds_check_115093 = x_115091 && y_115092;
                        bool index_certs_115094;
                        
                        if (!bounds_check_115093) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", i_115090,
                                          "] out of bounds for array of shape [",
                                          C_len_114582, "].",
                                          "-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float x_115095 = ((float *) mem_118201)[i_116898 *
                                                                C_len_114582 +
                                                                i_115090];
                        int64_t i_115096 = sub64(i_116877, (int64_t) 1);
                        bool x_115097 = sle64((int64_t) 0, i_115096);
                        bool y_115098 = slt64(i_115096, C_len_114582);
                        bool bounds_check_115099 = x_115097 && y_115098;
                        bool index_certs_115100;
                        
                        if (!bounds_check_115099) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", i_115096,
                                          "] out of bounds for array of shape [",
                                          C_len_114582, "].",
                                          "-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_115101 = ((float *) mem_118201)[i_116898 *
                                                                C_len_114582 +
                                                                i_115096];
                        float x_115102 = x_115095 - y_115101;
                        float defunc_0_f_res_f_res_115103 = x_115102 /
                              i64_res_114576;
                        
                        defunc_0_f_res_115087 = defunc_0_f_res_f_res_115103;
                    }
                    
                    float defunc_1_op_res_115084 = defunc_0_f_res_115087 +
                          scanacc_116875;
                    
                    ((float *) mem_118258)[i_116877] = defunc_1_op_res_115084;
                    
                    float scanacc_tmp_120451 = defunc_1_op_res_115084;
                    
                    scanacc_116875 = scanacc_tmp_120451;
                }
                discard_116879 = scanacc_116875;
                
                float defunc_2_reduce_res_115105;
                float redout_116880 = 0.0F;
                
                for (int64_t i_116881 = 0; i_116881 < n_p_114536; i_116881++) {
                    float x_115109 = ((float *) mem_118258)[i_116881];
                    float defunc_1_op_res_115108 = x_115109 + redout_116880;
                    float redout_tmp_120453 = defunc_1_op_res_115108;
                    
                    redout_116880 = redout_tmp_120453;
                }
                defunc_2_reduce_res_115105 = redout_116880;
                
                float discard_116887;
                float scanacc_116883 = 0.0F;
                
                for (int64_t i_116885 = 0; i_116885 <
                     lifted_single_ma_arg_114976; i_116885++) {
                    bool cond_115115 = i_116885 == (int64_t) 0;
                    float defunc_0_f_res_115116;
                    
                    if (cond_115115) {
                        float defunc_0_f_res_t_res_115117 =
                              defunc_2_reduce_res_115105 / i64_res_114576;
                        
                        defunc_0_f_res_115116 = defunc_0_f_res_t_res_115117;
                    } else {
                        int64_t x_115118 = add64(n_p_114536, i_116885);
                        int64_t i_115119 = sub64(x_115118, (int64_t) 1);
                        bool x_115120 = sle64((int64_t) 0, i_115119);
                        bool y_115121 = slt64(i_115119,
                                              lifted_single_ma_arg_114959);
                        bool bounds_check_115122 = x_115120 && y_115121;
                        bool index_certs_115123;
                        
                        if (!bounds_check_115122) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", i_115119,
                                          "] out of bounds for array of shape [",
                                          lifted_single_ma_arg_114959, "].",
                                          "-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float x_115124 = ((float *) mem_118258)[i_115119];
                        int64_t i_115125 = sub64(i_116885, (int64_t) 1);
                        bool x_115126 = sle64((int64_t) 0, i_115125);
                        bool y_115127 = slt64(i_115125,
                                              lifted_single_ma_arg_114959);
                        bool bounds_check_115128 = x_115126 && y_115127;
                        bool index_certs_115129;
                        
                        if (!bounds_check_115128) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", i_115125,
                                          "] out of bounds for array of shape [",
                                          lifted_single_ma_arg_114959, "].",
                                          "-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_115130 = ((float *) mem_118258)[i_115125];
                        float x_115131 = x_115124 - y_115130;
                        float defunc_0_f_res_f_res_115132 = x_115131 /
                              i64_res_114576;
                        
                        defunc_0_f_res_115116 = defunc_0_f_res_f_res_115132;
                    }
                    
                    float defunc_1_op_res_115113 = defunc_0_f_res_115116 +
                          scanacc_116883;
                    
                    ((float *) mem_118273)[i_116885] = defunc_1_op_res_115113;
                    
                    float scanacc_tmp_120454 = defunc_1_op_res_115113;
                    
                    scanacc_116883 = scanacc_tmp_120454;
                }
                discard_116887 = scanacc_116883;
                
                float defunc_2_reduce_res_115134;
                float redout_116888 = 0.0F;
                
                for (int32_t i_117320 = 0; i_117320 < 3; i_117320++) {
                    int64_t i_116889 = sext_i32_i64(i_117320);
                    float x_115138 = ((float *) mem_118273)[i_116889];
                    float defunc_1_op_res_115137 = x_115138 + redout_116888;
                    float redout_tmp_120456 = defunc_1_op_res_115137;
                    
                    redout_116888 = redout_tmp_120456;
                }
                defunc_2_reduce_res_115134 = redout_116888;
                
                float discard_116895;
                float scanacc_116891 = 0.0F;
                
                for (int64_t i_116893 = 0; i_116893 < n_114534; i_116893++) {
                    bool cond_115144 = i_116893 == (int64_t) 0;
                    float defunc_0_f_res_115145;
                    
                    if (cond_115144) {
                        float defunc_0_f_res_t_res_115146 =
                              defunc_2_reduce_res_115134 / 3.0F;
                        
                        defunc_0_f_res_115145 = defunc_0_f_res_t_res_115146;
                    } else {
                        int64_t x_115147 = add64((int64_t) 3, i_116893);
                        int64_t i_115148 = sub64(x_115147, (int64_t) 1);
                        bool x_115149 = sle64((int64_t) 0, i_115148);
                        bool y_115150 = slt64(i_115148,
                                              lifted_single_ma_arg_114976);
                        bool bounds_check_115151 = x_115149 && y_115150;
                        bool index_certs_115152;
                        
                        if (!bounds_check_115151) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", i_115148,
                                          "] out of bounds for array of shape [",
                                          lifted_single_ma_arg_114976, "].",
                                          "-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float x_115153 = ((float *) mem_118273)[i_115148];
                        int64_t i_115154 = sub64(i_116893, (int64_t) 1);
                        bool x_115155 = sle64((int64_t) 0, i_115154);
                        bool y_115156 = slt64(i_115154,
                                              lifted_single_ma_arg_114976);
                        bool bounds_check_115157 = x_115155 && y_115156;
                        bool index_certs_115158;
                        
                        if (!bounds_check_115157) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", i_115154,
                                          "] out of bounds for array of shape [",
                                          lifted_single_ma_arg_114976, "].",
                                          "-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_115159 = ((float *) mem_118273)[i_115154];
                        float x_115160 = x_115153 - y_115159;
                        float defunc_0_f_res_f_res_115161 = x_115160 / 3.0F;
                        
                        defunc_0_f_res_115145 = defunc_0_f_res_f_res_115161;
                    }
                    
                    float defunc_1_op_res_115142 = defunc_0_f_res_115145 +
                          scanacc_116891;
                    
                    ((float *) mem_118288)[i_116893] = defunc_1_op_res_115142;
                    
                    float scanacc_tmp_120457 = defunc_1_op_res_115142;
                    
                    scanacc_116891 = scanacc_tmp_120457;
                }
                discard_116895 = scanacc_116891;
                memmove(mem_118245 + i_116898 * n_114534 * (int64_t) 4,
                        mem_118288 + (int64_t) 0, n_114534 * (int64_t) 4);
            }
            for (int64_t i_116911 = 0; i_116911 < m_114533; i_116911++) {
                for (int64_t i_116904 = 0; i_116904 < n_114534; i_116904++) {
                    int64_t x_115170 = ((int64_t *) mem_117617)[i_116911 *
                                                                n_114534 +
                                                                i_116904];
                    bool cond_115171 = sle64((int64_t) 0, x_115170);
                    float defunc_0_f_res_115172;
                    
                    if (cond_115171) {
                        bool y_115173 = slt64(x_115170, n_114534);
                        bool bounds_check_115174 = cond_115171 && y_115173;
                        bool index_certs_115175;
                        
                        if (!bounds_check_115174) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", x_115170,
                                          "] out of bounds for array of shape [",
                                          n_114534, "].",
                                          "-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:231:36-58\n   #3  /prelude/soacs.fut:75:22-28\n   #4  /prelude/soacs.fut:75:3-45\n   #5  stl.fut:229:13-234:43\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float defunc_0_f_res_t_res_115176 =
                              ((float *) mem_118245)[i_116911 * n_114534 +
                                                     x_115170];
                        
                        defunc_0_f_res_115172 = defunc_0_f_res_t_res_115176;
                    } else {
                        defunc_0_f_res_115172 = 0.0F;
                    }
                    
                    float defunc_0_f_res_115177;
                    
                    if (cond_115171) {
                        bool y_115178 = slt64(x_115170,
                                              loopz2081Uz2085Uz2089U_115023);
                        bool bounds_check_115179 = cond_115171 && y_115178;
                        bool index_certs_115180;
                        
                        if (!bounds_check_115179) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", x_115170,
                                          "] out of bounds for array of shape [",
                                          loopz2081Uz2085Uz2089U_115023, "].",
                                          "-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:232:34-60\n   #3  /prelude/soacs.fut:75:22-28\n   #4  /prelude/soacs.fut:75:3-45\n   #5  stl.fut:229:13-234:43\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float defunc_0_f_res_t_res_115181 =
                              ((float *) mem_param_118087.mem)[ctx_param_ext_118082 +
                                                               (i_116911 *
                                                                ctx_param_ext_118083 +
                                                                x_115170 *
                                                                ctx_param_ext_118085)];
                        
                        defunc_0_f_res_115177 = defunc_0_f_res_t_res_115181;
                    } else {
                        defunc_0_f_res_115177 = 0.0F;
                    }
                    ((float *) mem_118316)[i_116911 * n_114534 + i_116904] =
                        defunc_0_f_res_115177;
                    ((float *) mem_118312)[i_116911 * n_114534 + i_116904] =
                        defunc_0_f_res_115172;
                }
            }
            
            struct memblock defunc_11_loess_l_res_mem_119021;
            
            defunc_11_loess_l_res_mem_119021.references = NULL;
            
            struct memblock defunc_11_loess_l_res_mem_119029;
            
            defunc_11_loess_l_res_mem_119029.references = NULL;
            if (cond_115012) {
                bool match_lit_115186 = (int64_t) 0 == l_degree_114540;
                struct memblock defunc_12_lifted_use_version_res_mem_118644;
                
                defunc_12_lifted_use_version_res_mem_118644.references = NULL;
                
                struct memblock defunc_12_lifted_use_version_res_mem_118652;
                
                defunc_12_lifted_use_version_res_mem_118652.references = NULL;
                if (match_lit_115186) {
                    struct memblock mem_118400;
                    
                    mem_118400.references = NULL;
                    if (memblock_alloc(ctx, &mem_118400, bytes_117824,
                                       "mem_118400")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_120463 = 0; i_120463 < m_114533;
                         i_120463++) {
                        for (int64_t i_120464 = 0; i_120464 < l_n_m_114584;
                             i_120464++) {
                            ((float *) mem_118400.mem)[i_120463 * l_n_m_114584 +
                                                       i_120464] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_118404;
                    
                    mem_118404.references = NULL;
                    if (memblock_alloc(ctx, &mem_118404, bytes_117824,
                                       "mem_118404")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_116924 = 0; i_116924 < m_114533;
                         i_116924++) {
                        int64_t x_115197 = ((int64_t *) mem_117620)[i_116924];
                        
                        for (int64_t i_116920 = 0; i_116920 < l_n_m_114584;
                             i_116920++) {
                            int64_t x_115200 =
                                    ((int64_t *) mem_117823)[i_116924 *
                                                             l_n_m_114584 +
                                                             i_116920];
                            float x_115201 = ((float *) mem_117827)[i_116924 *
                                                                    l_n_m_114584 +
                                                                    i_116920];
                            int64_t min_arg_115202 = mul64(t_jump_114541,
                                                           i_116920);
                            int64_t min_res_115203 = smin64(i_114610,
                                                            min_arg_115202);
                            float defunc_0_f_res_115204 =
                                  sitofp_i64_f32(min_res_115203);
                            float defunc_2_reduce_res_115205;
                            float redout_116914 = 0.0F;
                            
                            for (int64_t i_116915 = 0; i_116915 <
                                 l_window_114538; i_116915++) {
                                bool cond_115210 = sle64(x_115197, i_116915);
                                float defunc_0_f_res_115211;
                                
                                if (cond_115210) {
                                    defunc_0_f_res_115211 = 0.0F;
                                } else {
                                    int64_t i_115212 = add64(x_115200,
                                                             i_116915);
                                    float x_115213 =
                                          ((float *) mem_117691)[i_116924 *
                                                                 n_114534 +
                                                                 i_115212];
                                    float defunc_0_f_res_f_res_115214 = 1.0F +
                                          x_115213;
                                    
                                    defunc_0_f_res_115211 =
                                        defunc_0_f_res_f_res_115214;
                                }
                                
                                float defunc_0_f_res_115215;
                                
                                if (cond_115210) {
                                    defunc_0_f_res_115215 = 0.0F;
                                } else {
                                    int64_t i_115216 = add64(x_115200,
                                                             i_116915);
                                    float x_115217 =
                                          ((float *) mem_118316)[i_116924 *
                                                                 n_114534 +
                                                                 i_115216];
                                    
                                    defunc_0_f_res_115215 = x_115217;
                                }
                                
                                float x_j_115218 = defunc_0_f_res_115211 -
                                      defunc_0_f_res_115204;
                                float abs_res_115219 = (float) fabs(x_j_115218);
                                float tmp1_115220 = abs_res_115219 / x_115201;
                                float x_115221 = tmp1_115220 * tmp1_115220;
                                float y_115222 = tmp1_115220 * x_115221;
                                float tmp2_115223 = 1.0F - y_115222;
                                float x_115224 = tmp2_115223 * tmp2_115223;
                                float tmp3_115225 = tmp2_115223 * x_115224;
                                float w_j_115226 = defunc_0_f_res_115215 *
                                      tmp3_115225;
                                float defunc_1_op_res_115208 = w_j_115226 +
                                      redout_116914;
                                float redout_tmp_120467 =
                                      defunc_1_op_res_115208;
                                
                                redout_116914 = redout_tmp_120467;
                            }
                            defunc_2_reduce_res_115205 = redout_116914;
                            
                            float a0_115227 = 1.0F / defunc_2_reduce_res_115205;
                            float defunc_2_reduce_res_115228;
                            float redout_116916 = 0.0F;
                            
                            for (int64_t i_116917 = 0; i_116917 <
                                 l_window_114538; i_116917++) {
                                bool cond_115233 = sle64(x_115197, i_116917);
                                float defunc_0_f_res_115234;
                                
                                if (cond_115233) {
                                    defunc_0_f_res_115234 = 0.0F;
                                } else {
                                    int64_t i_115235 = add64(x_115200,
                                                             i_116917);
                                    float x_115236 =
                                          ((float *) mem_117691)[i_116924 *
                                                                 n_114534 +
                                                                 i_115235];
                                    float defunc_0_f_res_f_res_115237 = 1.0F +
                                          x_115236;
                                    
                                    defunc_0_f_res_115234 =
                                        defunc_0_f_res_f_res_115237;
                                }
                                
                                float defunc_0_f_res_115238;
                                
                                if (cond_115233) {
                                    defunc_0_f_res_115238 = 0.0F;
                                } else {
                                    int64_t i_115239 = add64(x_115200,
                                                             i_116917);
                                    float x_115240 =
                                          ((float *) mem_118316)[i_116924 *
                                                                 n_114534 +
                                                                 i_115239];
                                    
                                    defunc_0_f_res_115238 = x_115240;
                                }
                                
                                float x_j_115241 = defunc_0_f_res_115234 -
                                      defunc_0_f_res_115204;
                                float abs_res_115242 = (float) fabs(x_j_115241);
                                float tmp1_115243 = abs_res_115242 / x_115201;
                                float x_115244 = tmp1_115243 * tmp1_115243;
                                float y_115245 = tmp1_115243 * x_115244;
                                float tmp2_115246 = 1.0F - y_115245;
                                float x_115247 = tmp2_115246 * tmp2_115246;
                                float tmp3_115248 = tmp2_115246 * x_115247;
                                float tmp4_115249 = defunc_0_f_res_115238 *
                                      tmp3_115248;
                                float defunc_0_f_res_115250;
                                
                                if (cond_115233) {
                                    defunc_0_f_res_115250 = 0.0F;
                                } else {
                                    int64_t i_115251 = add64(x_115200,
                                                             i_116917);
                                    float x_115252 =
                                          ((float *) mem_118312)[i_116924 *
                                                                 n_114534 +
                                                                 i_115251];
                                    
                                    defunc_0_f_res_115250 = x_115252;
                                }
                                
                                float x_115253 = a0_115227 * tmp4_115249;
                                float defunc_9_fit_fun_res_115254 =
                                      defunc_0_f_res_115250 * x_115253;
                                float defunc_1_op_res_115231 =
                                      defunc_9_fit_fun_res_115254 +
                                      redout_116916;
                                float redout_tmp_120468 =
                                      defunc_1_op_res_115231;
                                
                                redout_116916 = redout_tmp_120468;
                            }
                            defunc_2_reduce_res_115228 = redout_116916;
                            ((float *) mem_118404.mem)[i_116924 * l_n_m_114584 +
                                                       i_116920] =
                                defunc_2_reduce_res_115228;
                        }
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_118644,
                                     &mem_118404, "mem_118404") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_118652,
                                     &mem_118400, "mem_118400") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118404, "mem_118404") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118400, "mem_118400") != 0)
                        return 1;
                } else {
                    bool match_lit_115257 = (int64_t) 1 == l_degree_114540;
                    struct memblock x_mem_118628;
                    
                    x_mem_118628.references = NULL;
                    
                    struct memblock x_mem_118636;
                    
                    x_mem_118636.references = NULL;
                    if (match_lit_115257) {
                        struct memblock mem_118448;
                        
                        mem_118448.references = NULL;
                        if (memblock_alloc(ctx, &mem_118448, bytes_117824,
                                           "mem_118448")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_118452;
                        
                        mem_118452.references = NULL;
                        if (memblock_alloc(ctx, &mem_118452, bytes_117824,
                                           "mem_118452")) {
                            err = 1;
                            goto cleanup;
                        }
                        for (int64_t i_116944 = 0; i_116944 < m_114533;
                             i_116944++) {
                            int64_t x_115268 =
                                    ((int64_t *) mem_117620)[i_116944];
                            
                            for (int64_t i_116937 = 0; i_116937 < l_n_m_114584;
                                 i_116937++) {
                                int64_t x_115272 =
                                        ((int64_t *) mem_117823)[i_116944 *
                                                                 l_n_m_114584 +
                                                                 i_116937];
                                float x_115273 =
                                      ((float *) mem_117827)[i_116944 *
                                                             l_n_m_114584 +
                                                             i_116937];
                                int64_t min_arg_115274 = mul64(t_jump_114541,
                                                               i_116937);
                                int64_t min_res_115275 = smin64(i_114610,
                                                                min_arg_115274);
                                float defunc_0_f_res_115276 =
                                      sitofp_i64_f32(min_res_115275);
                                float defunc_2_reduce_res_115277;
                                float defunc_2_reduce_res_115278;
                                float defunc_2_reduce_res_115279;
                                float redout_116926;
                                float redout_116927;
                                float redout_116928;
                                
                                redout_116926 = 0.0F;
                                redout_116927 = 0.0F;
                                redout_116928 = 0.0F;
                                for (int64_t i_116929 = 0; i_116929 <
                                     l_window_114538; i_116929++) {
                                    bool cond_115290 = sle64(x_115268,
                                                             i_116929);
                                    float defunc_0_f_res_115291;
                                    
                                    if (cond_115290) {
                                        defunc_0_f_res_115291 = 0.0F;
                                    } else {
                                        int64_t i_115292 = add64(x_115272,
                                                                 i_116929);
                                        float x_115293 =
                                              ((float *) mem_117691)[i_116944 *
                                                                     n_114534 +
                                                                     i_115292];
                                        float defunc_0_f_res_f_res_115294 =
                                              1.0F + x_115293;
                                        
                                        defunc_0_f_res_115291 =
                                            defunc_0_f_res_f_res_115294;
                                    }
                                    
                                    float defunc_0_f_res_115295;
                                    
                                    if (cond_115290) {
                                        defunc_0_f_res_115295 = 0.0F;
                                    } else {
                                        int64_t i_115296 = add64(x_115272,
                                                                 i_116929);
                                        float x_115297 =
                                              ((float *) mem_118316)[i_116944 *
                                                                     n_114534 +
                                                                     i_115296];
                                        
                                        defunc_0_f_res_115295 = x_115297;
                                    }
                                    
                                    float x_j_115298 = defunc_0_f_res_115291 -
                                          defunc_0_f_res_115276;
                                    float abs_res_115299 =
                                          (float) fabs(x_j_115298);
                                    float tmp1_115300 = abs_res_115299 /
                                          x_115273;
                                    float x_115301 = tmp1_115300 * tmp1_115300;
                                    float y_115302 = tmp1_115300 * x_115301;
                                    float tmp2_115303 = 1.0F - y_115302;
                                    float x_115304 = tmp2_115303 * tmp2_115303;
                                    float tmp3_115305 = tmp2_115303 * x_115304;
                                    float w_j_115306 = defunc_0_f_res_115295 *
                                          tmp3_115305;
                                    float xw_j_115307 = x_j_115298 * w_j_115306;
                                    float x2w_j_115308 = x_j_115298 *
                                          xw_j_115307;
                                    float defunc_1_op_res_115282 = w_j_115306 +
                                          redout_116926;
                                    float defunc_1_op_res_115285 = xw_j_115307 +
                                          redout_116927;
                                    float defunc_1_op_res_115288 =
                                          x2w_j_115308 + redout_116928;
                                    float redout_tmp_120473 =
                                          defunc_1_op_res_115282;
                                    float redout_tmp_120474 =
                                          defunc_1_op_res_115285;
                                    float redout_tmp_120475 =
                                          defunc_1_op_res_115288;
                                    
                                    redout_116926 = redout_tmp_120473;
                                    redout_116927 = redout_tmp_120474;
                                    redout_116928 = redout_tmp_120475;
                                }
                                defunc_2_reduce_res_115277 = redout_116926;
                                defunc_2_reduce_res_115278 = redout_116927;
                                defunc_2_reduce_res_115279 = redout_116928;
                                
                                float x_115309 = defunc_2_reduce_res_115277 *
                                      defunc_2_reduce_res_115279;
                                float y_115310 = defunc_2_reduce_res_115278 *
                                      defunc_2_reduce_res_115278;
                                float y_115311 = x_115309 - y_115310;
                                float det1_115312 = 1.0F / y_115311;
                                float a11_115313 = defunc_2_reduce_res_115279 *
                                      det1_115312;
                                float negate_arg_115314 =
                                      defunc_2_reduce_res_115278 * det1_115312;
                                float b11_115315 = 0.0F - negate_arg_115314;
                                float c11_115316 = defunc_2_reduce_res_115277 *
                                      det1_115312;
                                float defunc_2_reduce_res_115317;
                                float defunc_2_reduce_res_115318;
                                float redout_116930;
                                float redout_116931;
                                
                                redout_116930 = 0.0F;
                                redout_116931 = 0.0F;
                                for (int64_t i_116932 = 0; i_116932 <
                                     l_window_114538; i_116932++) {
                                    bool cond_115326 = sle64(x_115268,
                                                             i_116932);
                                    float defunc_0_f_res_115327;
                                    
                                    if (cond_115326) {
                                        defunc_0_f_res_115327 = 0.0F;
                                    } else {
                                        int64_t i_115328 = add64(x_115272,
                                                                 i_116932);
                                        float x_115329 =
                                              ((float *) mem_117691)[i_116944 *
                                                                     n_114534 +
                                                                     i_115328];
                                        float defunc_0_f_res_f_res_115330 =
                                              1.0F + x_115329;
                                        
                                        defunc_0_f_res_115327 =
                                            defunc_0_f_res_f_res_115330;
                                    }
                                    
                                    float defunc_0_f_res_115331;
                                    
                                    if (cond_115326) {
                                        defunc_0_f_res_115331 = 0.0F;
                                    } else {
                                        int64_t i_115332 = add64(x_115272,
                                                                 i_116932);
                                        float x_115333 =
                                              ((float *) mem_118316)[i_116944 *
                                                                     n_114534 +
                                                                     i_115332];
                                        
                                        defunc_0_f_res_115331 = x_115333;
                                    }
                                    
                                    float x_j_115334 = defunc_0_f_res_115327 -
                                          defunc_0_f_res_115276;
                                    float abs_res_115335 =
                                          (float) fabs(x_j_115334);
                                    float tmp1_115336 = abs_res_115335 /
                                          x_115273;
                                    float x_115337 = tmp1_115336 * tmp1_115336;
                                    float y_115338 = tmp1_115336 * x_115337;
                                    float tmp2_115339 = 1.0F - y_115338;
                                    float x_115340 = tmp2_115339 * tmp2_115339;
                                    float tmp3_115341 = tmp2_115339 * x_115340;
                                    float tmp4_115342 = defunc_0_f_res_115331 *
                                          tmp3_115341;
                                    float defunc_1_f_res_115343 = x_j_115334 *
                                          tmp4_115342;
                                    float defunc_0_f_res_115344;
                                    
                                    if (cond_115326) {
                                        defunc_0_f_res_115344 = 0.0F;
                                    } else {
                                        int64_t i_115345 = add64(x_115272,
                                                                 i_116932);
                                        float x_115346 =
                                              ((float *) mem_118312)[i_116944 *
                                                                     n_114534 +
                                                                     i_115345];
                                        
                                        defunc_0_f_res_115344 = x_115346;
                                    }
                                    
                                    float x_115347 = a11_115313 * tmp4_115342;
                                    float y_115348 = b11_115315 *
                                          defunc_1_f_res_115343;
                                    float x_115349 = x_115347 + y_115348;
                                    float defunc_9_fit_fun_res_115350 =
                                          defunc_0_f_res_115344 * x_115349;
                                    float x_115351 = b11_115315 * tmp4_115342;
                                    float y_115352 = c11_115316 *
                                          defunc_1_f_res_115343;
                                    float x_115353 = x_115351 + y_115352;
                                    float defunc_9_slope_fun_res_115354 =
                                          defunc_0_f_res_115344 * x_115353;
                                    float defunc_1_op_res_115321 =
                                          defunc_9_fit_fun_res_115350 +
                                          redout_116930;
                                    float defunc_1_op_res_115324 =
                                          defunc_9_slope_fun_res_115354 +
                                          redout_116931;
                                    float redout_tmp_120476 =
                                          defunc_1_op_res_115321;
                                    float redout_tmp_120477 =
                                          defunc_1_op_res_115324;
                                    
                                    redout_116930 = redout_tmp_120476;
                                    redout_116931 = redout_tmp_120477;
                                }
                                defunc_2_reduce_res_115317 = redout_116930;
                                defunc_2_reduce_res_115318 = redout_116931;
                                ((float *) mem_118448.mem)[i_116944 *
                                                           l_n_m_114584 +
                                                           i_116937] =
                                    defunc_2_reduce_res_115317;
                                ((float *) mem_118452.mem)[i_116944 *
                                                           l_n_m_114584 +
                                                           i_116937] =
                                    defunc_2_reduce_res_115318;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_118628, &mem_118448,
                                         "mem_118448") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_118636, &mem_118452,
                                         "mem_118452") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118452, "mem_118452") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118448, "mem_118448") != 0)
                            return 1;
                    } else {
                        struct memblock mem_118536;
                        
                        mem_118536.references = NULL;
                        if (memblock_alloc(ctx, &mem_118536, bytes_117824,
                                           "mem_118536")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_118540;
                        
                        mem_118540.references = NULL;
                        if (memblock_alloc(ctx, &mem_118540, bytes_117824,
                                           "mem_118540")) {
                            err = 1;
                            goto cleanup;
                        }
                        for (int64_t i_116967 = 0; i_116967 < m_114533;
                             i_116967++) {
                            int64_t x_115365 =
                                    ((int64_t *) mem_117620)[i_116967];
                            
                            for (int64_t i_116960 = 0; i_116960 < l_n_m_114584;
                                 i_116960++) {
                                int64_t x_115369 =
                                        ((int64_t *) mem_117823)[i_116967 *
                                                                 l_n_m_114584 +
                                                                 i_116960];
                                float x_115370 =
                                      ((float *) mem_117827)[i_116967 *
                                                             l_n_m_114584 +
                                                             i_116960];
                                int64_t min_arg_115371 = mul64(t_jump_114541,
                                                               i_116960);
                                int64_t min_res_115372 = smin64(i_114610,
                                                                min_arg_115371);
                                float defunc_0_f_res_115373 =
                                      sitofp_i64_f32(min_res_115372);
                                float defunc_2_reduce_res_115374;
                                float defunc_2_reduce_res_115375;
                                float defunc_2_reduce_res_115376;
                                float defunc_2_reduce_res_115377;
                                float defunc_2_reduce_res_115378;
                                float redout_116947;
                                float redout_116948;
                                float redout_116949;
                                float redout_116950;
                                float redout_116951;
                                
                                redout_116947 = 0.0F;
                                redout_116948 = 0.0F;
                                redout_116949 = 0.0F;
                                redout_116950 = 0.0F;
                                redout_116951 = 0.0F;
                                for (int64_t i_116952 = 0; i_116952 <
                                     l_window_114538; i_116952++) {
                                    bool cond_115395 = sle64(x_115365,
                                                             i_116952);
                                    float defunc_0_f_res_115396;
                                    
                                    if (cond_115395) {
                                        defunc_0_f_res_115396 = 0.0F;
                                    } else {
                                        int64_t i_115397 = add64(x_115369,
                                                                 i_116952);
                                        float x_115398 =
                                              ((float *) mem_117691)[i_116967 *
                                                                     n_114534 +
                                                                     i_115397];
                                        float defunc_0_f_res_f_res_115399 =
                                              1.0F + x_115398;
                                        
                                        defunc_0_f_res_115396 =
                                            defunc_0_f_res_f_res_115399;
                                    }
                                    
                                    float defunc_0_f_res_115400;
                                    
                                    if (cond_115395) {
                                        defunc_0_f_res_115400 = 0.0F;
                                    } else {
                                        int64_t i_115401 = add64(x_115369,
                                                                 i_116952);
                                        float x_115402 =
                                              ((float *) mem_118316)[i_116967 *
                                                                     n_114534 +
                                                                     i_115401];
                                        
                                        defunc_0_f_res_115400 = x_115402;
                                    }
                                    
                                    float x_j_115403 = defunc_0_f_res_115396 -
                                          defunc_0_f_res_115373;
                                    float abs_res_115404 =
                                          (float) fabs(x_j_115403);
                                    float tmp1_115405 = abs_res_115404 /
                                          x_115370;
                                    float x_115406 = tmp1_115405 * tmp1_115405;
                                    float y_115407 = tmp1_115405 * x_115406;
                                    float tmp2_115408 = 1.0F - y_115407;
                                    float x_115409 = tmp2_115408 * tmp2_115408;
                                    float tmp3_115410 = tmp2_115408 * x_115409;
                                    float w_j_115411 = defunc_0_f_res_115400 *
                                          tmp3_115410;
                                    float xw_j_115412 = x_j_115403 * w_j_115411;
                                    float x2w_j_115413 = x_j_115403 *
                                          xw_j_115412;
                                    float x3w_j_115414 = x_j_115403 *
                                          x2w_j_115413;
                                    float x4w_j_115415 = x_j_115403 *
                                          x3w_j_115414;
                                    float defunc_1_op_res_115381 = w_j_115411 +
                                          redout_116947;
                                    float defunc_1_op_res_115384 = xw_j_115412 +
                                          redout_116948;
                                    float defunc_1_op_res_115387 =
                                          x2w_j_115413 + redout_116949;
                                    float defunc_1_op_res_115390 =
                                          x3w_j_115414 + redout_116950;
                                    float defunc_1_op_res_115393 =
                                          x4w_j_115415 + redout_116951;
                                    float redout_tmp_120482 =
                                          defunc_1_op_res_115381;
                                    float redout_tmp_120483 =
                                          defunc_1_op_res_115384;
                                    float redout_tmp_120484 =
                                          defunc_1_op_res_115387;
                                    float redout_tmp_120485 =
                                          defunc_1_op_res_115390;
                                    float redout_tmp_120486 =
                                          defunc_1_op_res_115393;
                                    
                                    redout_116947 = redout_tmp_120482;
                                    redout_116948 = redout_tmp_120483;
                                    redout_116949 = redout_tmp_120484;
                                    redout_116950 = redout_tmp_120485;
                                    redout_116951 = redout_tmp_120486;
                                }
                                defunc_2_reduce_res_115374 = redout_116947;
                                defunc_2_reduce_res_115375 = redout_116948;
                                defunc_2_reduce_res_115376 = redout_116949;
                                defunc_2_reduce_res_115377 = redout_116950;
                                defunc_2_reduce_res_115378 = redout_116951;
                                
                                float x_115416 = defunc_2_reduce_res_115376 *
                                      defunc_2_reduce_res_115378;
                                float y_115417 = defunc_2_reduce_res_115377 *
                                      defunc_2_reduce_res_115377;
                                float a12_115418 = x_115416 - y_115417;
                                float x_115419 = defunc_2_reduce_res_115376 *
                                      defunc_2_reduce_res_115377;
                                float y_115420 = defunc_2_reduce_res_115375 *
                                      defunc_2_reduce_res_115378;
                                float b12_115421 = x_115419 - y_115420;
                                float x_115422 = defunc_2_reduce_res_115375 *
                                      defunc_2_reduce_res_115377;
                                float y_115423 = defunc_2_reduce_res_115376 *
                                      defunc_2_reduce_res_115376;
                                float c12_115424 = x_115422 - y_115423;
                                float x_115425 = defunc_2_reduce_res_115374 *
                                      defunc_2_reduce_res_115378;
                                float b2_115426 = x_115425 - y_115423;
                                float x_115427 = defunc_2_reduce_res_115375 *
                                      defunc_2_reduce_res_115376;
                                float y_115428 = defunc_2_reduce_res_115374 *
                                      defunc_2_reduce_res_115377;
                                float c2_115429 = x_115427 - y_115428;
                                float x_115430 = defunc_2_reduce_res_115374 *
                                      a12_115418;
                                float y_115431 = defunc_2_reduce_res_115375 *
                                      b12_115421;
                                float x_115432 = x_115430 + y_115431;
                                float y_115433 = defunc_2_reduce_res_115376 *
                                      c12_115424;
                                float y_115434 = x_115432 + y_115433;
                                float det_115435 = 1.0F / y_115434;
                                float a12_115436 = a12_115418 * det_115435;
                                float b12_115437 = b12_115421 * det_115435;
                                float c12_115438 = c12_115424 * det_115435;
                                float b2_115439 = b2_115426 * det_115435;
                                float c2_115440 = c2_115429 * det_115435;
                                float defunc_2_reduce_res_115441;
                                float defunc_2_reduce_res_115442;
                                float redout_116953;
                                float redout_116954;
                                
                                redout_116953 = 0.0F;
                                redout_116954 = 0.0F;
                                for (int64_t i_116955 = 0; i_116955 <
                                     l_window_114538; i_116955++) {
                                    bool cond_115450 = sle64(x_115365,
                                                             i_116955);
                                    float defunc_0_f_res_115451;
                                    
                                    if (cond_115450) {
                                        defunc_0_f_res_115451 = 0.0F;
                                    } else {
                                        int64_t i_115452 = add64(x_115369,
                                                                 i_116955);
                                        float x_115453 =
                                              ((float *) mem_117691)[i_116967 *
                                                                     n_114534 +
                                                                     i_115452];
                                        float defunc_0_f_res_f_res_115454 =
                                              1.0F + x_115453;
                                        
                                        defunc_0_f_res_115451 =
                                            defunc_0_f_res_f_res_115454;
                                    }
                                    
                                    float defunc_0_f_res_115455;
                                    
                                    if (cond_115450) {
                                        defunc_0_f_res_115455 = 0.0F;
                                    } else {
                                        int64_t i_115456 = add64(x_115369,
                                                                 i_116955);
                                        float x_115457 =
                                              ((float *) mem_118316)[i_116967 *
                                                                     n_114534 +
                                                                     i_115456];
                                        
                                        defunc_0_f_res_115455 = x_115457;
                                    }
                                    
                                    float x_j_115458 = defunc_0_f_res_115451 -
                                          defunc_0_f_res_115373;
                                    float abs_res_115459 =
                                          (float) fabs(x_j_115458);
                                    float tmp1_115460 = abs_res_115459 /
                                          x_115370;
                                    float x_115461 = tmp1_115460 * tmp1_115460;
                                    float y_115462 = tmp1_115460 * x_115461;
                                    float tmp2_115463 = 1.0F - y_115462;
                                    float x_115464 = tmp2_115463 * tmp2_115463;
                                    float tmp3_115465 = tmp2_115463 * x_115464;
                                    float tmp4_115466 = defunc_0_f_res_115455 *
                                          tmp3_115465;
                                    float defunc_1_f_res_115467 = x_j_115458 *
                                          tmp4_115466;
                                    float defunc_1_f_res_115468 = x_j_115458 *
                                          defunc_1_f_res_115467;
                                    float defunc_0_f_res_115469;
                                    
                                    if (cond_115450) {
                                        defunc_0_f_res_115469 = 0.0F;
                                    } else {
                                        int64_t i_115470 = add64(x_115369,
                                                                 i_116955);
                                        float x_115471 =
                                              ((float *) mem_118312)[i_116967 *
                                                                     n_114534 +
                                                                     i_115470];
                                        
                                        defunc_0_f_res_115469 = x_115471;
                                    }
                                    
                                    float x_115472 = a12_115436 * tmp4_115466;
                                    float y_115473 = b12_115437 *
                                          defunc_1_f_res_115467;
                                    float x_115474 = x_115472 + y_115473;
                                    float y_115475 = c12_115438 *
                                          defunc_1_f_res_115468;
                                    float x_115476 = x_115474 + y_115475;
                                    float defunc_9_fit_fun_res_115477 =
                                          defunc_0_f_res_115469 * x_115476;
                                    float x_115478 = b12_115437 * tmp4_115466;
                                    float y_115479 = b2_115439 *
                                          defunc_1_f_res_115467;
                                    float x_115480 = x_115478 + y_115479;
                                    float y_115481 = c2_115440 *
                                          defunc_1_f_res_115468;
                                    float x_115482 = x_115480 + y_115481;
                                    float defunc_9_slope_fun_res_115483 =
                                          defunc_0_f_res_115469 * x_115482;
                                    float defunc_1_op_res_115445 =
                                          defunc_9_fit_fun_res_115477 +
                                          redout_116953;
                                    float defunc_1_op_res_115448 =
                                          defunc_9_slope_fun_res_115483 +
                                          redout_116954;
                                    float redout_tmp_120487 =
                                          defunc_1_op_res_115445;
                                    float redout_tmp_120488 =
                                          defunc_1_op_res_115448;
                                    
                                    redout_116953 = redout_tmp_120487;
                                    redout_116954 = redout_tmp_120488;
                                }
                                defunc_2_reduce_res_115441 = redout_116953;
                                defunc_2_reduce_res_115442 = redout_116954;
                                ((float *) mem_118536.mem)[i_116967 *
                                                           l_n_m_114584 +
                                                           i_116960] =
                                    defunc_2_reduce_res_115441;
                                ((float *) mem_118540.mem)[i_116967 *
                                                           l_n_m_114584 +
                                                           i_116960] =
                                    defunc_2_reduce_res_115442;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_118628, &mem_118536,
                                         "mem_118536") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_118636, &mem_118540,
                                         "mem_118540") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118540, "mem_118540") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118536, "mem_118536") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_118644,
                                     &x_mem_118628, "x_mem_118628") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_118652,
                                     &x_mem_118636, "x_mem_118636") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_118636, "x_mem_118636") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_118628, "x_mem_118628") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119021,
                                 &defunc_12_lifted_use_version_res_mem_118644,
                                 "defunc_12_lifted_use_version_res_mem_118644") !=
                    0)
                    return 1;
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119029,
                                 &defunc_12_lifted_use_version_res_mem_118652,
                                 "defunc_12_lifted_use_version_res_mem_118652") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_118652,
                                   "defunc_12_lifted_use_version_res_mem_118652") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_118644,
                                   "defunc_12_lifted_use_version_res_mem_118644") !=
                    0)
                    return 1;
            } else {
                bool match_lit_115486 = (int64_t) 0 == l_degree_114540;
                int64_t binop_y_118683 = (int64_t) 4 * l_window_114538;
                int64_t bytes_118682 = smax64((int64_t) 0, binop_y_118683);
                struct memblock defunc_12_lifted_use_version_res_mem_119005;
                
                defunc_12_lifted_use_version_res_mem_119005.references = NULL;
                
                struct memblock defunc_12_lifted_use_version_res_mem_119013;
                
                defunc_12_lifted_use_version_res_mem_119013.references = NULL;
                if (match_lit_115486) {
                    struct memblock mem_118656;
                    
                    mem_118656.references = NULL;
                    if (memblock_alloc(ctx, &mem_118656, bytes_117824,
                                       "mem_118656")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_120489 = 0; i_120489 < m_114533;
                         i_120489++) {
                        for (int64_t i_120490 = 0; i_120490 < l_n_m_114584;
                             i_120490++) {
                            ((float *) mem_118656.mem)[i_120489 * l_n_m_114584 +
                                                       i_120490] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_118660;
                    
                    mem_118660.references = NULL;
                    if (memblock_alloc(ctx, &mem_118660, bytes_117824,
                                       "mem_118660")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (mem_118684_cached_sizze_120641 <
                        (size_t) bytes_118682) {
                        mem_118684 = realloc(mem_118684, bytes_118682);
                        mem_118684_cached_sizze_120641 = bytes_118682;
                    }
                    for (int64_t i_116983 = 0; i_116983 < m_114533;
                         i_116983++) {
                        int64_t x_115497 = ((int64_t *) mem_117620)[i_116983];
                        
                        for (int64_t i_116979 = 0; i_116979 < l_n_m_114584;
                             i_116979++) {
                            int64_t x_115500 =
                                    ((int64_t *) mem_117823)[i_116983 *
                                                             l_n_m_114584 +
                                                             i_116979];
                            float x_115501 = ((float *) mem_117827)[i_116983 *
                                                                    l_n_m_114584 +
                                                                    i_116979];
                            int64_t min_arg_115502 = mul64(t_jump_114541,
                                                           i_116979);
                            int64_t min_res_115503 = smin64(i_114610,
                                                            min_arg_115502);
                            float defunc_0_f_res_115504 =
                                  sitofp_i64_f32(min_res_115503);
                            float defunc_2_reduce_res_115505;
                            float redout_116971 = 0.0F;
                            
                            for (int64_t i_116973 = 0; i_116973 <
                                 l_window_114538; i_116973++) {
                                bool cond_115511 = sle64(x_115497, i_116973);
                                float defunc_0_f_res_115512;
                                
                                if (cond_115511) {
                                    defunc_0_f_res_115512 = 0.0F;
                                } else {
                                    int64_t i_115513 = add64(x_115500,
                                                             i_116973);
                                    float x_115514 =
                                          ((float *) mem_117691)[i_116983 *
                                                                 n_114534 +
                                                                 i_115513];
                                    float defunc_0_f_res_f_res_115515 = 1.0F +
                                          x_115514;
                                    
                                    defunc_0_f_res_115512 =
                                        defunc_0_f_res_f_res_115515;
                                }
                                
                                float defunc_0_f_res_115516;
                                
                                if (cond_115511) {
                                    defunc_0_f_res_115516 = 0.0F;
                                } else {
                                    int64_t i_115517 = add64(x_115500,
                                                             i_116973);
                                    float x_115518 =
                                          ((float *) mem_118316)[i_116983 *
                                                                 n_114534 +
                                                                 i_115517];
                                    
                                    defunc_0_f_res_115516 = x_115518;
                                }
                                
                                float x_j_115519 = defunc_0_f_res_115512 -
                                      defunc_0_f_res_115504;
                                float abs_res_115520 = (float) fabs(x_j_115519);
                                float tmp1_115521 = abs_res_115520 / x_115501;
                                float x_115522 = tmp1_115521 * tmp1_115521;
                                float y_115523 = tmp1_115521 * x_115522;
                                float tmp2_115524 = 1.0F - y_115523;
                                float x_115525 = tmp2_115524 * tmp2_115524;
                                float tmp3_115526 = tmp2_115524 * x_115525;
                                float tmp4_115527 = defunc_0_f_res_115516 *
                                      tmp3_115526;
                                float defunc_1_op_res_115509 = tmp4_115527 +
                                      redout_116971;
                                
                                ((float *) mem_118684)[i_116973] = tmp4_115527;
                                
                                float redout_tmp_120493 =
                                      defunc_1_op_res_115509;
                                
                                redout_116971 = redout_tmp_120493;
                            }
                            defunc_2_reduce_res_115505 = redout_116971;
                            
                            float a0_115528 = 1.0F / defunc_2_reduce_res_115505;
                            float defunc_2_reduce_res_115529;
                            float redout_116975 = 0.0F;
                            
                            for (int64_t i_116976 = 0; i_116976 <
                                 l_window_114538; i_116976++) {
                                float x_115534 =
                                      ((float *) mem_118684)[i_116976];
                                bool cond_115535 = sle64(x_115497, i_116976);
                                float defunc_0_f_res_115536;
                                
                                if (cond_115535) {
                                    defunc_0_f_res_115536 = 0.0F;
                                } else {
                                    int64_t i_115537 = add64(x_115500,
                                                             i_116976);
                                    float x_115538 =
                                          ((float *) mem_118312)[i_116983 *
                                                                 n_114534 +
                                                                 i_115537];
                                    
                                    defunc_0_f_res_115536 = x_115538;
                                }
                                
                                float x_115539 = a0_115528 * x_115534;
                                float defunc_9_fit_fun_res_115540 =
                                      defunc_0_f_res_115536 * x_115539;
                                float defunc_1_op_res_115532 =
                                      defunc_9_fit_fun_res_115540 +
                                      redout_116975;
                                float redout_tmp_120495 =
                                      defunc_1_op_res_115532;
                                
                                redout_116975 = redout_tmp_120495;
                            }
                            defunc_2_reduce_res_115529 = redout_116975;
                            ((float *) mem_118660.mem)[i_116983 * l_n_m_114584 +
                                                       i_116979] =
                                defunc_2_reduce_res_115529;
                        }
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119005,
                                     &mem_118660, "mem_118660") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119013,
                                     &mem_118656, "mem_118656") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118660, "mem_118660") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118656, "mem_118656") != 0)
                        return 1;
                } else {
                    bool match_lit_115543 = (int64_t) 1 == l_degree_114540;
                    int64_t binop_y_118767 = (int64_t) 4 * l_window_114538;
                    int64_t bytes_118766 = smax64((int64_t) 0, binop_y_118767);
                    int64_t binop_y_118885 = (int64_t) 4 * l_window_114538;
                    int64_t bytes_118884 = smax64((int64_t) 0, binop_y_118885);
                    struct memblock x_mem_118989;
                    
                    x_mem_118989.references = NULL;
                    
                    struct memblock x_mem_118997;
                    
                    x_mem_118997.references = NULL;
                    if (match_lit_115543) {
                        struct memblock mem_118719;
                        
                        mem_118719.references = NULL;
                        if (memblock_alloc(ctx, &mem_118719, bytes_117824,
                                           "mem_118719")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_118723;
                        
                        mem_118723.references = NULL;
                        if (memblock_alloc(ctx, &mem_118723, bytes_117824,
                                           "mem_118723")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (mem_118768_cached_sizze_120642 <
                            (size_t) bytes_118766) {
                            mem_118768 = realloc(mem_118768, bytes_118766);
                            mem_118768_cached_sizze_120642 = bytes_118766;
                        }
                        if (mem_118771_cached_sizze_120643 <
                            (size_t) bytes_118766) {
                            mem_118771 = realloc(mem_118771, bytes_118766);
                            mem_118771_cached_sizze_120643 = bytes_118766;
                        }
                        for (int64_t i_117009 = 0; i_117009 < m_114533;
                             i_117009++) {
                            int64_t x_115554 =
                                    ((int64_t *) mem_117620)[i_117009];
                            
                            for (int64_t i_117002 = 0; i_117002 < l_n_m_114584;
                                 i_117002++) {
                                int64_t x_115558 =
                                        ((int64_t *) mem_117823)[i_117009 *
                                                                 l_n_m_114584 +
                                                                 i_117002];
                                float x_115559 =
                                      ((float *) mem_117827)[i_117009 *
                                                             l_n_m_114584 +
                                                             i_117002];
                                int64_t min_arg_115560 = mul64(t_jump_114541,
                                                               i_117002);
                                int64_t min_res_115561 = smin64(i_114610,
                                                                min_arg_115560);
                                float defunc_0_f_res_115562 =
                                      sitofp_i64_f32(min_res_115561);
                                float defunc_2_reduce_res_115585;
                                float defunc_2_reduce_res_115586;
                                float defunc_2_reduce_res_115587;
                                float redout_116987;
                                float redout_116988;
                                float redout_116989;
                                
                                redout_116987 = 0.0F;
                                redout_116988 = 0.0F;
                                redout_116989 = 0.0F;
                                for (int64_t i_116992 = 0; i_116992 <
                                     l_window_114538; i_116992++) {
                                    bool cond_115600 = sle64(x_115554,
                                                             i_116992);
                                    float defunc_0_f_res_115601;
                                    
                                    if (cond_115600) {
                                        defunc_0_f_res_115601 = 0.0F;
                                    } else {
                                        int64_t i_115602 = add64(x_115558,
                                                                 i_116992);
                                        float x_115603 =
                                              ((float *) mem_117691)[i_117009 *
                                                                     n_114534 +
                                                                     i_115602];
                                        float defunc_0_f_res_f_res_115604 =
                                              1.0F + x_115603;
                                        
                                        defunc_0_f_res_115601 =
                                            defunc_0_f_res_f_res_115604;
                                    }
                                    
                                    float defunc_0_f_res_115605;
                                    
                                    if (cond_115600) {
                                        defunc_0_f_res_115605 = 0.0F;
                                    } else {
                                        int64_t i_115606 = add64(x_115558,
                                                                 i_116992);
                                        float x_115607 =
                                              ((float *) mem_118316)[i_117009 *
                                                                     n_114534 +
                                                                     i_115606];
                                        
                                        defunc_0_f_res_115605 = x_115607;
                                    }
                                    
                                    float x_j_115608 = defunc_0_f_res_115601 -
                                          defunc_0_f_res_115562;
                                    float abs_res_115609 =
                                          (float) fabs(x_j_115608);
                                    float tmp1_115610 = abs_res_115609 /
                                          x_115559;
                                    float x_115611 = tmp1_115610 * tmp1_115610;
                                    float y_115612 = tmp1_115610 * x_115611;
                                    float tmp2_115613 = 1.0F - y_115612;
                                    float x_115614 = tmp2_115613 * tmp2_115613;
                                    float tmp3_115615 = tmp2_115613 * x_115614;
                                    float tmp4_115616 = defunc_0_f_res_115605 *
                                          tmp3_115615;
                                    float defunc_1_f_res_115617 = x_j_115608 *
                                          tmp4_115616;
                                    float defunc_1_f_res_115618 = x_j_115608 *
                                          defunc_1_f_res_115617;
                                    float defunc_1_op_res_115592 = tmp4_115616 +
                                          redout_116987;
                                    float defunc_1_op_res_115595 =
                                          defunc_1_f_res_115617 + redout_116988;
                                    float defunc_1_op_res_115598 =
                                          defunc_1_f_res_115618 + redout_116989;
                                    
                                    ((float *) mem_118768)[i_116992] =
                                        defunc_1_f_res_115617;
                                    ((float *) mem_118771)[i_116992] =
                                        tmp4_115616;
                                    
                                    float redout_tmp_120500 =
                                          defunc_1_op_res_115592;
                                    float redout_tmp_120501 =
                                          defunc_1_op_res_115595;
                                    float redout_tmp_120502 =
                                          defunc_1_op_res_115598;
                                    
                                    redout_116987 = redout_tmp_120500;
                                    redout_116988 = redout_tmp_120501;
                                    redout_116989 = redout_tmp_120502;
                                }
                                defunc_2_reduce_res_115585 = redout_116987;
                                defunc_2_reduce_res_115586 = redout_116988;
                                defunc_2_reduce_res_115587 = redout_116989;
                                
                                float x_115624 = defunc_2_reduce_res_115585 *
                                      defunc_2_reduce_res_115587;
                                float y_115625 = defunc_2_reduce_res_115586 *
                                      defunc_2_reduce_res_115586;
                                float y_115626 = x_115624 - y_115625;
                                float det1_115627 = 1.0F / y_115626;
                                float a11_115628 = defunc_2_reduce_res_115587 *
                                      det1_115627;
                                float negate_arg_115629 =
                                      defunc_2_reduce_res_115586 * det1_115627;
                                float b11_115630 = 0.0F - negate_arg_115629;
                                float c11_115631 = defunc_2_reduce_res_115585 *
                                      det1_115627;
                                float defunc_2_reduce_res_115632;
                                float defunc_2_reduce_res_115633;
                                float redout_116995;
                                float redout_116996;
                                
                                redout_116995 = 0.0F;
                                redout_116996 = 0.0F;
                                for (int64_t i_116997 = 0; i_116997 <
                                     l_window_114538; i_116997++) {
                                    float x_115641 =
                                          ((float *) mem_118771)[i_116997];
                                    float x_115642 =
                                          ((float *) mem_118768)[i_116997];
                                    bool cond_115643 = sle64(x_115554,
                                                             i_116997);
                                    float defunc_0_f_res_115644;
                                    
                                    if (cond_115643) {
                                        defunc_0_f_res_115644 = 0.0F;
                                    } else {
                                        int64_t i_115645 = add64(x_115558,
                                                                 i_116997);
                                        float x_115646 =
                                              ((float *) mem_118312)[i_117009 *
                                                                     n_114534 +
                                                                     i_115645];
                                        
                                        defunc_0_f_res_115644 = x_115646;
                                    }
                                    
                                    float x_115647 = a11_115628 * x_115641;
                                    float y_115648 = b11_115630 * x_115642;
                                    float x_115649 = x_115647 + y_115648;
                                    float defunc_9_fit_fun_res_115650 =
                                          defunc_0_f_res_115644 * x_115649;
                                    float x_115651 = b11_115630 * x_115641;
                                    float y_115652 = c11_115631 * x_115642;
                                    float x_115653 = x_115651 + y_115652;
                                    float defunc_9_slope_fun_res_115654 =
                                          defunc_0_f_res_115644 * x_115653;
                                    float defunc_1_op_res_115636 =
                                          defunc_9_fit_fun_res_115650 +
                                          redout_116995;
                                    float defunc_1_op_res_115639 =
                                          defunc_9_slope_fun_res_115654 +
                                          redout_116996;
                                    float redout_tmp_120505 =
                                          defunc_1_op_res_115636;
                                    float redout_tmp_120506 =
                                          defunc_1_op_res_115639;
                                    
                                    redout_116995 = redout_tmp_120505;
                                    redout_116996 = redout_tmp_120506;
                                }
                                defunc_2_reduce_res_115632 = redout_116995;
                                defunc_2_reduce_res_115633 = redout_116996;
                                ((float *) mem_118719.mem)[i_117009 *
                                                           l_n_m_114584 +
                                                           i_117002] =
                                    defunc_2_reduce_res_115632;
                                ((float *) mem_118723.mem)[i_117009 *
                                                           l_n_m_114584 +
                                                           i_117002] =
                                    defunc_2_reduce_res_115633;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_118989, &mem_118719,
                                         "mem_118719") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_118997, &mem_118723,
                                         "mem_118723") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118723, "mem_118723") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118719, "mem_118719") != 0)
                            return 1;
                    } else {
                        struct memblock mem_118837;
                        
                        mem_118837.references = NULL;
                        if (memblock_alloc(ctx, &mem_118837, bytes_117824,
                                           "mem_118837")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_118841;
                        
                        mem_118841.references = NULL;
                        if (memblock_alloc(ctx, &mem_118841, bytes_117824,
                                           "mem_118841")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (mem_118886_cached_sizze_120644 <
                            (size_t) bytes_118884) {
                            mem_118886 = realloc(mem_118886, bytes_118884);
                            mem_118886_cached_sizze_120644 = bytes_118884;
                        }
                        if (mem_118889_cached_sizze_120645 <
                            (size_t) bytes_118884) {
                            mem_118889 = realloc(mem_118889, bytes_118884);
                            mem_118889_cached_sizze_120645 = bytes_118884;
                        }
                        if (mem_118916_cached_sizze_120646 <
                            (size_t) bytes_118884) {
                            mem_118916 = realloc(mem_118916, bytes_118884);
                            mem_118916_cached_sizze_120646 = bytes_118884;
                        }
                        if (mem_118919_cached_sizze_120647 <
                            (size_t) bytes_118884) {
                            mem_118919 = realloc(mem_118919, bytes_118884);
                            mem_118919_cached_sizze_120647 = bytes_118884;
                        }
                        for (int64_t i_117045 = 0; i_117045 < m_114533;
                             i_117045++) {
                            int64_t x_115665 =
                                    ((int64_t *) mem_117620)[i_117045];
                            
                            for (int64_t i_117038 = 0; i_117038 < l_n_m_114584;
                                 i_117038++) {
                                int64_t x_115669 =
                                        ((int64_t *) mem_117823)[i_117045 *
                                                                 l_n_m_114584 +
                                                                 i_117038];
                                float x_115670 =
                                      ((float *) mem_117827)[i_117045 *
                                                             l_n_m_114584 +
                                                             i_117038];
                                int64_t min_arg_115671 = mul64(t_jump_114541,
                                                               i_117038);
                                int64_t min_res_115672 = smin64(i_114610,
                                                                min_arg_115671);
                                float defunc_0_f_res_115673 =
                                      sitofp_i64_f32(min_res_115672);
                                
                                for (int64_t i_117016 = 0; i_117016 <
                                     l_window_114538; i_117016++) {
                                    bool cond_115677 = sle64(x_115665,
                                                             i_117016);
                                    float defunc_0_f_res_115678;
                                    
                                    if (cond_115677) {
                                        defunc_0_f_res_115678 = 0.0F;
                                    } else {
                                        int64_t i_115679 = add64(x_115669,
                                                                 i_117016);
                                        float x_115680 =
                                              ((float *) mem_117691)[i_117045 *
                                                                     n_114534 +
                                                                     i_115679];
                                        float defunc_0_f_res_f_res_115681 =
                                              1.0F + x_115680;
                                        
                                        defunc_0_f_res_115678 =
                                            defunc_0_f_res_f_res_115681;
                                    }
                                    
                                    float defunc_0_f_res_115682;
                                    
                                    if (cond_115677) {
                                        defunc_0_f_res_115682 = 0.0F;
                                    } else {
                                        int64_t i_115683 = add64(x_115669,
                                                                 i_117016);
                                        float x_115684 =
                                              ((float *) mem_118316)[i_117045 *
                                                                     n_114534 +
                                                                     i_115683];
                                        
                                        defunc_0_f_res_115682 = x_115684;
                                    }
                                    
                                    float x_j_115685 = defunc_0_f_res_115678 -
                                          defunc_0_f_res_115673;
                                    float abs_res_115686 =
                                          (float) fabs(x_j_115685);
                                    float tmp1_115687 = abs_res_115686 /
                                          x_115670;
                                    float x_115688 = tmp1_115687 * tmp1_115687;
                                    float y_115689 = tmp1_115687 * x_115688;
                                    float tmp2_115690 = 1.0F - y_115689;
                                    float x_115691 = tmp2_115690 * tmp2_115690;
                                    float tmp3_115692 = tmp2_115690 * x_115691;
                                    float tmp4_115693 = defunc_0_f_res_115682 *
                                          tmp3_115692;
                                    
                                    ((float *) mem_118886)[i_117016] =
                                        x_j_115685;
                                    ((float *) mem_118889)[i_117016] =
                                        tmp4_115693;
                                }
                                
                                float defunc_2_reduce_res_115700;
                                float defunc_2_reduce_res_115701;
                                float defunc_2_reduce_res_115702;
                                float defunc_2_reduce_res_115703;
                                float defunc_2_reduce_res_115704;
                                float redout_117021;
                                float redout_117022;
                                float redout_117023;
                                float redout_117024;
                                float redout_117025;
                                
                                redout_117021 = 0.0F;
                                redout_117022 = 0.0F;
                                redout_117023 = 0.0F;
                                redout_117024 = 0.0F;
                                redout_117025 = 0.0F;
                                for (int64_t i_117028 = 0; i_117028 <
                                     l_window_114538; i_117028++) {
                                    float x_115722 =
                                          ((float *) mem_118886)[i_117028];
                                    float x_115723 =
                                          ((float *) mem_118889)[i_117028];
                                    float defunc_1_f_res_115724 = x_115722 *
                                          x_115723;
                                    float defunc_1_f_res_115725 = x_115722 *
                                          defunc_1_f_res_115724;
                                    float defunc_1_f_res_115726 = x_115722 *
                                          defunc_1_f_res_115725;
                                    float defunc_1_f_res_115727 = x_115722 *
                                          defunc_1_f_res_115726;
                                    float defunc_1_op_res_115709 = x_115723 +
                                          redout_117021;
                                    float defunc_1_op_res_115712 =
                                          defunc_1_f_res_115724 + redout_117022;
                                    float defunc_1_op_res_115715 =
                                          defunc_1_f_res_115725 + redout_117023;
                                    float defunc_1_op_res_115718 =
                                          defunc_1_f_res_115726 + redout_117024;
                                    float defunc_1_op_res_115721 =
                                          defunc_1_f_res_115727 + redout_117025;
                                    
                                    ((float *) mem_118916)[i_117028] =
                                        defunc_1_f_res_115725;
                                    ((float *) mem_118919)[i_117028] =
                                        defunc_1_f_res_115724;
                                    
                                    float redout_tmp_120513 =
                                          defunc_1_op_res_115709;
                                    float redout_tmp_120514 =
                                          defunc_1_op_res_115712;
                                    float redout_tmp_120515 =
                                          defunc_1_op_res_115715;
                                    float redout_tmp_120516 =
                                          defunc_1_op_res_115718;
                                    float redout_tmp_120517 =
                                          defunc_1_op_res_115721;
                                    
                                    redout_117021 = redout_tmp_120513;
                                    redout_117022 = redout_tmp_120514;
                                    redout_117023 = redout_tmp_120515;
                                    redout_117024 = redout_tmp_120516;
                                    redout_117025 = redout_tmp_120517;
                                }
                                defunc_2_reduce_res_115700 = redout_117021;
                                defunc_2_reduce_res_115701 = redout_117022;
                                defunc_2_reduce_res_115702 = redout_117023;
                                defunc_2_reduce_res_115703 = redout_117024;
                                defunc_2_reduce_res_115704 = redout_117025;
                                
                                float x_115735 = defunc_2_reduce_res_115702 *
                                      defunc_2_reduce_res_115704;
                                float y_115736 = defunc_2_reduce_res_115703 *
                                      defunc_2_reduce_res_115703;
                                float a12_115737 = x_115735 - y_115736;
                                float x_115738 = defunc_2_reduce_res_115702 *
                                      defunc_2_reduce_res_115703;
                                float y_115739 = defunc_2_reduce_res_115701 *
                                      defunc_2_reduce_res_115704;
                                float b12_115740 = x_115738 - y_115739;
                                float x_115741 = defunc_2_reduce_res_115701 *
                                      defunc_2_reduce_res_115703;
                                float y_115742 = defunc_2_reduce_res_115702 *
                                      defunc_2_reduce_res_115702;
                                float c12_115743 = x_115741 - y_115742;
                                float x_115744 = defunc_2_reduce_res_115700 *
                                      defunc_2_reduce_res_115704;
                                float b2_115745 = x_115744 - y_115742;
                                float x_115746 = defunc_2_reduce_res_115701 *
                                      defunc_2_reduce_res_115702;
                                float y_115747 = defunc_2_reduce_res_115700 *
                                      defunc_2_reduce_res_115703;
                                float c2_115748 = x_115746 - y_115747;
                                float x_115749 = defunc_2_reduce_res_115700 *
                                      a12_115737;
                                float y_115750 = defunc_2_reduce_res_115701 *
                                      b12_115740;
                                float x_115751 = x_115749 + y_115750;
                                float y_115752 = defunc_2_reduce_res_115702 *
                                      c12_115743;
                                float y_115753 = x_115751 + y_115752;
                                float det_115754 = 1.0F / y_115753;
                                float a12_115755 = a12_115737 * det_115754;
                                float b12_115756 = b12_115740 * det_115754;
                                float c12_115757 = c12_115743 * det_115754;
                                float b2_115758 = b2_115745 * det_115754;
                                float c2_115759 = c2_115748 * det_115754;
                                float defunc_2_reduce_res_115760;
                                float defunc_2_reduce_res_115761;
                                float redout_117031;
                                float redout_117032;
                                
                                redout_117031 = 0.0F;
                                redout_117032 = 0.0F;
                                for (int64_t i_117033 = 0; i_117033 <
                                     l_window_114538; i_117033++) {
                                    float x_115769 =
                                          ((float *) mem_118889)[i_117033];
                                    float x_115770 =
                                          ((float *) mem_118919)[i_117033];
                                    float x_115771 =
                                          ((float *) mem_118916)[i_117033];
                                    bool cond_115772 = sle64(x_115665,
                                                             i_117033);
                                    float defunc_0_f_res_115773;
                                    
                                    if (cond_115772) {
                                        defunc_0_f_res_115773 = 0.0F;
                                    } else {
                                        int64_t i_115774 = add64(x_115669,
                                                                 i_117033);
                                        float x_115775 =
                                              ((float *) mem_118312)[i_117045 *
                                                                     n_114534 +
                                                                     i_115774];
                                        
                                        defunc_0_f_res_115773 = x_115775;
                                    }
                                    
                                    float x_115776 = a12_115755 * x_115769;
                                    float y_115777 = b12_115756 * x_115770;
                                    float x_115778 = x_115776 + y_115777;
                                    float y_115779 = c12_115757 * x_115771;
                                    float x_115780 = x_115778 + y_115779;
                                    float defunc_9_fit_fun_res_115781 =
                                          defunc_0_f_res_115773 * x_115780;
                                    float x_115782 = b12_115756 * x_115769;
                                    float y_115783 = b2_115758 * x_115770;
                                    float x_115784 = x_115782 + y_115783;
                                    float y_115785 = c2_115759 * x_115771;
                                    float x_115786 = x_115784 + y_115785;
                                    float defunc_9_slope_fun_res_115787 =
                                          defunc_0_f_res_115773 * x_115786;
                                    float defunc_1_op_res_115764 =
                                          defunc_9_fit_fun_res_115781 +
                                          redout_117031;
                                    float defunc_1_op_res_115767 =
                                          defunc_9_slope_fun_res_115787 +
                                          redout_117032;
                                    float redout_tmp_120520 =
                                          defunc_1_op_res_115764;
                                    float redout_tmp_120521 =
                                          defunc_1_op_res_115767;
                                    
                                    redout_117031 = redout_tmp_120520;
                                    redout_117032 = redout_tmp_120521;
                                }
                                defunc_2_reduce_res_115760 = redout_117031;
                                defunc_2_reduce_res_115761 = redout_117032;
                                ((float *) mem_118837.mem)[i_117045 *
                                                           l_n_m_114584 +
                                                           i_117038] =
                                    defunc_2_reduce_res_115760;
                                ((float *) mem_118841.mem)[i_117045 *
                                                           l_n_m_114584 +
                                                           i_117038] =
                                    defunc_2_reduce_res_115761;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_118989, &mem_118837,
                                         "mem_118837") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_118997, &mem_118841,
                                         "mem_118841") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118841, "mem_118841") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_118837, "mem_118837") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119005,
                                     &x_mem_118989, "x_mem_118989") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119013,
                                     &x_mem_118997, "x_mem_118997") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_118997, "x_mem_118997") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_118989, "x_mem_118989") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119021,
                                 &defunc_12_lifted_use_version_res_mem_119005,
                                 "defunc_12_lifted_use_version_res_mem_119005") !=
                    0)
                    return 1;
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119029,
                                 &defunc_12_lifted_use_version_res_mem_119013,
                                 "defunc_12_lifted_use_version_res_mem_119013") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_119013,
                                   "defunc_12_lifted_use_version_res_mem_119013") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_119005,
                                   "defunc_12_lifted_use_version_res_mem_119005") !=
                    0)
                    return 1;
            }
            
            struct memblock L_l_mem_119081;
            
            L_l_mem_119081.references = NULL;
            if (cond_114941) {
                bool zzero_115791 = l_jump_114542 == (int64_t) 0;
                bool nonzzero_115792 = !zzero_115791;
                bool nonzzero_cert_115793;
                
                if (!nonzzero_115792) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  stl.fut:55:27-34\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:252:21-67\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:250:15-253:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                    if (memblock_unref(ctx, &L_l_mem_119081,
                                       "L_l_mem_119081") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119029,
                                       "defunc_11_loess_l_res_mem_119029") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119021,
                                       "defunc_11_loess_l_res_mem_119021") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118109,
                                       "mem_param_118109") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118101,
                                       "mem_param_118101") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119885,
                                       "loopres_mem_119885") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119877,
                                       "loopres_mem_119877") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118087,
                                       "mem_param_118087") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118079,
                                       "mem_param_118079") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118071,
                                       "mem_param_118071") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120220,
                                       "stl_res_mem_120220") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120212,
                                       "stl_res_mem_120212") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120204,
                                       "stl_res_mem_120204") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120375,
                                       "out_mem_120375") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120374,
                                       "out_mem_120374") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120373,
                                       "out_mem_120373") != 0)
                        return 1;
                    return 1;
                }
                
                int64_t y_115794 = sub64(l_n_m_114584, (int64_t) 1);
                struct memblock mem_119033;
                
                mem_119033.references = NULL;
                if (memblock_alloc(ctx, &mem_119033, bytes_117688,
                                   "mem_119033")) {
                    err = 1;
                    goto cleanup;
                }
                for (int64_t i_117054 = 0; i_117054 < m_114533; i_117054++) {
                    for (int64_t i_117050 = 0; i_117050 < n_114534;
                         i_117050++) {
                        int64_t m_v_115800 = sdiv64(i_117050, l_jump_114542);
                        bool cond_115801 = m_v_115800 == y_115794;
                        int64_t j_115802;
                        
                        if (cond_115801) {
                            int64_t j_t_res_115803 = sub64(m_v_115800,
                                                           (int64_t) 1);
                            
                            j_115802 = j_t_res_115803;
                        } else {
                            j_115802 = m_v_115800;
                        }
                        
                        int64_t min_arg_115804 = mul64(l_jump_114542, j_115802);
                        int64_t min_res_115805 = smin64(i_114610,
                                                        min_arg_115804);
                        int64_t defunc_0_m_fun_arg_115806 = add64((int64_t) 1,
                                                                  j_115802);
                        int64_t min_arg_115807 = mul64(l_jump_114542,
                                                       defunc_0_m_fun_arg_115806);
                        int64_t min_res_115808 = smin64(i_114610,
                                                        min_arg_115807);
                        int64_t i64_arg_115809 = sub64(min_res_115808,
                                                       min_res_115805);
                        float i64_res_115810 = sitofp_i64_f32(i64_arg_115809);
                        int64_t i64_arg_115811 = sub64(i_117050,
                                                       min_res_115805);
                        float i64_res_115812 = sitofp_i64_f32(i64_arg_115811);
                        float u_115813 = i64_res_115812 / i64_res_115810;
                        float u2_115814 = u_115813 * u_115813;
                        float u3_115815 = u_115813 * u2_115814;
                        float x_115816 = 2.0F * u3_115815;
                        float y_115817 = 3.0F * u2_115814;
                        float x_115818 = x_115816 - y_115817;
                        float x_115819 = 1.0F + x_115818;
                        bool x_115820 = sle64((int64_t) 0, j_115802);
                        bool y_115821 = slt64(j_115802, l_n_m_114584);
                        bool bounds_check_115822 = x_115820 && y_115821;
                        bool index_certs_115823;
                        
                        if (!bounds_check_115822) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", j_115802,
                                          "] out of bounds for array of shape [",
                                          l_n_m_114584, "].",
                                          "-> #0  stl.fut:63:41-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:252:21-67\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:250:15-253:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_119033,
                                               "mem_119033") != 0)
                                return 1;
                            if (memblock_unref(ctx, &L_l_mem_119081,
                                               "L_l_mem_119081") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119029,
                                               "defunc_11_loess_l_res_mem_119029") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119021,
                                               "defunc_11_loess_l_res_mem_119021") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_115824 =
                              ((float *) defunc_11_loess_l_res_mem_119021.mem)[i_117054 *
                                                                               l_n_m_114584 +
                                                                               j_115802];
                        float x_115825 = x_115819 * y_115824;
                        float x_115826 = y_115817 - x_115816;
                        bool x_115827 = sle64((int64_t) 0,
                                              defunc_0_m_fun_arg_115806);
                        bool y_115828 = slt64(defunc_0_m_fun_arg_115806,
                                              l_n_m_114584);
                        bool bounds_check_115829 = x_115827 && y_115828;
                        bool index_certs_115830;
                        
                        if (!bounds_check_115829) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", defunc_0_m_fun_arg_115806,
                                          "] out of bounds for array of shape [",
                                          l_n_m_114584, "].",
                                          "-> #0  stl.fut:64:41-51\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:252:21-67\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:250:15-253:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_119033,
                                               "mem_119033") != 0)
                                return 1;
                            if (memblock_unref(ctx, &L_l_mem_119081,
                                               "L_l_mem_119081") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119029,
                                               "defunc_11_loess_l_res_mem_119029") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119021,
                                               "defunc_11_loess_l_res_mem_119021") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_115831 =
                              ((float *) defunc_11_loess_l_res_mem_119021.mem)[i_117054 *
                                                                               l_n_m_114584 +
                                                                               defunc_0_m_fun_arg_115806];
                        float y_115832 = x_115826 * y_115831;
                        float x_115833 = x_115825 + y_115832;
                        float y_115834 = 2.0F * u2_115814;
                        float x_115835 = u3_115815 - y_115834;
                        float x_115836 = u_115813 + x_115835;
                        float y_115837 =
                              ((float *) defunc_11_loess_l_res_mem_119029.mem)[i_117054 *
                                                                               l_n_m_114584 +
                                                                               j_115802];
                        float x_115838 = x_115836 * y_115837;
                        float y_115839 = i64_res_115810 * x_115838;
                        float x_115840 = x_115833 + y_115839;
                        float x_115841 = u3_115815 - u2_115814;
                        float y_115842 =
                              ((float *) defunc_11_loess_l_res_mem_119029.mem)[i_117054 *
                                                                               l_n_m_114584 +
                                                                               defunc_0_m_fun_arg_115806];
                        float x_115843 = x_115841 * y_115842;
                        float y_115844 = i64_res_115810 * x_115843;
                        float defunc_0_f_res_115845 = x_115840 + y_115844;
                        
                        ((float *) mem_119033.mem)[i_117054 * n_114534 +
                                                   i_117050] =
                            defunc_0_f_res_115845;
                    }
                }
                if (memblock_set(ctx, &L_l_mem_119081, &mem_119033,
                                 "mem_119033") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_119033, "mem_119033") != 0)
                    return 1;
            } else {
                bool dim_match_115847 = n_114534 == l_n_m_114584;
                bool empty_or_match_cert_115848;
                
                if (!dim_match_115847) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (", m_114533,
                                  ", ", l_n_m_114584,
                                  ") cannot match shape of type `[", m_114533,
                                  "][", n_114534, "]t`.",
                                  "-> #0  stl.fut:255:15-36\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
                    if (memblock_unref(ctx, &L_l_mem_119081,
                                       "L_l_mem_119081") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119029,
                                       "defunc_11_loess_l_res_mem_119029") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119021,
                                       "defunc_11_loess_l_res_mem_119021") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118109,
                                       "mem_param_118109") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118101,
                                       "mem_param_118101") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119885,
                                       "loopres_mem_119885") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119877,
                                       "loopres_mem_119877") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118087,
                                       "mem_param_118087") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118079,
                                       "mem_param_118079") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118071,
                                       "mem_param_118071") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120220,
                                       "stl_res_mem_120220") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120212,
                                       "stl_res_mem_120212") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120204,
                                       "stl_res_mem_120204") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120375,
                                       "out_mem_120375") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120374,
                                       "out_mem_120374") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120373,
                                       "out_mem_120373") != 0)
                        return 1;
                    return 1;
                }
                if (memblock_set(ctx, &L_l_mem_119081,
                                 &defunc_11_loess_l_res_mem_119021,
                                 "defunc_11_loess_l_res_mem_119021") != 0)
                    return 1;
            }
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119021,
                               "defunc_11_loess_l_res_mem_119021") != 0)
                return 1;
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119029,
                               "defunc_11_loess_l_res_mem_119029") != 0)
                return 1;
            
            struct memblock mem_119085;
            
            mem_119085.references = NULL;
            if (memblock_alloc(ctx, &mem_119085, bytes_117688, "mem_119085")) {
                err = 1;
                goto cleanup;
            }
            for (int64_t i_117062 = 0; i_117062 < m_114533; i_117062++) {
                for (int64_t i_117058 = 0; i_117058 < n_114534; i_117058++) {
                    int64_t slice_117361 = n_p_114536 + i_117058;
                    float x_115855 = ((float *) mem_118201)[i_117062 *
                                                            C_len_114582 +
                                                            slice_117361];
                    float x_115856 = ((float *) L_l_mem_119081.mem)[i_117062 *
                                                                    L_l_ixfn_119078 +
                                                                    i_117058];
                    float defunc_1_f_res_115857 = x_115855 - x_115856;
                    
                    ((float *) mem_119085.mem)[i_117062 * n_114534 + i_117058] =
                        defunc_1_f_res_115857;
                }
            }
            if (memblock_unref(ctx, &L_l_mem_119081, "L_l_mem_119081") != 0)
                return 1;
            for (int64_t i_117074 = 0; i_117074 < m_114533; i_117074++) {
                for (int64_t i_117066 = 0; i_117066 < n_114534; i_117066++) {
                    float x_115864 = ((float *) Y_mem_117613.mem)[i_117074 *
                                                                  n_114534 +
                                                                  i_117066];
                    float x_115865 = ((float *) mem_119085.mem)[i_117074 *
                                                                n_114534 +
                                                                i_117066];
                    float defunc_1_f_res_115866 = x_115864 - x_115865;
                    
                    ((float *) mem_119142)[i_117066] = defunc_1_f_res_115866;
                }
                for (int64_t i_117070 = 0; i_117070 < n_114534; i_117070++) {
                    int64_t x_115868 = ((int64_t *) mem_117617)[i_117074 *
                                                                n_114534 +
                                                                i_117070];
                    bool cond_115869 = sle64((int64_t) 0, x_115868);
                    float defunc_0_f_res_115870;
                    
                    if (cond_115869) {
                        bool y_115871 = slt64(x_115868, n_114534);
                        bool bounds_check_115872 = cond_115869 && y_115871;
                        bool index_certs_115873;
                        
                        if (!bounds_check_115872) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", x_115868,
                                          "] out of bounds for array of shape [",
                                          n_114534, "].",
                                          "-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:279:21-41\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:277:13-280:31\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_119085,
                                               "mem_119085") != 0)
                                return 1;
                            if (memblock_unref(ctx, &L_l_mem_119081,
                                               "L_l_mem_119081") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119029,
                                               "defunc_11_loess_l_res_mem_119029") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119021,
                                               "defunc_11_loess_l_res_mem_119021") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float defunc_0_f_res_t_res_115874 =
                              ((float *) mem_119142)[x_115868];
                        
                        defunc_0_f_res_115870 = defunc_0_f_res_t_res_115874;
                    } else {
                        defunc_0_f_res_115870 = 0.0F;
                    }
                    ((float *) mem_119129)[i_117074 * n_114534 + i_117070] =
                        defunc_0_f_res_115870;
                }
            }
            
            struct memblock defunc_11_loess_l_res_mem_119809;
            
            defunc_11_loess_l_res_mem_119809.references = NULL;
            
            struct memblock defunc_11_loess_l_res_mem_119817;
            
            defunc_11_loess_l_res_mem_119817.references = NULL;
            if (cond_115017) {
                bool match_lit_115878 = (int64_t) 0 == t_degree_114539;
                struct memblock defunc_12_lifted_use_version_res_mem_119432;
                
                defunc_12_lifted_use_version_res_mem_119432.references = NULL;
                
                struct memblock defunc_12_lifted_use_version_res_mem_119440;
                
                defunc_12_lifted_use_version_res_mem_119440.references = NULL;
                if (match_lit_115878) {
                    struct memblock mem_119188;
                    
                    mem_119188.references = NULL;
                    if (memblock_alloc(ctx, &mem_119188, bytes_117942,
                                       "mem_119188")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_120529 = 0; i_120529 < m_114533;
                         i_120529++) {
                        for (int64_t i_120530 = 0; i_120530 < t_n_m_114591;
                             i_120530++) {
                            ((float *) mem_119188.mem)[i_120529 * t_n_m_114591 +
                                                       i_120530] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_119192;
                    
                    mem_119192.references = NULL;
                    if (memblock_alloc(ctx, &mem_119192, bytes_117942,
                                       "mem_119192")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_117086 = 0; i_117086 < m_114533;
                         i_117086++) {
                        int64_t x_115889 = ((int64_t *) mem_117620)[i_117086];
                        
                        for (int64_t i_117082 = 0; i_117082 < t_n_m_114591;
                             i_117082++) {
                            int64_t x_115892 =
                                    ((int64_t *) mem_117941)[i_117086 *
                                                             t_n_m_114591 +
                                                             i_117082];
                            float x_115893 = ((float *) mem_117945)[i_117086 *
                                                                    t_n_m_114591 +
                                                                    i_117082];
                            int64_t min_arg_115894 = mul64(t_jump_114541,
                                                           i_117082);
                            int64_t min_res_115895 = smin64(i_114610,
                                                            min_arg_115894);
                            float defunc_0_f_res_115896 =
                                  sitofp_i64_f32(min_res_115895);
                            float defunc_2_reduce_res_115897;
                            float redout_117076 = 0.0F;
                            
                            for (int64_t i_117077 = 0; i_117077 <
                                 t_window_114537; i_117077++) {
                                bool cond_115902 = sle64(x_115889, i_117077);
                                float defunc_0_f_res_115903;
                                
                                if (cond_115902) {
                                    defunc_0_f_res_115903 = 0.0F;
                                } else {
                                    int64_t i_115904 = add64(x_115892,
                                                             i_117077);
                                    float x_115905 =
                                          ((float *) mem_117691)[i_117086 *
                                                                 n_114534 +
                                                                 i_115904];
                                    float defunc_0_f_res_f_res_115906 = 1.0F +
                                          x_115905;
                                    
                                    defunc_0_f_res_115903 =
                                        defunc_0_f_res_f_res_115906;
                                }
                                
                                float defunc_0_f_res_115907;
                                
                                if (cond_115902) {
                                    defunc_0_f_res_115907 = 0.0F;
                                } else {
                                    int64_t i_115908 = add64(x_115892,
                                                             i_117077);
                                    float x_115909 =
                                          ((float *) mem_118316)[i_117086 *
                                                                 n_114534 +
                                                                 i_115908];
                                    
                                    defunc_0_f_res_115907 = x_115909;
                                }
                                
                                float x_j_115910 = defunc_0_f_res_115903 -
                                      defunc_0_f_res_115896;
                                float abs_res_115911 = (float) fabs(x_j_115910);
                                float tmp1_115912 = abs_res_115911 / x_115893;
                                float x_115913 = tmp1_115912 * tmp1_115912;
                                float y_115914 = tmp1_115912 * x_115913;
                                float tmp2_115915 = 1.0F - y_115914;
                                float x_115916 = tmp2_115915 * tmp2_115915;
                                float tmp3_115917 = tmp2_115915 * x_115916;
                                float w_j_115918 = defunc_0_f_res_115907 *
                                      tmp3_115917;
                                float defunc_1_op_res_115900 = w_j_115918 +
                                      redout_117076;
                                float redout_tmp_120533 =
                                      defunc_1_op_res_115900;
                                
                                redout_117076 = redout_tmp_120533;
                            }
                            defunc_2_reduce_res_115897 = redout_117076;
                            
                            float a0_115919 = 1.0F / defunc_2_reduce_res_115897;
                            float defunc_2_reduce_res_115920;
                            float redout_117078 = 0.0F;
                            
                            for (int64_t i_117079 = 0; i_117079 <
                                 t_window_114537; i_117079++) {
                                bool cond_115925 = sle64(x_115889, i_117079);
                                float defunc_0_f_res_115926;
                                
                                if (cond_115925) {
                                    defunc_0_f_res_115926 = 0.0F;
                                } else {
                                    int64_t i_115927 = add64(x_115892,
                                                             i_117079);
                                    float x_115928 =
                                          ((float *) mem_117691)[i_117086 *
                                                                 n_114534 +
                                                                 i_115927];
                                    float defunc_0_f_res_f_res_115929 = 1.0F +
                                          x_115928;
                                    
                                    defunc_0_f_res_115926 =
                                        defunc_0_f_res_f_res_115929;
                                }
                                
                                float defunc_0_f_res_115930;
                                
                                if (cond_115925) {
                                    defunc_0_f_res_115930 = 0.0F;
                                } else {
                                    int64_t i_115931 = add64(x_115892,
                                                             i_117079);
                                    float x_115932 =
                                          ((float *) mem_118316)[i_117086 *
                                                                 n_114534 +
                                                                 i_115931];
                                    
                                    defunc_0_f_res_115930 = x_115932;
                                }
                                
                                float x_j_115933 = defunc_0_f_res_115926 -
                                      defunc_0_f_res_115896;
                                float abs_res_115934 = (float) fabs(x_j_115933);
                                float tmp1_115935 = abs_res_115934 / x_115893;
                                float x_115936 = tmp1_115935 * tmp1_115935;
                                float y_115937 = tmp1_115935 * x_115936;
                                float tmp2_115938 = 1.0F - y_115937;
                                float x_115939 = tmp2_115938 * tmp2_115938;
                                float tmp3_115940 = tmp2_115938 * x_115939;
                                float tmp4_115941 = defunc_0_f_res_115930 *
                                      tmp3_115940;
                                float defunc_0_f_res_115942;
                                
                                if (cond_115925) {
                                    defunc_0_f_res_115942 = 0.0F;
                                } else {
                                    int64_t i_115943 = add64(x_115892,
                                                             i_117079);
                                    float x_115944 =
                                          ((float *) mem_119129)[i_117086 *
                                                                 n_114534 +
                                                                 i_115943];
                                    
                                    defunc_0_f_res_115942 = x_115944;
                                }
                                
                                float x_115945 = a0_115919 * tmp4_115941;
                                float defunc_9_fit_fun_res_115946 =
                                      defunc_0_f_res_115942 * x_115945;
                                float defunc_1_op_res_115923 =
                                      defunc_9_fit_fun_res_115946 +
                                      redout_117078;
                                float redout_tmp_120534 =
                                      defunc_1_op_res_115923;
                                
                                redout_117078 = redout_tmp_120534;
                            }
                            defunc_2_reduce_res_115920 = redout_117078;
                            ((float *) mem_119192.mem)[i_117086 * t_n_m_114591 +
                                                       i_117082] =
                                defunc_2_reduce_res_115920;
                        }
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119432,
                                     &mem_119192, "mem_119192") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119440,
                                     &mem_119188, "mem_119188") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_119192, "mem_119192") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_119188, "mem_119188") != 0)
                        return 1;
                } else {
                    bool match_lit_115949 = (int64_t) 1 == t_degree_114539;
                    struct memblock x_mem_119416;
                    
                    x_mem_119416.references = NULL;
                    
                    struct memblock x_mem_119424;
                    
                    x_mem_119424.references = NULL;
                    if (match_lit_115949) {
                        struct memblock mem_119236;
                        
                        mem_119236.references = NULL;
                        if (memblock_alloc(ctx, &mem_119236, bytes_117942,
                                           "mem_119236")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_119240;
                        
                        mem_119240.references = NULL;
                        if (memblock_alloc(ctx, &mem_119240, bytes_117942,
                                           "mem_119240")) {
                            err = 1;
                            goto cleanup;
                        }
                        for (int64_t i_117106 = 0; i_117106 < m_114533;
                             i_117106++) {
                            int64_t x_115960 =
                                    ((int64_t *) mem_117620)[i_117106];
                            
                            for (int64_t i_117099 = 0; i_117099 < t_n_m_114591;
                                 i_117099++) {
                                int64_t x_115964 =
                                        ((int64_t *) mem_117941)[i_117106 *
                                                                 t_n_m_114591 +
                                                                 i_117099];
                                float x_115965 =
                                      ((float *) mem_117945)[i_117106 *
                                                             t_n_m_114591 +
                                                             i_117099];
                                int64_t min_arg_115966 = mul64(t_jump_114541,
                                                               i_117099);
                                int64_t min_res_115967 = smin64(i_114610,
                                                                min_arg_115966);
                                float defunc_0_f_res_115968 =
                                      sitofp_i64_f32(min_res_115967);
                                float defunc_2_reduce_res_115969;
                                float defunc_2_reduce_res_115970;
                                float defunc_2_reduce_res_115971;
                                float redout_117088;
                                float redout_117089;
                                float redout_117090;
                                
                                redout_117088 = 0.0F;
                                redout_117089 = 0.0F;
                                redout_117090 = 0.0F;
                                for (int64_t i_117091 = 0; i_117091 <
                                     t_window_114537; i_117091++) {
                                    bool cond_115982 = sle64(x_115960,
                                                             i_117091);
                                    float defunc_0_f_res_115983;
                                    
                                    if (cond_115982) {
                                        defunc_0_f_res_115983 = 0.0F;
                                    } else {
                                        int64_t i_115984 = add64(x_115964,
                                                                 i_117091);
                                        float x_115985 =
                                              ((float *) mem_117691)[i_117106 *
                                                                     n_114534 +
                                                                     i_115984];
                                        float defunc_0_f_res_f_res_115986 =
                                              1.0F + x_115985;
                                        
                                        defunc_0_f_res_115983 =
                                            defunc_0_f_res_f_res_115986;
                                    }
                                    
                                    float defunc_0_f_res_115987;
                                    
                                    if (cond_115982) {
                                        defunc_0_f_res_115987 = 0.0F;
                                    } else {
                                        int64_t i_115988 = add64(x_115964,
                                                                 i_117091);
                                        float x_115989 =
                                              ((float *) mem_118316)[i_117106 *
                                                                     n_114534 +
                                                                     i_115988];
                                        
                                        defunc_0_f_res_115987 = x_115989;
                                    }
                                    
                                    float x_j_115990 = defunc_0_f_res_115983 -
                                          defunc_0_f_res_115968;
                                    float abs_res_115991 =
                                          (float) fabs(x_j_115990);
                                    float tmp1_115992 = abs_res_115991 /
                                          x_115965;
                                    float x_115993 = tmp1_115992 * tmp1_115992;
                                    float y_115994 = tmp1_115992 * x_115993;
                                    float tmp2_115995 = 1.0F - y_115994;
                                    float x_115996 = tmp2_115995 * tmp2_115995;
                                    float tmp3_115997 = tmp2_115995 * x_115996;
                                    float w_j_115998 = defunc_0_f_res_115987 *
                                          tmp3_115997;
                                    float xw_j_115999 = x_j_115990 * w_j_115998;
                                    float x2w_j_116000 = x_j_115990 *
                                          xw_j_115999;
                                    float defunc_1_op_res_115974 = w_j_115998 +
                                          redout_117088;
                                    float defunc_1_op_res_115977 = xw_j_115999 +
                                          redout_117089;
                                    float defunc_1_op_res_115980 =
                                          x2w_j_116000 + redout_117090;
                                    float redout_tmp_120539 =
                                          defunc_1_op_res_115974;
                                    float redout_tmp_120540 =
                                          defunc_1_op_res_115977;
                                    float redout_tmp_120541 =
                                          defunc_1_op_res_115980;
                                    
                                    redout_117088 = redout_tmp_120539;
                                    redout_117089 = redout_tmp_120540;
                                    redout_117090 = redout_tmp_120541;
                                }
                                defunc_2_reduce_res_115969 = redout_117088;
                                defunc_2_reduce_res_115970 = redout_117089;
                                defunc_2_reduce_res_115971 = redout_117090;
                                
                                float x_116001 = defunc_2_reduce_res_115969 *
                                      defunc_2_reduce_res_115971;
                                float y_116002 = defunc_2_reduce_res_115970 *
                                      defunc_2_reduce_res_115970;
                                float y_116003 = x_116001 - y_116002;
                                float det1_116004 = 1.0F / y_116003;
                                float a11_116005 = defunc_2_reduce_res_115971 *
                                      det1_116004;
                                float negate_arg_116006 =
                                      defunc_2_reduce_res_115970 * det1_116004;
                                float b11_116007 = 0.0F - negate_arg_116006;
                                float c11_116008 = defunc_2_reduce_res_115969 *
                                      det1_116004;
                                float defunc_2_reduce_res_116009;
                                float defunc_2_reduce_res_116010;
                                float redout_117092;
                                float redout_117093;
                                
                                redout_117092 = 0.0F;
                                redout_117093 = 0.0F;
                                for (int64_t i_117094 = 0; i_117094 <
                                     t_window_114537; i_117094++) {
                                    bool cond_116018 = sle64(x_115960,
                                                             i_117094);
                                    float defunc_0_f_res_116019;
                                    
                                    if (cond_116018) {
                                        defunc_0_f_res_116019 = 0.0F;
                                    } else {
                                        int64_t i_116020 = add64(x_115964,
                                                                 i_117094);
                                        float x_116021 =
                                              ((float *) mem_117691)[i_117106 *
                                                                     n_114534 +
                                                                     i_116020];
                                        float defunc_0_f_res_f_res_116022 =
                                              1.0F + x_116021;
                                        
                                        defunc_0_f_res_116019 =
                                            defunc_0_f_res_f_res_116022;
                                    }
                                    
                                    float defunc_0_f_res_116023;
                                    
                                    if (cond_116018) {
                                        defunc_0_f_res_116023 = 0.0F;
                                    } else {
                                        int64_t i_116024 = add64(x_115964,
                                                                 i_117094);
                                        float x_116025 =
                                              ((float *) mem_118316)[i_117106 *
                                                                     n_114534 +
                                                                     i_116024];
                                        
                                        defunc_0_f_res_116023 = x_116025;
                                    }
                                    
                                    float x_j_116026 = defunc_0_f_res_116019 -
                                          defunc_0_f_res_115968;
                                    float abs_res_116027 =
                                          (float) fabs(x_j_116026);
                                    float tmp1_116028 = abs_res_116027 /
                                          x_115965;
                                    float x_116029 = tmp1_116028 * tmp1_116028;
                                    float y_116030 = tmp1_116028 * x_116029;
                                    float tmp2_116031 = 1.0F - y_116030;
                                    float x_116032 = tmp2_116031 * tmp2_116031;
                                    float tmp3_116033 = tmp2_116031 * x_116032;
                                    float tmp4_116034 = defunc_0_f_res_116023 *
                                          tmp3_116033;
                                    float defunc_1_f_res_116035 = x_j_116026 *
                                          tmp4_116034;
                                    float defunc_0_f_res_116036;
                                    
                                    if (cond_116018) {
                                        defunc_0_f_res_116036 = 0.0F;
                                    } else {
                                        int64_t i_116037 = add64(x_115964,
                                                                 i_117094);
                                        float x_116038 =
                                              ((float *) mem_119129)[i_117106 *
                                                                     n_114534 +
                                                                     i_116037];
                                        
                                        defunc_0_f_res_116036 = x_116038;
                                    }
                                    
                                    float x_116039 = a11_116005 * tmp4_116034;
                                    float y_116040 = b11_116007 *
                                          defunc_1_f_res_116035;
                                    float x_116041 = x_116039 + y_116040;
                                    float defunc_9_fit_fun_res_116042 =
                                          defunc_0_f_res_116036 * x_116041;
                                    float x_116043 = b11_116007 * tmp4_116034;
                                    float y_116044 = c11_116008 *
                                          defunc_1_f_res_116035;
                                    float x_116045 = x_116043 + y_116044;
                                    float defunc_9_slope_fun_res_116046 =
                                          defunc_0_f_res_116036 * x_116045;
                                    float defunc_1_op_res_116013 =
                                          defunc_9_fit_fun_res_116042 +
                                          redout_117092;
                                    float defunc_1_op_res_116016 =
                                          defunc_9_slope_fun_res_116046 +
                                          redout_117093;
                                    float redout_tmp_120542 =
                                          defunc_1_op_res_116013;
                                    float redout_tmp_120543 =
                                          defunc_1_op_res_116016;
                                    
                                    redout_117092 = redout_tmp_120542;
                                    redout_117093 = redout_tmp_120543;
                                }
                                defunc_2_reduce_res_116009 = redout_117092;
                                defunc_2_reduce_res_116010 = redout_117093;
                                ((float *) mem_119236.mem)[i_117106 *
                                                           t_n_m_114591 +
                                                           i_117099] =
                                    defunc_2_reduce_res_116009;
                                ((float *) mem_119240.mem)[i_117106 *
                                                           t_n_m_114591 +
                                                           i_117099] =
                                    defunc_2_reduce_res_116010;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_119416, &mem_119236,
                                         "mem_119236") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_119424, &mem_119240,
                                         "mem_119240") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119240, "mem_119240") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119236, "mem_119236") != 0)
                            return 1;
                    } else {
                        struct memblock mem_119324;
                        
                        mem_119324.references = NULL;
                        if (memblock_alloc(ctx, &mem_119324, bytes_117942,
                                           "mem_119324")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_119328;
                        
                        mem_119328.references = NULL;
                        if (memblock_alloc(ctx, &mem_119328, bytes_117942,
                                           "mem_119328")) {
                            err = 1;
                            goto cleanup;
                        }
                        for (int64_t i_117129 = 0; i_117129 < m_114533;
                             i_117129++) {
                            int64_t x_116057 =
                                    ((int64_t *) mem_117620)[i_117129];
                            
                            for (int64_t i_117122 = 0; i_117122 < t_n_m_114591;
                                 i_117122++) {
                                int64_t x_116061 =
                                        ((int64_t *) mem_117941)[i_117129 *
                                                                 t_n_m_114591 +
                                                                 i_117122];
                                float x_116062 =
                                      ((float *) mem_117945)[i_117129 *
                                                             t_n_m_114591 +
                                                             i_117122];
                                int64_t min_arg_116063 = mul64(t_jump_114541,
                                                               i_117122);
                                int64_t min_res_116064 = smin64(i_114610,
                                                                min_arg_116063);
                                float defunc_0_f_res_116065 =
                                      sitofp_i64_f32(min_res_116064);
                                float defunc_2_reduce_res_116066;
                                float defunc_2_reduce_res_116067;
                                float defunc_2_reduce_res_116068;
                                float defunc_2_reduce_res_116069;
                                float defunc_2_reduce_res_116070;
                                float redout_117109;
                                float redout_117110;
                                float redout_117111;
                                float redout_117112;
                                float redout_117113;
                                
                                redout_117109 = 0.0F;
                                redout_117110 = 0.0F;
                                redout_117111 = 0.0F;
                                redout_117112 = 0.0F;
                                redout_117113 = 0.0F;
                                for (int64_t i_117114 = 0; i_117114 <
                                     t_window_114537; i_117114++) {
                                    bool cond_116087 = sle64(x_116057,
                                                             i_117114);
                                    float defunc_0_f_res_116088;
                                    
                                    if (cond_116087) {
                                        defunc_0_f_res_116088 = 0.0F;
                                    } else {
                                        int64_t i_116089 = add64(x_116061,
                                                                 i_117114);
                                        float x_116090 =
                                              ((float *) mem_117691)[i_117129 *
                                                                     n_114534 +
                                                                     i_116089];
                                        float defunc_0_f_res_f_res_116091 =
                                              1.0F + x_116090;
                                        
                                        defunc_0_f_res_116088 =
                                            defunc_0_f_res_f_res_116091;
                                    }
                                    
                                    float defunc_0_f_res_116092;
                                    
                                    if (cond_116087) {
                                        defunc_0_f_res_116092 = 0.0F;
                                    } else {
                                        int64_t i_116093 = add64(x_116061,
                                                                 i_117114);
                                        float x_116094 =
                                              ((float *) mem_118316)[i_117129 *
                                                                     n_114534 +
                                                                     i_116093];
                                        
                                        defunc_0_f_res_116092 = x_116094;
                                    }
                                    
                                    float x_j_116095 = defunc_0_f_res_116088 -
                                          defunc_0_f_res_116065;
                                    float abs_res_116096 =
                                          (float) fabs(x_j_116095);
                                    float tmp1_116097 = abs_res_116096 /
                                          x_116062;
                                    float x_116098 = tmp1_116097 * tmp1_116097;
                                    float y_116099 = tmp1_116097 * x_116098;
                                    float tmp2_116100 = 1.0F - y_116099;
                                    float x_116101 = tmp2_116100 * tmp2_116100;
                                    float tmp3_116102 = tmp2_116100 * x_116101;
                                    float w_j_116103 = defunc_0_f_res_116092 *
                                          tmp3_116102;
                                    float xw_j_116104 = x_j_116095 * w_j_116103;
                                    float x2w_j_116105 = x_j_116095 *
                                          xw_j_116104;
                                    float x3w_j_116106 = x_j_116095 *
                                          x2w_j_116105;
                                    float x4w_j_116107 = x_j_116095 *
                                          x3w_j_116106;
                                    float defunc_1_op_res_116073 = w_j_116103 +
                                          redout_117109;
                                    float defunc_1_op_res_116076 = xw_j_116104 +
                                          redout_117110;
                                    float defunc_1_op_res_116079 =
                                          x2w_j_116105 + redout_117111;
                                    float defunc_1_op_res_116082 =
                                          x3w_j_116106 + redout_117112;
                                    float defunc_1_op_res_116085 =
                                          x4w_j_116107 + redout_117113;
                                    float redout_tmp_120548 =
                                          defunc_1_op_res_116073;
                                    float redout_tmp_120549 =
                                          defunc_1_op_res_116076;
                                    float redout_tmp_120550 =
                                          defunc_1_op_res_116079;
                                    float redout_tmp_120551 =
                                          defunc_1_op_res_116082;
                                    float redout_tmp_120552 =
                                          defunc_1_op_res_116085;
                                    
                                    redout_117109 = redout_tmp_120548;
                                    redout_117110 = redout_tmp_120549;
                                    redout_117111 = redout_tmp_120550;
                                    redout_117112 = redout_tmp_120551;
                                    redout_117113 = redout_tmp_120552;
                                }
                                defunc_2_reduce_res_116066 = redout_117109;
                                defunc_2_reduce_res_116067 = redout_117110;
                                defunc_2_reduce_res_116068 = redout_117111;
                                defunc_2_reduce_res_116069 = redout_117112;
                                defunc_2_reduce_res_116070 = redout_117113;
                                
                                float x_116108 = defunc_2_reduce_res_116068 *
                                      defunc_2_reduce_res_116070;
                                float y_116109 = defunc_2_reduce_res_116069 *
                                      defunc_2_reduce_res_116069;
                                float a12_116110 = x_116108 - y_116109;
                                float x_116111 = defunc_2_reduce_res_116068 *
                                      defunc_2_reduce_res_116069;
                                float y_116112 = defunc_2_reduce_res_116067 *
                                      defunc_2_reduce_res_116070;
                                float b12_116113 = x_116111 - y_116112;
                                float x_116114 = defunc_2_reduce_res_116067 *
                                      defunc_2_reduce_res_116069;
                                float y_116115 = defunc_2_reduce_res_116068 *
                                      defunc_2_reduce_res_116068;
                                float c12_116116 = x_116114 - y_116115;
                                float x_116117 = defunc_2_reduce_res_116066 *
                                      defunc_2_reduce_res_116070;
                                float b2_116118 = x_116117 - y_116115;
                                float x_116119 = defunc_2_reduce_res_116067 *
                                      defunc_2_reduce_res_116068;
                                float y_116120 = defunc_2_reduce_res_116066 *
                                      defunc_2_reduce_res_116069;
                                float c2_116121 = x_116119 - y_116120;
                                float x_116122 = defunc_2_reduce_res_116066 *
                                      a12_116110;
                                float y_116123 = defunc_2_reduce_res_116067 *
                                      b12_116113;
                                float x_116124 = x_116122 + y_116123;
                                float y_116125 = defunc_2_reduce_res_116068 *
                                      c12_116116;
                                float y_116126 = x_116124 + y_116125;
                                float det_116127 = 1.0F / y_116126;
                                float a12_116128 = a12_116110 * det_116127;
                                float b12_116129 = b12_116113 * det_116127;
                                float c12_116130 = c12_116116 * det_116127;
                                float b2_116131 = b2_116118 * det_116127;
                                float c2_116132 = c2_116121 * det_116127;
                                float defunc_2_reduce_res_116133;
                                float defunc_2_reduce_res_116134;
                                float redout_117115;
                                float redout_117116;
                                
                                redout_117115 = 0.0F;
                                redout_117116 = 0.0F;
                                for (int64_t i_117117 = 0; i_117117 <
                                     t_window_114537; i_117117++) {
                                    bool cond_116142 = sle64(x_116057,
                                                             i_117117);
                                    float defunc_0_f_res_116143;
                                    
                                    if (cond_116142) {
                                        defunc_0_f_res_116143 = 0.0F;
                                    } else {
                                        int64_t i_116144 = add64(x_116061,
                                                                 i_117117);
                                        float x_116145 =
                                              ((float *) mem_117691)[i_117129 *
                                                                     n_114534 +
                                                                     i_116144];
                                        float defunc_0_f_res_f_res_116146 =
                                              1.0F + x_116145;
                                        
                                        defunc_0_f_res_116143 =
                                            defunc_0_f_res_f_res_116146;
                                    }
                                    
                                    float defunc_0_f_res_116147;
                                    
                                    if (cond_116142) {
                                        defunc_0_f_res_116147 = 0.0F;
                                    } else {
                                        int64_t i_116148 = add64(x_116061,
                                                                 i_117117);
                                        float x_116149 =
                                              ((float *) mem_118316)[i_117129 *
                                                                     n_114534 +
                                                                     i_116148];
                                        
                                        defunc_0_f_res_116147 = x_116149;
                                    }
                                    
                                    float x_j_116150 = defunc_0_f_res_116143 -
                                          defunc_0_f_res_116065;
                                    float abs_res_116151 =
                                          (float) fabs(x_j_116150);
                                    float tmp1_116152 = abs_res_116151 /
                                          x_116062;
                                    float x_116153 = tmp1_116152 * tmp1_116152;
                                    float y_116154 = tmp1_116152 * x_116153;
                                    float tmp2_116155 = 1.0F - y_116154;
                                    float x_116156 = tmp2_116155 * tmp2_116155;
                                    float tmp3_116157 = tmp2_116155 * x_116156;
                                    float tmp4_116158 = defunc_0_f_res_116147 *
                                          tmp3_116157;
                                    float defunc_1_f_res_116159 = x_j_116150 *
                                          tmp4_116158;
                                    float defunc_1_f_res_116160 = x_j_116150 *
                                          defunc_1_f_res_116159;
                                    float defunc_0_f_res_116161;
                                    
                                    if (cond_116142) {
                                        defunc_0_f_res_116161 = 0.0F;
                                    } else {
                                        int64_t i_116162 = add64(x_116061,
                                                                 i_117117);
                                        float x_116163 =
                                              ((float *) mem_119129)[i_117129 *
                                                                     n_114534 +
                                                                     i_116162];
                                        
                                        defunc_0_f_res_116161 = x_116163;
                                    }
                                    
                                    float x_116164 = a12_116128 * tmp4_116158;
                                    float y_116165 = b12_116129 *
                                          defunc_1_f_res_116159;
                                    float x_116166 = x_116164 + y_116165;
                                    float y_116167 = c12_116130 *
                                          defunc_1_f_res_116160;
                                    float x_116168 = x_116166 + y_116167;
                                    float defunc_9_fit_fun_res_116169 =
                                          defunc_0_f_res_116161 * x_116168;
                                    float x_116170 = b12_116129 * tmp4_116158;
                                    float y_116171 = b2_116131 *
                                          defunc_1_f_res_116159;
                                    float x_116172 = x_116170 + y_116171;
                                    float y_116173 = c2_116132 *
                                          defunc_1_f_res_116160;
                                    float x_116174 = x_116172 + y_116173;
                                    float defunc_9_slope_fun_res_116175 =
                                          defunc_0_f_res_116161 * x_116174;
                                    float defunc_1_op_res_116137 =
                                          defunc_9_fit_fun_res_116169 +
                                          redout_117115;
                                    float defunc_1_op_res_116140 =
                                          defunc_9_slope_fun_res_116175 +
                                          redout_117116;
                                    float redout_tmp_120553 =
                                          defunc_1_op_res_116137;
                                    float redout_tmp_120554 =
                                          defunc_1_op_res_116140;
                                    
                                    redout_117115 = redout_tmp_120553;
                                    redout_117116 = redout_tmp_120554;
                                }
                                defunc_2_reduce_res_116133 = redout_117115;
                                defunc_2_reduce_res_116134 = redout_117116;
                                ((float *) mem_119324.mem)[i_117129 *
                                                           t_n_m_114591 +
                                                           i_117122] =
                                    defunc_2_reduce_res_116133;
                                ((float *) mem_119328.mem)[i_117129 *
                                                           t_n_m_114591 +
                                                           i_117122] =
                                    defunc_2_reduce_res_116134;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_119416, &mem_119324,
                                         "mem_119324") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_119424, &mem_119328,
                                         "mem_119328") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119328, "mem_119328") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119324, "mem_119324") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119432,
                                     &x_mem_119416, "x_mem_119416") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119440,
                                     &x_mem_119424, "x_mem_119424") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_119424, "x_mem_119424") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_119416, "x_mem_119416") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119809,
                                 &defunc_12_lifted_use_version_res_mem_119432,
                                 "defunc_12_lifted_use_version_res_mem_119432") !=
                    0)
                    return 1;
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119817,
                                 &defunc_12_lifted_use_version_res_mem_119440,
                                 "defunc_12_lifted_use_version_res_mem_119440") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_119440,
                                   "defunc_12_lifted_use_version_res_mem_119440") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_119432,
                                   "defunc_12_lifted_use_version_res_mem_119432") !=
                    0)
                    return 1;
            } else {
                bool match_lit_116178 = (int64_t) 0 == t_degree_114539;
                int64_t binop_y_119471 = (int64_t) 4 * t_window_114537;
                int64_t bytes_119470 = smax64((int64_t) 0, binop_y_119471);
                struct memblock defunc_12_lifted_use_version_res_mem_119793;
                
                defunc_12_lifted_use_version_res_mem_119793.references = NULL;
                
                struct memblock defunc_12_lifted_use_version_res_mem_119801;
                
                defunc_12_lifted_use_version_res_mem_119801.references = NULL;
                if (match_lit_116178) {
                    struct memblock mem_119444;
                    
                    mem_119444.references = NULL;
                    if (memblock_alloc(ctx, &mem_119444, bytes_117942,
                                       "mem_119444")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_120555 = 0; i_120555 < m_114533;
                         i_120555++) {
                        for (int64_t i_120556 = 0; i_120556 < t_n_m_114591;
                             i_120556++) {
                            ((float *) mem_119444.mem)[i_120555 * t_n_m_114591 +
                                                       i_120556] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_119448;
                    
                    mem_119448.references = NULL;
                    if (memblock_alloc(ctx, &mem_119448, bytes_117942,
                                       "mem_119448")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (mem_119472_cached_sizze_120650 <
                        (size_t) bytes_119470) {
                        mem_119472 = realloc(mem_119472, bytes_119470);
                        mem_119472_cached_sizze_120650 = bytes_119470;
                    }
                    for (int64_t i_117145 = 0; i_117145 < m_114533;
                         i_117145++) {
                        int64_t x_116189 = ((int64_t *) mem_117620)[i_117145];
                        
                        for (int64_t i_117141 = 0; i_117141 < t_n_m_114591;
                             i_117141++) {
                            int64_t x_116192 =
                                    ((int64_t *) mem_117941)[i_117145 *
                                                             t_n_m_114591 +
                                                             i_117141];
                            float x_116193 = ((float *) mem_117945)[i_117145 *
                                                                    t_n_m_114591 +
                                                                    i_117141];
                            int64_t min_arg_116194 = mul64(t_jump_114541,
                                                           i_117141);
                            int64_t min_res_116195 = smin64(i_114610,
                                                            min_arg_116194);
                            float defunc_0_f_res_116196 =
                                  sitofp_i64_f32(min_res_116195);
                            float defunc_2_reduce_res_116197;
                            float redout_117133 = 0.0F;
                            
                            for (int64_t i_117135 = 0; i_117135 <
                                 t_window_114537; i_117135++) {
                                bool cond_116203 = sle64(x_116189, i_117135);
                                float defunc_0_f_res_116204;
                                
                                if (cond_116203) {
                                    defunc_0_f_res_116204 = 0.0F;
                                } else {
                                    int64_t i_116205 = add64(x_116192,
                                                             i_117135);
                                    float x_116206 =
                                          ((float *) mem_117691)[i_117145 *
                                                                 n_114534 +
                                                                 i_116205];
                                    float defunc_0_f_res_f_res_116207 = 1.0F +
                                          x_116206;
                                    
                                    defunc_0_f_res_116204 =
                                        defunc_0_f_res_f_res_116207;
                                }
                                
                                float defunc_0_f_res_116208;
                                
                                if (cond_116203) {
                                    defunc_0_f_res_116208 = 0.0F;
                                } else {
                                    int64_t i_116209 = add64(x_116192,
                                                             i_117135);
                                    float x_116210 =
                                          ((float *) mem_118316)[i_117145 *
                                                                 n_114534 +
                                                                 i_116209];
                                    
                                    defunc_0_f_res_116208 = x_116210;
                                }
                                
                                float x_j_116211 = defunc_0_f_res_116204 -
                                      defunc_0_f_res_116196;
                                float abs_res_116212 = (float) fabs(x_j_116211);
                                float tmp1_116213 = abs_res_116212 / x_116193;
                                float x_116214 = tmp1_116213 * tmp1_116213;
                                float y_116215 = tmp1_116213 * x_116214;
                                float tmp2_116216 = 1.0F - y_116215;
                                float x_116217 = tmp2_116216 * tmp2_116216;
                                float tmp3_116218 = tmp2_116216 * x_116217;
                                float tmp4_116219 = defunc_0_f_res_116208 *
                                      tmp3_116218;
                                float defunc_1_op_res_116201 = tmp4_116219 +
                                      redout_117133;
                                
                                ((float *) mem_119472)[i_117135] = tmp4_116219;
                                
                                float redout_tmp_120559 =
                                      defunc_1_op_res_116201;
                                
                                redout_117133 = redout_tmp_120559;
                            }
                            defunc_2_reduce_res_116197 = redout_117133;
                            
                            float a0_116220 = 1.0F / defunc_2_reduce_res_116197;
                            float defunc_2_reduce_res_116221;
                            float redout_117137 = 0.0F;
                            
                            for (int64_t i_117138 = 0; i_117138 <
                                 t_window_114537; i_117138++) {
                                float x_116226 =
                                      ((float *) mem_119472)[i_117138];
                                bool cond_116227 = sle64(x_116189, i_117138);
                                float defunc_0_f_res_116228;
                                
                                if (cond_116227) {
                                    defunc_0_f_res_116228 = 0.0F;
                                } else {
                                    int64_t i_116229 = add64(x_116192,
                                                             i_117138);
                                    float x_116230 =
                                          ((float *) mem_119129)[i_117145 *
                                                                 n_114534 +
                                                                 i_116229];
                                    
                                    defunc_0_f_res_116228 = x_116230;
                                }
                                
                                float x_116231 = a0_116220 * x_116226;
                                float defunc_9_fit_fun_res_116232 =
                                      defunc_0_f_res_116228 * x_116231;
                                float defunc_1_op_res_116224 =
                                      defunc_9_fit_fun_res_116232 +
                                      redout_117137;
                                float redout_tmp_120561 =
                                      defunc_1_op_res_116224;
                                
                                redout_117137 = redout_tmp_120561;
                            }
                            defunc_2_reduce_res_116221 = redout_117137;
                            ((float *) mem_119448.mem)[i_117145 * t_n_m_114591 +
                                                       i_117141] =
                                defunc_2_reduce_res_116221;
                        }
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119793,
                                     &mem_119448, "mem_119448") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119801,
                                     &mem_119444, "mem_119444") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_119448, "mem_119448") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_119444, "mem_119444") != 0)
                        return 1;
                } else {
                    bool match_lit_116235 = (int64_t) 1 == t_degree_114539;
                    int64_t binop_y_119555 = (int64_t) 4 * t_window_114537;
                    int64_t bytes_119554 = smax64((int64_t) 0, binop_y_119555);
                    int64_t binop_y_119673 = (int64_t) 4 * t_window_114537;
                    int64_t bytes_119672 = smax64((int64_t) 0, binop_y_119673);
                    struct memblock x_mem_119777;
                    
                    x_mem_119777.references = NULL;
                    
                    struct memblock x_mem_119785;
                    
                    x_mem_119785.references = NULL;
                    if (match_lit_116235) {
                        struct memblock mem_119507;
                        
                        mem_119507.references = NULL;
                        if (memblock_alloc(ctx, &mem_119507, bytes_117942,
                                           "mem_119507")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_119511;
                        
                        mem_119511.references = NULL;
                        if (memblock_alloc(ctx, &mem_119511, bytes_117942,
                                           "mem_119511")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (mem_119556_cached_sizze_120651 <
                            (size_t) bytes_119554) {
                            mem_119556 = realloc(mem_119556, bytes_119554);
                            mem_119556_cached_sizze_120651 = bytes_119554;
                        }
                        if (mem_119559_cached_sizze_120652 <
                            (size_t) bytes_119554) {
                            mem_119559 = realloc(mem_119559, bytes_119554);
                            mem_119559_cached_sizze_120652 = bytes_119554;
                        }
                        for (int64_t i_117171 = 0; i_117171 < m_114533;
                             i_117171++) {
                            int64_t x_116246 =
                                    ((int64_t *) mem_117620)[i_117171];
                            
                            for (int64_t i_117164 = 0; i_117164 < t_n_m_114591;
                                 i_117164++) {
                                int64_t x_116250 =
                                        ((int64_t *) mem_117941)[i_117171 *
                                                                 t_n_m_114591 +
                                                                 i_117164];
                                float x_116251 =
                                      ((float *) mem_117945)[i_117171 *
                                                             t_n_m_114591 +
                                                             i_117164];
                                int64_t min_arg_116252 = mul64(t_jump_114541,
                                                               i_117164);
                                int64_t min_res_116253 = smin64(i_114610,
                                                                min_arg_116252);
                                float defunc_0_f_res_116254 =
                                      sitofp_i64_f32(min_res_116253);
                                float defunc_2_reduce_res_116277;
                                float defunc_2_reduce_res_116278;
                                float defunc_2_reduce_res_116279;
                                float redout_117149;
                                float redout_117150;
                                float redout_117151;
                                
                                redout_117149 = 0.0F;
                                redout_117150 = 0.0F;
                                redout_117151 = 0.0F;
                                for (int64_t i_117154 = 0; i_117154 <
                                     t_window_114537; i_117154++) {
                                    bool cond_116292 = sle64(x_116246,
                                                             i_117154);
                                    float defunc_0_f_res_116293;
                                    
                                    if (cond_116292) {
                                        defunc_0_f_res_116293 = 0.0F;
                                    } else {
                                        int64_t i_116294 = add64(x_116250,
                                                                 i_117154);
                                        float x_116295 =
                                              ((float *) mem_117691)[i_117171 *
                                                                     n_114534 +
                                                                     i_116294];
                                        float defunc_0_f_res_f_res_116296 =
                                              1.0F + x_116295;
                                        
                                        defunc_0_f_res_116293 =
                                            defunc_0_f_res_f_res_116296;
                                    }
                                    
                                    float defunc_0_f_res_116297;
                                    
                                    if (cond_116292) {
                                        defunc_0_f_res_116297 = 0.0F;
                                    } else {
                                        int64_t i_116298 = add64(x_116250,
                                                                 i_117154);
                                        float x_116299 =
                                              ((float *) mem_118316)[i_117171 *
                                                                     n_114534 +
                                                                     i_116298];
                                        
                                        defunc_0_f_res_116297 = x_116299;
                                    }
                                    
                                    float x_j_116300 = defunc_0_f_res_116293 -
                                          defunc_0_f_res_116254;
                                    float abs_res_116301 =
                                          (float) fabs(x_j_116300);
                                    float tmp1_116302 = abs_res_116301 /
                                          x_116251;
                                    float x_116303 = tmp1_116302 * tmp1_116302;
                                    float y_116304 = tmp1_116302 * x_116303;
                                    float tmp2_116305 = 1.0F - y_116304;
                                    float x_116306 = tmp2_116305 * tmp2_116305;
                                    float tmp3_116307 = tmp2_116305 * x_116306;
                                    float tmp4_116308 = defunc_0_f_res_116297 *
                                          tmp3_116307;
                                    float defunc_1_f_res_116309 = x_j_116300 *
                                          tmp4_116308;
                                    float defunc_1_f_res_116310 = x_j_116300 *
                                          defunc_1_f_res_116309;
                                    float defunc_1_op_res_116284 = tmp4_116308 +
                                          redout_117149;
                                    float defunc_1_op_res_116287 =
                                          defunc_1_f_res_116309 + redout_117150;
                                    float defunc_1_op_res_116290 =
                                          defunc_1_f_res_116310 + redout_117151;
                                    
                                    ((float *) mem_119556)[i_117154] =
                                        defunc_1_f_res_116309;
                                    ((float *) mem_119559)[i_117154] =
                                        tmp4_116308;
                                    
                                    float redout_tmp_120566 =
                                          defunc_1_op_res_116284;
                                    float redout_tmp_120567 =
                                          defunc_1_op_res_116287;
                                    float redout_tmp_120568 =
                                          defunc_1_op_res_116290;
                                    
                                    redout_117149 = redout_tmp_120566;
                                    redout_117150 = redout_tmp_120567;
                                    redout_117151 = redout_tmp_120568;
                                }
                                defunc_2_reduce_res_116277 = redout_117149;
                                defunc_2_reduce_res_116278 = redout_117150;
                                defunc_2_reduce_res_116279 = redout_117151;
                                
                                float x_116316 = defunc_2_reduce_res_116277 *
                                      defunc_2_reduce_res_116279;
                                float y_116317 = defunc_2_reduce_res_116278 *
                                      defunc_2_reduce_res_116278;
                                float y_116318 = x_116316 - y_116317;
                                float det1_116319 = 1.0F / y_116318;
                                float a11_116320 = defunc_2_reduce_res_116279 *
                                      det1_116319;
                                float negate_arg_116321 =
                                      defunc_2_reduce_res_116278 * det1_116319;
                                float b11_116322 = 0.0F - negate_arg_116321;
                                float c11_116323 = defunc_2_reduce_res_116277 *
                                      det1_116319;
                                float defunc_2_reduce_res_116324;
                                float defunc_2_reduce_res_116325;
                                float redout_117157;
                                float redout_117158;
                                
                                redout_117157 = 0.0F;
                                redout_117158 = 0.0F;
                                for (int64_t i_117159 = 0; i_117159 <
                                     t_window_114537; i_117159++) {
                                    float x_116333 =
                                          ((float *) mem_119559)[i_117159];
                                    float x_116334 =
                                          ((float *) mem_119556)[i_117159];
                                    bool cond_116335 = sle64(x_116246,
                                                             i_117159);
                                    float defunc_0_f_res_116336;
                                    
                                    if (cond_116335) {
                                        defunc_0_f_res_116336 = 0.0F;
                                    } else {
                                        int64_t i_116337 = add64(x_116250,
                                                                 i_117159);
                                        float x_116338 =
                                              ((float *) mem_119129)[i_117171 *
                                                                     n_114534 +
                                                                     i_116337];
                                        
                                        defunc_0_f_res_116336 = x_116338;
                                    }
                                    
                                    float x_116339 = a11_116320 * x_116333;
                                    float y_116340 = b11_116322 * x_116334;
                                    float x_116341 = x_116339 + y_116340;
                                    float defunc_9_fit_fun_res_116342 =
                                          defunc_0_f_res_116336 * x_116341;
                                    float x_116343 = b11_116322 * x_116333;
                                    float y_116344 = c11_116323 * x_116334;
                                    float x_116345 = x_116343 + y_116344;
                                    float defunc_9_slope_fun_res_116346 =
                                          defunc_0_f_res_116336 * x_116345;
                                    float defunc_1_op_res_116328 =
                                          defunc_9_fit_fun_res_116342 +
                                          redout_117157;
                                    float defunc_1_op_res_116331 =
                                          defunc_9_slope_fun_res_116346 +
                                          redout_117158;
                                    float redout_tmp_120571 =
                                          defunc_1_op_res_116328;
                                    float redout_tmp_120572 =
                                          defunc_1_op_res_116331;
                                    
                                    redout_117157 = redout_tmp_120571;
                                    redout_117158 = redout_tmp_120572;
                                }
                                defunc_2_reduce_res_116324 = redout_117157;
                                defunc_2_reduce_res_116325 = redout_117158;
                                ((float *) mem_119507.mem)[i_117171 *
                                                           t_n_m_114591 +
                                                           i_117164] =
                                    defunc_2_reduce_res_116324;
                                ((float *) mem_119511.mem)[i_117171 *
                                                           t_n_m_114591 +
                                                           i_117164] =
                                    defunc_2_reduce_res_116325;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_119777, &mem_119507,
                                         "mem_119507") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_119785, &mem_119511,
                                         "mem_119511") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119511, "mem_119511") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119507, "mem_119507") != 0)
                            return 1;
                    } else {
                        struct memblock mem_119625;
                        
                        mem_119625.references = NULL;
                        if (memblock_alloc(ctx, &mem_119625, bytes_117942,
                                           "mem_119625")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_119629;
                        
                        mem_119629.references = NULL;
                        if (memblock_alloc(ctx, &mem_119629, bytes_117942,
                                           "mem_119629")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (mem_119674_cached_sizze_120653 <
                            (size_t) bytes_119672) {
                            mem_119674 = realloc(mem_119674, bytes_119672);
                            mem_119674_cached_sizze_120653 = bytes_119672;
                        }
                        if (mem_119677_cached_sizze_120654 <
                            (size_t) bytes_119672) {
                            mem_119677 = realloc(mem_119677, bytes_119672);
                            mem_119677_cached_sizze_120654 = bytes_119672;
                        }
                        if (mem_119704_cached_sizze_120655 <
                            (size_t) bytes_119672) {
                            mem_119704 = realloc(mem_119704, bytes_119672);
                            mem_119704_cached_sizze_120655 = bytes_119672;
                        }
                        if (mem_119707_cached_sizze_120656 <
                            (size_t) bytes_119672) {
                            mem_119707 = realloc(mem_119707, bytes_119672);
                            mem_119707_cached_sizze_120656 = bytes_119672;
                        }
                        for (int64_t i_117207 = 0; i_117207 < m_114533;
                             i_117207++) {
                            int64_t x_116357 =
                                    ((int64_t *) mem_117620)[i_117207];
                            
                            for (int64_t i_117200 = 0; i_117200 < t_n_m_114591;
                                 i_117200++) {
                                int64_t x_116361 =
                                        ((int64_t *) mem_117941)[i_117207 *
                                                                 t_n_m_114591 +
                                                                 i_117200];
                                float x_116362 =
                                      ((float *) mem_117945)[i_117207 *
                                                             t_n_m_114591 +
                                                             i_117200];
                                int64_t min_arg_116363 = mul64(t_jump_114541,
                                                               i_117200);
                                int64_t min_res_116364 = smin64(i_114610,
                                                                min_arg_116363);
                                float defunc_0_f_res_116365 =
                                      sitofp_i64_f32(min_res_116364);
                                
                                for (int64_t i_117178 = 0; i_117178 <
                                     t_window_114537; i_117178++) {
                                    bool cond_116369 = sle64(x_116357,
                                                             i_117178);
                                    float defunc_0_f_res_116370;
                                    
                                    if (cond_116369) {
                                        defunc_0_f_res_116370 = 0.0F;
                                    } else {
                                        int64_t i_116371 = add64(x_116361,
                                                                 i_117178);
                                        float x_116372 =
                                              ((float *) mem_117691)[i_117207 *
                                                                     n_114534 +
                                                                     i_116371];
                                        float defunc_0_f_res_f_res_116373 =
                                              1.0F + x_116372;
                                        
                                        defunc_0_f_res_116370 =
                                            defunc_0_f_res_f_res_116373;
                                    }
                                    
                                    float defunc_0_f_res_116374;
                                    
                                    if (cond_116369) {
                                        defunc_0_f_res_116374 = 0.0F;
                                    } else {
                                        int64_t i_116375 = add64(x_116361,
                                                                 i_117178);
                                        float x_116376 =
                                              ((float *) mem_118316)[i_117207 *
                                                                     n_114534 +
                                                                     i_116375];
                                        
                                        defunc_0_f_res_116374 = x_116376;
                                    }
                                    
                                    float x_j_116377 = defunc_0_f_res_116370 -
                                          defunc_0_f_res_116365;
                                    float abs_res_116378 =
                                          (float) fabs(x_j_116377);
                                    float tmp1_116379 = abs_res_116378 /
                                          x_116362;
                                    float x_116380 = tmp1_116379 * tmp1_116379;
                                    float y_116381 = tmp1_116379 * x_116380;
                                    float tmp2_116382 = 1.0F - y_116381;
                                    float x_116383 = tmp2_116382 * tmp2_116382;
                                    float tmp3_116384 = tmp2_116382 * x_116383;
                                    float tmp4_116385 = defunc_0_f_res_116374 *
                                          tmp3_116384;
                                    
                                    ((float *) mem_119674)[i_117178] =
                                        x_j_116377;
                                    ((float *) mem_119677)[i_117178] =
                                        tmp4_116385;
                                }
                                
                                float defunc_2_reduce_res_116392;
                                float defunc_2_reduce_res_116393;
                                float defunc_2_reduce_res_116394;
                                float defunc_2_reduce_res_116395;
                                float defunc_2_reduce_res_116396;
                                float redout_117183;
                                float redout_117184;
                                float redout_117185;
                                float redout_117186;
                                float redout_117187;
                                
                                redout_117183 = 0.0F;
                                redout_117184 = 0.0F;
                                redout_117185 = 0.0F;
                                redout_117186 = 0.0F;
                                redout_117187 = 0.0F;
                                for (int64_t i_117190 = 0; i_117190 <
                                     t_window_114537; i_117190++) {
                                    float x_116414 =
                                          ((float *) mem_119674)[i_117190];
                                    float x_116415 =
                                          ((float *) mem_119677)[i_117190];
                                    float defunc_1_f_res_116416 = x_116414 *
                                          x_116415;
                                    float defunc_1_f_res_116417 = x_116414 *
                                          defunc_1_f_res_116416;
                                    float defunc_1_f_res_116418 = x_116414 *
                                          defunc_1_f_res_116417;
                                    float defunc_1_f_res_116419 = x_116414 *
                                          defunc_1_f_res_116418;
                                    float defunc_1_op_res_116401 = x_116415 +
                                          redout_117183;
                                    float defunc_1_op_res_116404 =
                                          defunc_1_f_res_116416 + redout_117184;
                                    float defunc_1_op_res_116407 =
                                          defunc_1_f_res_116417 + redout_117185;
                                    float defunc_1_op_res_116410 =
                                          defunc_1_f_res_116418 + redout_117186;
                                    float defunc_1_op_res_116413 =
                                          defunc_1_f_res_116419 + redout_117187;
                                    
                                    ((float *) mem_119704)[i_117190] =
                                        defunc_1_f_res_116417;
                                    ((float *) mem_119707)[i_117190] =
                                        defunc_1_f_res_116416;
                                    
                                    float redout_tmp_120579 =
                                          defunc_1_op_res_116401;
                                    float redout_tmp_120580 =
                                          defunc_1_op_res_116404;
                                    float redout_tmp_120581 =
                                          defunc_1_op_res_116407;
                                    float redout_tmp_120582 =
                                          defunc_1_op_res_116410;
                                    float redout_tmp_120583 =
                                          defunc_1_op_res_116413;
                                    
                                    redout_117183 = redout_tmp_120579;
                                    redout_117184 = redout_tmp_120580;
                                    redout_117185 = redout_tmp_120581;
                                    redout_117186 = redout_tmp_120582;
                                    redout_117187 = redout_tmp_120583;
                                }
                                defunc_2_reduce_res_116392 = redout_117183;
                                defunc_2_reduce_res_116393 = redout_117184;
                                defunc_2_reduce_res_116394 = redout_117185;
                                defunc_2_reduce_res_116395 = redout_117186;
                                defunc_2_reduce_res_116396 = redout_117187;
                                
                                float x_116427 = defunc_2_reduce_res_116394 *
                                      defunc_2_reduce_res_116396;
                                float y_116428 = defunc_2_reduce_res_116395 *
                                      defunc_2_reduce_res_116395;
                                float a12_116429 = x_116427 - y_116428;
                                float x_116430 = defunc_2_reduce_res_116394 *
                                      defunc_2_reduce_res_116395;
                                float y_116431 = defunc_2_reduce_res_116393 *
                                      defunc_2_reduce_res_116396;
                                float b12_116432 = x_116430 - y_116431;
                                float x_116433 = defunc_2_reduce_res_116393 *
                                      defunc_2_reduce_res_116395;
                                float y_116434 = defunc_2_reduce_res_116394 *
                                      defunc_2_reduce_res_116394;
                                float c12_116435 = x_116433 - y_116434;
                                float x_116436 = defunc_2_reduce_res_116392 *
                                      defunc_2_reduce_res_116396;
                                float b2_116437 = x_116436 - y_116434;
                                float x_116438 = defunc_2_reduce_res_116393 *
                                      defunc_2_reduce_res_116394;
                                float y_116439 = defunc_2_reduce_res_116392 *
                                      defunc_2_reduce_res_116395;
                                float c2_116440 = x_116438 - y_116439;
                                float x_116441 = defunc_2_reduce_res_116392 *
                                      a12_116429;
                                float y_116442 = defunc_2_reduce_res_116393 *
                                      b12_116432;
                                float x_116443 = x_116441 + y_116442;
                                float y_116444 = defunc_2_reduce_res_116394 *
                                      c12_116435;
                                float y_116445 = x_116443 + y_116444;
                                float det_116446 = 1.0F / y_116445;
                                float a12_116447 = a12_116429 * det_116446;
                                float b12_116448 = b12_116432 * det_116446;
                                float c12_116449 = c12_116435 * det_116446;
                                float b2_116450 = b2_116437 * det_116446;
                                float c2_116451 = c2_116440 * det_116446;
                                float defunc_2_reduce_res_116452;
                                float defunc_2_reduce_res_116453;
                                float redout_117193;
                                float redout_117194;
                                
                                redout_117193 = 0.0F;
                                redout_117194 = 0.0F;
                                for (int64_t i_117195 = 0; i_117195 <
                                     t_window_114537; i_117195++) {
                                    float x_116461 =
                                          ((float *) mem_119677)[i_117195];
                                    float x_116462 =
                                          ((float *) mem_119707)[i_117195];
                                    float x_116463 =
                                          ((float *) mem_119704)[i_117195];
                                    bool cond_116464 = sle64(x_116357,
                                                             i_117195);
                                    float defunc_0_f_res_116465;
                                    
                                    if (cond_116464) {
                                        defunc_0_f_res_116465 = 0.0F;
                                    } else {
                                        int64_t i_116466 = add64(x_116361,
                                                                 i_117195);
                                        float x_116467 =
                                              ((float *) mem_119129)[i_117207 *
                                                                     n_114534 +
                                                                     i_116466];
                                        
                                        defunc_0_f_res_116465 = x_116467;
                                    }
                                    
                                    float x_116468 = a12_116447 * x_116461;
                                    float y_116469 = b12_116448 * x_116462;
                                    float x_116470 = x_116468 + y_116469;
                                    float y_116471 = c12_116449 * x_116463;
                                    float x_116472 = x_116470 + y_116471;
                                    float defunc_9_fit_fun_res_116473 =
                                          defunc_0_f_res_116465 * x_116472;
                                    float x_116474 = b12_116448 * x_116461;
                                    float y_116475 = b2_116450 * x_116462;
                                    float x_116476 = x_116474 + y_116475;
                                    float y_116477 = c2_116451 * x_116463;
                                    float x_116478 = x_116476 + y_116477;
                                    float defunc_9_slope_fun_res_116479 =
                                          defunc_0_f_res_116465 * x_116478;
                                    float defunc_1_op_res_116456 =
                                          defunc_9_fit_fun_res_116473 +
                                          redout_117193;
                                    float defunc_1_op_res_116459 =
                                          defunc_9_slope_fun_res_116479 +
                                          redout_117194;
                                    float redout_tmp_120586 =
                                          defunc_1_op_res_116456;
                                    float redout_tmp_120587 =
                                          defunc_1_op_res_116459;
                                    
                                    redout_117193 = redout_tmp_120586;
                                    redout_117194 = redout_tmp_120587;
                                }
                                defunc_2_reduce_res_116452 = redout_117193;
                                defunc_2_reduce_res_116453 = redout_117194;
                                ((float *) mem_119625.mem)[i_117207 *
                                                           t_n_m_114591 +
                                                           i_117200] =
                                    defunc_2_reduce_res_116452;
                                ((float *) mem_119629.mem)[i_117207 *
                                                           t_n_m_114591 +
                                                           i_117200] =
                                    defunc_2_reduce_res_116453;
                            }
                        }
                        if (memblock_set(ctx, &x_mem_119777, &mem_119625,
                                         "mem_119625") != 0)
                            return 1;
                        if (memblock_set(ctx, &x_mem_119785, &mem_119629,
                                         "mem_119629") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119629, "mem_119629") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_119625, "mem_119625") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119793,
                                     &x_mem_119777, "x_mem_119777") != 0)
                        return 1;
                    if (memblock_set(ctx,
                                     &defunc_12_lifted_use_version_res_mem_119801,
                                     &x_mem_119785, "x_mem_119785") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_119785, "x_mem_119785") != 0)
                        return 1;
                    if (memblock_unref(ctx, &x_mem_119777, "x_mem_119777") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119809,
                                 &defunc_12_lifted_use_version_res_mem_119793,
                                 "defunc_12_lifted_use_version_res_mem_119793") !=
                    0)
                    return 1;
                if (memblock_set(ctx, &defunc_11_loess_l_res_mem_119817,
                                 &defunc_12_lifted_use_version_res_mem_119801,
                                 "defunc_12_lifted_use_version_res_mem_119801") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_119801,
                                   "defunc_12_lifted_use_version_res_mem_119801") !=
                    0)
                    return 1;
                if (memblock_unref(ctx,
                                   &defunc_12_lifted_use_version_res_mem_119793,
                                   "defunc_12_lifted_use_version_res_mem_119793") !=
                    0)
                    return 1;
            }
            
            struct memblock trend_l_mem_119869;
            
            trend_l_mem_119869.references = NULL;
            if (cond_114942) {
                bool zzero_116483 = t_jump_114541 == (int64_t) 0;
                bool nonzzero_116484 = !zzero_116483;
                bool nonzzero_cert_116485;
                
                if (!nonzzero_116484) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  stl.fut:55:27-34\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:300:23-69\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:299:15-301:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                    if (memblock_unref(ctx, &trend_l_mem_119869,
                                       "trend_l_mem_119869") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119817,
                                       "defunc_11_loess_l_res_mem_119817") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119809,
                                       "defunc_11_loess_l_res_mem_119809") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_119085, "mem_119085") != 0)
                        return 1;
                    if (memblock_unref(ctx, &L_l_mem_119081,
                                       "L_l_mem_119081") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119029,
                                       "defunc_11_loess_l_res_mem_119029") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119021,
                                       "defunc_11_loess_l_res_mem_119021") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118109,
                                       "mem_param_118109") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118101,
                                       "mem_param_118101") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119885,
                                       "loopres_mem_119885") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119877,
                                       "loopres_mem_119877") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118087,
                                       "mem_param_118087") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118079,
                                       "mem_param_118079") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118071,
                                       "mem_param_118071") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120220,
                                       "stl_res_mem_120220") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120212,
                                       "stl_res_mem_120212") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120204,
                                       "stl_res_mem_120204") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120375,
                                       "out_mem_120375") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120374,
                                       "out_mem_120374") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120373,
                                       "out_mem_120373") != 0)
                        return 1;
                    return 1;
                }
                
                int64_t y_116486 = sub64(t_n_m_114591, (int64_t) 1);
                struct memblock mem_119821;
                
                mem_119821.references = NULL;
                if (memblock_alloc(ctx, &mem_119821, bytes_117688,
                                   "mem_119821")) {
                    err = 1;
                    goto cleanup;
                }
                for (int64_t i_117216 = 0; i_117216 < m_114533; i_117216++) {
                    for (int64_t i_117212 = 0; i_117212 < n_114534;
                         i_117212++) {
                        int64_t m_v_116492 = sdiv64(i_117212, t_jump_114541);
                        bool cond_116493 = m_v_116492 == y_116486;
                        int64_t j_116494;
                        
                        if (cond_116493) {
                            int64_t j_t_res_116495 = sub64(m_v_116492,
                                                           (int64_t) 1);
                            
                            j_116494 = j_t_res_116495;
                        } else {
                            j_116494 = m_v_116492;
                        }
                        
                        int64_t min_arg_116496 = mul64(t_jump_114541, j_116494);
                        int64_t min_res_116497 = smin64(i_114610,
                                                        min_arg_116496);
                        int64_t defunc_0_m_fun_arg_116498 = add64((int64_t) 1,
                                                                  j_116494);
                        int64_t min_arg_116499 = mul64(t_jump_114541,
                                                       defunc_0_m_fun_arg_116498);
                        int64_t min_res_116500 = smin64(i_114610,
                                                        min_arg_116499);
                        int64_t i64_arg_116501 = sub64(min_res_116500,
                                                       min_res_116497);
                        float i64_res_116502 = sitofp_i64_f32(i64_arg_116501);
                        int64_t i64_arg_116503 = sub64(i_117212,
                                                       min_res_116497);
                        float i64_res_116504 = sitofp_i64_f32(i64_arg_116503);
                        float u_116505 = i64_res_116504 / i64_res_116502;
                        float u2_116506 = u_116505 * u_116505;
                        float u3_116507 = u_116505 * u2_116506;
                        float x_116508 = 2.0F * u3_116507;
                        float y_116509 = 3.0F * u2_116506;
                        float x_116510 = x_116508 - y_116509;
                        float x_116511 = 1.0F + x_116510;
                        bool x_116512 = sle64((int64_t) 0, j_116494);
                        bool y_116513 = slt64(j_116494, t_n_m_114591);
                        bool bounds_check_116514 = x_116512 && y_116513;
                        bool index_certs_116515;
                        
                        if (!bounds_check_116514) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", j_116494,
                                          "] out of bounds for array of shape [",
                                          t_n_m_114591, "].",
                                          "-> #0  stl.fut:63:41-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:300:23-69\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:299:15-301:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_119821,
                                               "mem_119821") != 0)
                                return 1;
                            if (memblock_unref(ctx, &trend_l_mem_119869,
                                               "trend_l_mem_119869") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119817,
                                               "defunc_11_loess_l_res_mem_119817") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119809,
                                               "defunc_11_loess_l_res_mem_119809") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_119085,
                                               "mem_119085") != 0)
                                return 1;
                            if (memblock_unref(ctx, &L_l_mem_119081,
                                               "L_l_mem_119081") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119029,
                                               "defunc_11_loess_l_res_mem_119029") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119021,
                                               "defunc_11_loess_l_res_mem_119021") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_116516 =
                              ((float *) defunc_11_loess_l_res_mem_119809.mem)[i_117216 *
                                                                               t_n_m_114591 +
                                                                               j_116494];
                        float x_116517 = x_116511 * y_116516;
                        float x_116518 = y_116509 - x_116508;
                        bool x_116519 = sle64((int64_t) 0,
                                              defunc_0_m_fun_arg_116498);
                        bool y_116520 = slt64(defunc_0_m_fun_arg_116498,
                                              t_n_m_114591);
                        bool bounds_check_116521 = x_116519 && y_116520;
                        bool index_certs_116522;
                        
                        if (!bounds_check_116521) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", defunc_0_m_fun_arg_116498,
                                          "] out of bounds for array of shape [",
                                          t_n_m_114591, "].",
                                          "-> #0  stl.fut:64:41-51\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:300:23-69\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:299:15-301:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &mem_119821,
                                               "mem_119821") != 0)
                                return 1;
                            if (memblock_unref(ctx, &trend_l_mem_119869,
                                               "trend_l_mem_119869") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119817,
                                               "defunc_11_loess_l_res_mem_119817") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119809,
                                               "defunc_11_loess_l_res_mem_119809") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_119085,
                                               "mem_119085") != 0)
                                return 1;
                            if (memblock_unref(ctx, &L_l_mem_119081,
                                               "L_l_mem_119081") != 0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119029,
                                               "defunc_11_loess_l_res_mem_119029") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx,
                                               &defunc_11_loess_l_res_mem_119021,
                                               "defunc_11_loess_l_res_mem_119021") !=
                                0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float y_116523 =
                              ((float *) defunc_11_loess_l_res_mem_119809.mem)[i_117216 *
                                                                               t_n_m_114591 +
                                                                               defunc_0_m_fun_arg_116498];
                        float y_116524 = x_116518 * y_116523;
                        float x_116525 = x_116517 + y_116524;
                        float y_116526 = 2.0F * u2_116506;
                        float x_116527 = u3_116507 - y_116526;
                        float x_116528 = u_116505 + x_116527;
                        float y_116529 =
                              ((float *) defunc_11_loess_l_res_mem_119817.mem)[i_117216 *
                                                                               t_n_m_114591 +
                                                                               j_116494];
                        float x_116530 = x_116528 * y_116529;
                        float y_116531 = i64_res_116502 * x_116530;
                        float x_116532 = x_116525 + y_116531;
                        float x_116533 = u3_116507 - u2_116506;
                        float y_116534 =
                              ((float *) defunc_11_loess_l_res_mem_119817.mem)[i_117216 *
                                                                               t_n_m_114591 +
                                                                               defunc_0_m_fun_arg_116498];
                        float x_116535 = x_116533 * y_116534;
                        float y_116536 = i64_res_116502 * x_116535;
                        float defunc_0_f_res_116537 = x_116532 + y_116536;
                        
                        ((float *) mem_119821.mem)[i_117216 * n_114534 +
                                                   i_117212] =
                            defunc_0_f_res_116537;
                    }
                }
                if (memblock_set(ctx, &trend_l_mem_119869, &mem_119821,
                                 "mem_119821") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_119821, "mem_119821") != 0)
                    return 1;
            } else {
                bool dim_match_116539 = n_114534 == t_n_m_114591;
                bool empty_or_match_cert_116540;
                
                if (!dim_match_116539) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (", m_114533,
                                  ", ", t_n_m_114591,
                                  ") cannot match shape of type `[", m_114533,
                                  "][", n_114534, "]t`.",
                                  "-> #0  stl.fut:303:15-36\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
                    if (memblock_unref(ctx, &trend_l_mem_119869,
                                       "trend_l_mem_119869") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119817,
                                       "defunc_11_loess_l_res_mem_119817") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119809,
                                       "defunc_11_loess_l_res_mem_119809") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_119085, "mem_119085") != 0)
                        return 1;
                    if (memblock_unref(ctx, &L_l_mem_119081,
                                       "L_l_mem_119081") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119029,
                                       "defunc_11_loess_l_res_mem_119029") != 0)
                        return 1;
                    if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119021,
                                       "defunc_11_loess_l_res_mem_119021") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118109,
                                       "mem_param_118109") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118101,
                                       "mem_param_118101") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119885,
                                       "loopres_mem_119885") != 0)
                        return 1;
                    if (memblock_unref(ctx, &loopres_mem_119877,
                                       "loopres_mem_119877") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118087,
                                       "mem_param_118087") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118079,
                                       "mem_param_118079") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_118071,
                                       "mem_param_118071") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120220,
                                       "stl_res_mem_120220") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120212,
                                       "stl_res_mem_120212") != 0)
                        return 1;
                    if (memblock_unref(ctx, &stl_res_mem_120204,
                                       "stl_res_mem_120204") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120375,
                                       "out_mem_120375") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120374,
                                       "out_mem_120374") != 0)
                        return 1;
                    if (memblock_unref(ctx, &out_mem_120373,
                                       "out_mem_120373") != 0)
                        return 1;
                    return 1;
                }
                if (memblock_set(ctx, &trend_l_mem_119869,
                                 &defunc_11_loess_l_res_mem_119809,
                                 "defunc_11_loess_l_res_mem_119809") != 0)
                    return 1;
            }
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119809,
                               "defunc_11_loess_l_res_mem_119809") != 0)
                return 1;
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119817,
                               "defunc_11_loess_l_res_mem_119817") != 0)
                return 1;
            
            int64_t ctx_param_ext_tmp_120436 = trend_l_ixfn_119865;
            int64_t ctx_param_ext_tmp_120437 = trend_l_ixfn_119866;
            struct memblock mem_param_tmp_120438;
            
            mem_param_tmp_120438.references = NULL;
            if (memblock_set(ctx, &mem_param_tmp_120438, &mem_119085,
                             "mem_119085") != 0)
                return 1;
            
            struct memblock mem_param_tmp_120439;
            
            mem_param_tmp_120439.references = NULL;
            if (memblock_set(ctx, &mem_param_tmp_120439, &trend_l_mem_119869,
                             "trend_l_mem_119869") != 0)
                return 1;
            ctx_param_ext_118103 = ctx_param_ext_tmp_120436;
            ctx_param_ext_118105 = ctx_param_ext_tmp_120437;
            if (memblock_set(ctx, &mem_param_118101, &mem_param_tmp_120438,
                             "mem_param_tmp_120438") != 0)
                return 1;
            if (memblock_set(ctx, &mem_param_118109, &mem_param_tmp_120439,
                             "mem_param_tmp_120439") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_tmp_120439,
                               "mem_param_tmp_120439") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_tmp_120438,
                               "mem_param_tmp_120438") != 0)
                return 1;
            if (memblock_unref(ctx, &trend_l_mem_119869,
                               "trend_l_mem_119869") != 0)
                return 1;
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119817,
                               "defunc_11_loess_l_res_mem_119817") != 0)
                return 1;
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119809,
                               "defunc_11_loess_l_res_mem_119809") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_119085, "mem_119085") != 0)
                return 1;
            if (memblock_unref(ctx, &L_l_mem_119081, "L_l_mem_119081") != 0)
                return 1;
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119029,
                               "defunc_11_loess_l_res_mem_119029") != 0)
                return 1;
            if (memblock_unref(ctx, &defunc_11_loess_l_res_mem_119021,
                               "defunc_11_loess_l_res_mem_119021") != 0)
                return 1;
        }
        loopres_ixfn_119879 = ctx_param_ext_118103;
        loopres_ixfn_119881 = ctx_param_ext_118105;
        if (memblock_set(ctx, &loopres_mem_119877, &mem_param_118101,
                         "mem_param_118101") != 0)
            return 1;
        if (memblock_set(ctx, &loopres_mem_119885, &mem_param_118109,
                         "mem_param_118109") != 0)
            return 1;
        
        bool cond_116542 = slt64(i_outer_115022, y_114943);
        int64_t sizze_116543;
        
        if (cond_116542) {
            sizze_116543 = n_114534;
        } else {
            sizze_116543 = loopz2081Uz2085Uz2089U_115023;
        }
        
        int64_t weights_l_ixfn_120191;
        
        if (cond_116542) {
            weights_l_ixfn_120191 = m_114533;
        } else {
            weights_l_ixfn_120191 = ctx_param_ext_118080;
        }
        
        int64_t weights_l_ixfn_120192;
        
        if (cond_116542) {
            weights_l_ixfn_120192 = n_114534;
        } else {
            weights_l_ixfn_120192 = ctx_param_ext_118081;
        }
        
        int64_t weights_l_ixfn_120193;
        
        if (cond_116542) {
            weights_l_ixfn_120193 = n_114534;
        } else {
            weights_l_ixfn_120193 = ctx_param_ext_118083;
        }
        
        int64_t weights_l_ixfn_120194;
        
        if (cond_116542) {
            weights_l_ixfn_120194 = (int64_t) 1;
        } else {
            weights_l_ixfn_120194 = ctx_param_ext_118085;
        }
        
        int64_t weights_l_ixfn_120195;
        
        if (cond_116542) {
            weights_l_ixfn_120195 = (int64_t) 0;
        } else {
            weights_l_ixfn_120195 = ctx_param_ext_118082;
        }
        
        struct memblock weights_l_mem_120196;
        
        weights_l_mem_120196.references = NULL;
        if (cond_116542) {
            if (mem_119889_cached_sizze_120657 < (size_t) bytes_117688) {
                mem_119889 = realloc(mem_119889, bytes_117688);
                mem_119889_cached_sizze_120657 = bytes_117688;
            }
            for (int64_t i_117224 = 0; i_117224 < m_114533; i_117224++) {
                for (int64_t i_117220 = 0; i_117220 < n_114534; i_117220++) {
                    float x_116550 = ((float *) Y_mem_117613.mem)[i_117224 *
                                                                  n_114534 +
                                                                  i_117220];
                    float x_116551 =
                          ((float *) loopres_mem_119877.mem)[i_117224 *
                                                             n_114534 +
                                                             i_117220];
                    float x_116552 =
                          ((float *) loopres_mem_119885.mem)[i_117224 *
                                                             loopres_ixfn_119881 +
                                                             i_117220];
                    float x_116553 = x_116550 - x_116551;
                    float defunc_2_f_res_116554 = x_116553 - x_116552;
                    bool isnan_res_116555;
                    
                    isnan_res_116555 = futrts_isnan32(defunc_2_f_res_116554);
                    
                    float defunc_0_f_res_116556;
                    
                    if (isnan_res_116555) {
                        defunc_0_f_res_116556 = NAN;
                    } else {
                        float abs_res_116557 =
                              (float) fabs(defunc_2_f_res_116554);
                        
                        defunc_0_f_res_116556 = abs_res_116557;
                    }
                    ((float *) mem_119889)[i_117224 * n_114534 + i_117220] =
                        defunc_0_f_res_116556;
                }
            }
            if (mem_119933_cached_sizze_120658 < (size_t) bytes_117688) {
                mem_119933 = realloc(mem_119933, bytes_117688);
                mem_119933_cached_sizze_120658 = bytes_117688;
            }
            for (int64_t i_117232 = 0; i_117232 < m_114533; i_117232++) {
                for (int64_t i_117228 = 0; i_117228 < n_114534; i_117228++) {
                    int64_t x_116563 = ((int64_t *) mem_117617)[i_117232 *
                                                                n_114534 +
                                                                i_117228];
                    bool cond_116564 = sle64((int64_t) 0, x_116563);
                    float defunc_0_f_res_116565;
                    
                    if (cond_116564) {
                        bool y_116566 = slt64(x_116563, n_114534);
                        bool bounds_check_116567 = cond_116564 && y_116566;
                        bool index_certs_116568;
                        
                        if (!bounds_check_116567) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", x_116563,
                                          "] out of bounds for array of shape [",
                                          n_114534, "].",
                                          "-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:330:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:328:13-331:35\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
                            if (memblock_unref(ctx, &weights_l_mem_120196,
                                               "weights_l_mem_120196") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118109,
                                               "mem_param_118109") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118101,
                                               "mem_param_118101") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119885,
                                               "loopres_mem_119885") != 0)
                                return 1;
                            if (memblock_unref(ctx, &loopres_mem_119877,
                                               "loopres_mem_119877") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118087,
                                               "mem_param_118087") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118079,
                                               "mem_param_118079") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_118071,
                                               "mem_param_118071") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120220,
                                               "stl_res_mem_120220") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120212,
                                               "stl_res_mem_120212") != 0)
                                return 1;
                            if (memblock_unref(ctx, &stl_res_mem_120204,
                                               "stl_res_mem_120204") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118063,
                                               "mem_118063") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_118059,
                                               "mem_118059") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120375,
                                               "out_mem_120375") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120374,
                                               "out_mem_120374") != 0)
                                return 1;
                            if (memblock_unref(ctx, &out_mem_120373,
                                               "out_mem_120373") != 0)
                                return 1;
                            return 1;
                        }
                        
                        float defunc_0_f_res_t_res_116569 =
                              ((float *) mem_119889)[i_117232 * n_114534 +
                                                     x_116563];
                        
                        defunc_0_f_res_116565 = defunc_0_f_res_t_res_116569;
                    } else {
                        defunc_0_f_res_116565 = INFINITY;
                    }
                    ((float *) mem_119933)[i_117232 * n_114534 + i_117228] =
                        defunc_0_f_res_116565;
                }
            }
            
            int32_t iters_116571;
            
            if (empty_slice_114994) {
                iters_116571 = 0;
            } else {
                iters_116571 = 16;
            }
            
            bool loop_nonempty_116572 = slt32(0, iters_116571);
            bool loop_not_taken_116573 = !loop_nonempty_116572;
            bool protect_assert_disj_116574 = bounds_check_114613 ||
                 loop_not_taken_116573;
            bool index_certs_116575;
            
            if (!protect_assert_disj_116574) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", i_114610,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  /prelude/array.fut:26:29-34\n   #1  lib/github.com/diku-dk/sorts/radix_sort.fut:25:24-35\n   #2  lib/github.com/diku-dk/sorts/radix_sort.fut:53:31-62\n   #3  lib/github.com/diku-dk/sorts/radix_sort.fut:104:6-36\n   #4  stl.fut:334:35-77\n   #5  stl.fut:333:28-335:40\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &weights_l_mem_120196,
                                   "weights_l_mem_120196") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118109,
                                   "mem_param_118109") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118101,
                                   "mem_param_118101") != 0)
                    return 1;
                if (memblock_unref(ctx, &loopres_mem_119885,
                                   "loopres_mem_119885") != 0)
                    return 1;
                if (memblock_unref(ctx, &loopres_mem_119877,
                                   "loopres_mem_119877") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118087,
                                   "mem_param_118087") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118079,
                                   "mem_param_118079") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118071,
                                   "mem_param_118071") != 0)
                    return 1;
                if (memblock_unref(ctx, &stl_res_mem_120220,
                                   "stl_res_mem_120220") != 0)
                    return 1;
                if (memblock_unref(ctx, &stl_res_mem_120212,
                                   "stl_res_mem_120212") != 0)
                    return 1;
                if (memblock_unref(ctx, &stl_res_mem_120204,
                                   "stl_res_mem_120204") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            if (mem_119977_cached_sizze_120659 < (size_t) bytes_117688) {
                mem_119977 = realloc(mem_119977, bytes_117688);
                mem_119977_cached_sizze_120659 = bytes_117688;
            }
            if (mem_119998_cached_sizze_120660 < (size_t) bytes_119996) {
                mem_119998 = realloc(mem_119998, bytes_119996);
                mem_119998_cached_sizze_120660 = bytes_119996;
            }
            if (mem_120001_cached_sizze_120661 < (size_t) bytes_119996) {
                mem_120001 = realloc(mem_120001, bytes_119996);
                mem_120001_cached_sizze_120661 = bytes_119996;
            }
            if (mem_120004_cached_sizze_120662 < (size_t) bytes_119996) {
                mem_120004 = realloc(mem_120004, bytes_119996);
                mem_120004_cached_sizze_120662 = bytes_119996;
            }
            if (mem_120007_cached_sizze_120663 < (size_t) bytes_119996) {
                mem_120007 = realloc(mem_120007, bytes_119996);
                mem_120007_cached_sizze_120663 = bytes_119996;
            }
            if (mem_120010_cached_sizze_120664 < (size_t) bytes_120008) {
                mem_120010 = realloc(mem_120010, bytes_120008);
                mem_120010_cached_sizze_120664 = bytes_120008;
            }
            if (mem_120073_cached_sizze_120665 < (size_t) bytes_120008) {
                mem_120073 = realloc(mem_120073, bytes_120008);
                mem_120073_cached_sizze_120665 = bytes_120008;
            }
            for (int64_t i_117269 = 0; i_117269 < m_114533; i_117269++) {
                memmove(mem_119977 + i_117269 * n_114534 * (int64_t) 4,
                        mem_119933 + i_117269 * n_114534 * (int64_t) 4,
                        n_114534 * (int64_t) 4);
                for (int32_t i_116579 = 0; i_116579 < iters_116571;
                     i_116579++) {
                    int32_t defunc_2_radix_sort_step_arg_116581 = mul32(2,
                                                                        i_116579);
                    int32_t defunc_0_get_bit_arg_116582 = add32(1,
                                                                defunc_2_radix_sort_step_arg_116581);
                    bool cond_f_res_116583 = defunc_0_get_bit_arg_116582 == 31;
                    bool cond_f_res_116584 =
                         defunc_2_radix_sort_step_arg_116581 == 31;
                    int64_t discard_117254;
                    int64_t discard_117255;
                    int64_t discard_117256;
                    int64_t discard_117257;
                    int64_t scanacc_117239;
                    int64_t scanacc_117240;
                    int64_t scanacc_117241;
                    int64_t scanacc_117242;
                    
                    scanacc_117239 = (int64_t) 0;
                    scanacc_117240 = (int64_t) 0;
                    scanacc_117241 = (int64_t) 0;
                    scanacc_117242 = (int64_t) 0;
                    for (int64_t i_117248 = 0; i_117248 < n_114534;
                         i_117248++) {
                        float x_116623 = ((float *) mem_119977)[i_117269 *
                                                                n_114534 +
                                                                i_117248];
                        int32_t i32_arg_116624;
                        
                        i32_arg_116624 = futrts_to_bits32(x_116623);
                        
                        int32_t unsign_arg_116625 = ashr32(i32_arg_116624,
                                                           defunc_0_get_bit_arg_116582);
                        int32_t unsign_arg_116626 = 1 & unsign_arg_116625;
                        int32_t unsign_arg_116627 = ashr32(i32_arg_116624, 31);
                        int32_t unsign_arg_116628 = 1 & unsign_arg_116627;
                        bool cond_116629 = unsign_arg_116628 == 1;
                        bool x_116630 = !cond_116629;
                        bool y_116631 = cond_f_res_116583 && x_116630;
                        bool cond_116632 = cond_116629 || y_116631;
                        int32_t defunc_1_get_bit_res_116633;
                        
                        if (cond_116632) {
                            int32_t defunc_1_get_bit_res_t_res_116634 = 1 ^
                                    unsign_arg_116626;
                            
                            defunc_1_get_bit_res_116633 =
                                defunc_1_get_bit_res_t_res_116634;
                        } else {
                            defunc_1_get_bit_res_116633 = unsign_arg_116626;
                        }
                        
                        int32_t x_116635 = mul32(2,
                                                 defunc_1_get_bit_res_116633);
                        int32_t unsign_arg_116636 = ashr32(i32_arg_116624,
                                                           defunc_2_radix_sort_step_arg_116581);
                        int32_t unsign_arg_116637 = 1 & unsign_arg_116636;
                        bool y_116638 = cond_f_res_116584 && x_116630;
                        bool cond_116639 = cond_116629 || y_116638;
                        int32_t defunc_1_get_bit_res_116640;
                        
                        if (cond_116639) {
                            int32_t defunc_1_get_bit_res_t_res_116641 = 1 ^
                                    unsign_arg_116637;
                            
                            defunc_1_get_bit_res_116640 =
                                defunc_1_get_bit_res_t_res_116641;
                        } else {
                            defunc_1_get_bit_res_116640 = unsign_arg_116637;
                        }
                        
                        int32_t defunc_0_f_res_116642 = add32(x_116635,
                                                              defunc_1_get_bit_res_116640);
                        bool cond_116643 = defunc_0_f_res_116642 == 0;
                        int64_t defunc_0_f_res_116644 =
                                btoi_bool_i64(cond_116643);
                        int64_t defunc_0_f_res_116645;
                        int64_t defunc_0_f_res_116646;
                        int64_t defunc_0_f_res_116647;
                        
                        if (cond_116643) {
                            defunc_0_f_res_116645 = (int64_t) 0;
                            defunc_0_f_res_116646 = (int64_t) 0;
                            defunc_0_f_res_116647 = (int64_t) 0;
                        } else {
                            bool cond_116648 = defunc_0_f_res_116642 == 1;
                            int64_t defunc_0_f_res_f_res_116649 =
                                    btoi_bool_i64(cond_116648);
                            int64_t defunc_0_f_res_f_res_116650;
                            int64_t defunc_0_f_res_f_res_116651;
                            
                            if (cond_116648) {
                                defunc_0_f_res_f_res_116650 = (int64_t) 0;
                                defunc_0_f_res_f_res_116651 = (int64_t) 0;
                            } else {
                                bool cond_116652 = defunc_0_f_res_116642 == 2;
                                int64_t defunc_0_f_res_f_res_f_res_116653 =
                                        btoi_bool_i64(cond_116652);
                                bool cond_neg_116654 = !cond_116652;
                                int64_t defunc_0_f_res_f_res_f_res_116655 =
                                        btoi_bool_i64(cond_neg_116654);
                                
                                defunc_0_f_res_f_res_116650 =
                                    defunc_0_f_res_f_res_f_res_116653;
                                defunc_0_f_res_f_res_116651 =
                                    defunc_0_f_res_f_res_f_res_116655;
                            }
                            defunc_0_f_res_116645 = defunc_0_f_res_f_res_116649;
                            defunc_0_f_res_116646 = defunc_0_f_res_f_res_116650;
                            defunc_0_f_res_116647 = defunc_0_f_res_f_res_116651;
                        }
                        
                        int64_t defunc_1_op_res_116619 =
                                add64(defunc_0_f_res_116644, scanacc_117239);
                        int64_t defunc_1_op_res_116620 =
                                add64(defunc_0_f_res_116645, scanacc_117240);
                        int64_t defunc_1_op_res_116621 =
                                add64(defunc_0_f_res_116646, scanacc_117241);
                        int64_t defunc_1_op_res_116622 =
                                add64(defunc_0_f_res_116647, scanacc_117242);
                        
                        ((int64_t *) mem_119998)[i_117248] =
                            defunc_1_op_res_116619;
                        ((int64_t *) mem_120001)[i_117248] =
                            defunc_1_op_res_116620;
                        ((int64_t *) mem_120004)[i_117248] =
                            defunc_1_op_res_116621;
                        ((int64_t *) mem_120007)[i_117248] =
                            defunc_1_op_res_116622;
                        ((int32_t *) mem_120010)[i_117248] =
                            defunc_0_f_res_116642;
                        
                        int64_t scanacc_tmp_120596 = defunc_1_op_res_116619;
                        int64_t scanacc_tmp_120597 = defunc_1_op_res_116620;
                        int64_t scanacc_tmp_120598 = defunc_1_op_res_116621;
                        int64_t scanacc_tmp_120599 = defunc_1_op_res_116622;
                        
                        scanacc_117239 = scanacc_tmp_120596;
                        scanacc_117240 = scanacc_tmp_120597;
                        scanacc_117241 = scanacc_tmp_120598;
                        scanacc_117242 = scanacc_tmp_120599;
                    }
                    discard_117254 = scanacc_117239;
                    discard_117255 = scanacc_117240;
                    discard_117256 = scanacc_117241;
                    discard_117257 = scanacc_117242;
                    
                    int64_t last_res_116661 =
                            ((int64_t *) mem_119998)[i_114610];
                    int64_t last_res_116662 =
                            ((int64_t *) mem_120001)[i_114610];
                    int64_t last_res_116663 =
                            ((int64_t *) mem_120004)[i_114610];
                    
                    memmove(mem_120073 + (int64_t) 0, mem_119977 + i_117269 *
                            n_114534 * (int64_t) 4, n_114534 * (int64_t) 4);
                    for (int64_t write_iter_117258 = 0; write_iter_117258 <
                         n_114534; write_iter_117258++) {
                        int32_t write_iv_117260 =
                                ((int32_t *) mem_120010)[write_iter_117258];
                        int64_t write_iv_117261 =
                                ((int64_t *) mem_119998)[write_iter_117258];
                        int64_t write_iv_117262 =
                                ((int64_t *) mem_120001)[write_iter_117258];
                        int64_t write_iv_117263 =
                                ((int64_t *) mem_120004)[write_iter_117258];
                        int64_t write_iv_117264 =
                                ((int64_t *) mem_120007)[write_iter_117258];
                        bool match_lit_116672 = 0 == write_iv_117260;
                        int64_t defunc_1_f_res_116673;
                        
                        if (match_lit_116672) {
                            int64_t case_res_116674 = sub64(write_iv_117261,
                                                            (int64_t) 1);
                            
                            defunc_1_f_res_116673 = case_res_116674;
                        } else {
                            bool match_lit_116675 = 1 == write_iv_117260;
                            int64_t x_116676;
                            
                            if (match_lit_116675) {
                                int64_t x_116677 = add64(last_res_116661,
                                                         write_iv_117262);
                                int64_t case_res_116678 = sub64(x_116677,
                                                                (int64_t) 1);
                                
                                x_116676 = case_res_116678;
                            } else {
                                bool match_lit_116679 = 2 == write_iv_117260;
                                int64_t x_116680;
                                
                                if (match_lit_116679) {
                                    int64_t x_116681 = add64(last_res_116661,
                                                             last_res_116662);
                                    int64_t x_116682 = add64(x_116681,
                                                             write_iv_117263);
                                    int64_t case_res_116683 = sub64(x_116682,
                                                                    (int64_t) 1);
                                    
                                    x_116680 = case_res_116683;
                                } else {
                                    int64_t x_116684 = add64(last_res_116661,
                                                             last_res_116662);
                                    int64_t x_116685 = add64(last_res_116663,
                                                             x_116684);
                                    int64_t x_116686 = add64(x_116685,
                                                             write_iv_117264);
                                    int64_t defunc_1_f_res_res_116687 =
                                            sub64(x_116686, (int64_t) 1);
                                    
                                    x_116680 = defunc_1_f_res_res_116687;
                                }
                                x_116676 = x_116680;
                            }
                            defunc_1_f_res_116673 = x_116676;
                        }
                        if (sle64((int64_t) 0, defunc_1_f_res_116673) &&
                            slt64(defunc_1_f_res_116673, n_114534)) {
                            memmove(mem_120073 + defunc_1_f_res_116673 *
                                    (int64_t) 4, mem_119977 + (i_117269 *
                                                               n_114534 +
                                                               write_iter_117258) *
                                    (int64_t) 4, (int64_t) 4);
                        }
                    }
                    memmove(mem_119977 + i_117269 * n_114534 * (int64_t) 4,
                            mem_120073 + (int64_t) 0, n_114534 * (int64_t) 4);
                }
            }
            
            bool empty_slice_116689 = j_m_i_115007 == (int64_t) 0;
            int64_t m_116690 = sub64(j_m_i_115007, (int64_t) 1);
            int64_t i_p_m_t_s_116691 = add64(stl_res_114604, m_116690);
            bool zzero_leq_i_p_m_t_s_116692 = sle64((int64_t) 0,
                                                    i_p_m_t_s_116691);
            bool i_p_m_t_s_leq_w_116693 = slt64(i_p_m_t_s_116691, n_114534);
            bool zzero_lte_i_116694 = sle64((int64_t) 0, stl_res_114604);
            bool i_lte_j_116695 = sle64(stl_res_114604, stl_res_114605);
            bool y_116696 = i_p_m_t_s_leq_w_116693 && zzero_lte_i_116694;
            bool y_116697 = zzero_leq_i_p_m_t_s_116692 && y_116696;
            bool y_116698 = i_lte_j_116695 && y_116697;
            bool forwards_ok_116699 = zzero_lte_i_116694 && y_116698;
            bool ok_or_empty_116700 = empty_slice_116689 || forwards_ok_116699;
            bool index_certs_116701;
            
            if (!ok_or_empty_116700) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", stl_res_114604, ":", stl_res_114605,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  stl.fut:340:33-51\n   #1  stl.fut:338:13-345:28\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
                if (memblock_unref(ctx, &weights_l_mem_120196,
                                   "weights_l_mem_120196") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118109,
                                   "mem_param_118109") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118101,
                                   "mem_param_118101") != 0)
                    return 1;
                if (memblock_unref(ctx, &loopres_mem_119885,
                                   "loopres_mem_119885") != 0)
                    return 1;
                if (memblock_unref(ctx, &loopres_mem_119877,
                                   "loopres_mem_119877") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118087,
                                   "mem_param_118087") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118079,
                                   "mem_param_118079") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_118071,
                                   "mem_param_118071") != 0)
                    return 1;
                if (memblock_unref(ctx, &stl_res_mem_120220,
                                   "stl_res_mem_120220") != 0)
                    return 1;
                if (memblock_unref(ctx, &stl_res_mem_120212,
                                   "stl_res_mem_120212") != 0)
                    return 1;
                if (memblock_unref(ctx, &stl_res_mem_120204,
                                   "stl_res_mem_120204") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
                    return 1;
                if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
                    return 1;
                return 1;
            }
            
            int64_t binop_y_120103 = (int64_t) 4 * m_114533;
            int64_t bytes_120102 = smax64((int64_t) 0, binop_y_120103);
            
            if (mem_120104_cached_sizze_120666 < (size_t) bytes_120102) {
                mem_120104 = realloc(mem_120104, bytes_120102);
                mem_120104_cached_sizze_120666 = bytes_120102;
            }
            if (mem_120107_cached_sizze_120667 < (size_t) bytes_120102) {
                mem_120107 = realloc(mem_120107, bytes_120102);
                mem_120107_cached_sizze_120667 = bytes_120102;
            }
            if (mem_120110_cached_sizze_120668 < (size_t) bytes_120102) {
                mem_120110 = realloc(mem_120110, bytes_120102);
                mem_120110_cached_sizze_120668 = bytes_120102;
            }
            for (int64_t i_117279 = 0; i_117279 < m_114533; i_117279++) {
                float defunc_2_reduce_res_116707;
                float redout_117271 = 0.0F;
                
                for (int64_t i_117272 = 0; i_117272 < j_m_i_115007;
                     i_117272++) {
                    int64_t slice_117401 = stl_res_114604 + i_117272;
                    float x_116711 = ((float *) mem_119977)[i_117279 *
                                                            n_114534 +
                                                            slice_117401];
                    float defunc_1_op_res_116710 = x_116711 + redout_117271;
                    float redout_tmp_120609 = defunc_1_op_res_116710;
                    
                    redout_117271 = redout_tmp_120609;
                }
                defunc_2_reduce_res_116707 = redout_117271;
                
                float h_116712 = 3.0F * defunc_2_reduce_res_116707;
                float h9_116713 = 0.999F * h_116712;
                float h1_116714 = 1.0e-3F * h_116712;
                
                ((float *) mem_120104)[i_117279] = h_116712;
                ((float *) mem_120107)[i_117279] = h9_116713;
                ((float *) mem_120110)[i_117279] = h1_116714;
            }
            
            struct memblock mem_120150;
            
            mem_120150.references = NULL;
            if (memblock_alloc(ctx, &mem_120150, bytes_117688, "mem_120150")) {
                err = 1;
                goto cleanup;
            }
            for (int64_t i_117289 = 0; i_117289 < m_114533; i_117289++) {
                float x_116720 = ((float *) mem_120104)[i_117289];
                float x_116721 = ((float *) mem_120107)[i_117289];
                float x_116722 = ((float *) mem_120110)[i_117289];
                
                for (int64_t i_117285 = 0; i_117285 < n_114534; i_117285++) {
                    float x_116724 = ((float *) mem_119889)[i_117289 *
                                                            n_114534 +
                                                            i_117285];
                    float x_116725 = x_116724 / x_116720;
                    float y_116726 = fpow32(x_116725, 2.0F);
                    float x_116727 = 1.0F - y_116726;
                    float bicube_116728 = fpow32(x_116727, 2.0F);
                    bool isnan_res_116729;
                    
                    isnan_res_116729 = futrts_isnan32(x_116724);
                    
                    bool cond_f_res_116730 = x_116724 <= x_116722;
                    bool x_116731 = !isnan_res_116729;
                    bool y_116732 = cond_f_res_116730 && x_116731;
                    bool cond_116733 = isnan_res_116729 || y_116732;
                    float defunc_0_f_res_116734;
                    
                    if (cond_116733) {
                        defunc_0_f_res_116734 = 1.0F;
                    } else {
                        bool cond_116735 = x_116721 <= x_116724;
                        bool cond_f_res_116736 = x_116724 <= 1.0e-6F;
                        bool x_116737 = !cond_116735;
                        bool y_116738 = cond_f_res_116736 && x_116737;
                        bool cond_116739 = cond_116735 || y_116738;
                        float defunc_0_f_res_f_res_116740;
                        
                        if (cond_116739) {
                            defunc_0_f_res_f_res_116740 = 1.0e-6F;
                        } else {
                            defunc_0_f_res_f_res_116740 = bicube_116728;
                        }
                        defunc_0_f_res_116734 = defunc_0_f_res_f_res_116740;
                    }
                    ((float *) mem_120150.mem)[i_117289 * n_114534 + i_117285] =
                        defunc_0_f_res_116734;
                }
            }
            if (memblock_set(ctx, &weights_l_mem_120196, &mem_120150,
                             "mem_120150") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_120150, "mem_120150") != 0)
                return 1;
        } else {
            if (memblock_set(ctx, &weights_l_mem_120196, &mem_param_118087,
                             "mem_param_118087") != 0)
                return 1;
        }
        
        int64_t loopz2081Uz2085Uz2089U_tmp_120421 = sizze_116543;
        int64_t ctx_param_ext_tmp_120422 = loopres_ixfn_119879;
        int64_t ctx_param_ext_tmp_120423 = loopres_ixfn_119881;
        int64_t ctx_param_ext_tmp_120424 = weights_l_ixfn_120191;
        int64_t ctx_param_ext_tmp_120425 = weights_l_ixfn_120192;
        int64_t ctx_param_ext_tmp_120426 = weights_l_ixfn_120195;
        int64_t ctx_param_ext_tmp_120427 = weights_l_ixfn_120193;
        int64_t ctx_param_ext_tmp_120428 = weights_l_ixfn_120194;
        int64_t ctx_param_ext_tmp_120429 = sizze_116543;
        struct memblock mem_param_tmp_120430;
        
        mem_param_tmp_120430.references = NULL;
        if (memblock_set(ctx, &mem_param_tmp_120430, &loopres_mem_119877,
                         "loopres_mem_119877") != 0)
            return 1;
        
        struct memblock mem_param_tmp_120431;
        
        mem_param_tmp_120431.references = NULL;
        if (memblock_set(ctx, &mem_param_tmp_120431, &loopres_mem_119885,
                         "loopres_mem_119885") != 0)
            return 1;
        
        struct memblock mem_param_tmp_120432;
        
        mem_param_tmp_120432.references = NULL;
        if (memblock_set(ctx, &mem_param_tmp_120432, &weights_l_mem_120196,
                         "weights_l_mem_120196") != 0)
            return 1;
        loopz2081Uz2085Uz2089U_115023 = loopz2081Uz2085Uz2089U_tmp_120421;
        ctx_param_ext_118073 = ctx_param_ext_tmp_120422;
        ctx_param_ext_118075 = ctx_param_ext_tmp_120423;
        ctx_param_ext_118080 = ctx_param_ext_tmp_120424;
        ctx_param_ext_118081 = ctx_param_ext_tmp_120425;
        ctx_param_ext_118082 = ctx_param_ext_tmp_120426;
        ctx_param_ext_118083 = ctx_param_ext_tmp_120427;
        ctx_param_ext_118085 = ctx_param_ext_tmp_120428;
        ctx_param_ext_118086 = ctx_param_ext_tmp_120429;
        if (memblock_set(ctx, &mem_param_118071, &mem_param_tmp_120430,
                         "mem_param_tmp_120430") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_118079, &mem_param_tmp_120431,
                         "mem_param_tmp_120431") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_118087, &mem_param_tmp_120432,
                         "mem_param_tmp_120432") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_tmp_120432,
                           "mem_param_tmp_120432") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_tmp_120431,
                           "mem_param_tmp_120431") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_tmp_120430,
                           "mem_param_tmp_120430") != 0)
            return 1;
        if (memblock_unref(ctx, &weights_l_mem_120196,
                           "weights_l_mem_120196") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_118109, "mem_param_118109") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_118101, "mem_param_118101") != 0)
            return 1;
        if (memblock_unref(ctx, &loopres_mem_119885, "loopres_mem_119885") != 0)
            return 1;
        if (memblock_unref(ctx, &loopres_mem_119877, "loopres_mem_119877") != 0)
            return 1;
    }
    sizze_115018 = loopz2081Uz2085Uz2089U_115023;
    stl_res_ixfn_120206 = ctx_param_ext_118073;
    stl_res_ixfn_120208 = ctx_param_ext_118075;
    stl_res_ixfn_120213 = ctx_param_ext_118080;
    stl_res_ixfn_120214 = ctx_param_ext_118081;
    stl_res_ixfn_120215 = ctx_param_ext_118082;
    stl_res_ixfn_120216 = ctx_param_ext_118083;
    stl_res_ixfn_120218 = ctx_param_ext_118085;
    stl_res_ixfn_120219 = ctx_param_ext_118086;
    if (memblock_set(ctx, &stl_res_mem_120204, &mem_param_118071,
                     "mem_param_118071") != 0)
        return 1;
    if (memblock_set(ctx, &stl_res_mem_120212, &mem_param_118079,
                     "mem_param_118079") != 0)
        return 1;
    if (memblock_set(ctx, &stl_res_mem_120220, &mem_param_118087,
                     "mem_param_118087") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
        return 1;
    if (mem_120224_cached_sizze_120669 < (size_t) bytes_117688) {
        mem_120224 = realloc(mem_120224, bytes_117688);
        mem_120224_cached_sizze_120669 = bytes_117688;
    }
    for (int64_t i_117297 = 0; i_117297 < m_114533; i_117297++) {
        for (int64_t i_117293 = 0; i_117293 < n_114534; i_117293++) {
            float x_116749 = ((float *) Y_mem_117613.mem)[i_117297 * n_114534 +
                                                          i_117293];
            float x_116750 = ((float *) stl_res_mem_120204.mem)[i_117297 *
                                                                n_114534 +
                                                                i_117293];
            float x_116751 = ((float *) stl_res_mem_120212.mem)[i_117297 *
                                                                stl_res_ixfn_120208 +
                                                                i_117293];
            float x_116752 = x_116749 - x_116750;
            float defunc_2_f_res_116753 = x_116752 - x_116751;
            
            ((float *) mem_120224)[i_117297 * n_114534 + i_117293] =
                defunc_2_f_res_116753;
        }
    }
    
    struct memblock mem_120268;
    
    mem_120268.references = NULL;
    if (memblock_alloc(ctx, &mem_120268, bytes_117688, "mem_120268")) {
        err = 1;
        goto cleanup;
    }
    memmove(mem_120268.mem + (int64_t) 0, stl_res_mem_120204.mem + (int64_t) 0,
            m_114533 * n_114534 * (int64_t) 4);
    if (memblock_unref(ctx, &stl_res_mem_120204, "stl_res_mem_120204") != 0)
        return 1;
    
    struct memblock mem_120273;
    
    mem_120273.references = NULL;
    if (memblock_alloc(ctx, &mem_120273, bytes_117688, "mem_120273")) {
        err = 1;
        goto cleanup;
    }
    memmove(mem_120273.mem + (int64_t) 0, stl_res_mem_120212.mem + (int64_t) 0,
            m_114533 * n_114534 * (int64_t) 4);
    if (memblock_unref(ctx, &stl_res_mem_120212, "stl_res_mem_120212") != 0)
        return 1;
    
    struct memblock mem_120278;
    
    mem_120278.references = NULL;
    if (memblock_alloc(ctx, &mem_120278, bytes_117688, "mem_120278")) {
        err = 1;
        goto cleanup;
    }
    memmove(mem_120278.mem + (int64_t) 0, mem_120224 + (int64_t) 0, m_114533 *
            n_114534 * (int64_t) 4);
    if (memblock_set(ctx, &out_mem_120373, &mem_120268, "mem_120268") != 0)
        return 1;
    if (memblock_set(ctx, &out_mem_120374, &mem_120273, "mem_120273") != 0)
        return 1;
    if (memblock_set(ctx, &out_mem_120375, &mem_120278, "mem_120278") != 0)
        return 1;
    (*out_mem_p_120614).references = NULL;
    if (memblock_set(ctx, &*out_mem_p_120614, &out_mem_120373,
                     "out_mem_120373") != 0)
        return 1;
    (*out_mem_p_120615).references = NULL;
    if (memblock_set(ctx, &*out_mem_p_120615, &out_mem_120374,
                     "out_mem_120374") != 0)
        return 1;
    (*out_mem_p_120616).references = NULL;
    if (memblock_set(ctx, &*out_mem_p_120616, &out_mem_120375,
                     "out_mem_120375") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_120278, "mem_120278") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_120273, "mem_120273") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_120268, "mem_120268") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_118087, "mem_param_118087") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_118079, "mem_param_118079") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_118071, "mem_param_118071") != 0)
        return 1;
    if (memblock_unref(ctx, &stl_res_mem_120220, "stl_res_mem_120220") != 0)
        return 1;
    if (memblock_unref(ctx, &stl_res_mem_120212, "stl_res_mem_120212") != 0)
        return 1;
    if (memblock_unref(ctx, &stl_res_mem_120204, "stl_res_mem_120204") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_118063, "mem_118063") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_118059, "mem_118059") != 0)
        return 1;
    if (memblock_unref(ctx, &out_mem_120375, "out_mem_120375") != 0)
        return 1;
    if (memblock_unref(ctx, &out_mem_120374, "out_mem_120374") != 0)
        return 1;
    if (memblock_unref(ctx, &out_mem_120373, "out_mem_120373") != 0)
        return 1;
    
  cleanup:
    { }
    free(mem_117617);
    free(mem_117620);
    free(mem_117640);
    free(mem_117655);
    free(mem_117691);
    free(mem_117735);
    free(mem_117779);
    free(mem_117823);
    free(mem_117827);
    free(mem_117850);
    free(mem_117853);
    free(mem_117941);
    free(mem_117945);
    free(mem_117968);
    free(mem_117971);
    free(mem_118113);
    free(mem_118157);
    free(mem_118201);
    free(mem_118245);
    free(mem_118258);
    free(mem_118273);
    free(mem_118288);
    free(mem_118312);
    free(mem_118316);
    free(mem_118684);
    free(mem_118768);
    free(mem_118771);
    free(mem_118886);
    free(mem_118889);
    free(mem_118916);
    free(mem_118919);
    free(mem_119129);
    free(mem_119142);
    free(mem_119472);
    free(mem_119556);
    free(mem_119559);
    free(mem_119674);
    free(mem_119677);
    free(mem_119704);
    free(mem_119707);
    free(mem_119889);
    free(mem_119933);
    free(mem_119977);
    free(mem_119998);
    free(mem_120001);
    free(mem_120004);
    free(mem_120007);
    free(mem_120010);
    free(mem_120073);
    free(mem_120104);
    free(mem_120107);
    free(mem_120110);
    free(mem_120224);
    return err;
}
int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f32_2d **out0,
                       struct futhark_f32_2d **out1,
                       struct futhark_f32_2d **out2, 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, const int64_t in6, const int64_t in7, const
                       int64_t in8, const int64_t in9, const int64_t in10, const
                       int64_t in11)
{
    struct memblock Y_mem_117613;
    
    Y_mem_117613.references = NULL;
    
    int64_t m_114533;
    int64_t n_114534;
    int64_t n_p_114536;
    int64_t t_window_114537;
    int64_t l_window_114538;
    int64_t t_degree_114539;
    int64_t l_degree_114540;
    int64_t t_jump_114541;
    int64_t l_jump_114542;
    int64_t inner_114543;
    int64_t outer_114544;
    int64_t jump_threshold_114545;
    int64_t max_group_sizze_114546;
    struct memblock out_mem_120373;
    
    out_mem_120373.references = NULL;
    
    struct memblock out_mem_120374;
    
    out_mem_120374.references = NULL;
    
    struct memblock out_mem_120375;
    
    out_mem_120375.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    Y_mem_117613 = in0->mem;
    m_114533 = in0->shape[0];
    n_114534 = in0->shape[1];
    n_p_114536 = in1;
    t_window_114537 = in2;
    l_window_114538 = in3;
    t_degree_114539 = in4;
    l_degree_114540 = in5;
    t_jump_114541 = in6;
    l_jump_114542 = in7;
    inner_114543 = in8;
    outer_114544 = in9;
    jump_threshold_114545 = in10;
    max_group_sizze_114546 = in11;
    if (!((m_114533 == in0->shape[0] && n_114534 == in0->shape[1]) && (true &&
                                                                       (true &&
                                                                        (true &&
                                                                         (true &&
                                                                          (true &&
                                                                           (true &&
                                                                            (true &&
                                                                             (true &&
                                                                              (true &&
                                                                               (true &&
                                                                                true)))))))))))) {
        ret = 1;
        if (!ctx->error)
            ctx->error =
                msgprintf("Error: entry point arguments have invalid sizes.\n");
    } else {
        ret = futrts_entry_main(ctx, &out_mem_120373, &out_mem_120374,
                                &out_mem_120375, Y_mem_117613, m_114533,
                                n_114534, n_p_114536, t_window_114537,
                                l_window_114538, t_degree_114539,
                                l_degree_114540, t_jump_114541, l_jump_114542,
                                inner_114543, outer_114544,
                                jump_threshold_114545, max_group_sizze_114546);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out0)->mem = out_mem_120373;
            (*out0)->shape[0] = m_114533;
            (*out0)->shape[1] = n_114534;
            assert((*out1 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out1)->mem = out_mem_120374;
            (*out1)->shape[0] = m_114533;
            (*out1)->shape[1] = n_114534;
            assert((*out2 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out2)->mem = out_mem_120375;
            (*out2)->shape[0] = m_114533;
            (*out2)->shape[1] = n_114534;
        }
    }
    lock_unlock(&ctx->lock);
    return ret;
}
