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

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

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

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

#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_profiling(struct futhark_context_config *cfg,
                                          int flag);
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int flag);
void futhark_context_config_set_num_threads(struct futhark_context_config *cfg,
                                            int n);
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_sync(struct futhark_context *ctx);
int futhark_context_config_set_tuning_param(struct futhark_context_config *cfg,
                                            const char *param_name,
                                            size_t param_value);
int futhark_get_tuning_param_count(void);
const char *futhark_get_tuning_param_name(int);
const char *futhark_get_tuning_param_class(int);

// Arrays
struct futhark_f32_2d;
struct futhark_f32_2d *futhark_new_f32_2d(struct futhark_context *ctx, const
                                          float *data, int64_t dim0,
                                          int64_t dim1);
struct futhark_f32_2d *futhark_new_raw_f32_2d(struct futhark_context *ctx, const
                                              unsigned char *data,
                                              int64_t offset, int64_t dim0,
                                              int64_t dim1);
int futhark_free_f32_2d(struct futhark_context *ctx,
                        struct futhark_f32_2d *arr);
int futhark_values_f32_2d(struct futhark_context *ctx,
                          struct futhark_f32_2d *arr, float *data);
unsigned 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, const int64_t in12, const int64_t in13,
                       const int64_t in14);

// Miscellaneous
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_multicore

#ifdef __cplusplus
}
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <stdint.h>
// If NDEBUG is set, the assert() macro will do nothing. Since Futhark
// (unfortunately) makes use of assert() for error detection (and even some
// side effects), we want to avoid that.
#undef NDEBUG
#include <assert.h>
#include <stdarg.h>
// Start of util.h.
//
// Various helper functions that are useful in all generated C code.

#include <errno.h>
#include <string.h>

static const char *fut_progname = "(embedded Futhark)";

static void futhark_panic(int eval, const char *fmt, ...) __attribute__((noreturn));
static char* msgprintf(const char *s, ...);
static void* slurp_file(const char *filename, size_t *size);
static int dump_file(const char *file, const void *buf, size_t n);
struct str_builder;
static void str_builder_init(struct str_builder *b);
static void str_builder(struct str_builder *b, const char *s, ...);

static void futhark_panic(int eval, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  fprintf(stderr, "%s: ", fut_progname);
  vfprintf(stderr, fmt, ap);
  va_end(ap);
  exit(eval);
}

// For generating arbitrary-sized error messages.  It is the callers
// responsibility to free the buffer at some point.
static char* msgprintf(const char *s, ...) {
  va_list vl;
  va_start(vl, s);
  size_t needed = 1 + (size_t)vsnprintf(NULL, 0, s, vl);
  char *buffer = (char*) malloc(needed);
  va_start(vl, s); // Must re-init.
  vsnprintf(buffer, needed, s, vl);
  return buffer;
}

static inline void check_err(int errval, int sets_errno, const char *fun, int line,
                            const char *msg, ...) {
  if (errval) {
    char errnum[10];

    va_list vl;
    va_start(vl, msg);

    fprintf(stderr, "ERROR: ");
    vfprintf(stderr, msg, vl);
    fprintf(stderr, " in %s() at line %d with error code %s\n",
            fun, line,
            sets_errno ? strerror(errno) : errnum);
    exit(errval);
  }
}

#define CHECK_ERR(err, ...) check_err(err, 0, __func__, __LINE__, __VA_ARGS__)
#define CHECK_ERRNO(err, ...) check_err(err, 1, __func__, __LINE__, __VA_ARGS__)

// Read the rest of an open file into a NUL-terminated string; returns
// NULL on error.
static void* fslurp_file(FILE *f, size_t *size) {
  long start = ftell(f);
  fseek(f, 0, SEEK_END);
  long src_size = ftell(f)-start;
  fseek(f, start, SEEK_SET);
  unsigned char *s = (unsigned char*) malloc((size_t)src_size + 1);
  if (fread(s, 1, (size_t)src_size, f) != (size_t)src_size) {
    free(s);
    s = NULL;
  } else {
    s[src_size] = '\0';
  }

  if (size) {
    *size = (size_t)src_size;
  }

  return s;
}

// Read a file into a NUL-terminated string; returns NULL on error.
static void* slurp_file(const char *filename, size_t *size) {
  FILE *f = fopen(filename, "rb"); // To avoid Windows messing with linebreaks.
  if (f == NULL) return NULL;
  unsigned char *s = fslurp_file(f, size);
  fclose(f);
  return s;
}

// Dump 'n' bytes from 'buf' into the file at the designated location.
// Returns 0 on success.
static int dump_file(const char *file, const void *buf, size_t n) {
  FILE *f = fopen(file, "w");

  if (f == NULL) {
    return 1;
  }

  if (fwrite(buf, sizeof(char), n, f) != n) {
    return 1;
  }

  if (fclose(f) != 0) {
    return 1;
  }

  return 0;
}

struct str_builder {
  char *str;
  size_t capacity; // Size of buffer.
  size_t used; // Bytes used, *not* including final zero.
};

static void str_builder_init(struct str_builder *b) {
  b->capacity = 10;
  b->used = 0;
  b->str = malloc(b->capacity);
  b->str[0] = 0;
}

static void str_builder(struct str_builder *b, const char *s, ...) {
  va_list vl;
  va_start(vl, s);
  size_t needed = (size_t)vsnprintf(NULL, 0, s, vl);

  while (b->capacity < b->used + needed + 1) {
    b->capacity *= 2;
    b->str = realloc(b->str, b->capacity);
  }

  va_start(vl, s); // Must re-init.
  vsnprintf(b->str+b->used, b->capacity-b->used, s, vl);
  b->used += needed;
}

// End of util.h.
// Start of half.h.

// Conversion functions are from http://half.sourceforge.net/, but
// translated to C.
//
// Copyright (c) 2012-2021 Christian Rau
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#ifndef __OPENCL_VERSION__
#define __constant
#endif

__constant static const uint16_t base_table[512] = {
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,
  0x0200, 0x0400, 0x0800, 0x0C00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x2400, 0x2800, 0x2C00, 0x3000, 0x3400, 0x3800, 0x3C00,
  0x4000, 0x4400, 0x4800, 0x4C00, 0x5000, 0x5400, 0x5800, 0x5C00, 0x6000, 0x6400, 0x6800, 0x6C00, 0x7000, 0x7400, 0x7800, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8001, 0x8002, 0x8004, 0x8008, 0x8010, 0x8020, 0x8040, 0x8080, 0x8100,
  0x8200, 0x8400, 0x8800, 0x8C00, 0x9000, 0x9400, 0x9800, 0x9C00, 0xA000, 0xA400, 0xA800, 0xAC00, 0xB000, 0xB400, 0xB800, 0xBC00,
  0xC000, 0xC400, 0xC800, 0xCC00, 0xD000, 0xD400, 0xD800, 0xDC00, 0xE000, 0xE400, 0xE800, 0xEC00, 0xF000, 0xF400, 0xF800, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00 };

__constant static const unsigned char shift_table[512] = {
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13 };

__constant static const uint32_t mantissa_table[2048] = {
  0x00000000, 0x33800000, 0x34000000, 0x34400000, 0x34800000, 0x34A00000, 0x34C00000, 0x34E00000, 0x35000000, 0x35100000, 0x35200000, 0x35300000, 0x35400000, 0x35500000, 0x35600000, 0x35700000,
  0x35800000, 0x35880000, 0x35900000, 0x35980000, 0x35A00000, 0x35A80000, 0x35B00000, 0x35B80000, 0x35C00000, 0x35C80000, 0x35D00000, 0x35D80000, 0x35E00000, 0x35E80000, 0x35F00000, 0x35F80000,
  0x36000000, 0x36040000, 0x36080000, 0x360C0000, 0x36100000, 0x36140000, 0x36180000, 0x361C0000, 0x36200000, 0x36240000, 0x36280000, 0x362C0000, 0x36300000, 0x36340000, 0x36380000, 0x363C0000,
  0x36400000, 0x36440000, 0x36480000, 0x364C0000, 0x36500000, 0x36540000, 0x36580000, 0x365C0000, 0x36600000, 0x36640000, 0x36680000, 0x366C0000, 0x36700000, 0x36740000, 0x36780000, 0x367C0000,
  0x36800000, 0x36820000, 0x36840000, 0x36860000, 0x36880000, 0x368A0000, 0x368C0000, 0x368E0000, 0x36900000, 0x36920000, 0x36940000, 0x36960000, 0x36980000, 0x369A0000, 0x369C0000, 0x369E0000,
  0x36A00000, 0x36A20000, 0x36A40000, 0x36A60000, 0x36A80000, 0x36AA0000, 0x36AC0000, 0x36AE0000, 0x36B00000, 0x36B20000, 0x36B40000, 0x36B60000, 0x36B80000, 0x36BA0000, 0x36BC0000, 0x36BE0000,
  0x36C00000, 0x36C20000, 0x36C40000, 0x36C60000, 0x36C80000, 0x36CA0000, 0x36CC0000, 0x36CE0000, 0x36D00000, 0x36D20000, 0x36D40000, 0x36D60000, 0x36D80000, 0x36DA0000, 0x36DC0000, 0x36DE0000,
  0x36E00000, 0x36E20000, 0x36E40000, 0x36E60000, 0x36E80000, 0x36EA0000, 0x36EC0000, 0x36EE0000, 0x36F00000, 0x36F20000, 0x36F40000, 0x36F60000, 0x36F80000, 0x36FA0000, 0x36FC0000, 0x36FE0000,
  0x37000000, 0x37010000, 0x37020000, 0x37030000, 0x37040000, 0x37050000, 0x37060000, 0x37070000, 0x37080000, 0x37090000, 0x370A0000, 0x370B0000, 0x370C0000, 0x370D0000, 0x370E0000, 0x370F0000,
  0x37100000, 0x37110000, 0x37120000, 0x37130000, 0x37140000, 0x37150000, 0x37160000, 0x37170000, 0x37180000, 0x37190000, 0x371A0000, 0x371B0000, 0x371C0000, 0x371D0000, 0x371E0000, 0x371F0000,
  0x37200000, 0x37210000, 0x37220000, 0x37230000, 0x37240000, 0x37250000, 0x37260000, 0x37270000, 0x37280000, 0x37290000, 0x372A0000, 0x372B0000, 0x372C0000, 0x372D0000, 0x372E0000, 0x372F0000,
  0x37300000, 0x37310000, 0x37320000, 0x37330000, 0x37340000, 0x37350000, 0x37360000, 0x37370000, 0x37380000, 0x37390000, 0x373A0000, 0x373B0000, 0x373C0000, 0x373D0000, 0x373E0000, 0x373F0000,
  0x37400000, 0x37410000, 0x37420000, 0x37430000, 0x37440000, 0x37450000, 0x37460000, 0x37470000, 0x37480000, 0x37490000, 0x374A0000, 0x374B0000, 0x374C0000, 0x374D0000, 0x374E0000, 0x374F0000,
  0x37500000, 0x37510000, 0x37520000, 0x37530000, 0x37540000, 0x37550000, 0x37560000, 0x37570000, 0x37580000, 0x37590000, 0x375A0000, 0x375B0000, 0x375C0000, 0x375D0000, 0x375E0000, 0x375F0000,
  0x37600000, 0x37610000, 0x37620000, 0x37630000, 0x37640000, 0x37650000, 0x37660000, 0x37670000, 0x37680000, 0x37690000, 0x376A0000, 0x376B0000, 0x376C0000, 0x376D0000, 0x376E0000, 0x376F0000,
  0x37700000, 0x37710000, 0x37720000, 0x37730000, 0x37740000, 0x37750000, 0x37760000, 0x37770000, 0x37780000, 0x37790000, 0x377A0000, 0x377B0000, 0x377C0000, 0x377D0000, 0x377E0000, 0x377F0000,
  0x37800000, 0x37808000, 0x37810000, 0x37818000, 0x37820000, 0x37828000, 0x37830000, 0x37838000, 0x37840000, 0x37848000, 0x37850000, 0x37858000, 0x37860000, 0x37868000, 0x37870000, 0x37878000,
  0x37880000, 0x37888000, 0x37890000, 0x37898000, 0x378A0000, 0x378A8000, 0x378B0000, 0x378B8000, 0x378C0000, 0x378C8000, 0x378D0000, 0x378D8000, 0x378E0000, 0x378E8000, 0x378F0000, 0x378F8000,
  0x37900000, 0x37908000, 0x37910000, 0x37918000, 0x37920000, 0x37928000, 0x37930000, 0x37938000, 0x37940000, 0x37948000, 0x37950000, 0x37958000, 0x37960000, 0x37968000, 0x37970000, 0x37978000,
  0x37980000, 0x37988000, 0x37990000, 0x37998000, 0x379A0000, 0x379A8000, 0x379B0000, 0x379B8000, 0x379C0000, 0x379C8000, 0x379D0000, 0x379D8000, 0x379E0000, 0x379E8000, 0x379F0000, 0x379F8000,
  0x37A00000, 0x37A08000, 0x37A10000, 0x37A18000, 0x37A20000, 0x37A28000, 0x37A30000, 0x37A38000, 0x37A40000, 0x37A48000, 0x37A50000, 0x37A58000, 0x37A60000, 0x37A68000, 0x37A70000, 0x37A78000,
  0x37A80000, 0x37A88000, 0x37A90000, 0x37A98000, 0x37AA0000, 0x37AA8000, 0x37AB0000, 0x37AB8000, 0x37AC0000, 0x37AC8000, 0x37AD0000, 0x37AD8000, 0x37AE0000, 0x37AE8000, 0x37AF0000, 0x37AF8000,
  0x37B00000, 0x37B08000, 0x37B10000, 0x37B18000, 0x37B20000, 0x37B28000, 0x37B30000, 0x37B38000, 0x37B40000, 0x37B48000, 0x37B50000, 0x37B58000, 0x37B60000, 0x37B68000, 0x37B70000, 0x37B78000,
  0x37B80000, 0x37B88000, 0x37B90000, 0x37B98000, 0x37BA0000, 0x37BA8000, 0x37BB0000, 0x37BB8000, 0x37BC0000, 0x37BC8000, 0x37BD0000, 0x37BD8000, 0x37BE0000, 0x37BE8000, 0x37BF0000, 0x37BF8000,
  0x37C00000, 0x37C08000, 0x37C10000, 0x37C18000, 0x37C20000, 0x37C28000, 0x37C30000, 0x37C38000, 0x37C40000, 0x37C48000, 0x37C50000, 0x37C58000, 0x37C60000, 0x37C68000, 0x37C70000, 0x37C78000,
  0x37C80000, 0x37C88000, 0x37C90000, 0x37C98000, 0x37CA0000, 0x37CA8000, 0x37CB0000, 0x37CB8000, 0x37CC0000, 0x37CC8000, 0x37CD0000, 0x37CD8000, 0x37CE0000, 0x37CE8000, 0x37CF0000, 0x37CF8000,
  0x37D00000, 0x37D08000, 0x37D10000, 0x37D18000, 0x37D20000, 0x37D28000, 0x37D30000, 0x37D38000, 0x37D40000, 0x37D48000, 0x37D50000, 0x37D58000, 0x37D60000, 0x37D68000, 0x37D70000, 0x37D78000,
  0x37D80000, 0x37D88000, 0x37D90000, 0x37D98000, 0x37DA0000, 0x37DA8000, 0x37DB0000, 0x37DB8000, 0x37DC0000, 0x37DC8000, 0x37DD0000, 0x37DD8000, 0x37DE0000, 0x37DE8000, 0x37DF0000, 0x37DF8000,
  0x37E00000, 0x37E08000, 0x37E10000, 0x37E18000, 0x37E20000, 0x37E28000, 0x37E30000, 0x37E38000, 0x37E40000, 0x37E48000, 0x37E50000, 0x37E58000, 0x37E60000, 0x37E68000, 0x37E70000, 0x37E78000,
  0x37E80000, 0x37E88000, 0x37E90000, 0x37E98000, 0x37EA0000, 0x37EA8000, 0x37EB0000, 0x37EB8000, 0x37EC0000, 0x37EC8000, 0x37ED0000, 0x37ED8000, 0x37EE0000, 0x37EE8000, 0x37EF0000, 0x37EF8000,
  0x37F00000, 0x37F08000, 0x37F10000, 0x37F18000, 0x37F20000, 0x37F28000, 0x37F30000, 0x37F38000, 0x37F40000, 0x37F48000, 0x37F50000, 0x37F58000, 0x37F60000, 0x37F68000, 0x37F70000, 0x37F78000,
  0x37F80000, 0x37F88000, 0x37F90000, 0x37F98000, 0x37FA0000, 0x37FA8000, 0x37FB0000, 0x37FB8000, 0x37FC0000, 0x37FC8000, 0x37FD0000, 0x37FD8000, 0x37FE0000, 0x37FE8000, 0x37FF0000, 0x37FF8000,
  0x38000000, 0x38004000, 0x38008000, 0x3800C000, 0x38010000, 0x38014000, 0x38018000, 0x3801C000, 0x38020000, 0x38024000, 0x38028000, 0x3802C000, 0x38030000, 0x38034000, 0x38038000, 0x3803C000,
  0x38040000, 0x38044000, 0x38048000, 0x3804C000, 0x38050000, 0x38054000, 0x38058000, 0x3805C000, 0x38060000, 0x38064000, 0x38068000, 0x3806C000, 0x38070000, 0x38074000, 0x38078000, 0x3807C000,
  0x38080000, 0x38084000, 0x38088000, 0x3808C000, 0x38090000, 0x38094000, 0x38098000, 0x3809C000, 0x380A0000, 0x380A4000, 0x380A8000, 0x380AC000, 0x380B0000, 0x380B4000, 0x380B8000, 0x380BC000,
  0x380C0000, 0x380C4000, 0x380C8000, 0x380CC000, 0x380D0000, 0x380D4000, 0x380D8000, 0x380DC000, 0x380E0000, 0x380E4000, 0x380E8000, 0x380EC000, 0x380F0000, 0x380F4000, 0x380F8000, 0x380FC000,
  0x38100000, 0x38104000, 0x38108000, 0x3810C000, 0x38110000, 0x38114000, 0x38118000, 0x3811C000, 0x38120000, 0x38124000, 0x38128000, 0x3812C000, 0x38130000, 0x38134000, 0x38138000, 0x3813C000,
  0x38140000, 0x38144000, 0x38148000, 0x3814C000, 0x38150000, 0x38154000, 0x38158000, 0x3815C000, 0x38160000, 0x38164000, 0x38168000, 0x3816C000, 0x38170000, 0x38174000, 0x38178000, 0x3817C000,
  0x38180000, 0x38184000, 0x38188000, 0x3818C000, 0x38190000, 0x38194000, 0x38198000, 0x3819C000, 0x381A0000, 0x381A4000, 0x381A8000, 0x381AC000, 0x381B0000, 0x381B4000, 0x381B8000, 0x381BC000,
  0x381C0000, 0x381C4000, 0x381C8000, 0x381CC000, 0x381D0000, 0x381D4000, 0x381D8000, 0x381DC000, 0x381E0000, 0x381E4000, 0x381E8000, 0x381EC000, 0x381F0000, 0x381F4000, 0x381F8000, 0x381FC000,
  0x38200000, 0x38204000, 0x38208000, 0x3820C000, 0x38210000, 0x38214000, 0x38218000, 0x3821C000, 0x38220000, 0x38224000, 0x38228000, 0x3822C000, 0x38230000, 0x38234000, 0x38238000, 0x3823C000,
  0x38240000, 0x38244000, 0x38248000, 0x3824C000, 0x38250000, 0x38254000, 0x38258000, 0x3825C000, 0x38260000, 0x38264000, 0x38268000, 0x3826C000, 0x38270000, 0x38274000, 0x38278000, 0x3827C000,
  0x38280000, 0x38284000, 0x38288000, 0x3828C000, 0x38290000, 0x38294000, 0x38298000, 0x3829C000, 0x382A0000, 0x382A4000, 0x382A8000, 0x382AC000, 0x382B0000, 0x382B4000, 0x382B8000, 0x382BC000,
  0x382C0000, 0x382C4000, 0x382C8000, 0x382CC000, 0x382D0000, 0x382D4000, 0x382D8000, 0x382DC000, 0x382E0000, 0x382E4000, 0x382E8000, 0x382EC000, 0x382F0000, 0x382F4000, 0x382F8000, 0x382FC000,
  0x38300000, 0x38304000, 0x38308000, 0x3830C000, 0x38310000, 0x38314000, 0x38318000, 0x3831C000, 0x38320000, 0x38324000, 0x38328000, 0x3832C000, 0x38330000, 0x38334000, 0x38338000, 0x3833C000,
  0x38340000, 0x38344000, 0x38348000, 0x3834C000, 0x38350000, 0x38354000, 0x38358000, 0x3835C000, 0x38360000, 0x38364000, 0x38368000, 0x3836C000, 0x38370000, 0x38374000, 0x38378000, 0x3837C000,
  0x38380000, 0x38384000, 0x38388000, 0x3838C000, 0x38390000, 0x38394000, 0x38398000, 0x3839C000, 0x383A0000, 0x383A4000, 0x383A8000, 0x383AC000, 0x383B0000, 0x383B4000, 0x383B8000, 0x383BC000,
  0x383C0000, 0x383C4000, 0x383C8000, 0x383CC000, 0x383D0000, 0x383D4000, 0x383D8000, 0x383DC000, 0x383E0000, 0x383E4000, 0x383E8000, 0x383EC000, 0x383F0000, 0x383F4000, 0x383F8000, 0x383FC000,
  0x38400000, 0x38404000, 0x38408000, 0x3840C000, 0x38410000, 0x38414000, 0x38418000, 0x3841C000, 0x38420000, 0x38424000, 0x38428000, 0x3842C000, 0x38430000, 0x38434000, 0x38438000, 0x3843C000,
  0x38440000, 0x38444000, 0x38448000, 0x3844C000, 0x38450000, 0x38454000, 0x38458000, 0x3845C000, 0x38460000, 0x38464000, 0x38468000, 0x3846C000, 0x38470000, 0x38474000, 0x38478000, 0x3847C000,
  0x38480000, 0x38484000, 0x38488000, 0x3848C000, 0x38490000, 0x38494000, 0x38498000, 0x3849C000, 0x384A0000, 0x384A4000, 0x384A8000, 0x384AC000, 0x384B0000, 0x384B4000, 0x384B8000, 0x384BC000,
  0x384C0000, 0x384C4000, 0x384C8000, 0x384CC000, 0x384D0000, 0x384D4000, 0x384D8000, 0x384DC000, 0x384E0000, 0x384E4000, 0x384E8000, 0x384EC000, 0x384F0000, 0x384F4000, 0x384F8000, 0x384FC000,
  0x38500000, 0x38504000, 0x38508000, 0x3850C000, 0x38510000, 0x38514000, 0x38518000, 0x3851C000, 0x38520000, 0x38524000, 0x38528000, 0x3852C000, 0x38530000, 0x38534000, 0x38538000, 0x3853C000,
  0x38540000, 0x38544000, 0x38548000, 0x3854C000, 0x38550000, 0x38554000, 0x38558000, 0x3855C000, 0x38560000, 0x38564000, 0x38568000, 0x3856C000, 0x38570000, 0x38574000, 0x38578000, 0x3857C000,
  0x38580000, 0x38584000, 0x38588000, 0x3858C000, 0x38590000, 0x38594000, 0x38598000, 0x3859C000, 0x385A0000, 0x385A4000, 0x385A8000, 0x385AC000, 0x385B0000, 0x385B4000, 0x385B8000, 0x385BC000,
  0x385C0000, 0x385C4000, 0x385C8000, 0x385CC000, 0x385D0000, 0x385D4000, 0x385D8000, 0x385DC000, 0x385E0000, 0x385E4000, 0x385E8000, 0x385EC000, 0x385F0000, 0x385F4000, 0x385F8000, 0x385FC000,
  0x38600000, 0x38604000, 0x38608000, 0x3860C000, 0x38610000, 0x38614000, 0x38618000, 0x3861C000, 0x38620000, 0x38624000, 0x38628000, 0x3862C000, 0x38630000, 0x38634000, 0x38638000, 0x3863C000,
  0x38640000, 0x38644000, 0x38648000, 0x3864C000, 0x38650000, 0x38654000, 0x38658000, 0x3865C000, 0x38660000, 0x38664000, 0x38668000, 0x3866C000, 0x38670000, 0x38674000, 0x38678000, 0x3867C000,
  0x38680000, 0x38684000, 0x38688000, 0x3868C000, 0x38690000, 0x38694000, 0x38698000, 0x3869C000, 0x386A0000, 0x386A4000, 0x386A8000, 0x386AC000, 0x386B0000, 0x386B4000, 0x386B8000, 0x386BC000,
  0x386C0000, 0x386C4000, 0x386C8000, 0x386CC000, 0x386D0000, 0x386D4000, 0x386D8000, 0x386DC000, 0x386E0000, 0x386E4000, 0x386E8000, 0x386EC000, 0x386F0000, 0x386F4000, 0x386F8000, 0x386FC000,
  0x38700000, 0x38704000, 0x38708000, 0x3870C000, 0x38710000, 0x38714000, 0x38718000, 0x3871C000, 0x38720000, 0x38724000, 0x38728000, 0x3872C000, 0x38730000, 0x38734000, 0x38738000, 0x3873C000,
  0x38740000, 0x38744000, 0x38748000, 0x3874C000, 0x38750000, 0x38754000, 0x38758000, 0x3875C000, 0x38760000, 0x38764000, 0x38768000, 0x3876C000, 0x38770000, 0x38774000, 0x38778000, 0x3877C000,
  0x38780000, 0x38784000, 0x38788000, 0x3878C000, 0x38790000, 0x38794000, 0x38798000, 0x3879C000, 0x387A0000, 0x387A4000, 0x387A8000, 0x387AC000, 0x387B0000, 0x387B4000, 0x387B8000, 0x387BC000,
  0x387C0000, 0x387C4000, 0x387C8000, 0x387CC000, 0x387D0000, 0x387D4000, 0x387D8000, 0x387DC000, 0x387E0000, 0x387E4000, 0x387E8000, 0x387EC000, 0x387F0000, 0x387F4000, 0x387F8000, 0x387FC000,
  0x38000000, 0x38002000, 0x38004000, 0x38006000, 0x38008000, 0x3800A000, 0x3800C000, 0x3800E000, 0x38010000, 0x38012000, 0x38014000, 0x38016000, 0x38018000, 0x3801A000, 0x3801C000, 0x3801E000,
  0x38020000, 0x38022000, 0x38024000, 0x38026000, 0x38028000, 0x3802A000, 0x3802C000, 0x3802E000, 0x38030000, 0x38032000, 0x38034000, 0x38036000, 0x38038000, 0x3803A000, 0x3803C000, 0x3803E000,
  0x38040000, 0x38042000, 0x38044000, 0x38046000, 0x38048000, 0x3804A000, 0x3804C000, 0x3804E000, 0x38050000, 0x38052000, 0x38054000, 0x38056000, 0x38058000, 0x3805A000, 0x3805C000, 0x3805E000,
  0x38060000, 0x38062000, 0x38064000, 0x38066000, 0x38068000, 0x3806A000, 0x3806C000, 0x3806E000, 0x38070000, 0x38072000, 0x38074000, 0x38076000, 0x38078000, 0x3807A000, 0x3807C000, 0x3807E000,
  0x38080000, 0x38082000, 0x38084000, 0x38086000, 0x38088000, 0x3808A000, 0x3808C000, 0x3808E000, 0x38090000, 0x38092000, 0x38094000, 0x38096000, 0x38098000, 0x3809A000, 0x3809C000, 0x3809E000,
  0x380A0000, 0x380A2000, 0x380A4000, 0x380A6000, 0x380A8000, 0x380AA000, 0x380AC000, 0x380AE000, 0x380B0000, 0x380B2000, 0x380B4000, 0x380B6000, 0x380B8000, 0x380BA000, 0x380BC000, 0x380BE000,
  0x380C0000, 0x380C2000, 0x380C4000, 0x380C6000, 0x380C8000, 0x380CA000, 0x380CC000, 0x380CE000, 0x380D0000, 0x380D2000, 0x380D4000, 0x380D6000, 0x380D8000, 0x380DA000, 0x380DC000, 0x380DE000,
  0x380E0000, 0x380E2000, 0x380E4000, 0x380E6000, 0x380E8000, 0x380EA000, 0x380EC000, 0x380EE000, 0x380F0000, 0x380F2000, 0x380F4000, 0x380F6000, 0x380F8000, 0x380FA000, 0x380FC000, 0x380FE000,
  0x38100000, 0x38102000, 0x38104000, 0x38106000, 0x38108000, 0x3810A000, 0x3810C000, 0x3810E000, 0x38110000, 0x38112000, 0x38114000, 0x38116000, 0x38118000, 0x3811A000, 0x3811C000, 0x3811E000,
  0x38120000, 0x38122000, 0x38124000, 0x38126000, 0x38128000, 0x3812A000, 0x3812C000, 0x3812E000, 0x38130000, 0x38132000, 0x38134000, 0x38136000, 0x38138000, 0x3813A000, 0x3813C000, 0x3813E000,
  0x38140000, 0x38142000, 0x38144000, 0x38146000, 0x38148000, 0x3814A000, 0x3814C000, 0x3814E000, 0x38150000, 0x38152000, 0x38154000, 0x38156000, 0x38158000, 0x3815A000, 0x3815C000, 0x3815E000,
  0x38160000, 0x38162000, 0x38164000, 0x38166000, 0x38168000, 0x3816A000, 0x3816C000, 0x3816E000, 0x38170000, 0x38172000, 0x38174000, 0x38176000, 0x38178000, 0x3817A000, 0x3817C000, 0x3817E000,
  0x38180000, 0x38182000, 0x38184000, 0x38186000, 0x38188000, 0x3818A000, 0x3818C000, 0x3818E000, 0x38190000, 0x38192000, 0x38194000, 0x38196000, 0x38198000, 0x3819A000, 0x3819C000, 0x3819E000,
  0x381A0000, 0x381A2000, 0x381A4000, 0x381A6000, 0x381A8000, 0x381AA000, 0x381AC000, 0x381AE000, 0x381B0000, 0x381B2000, 0x381B4000, 0x381B6000, 0x381B8000, 0x381BA000, 0x381BC000, 0x381BE000,
  0x381C0000, 0x381C2000, 0x381C4000, 0x381C6000, 0x381C8000, 0x381CA000, 0x381CC000, 0x381CE000, 0x381D0000, 0x381D2000, 0x381D4000, 0x381D6000, 0x381D8000, 0x381DA000, 0x381DC000, 0x381DE000,
  0x381E0000, 0x381E2000, 0x381E4000, 0x381E6000, 0x381E8000, 0x381EA000, 0x381EC000, 0x381EE000, 0x381F0000, 0x381F2000, 0x381F4000, 0x381F6000, 0x381F8000, 0x381FA000, 0x381FC000, 0x381FE000,
  0x38200000, 0x38202000, 0x38204000, 0x38206000, 0x38208000, 0x3820A000, 0x3820C000, 0x3820E000, 0x38210000, 0x38212000, 0x38214000, 0x38216000, 0x38218000, 0x3821A000, 0x3821C000, 0x3821E000,
  0x38220000, 0x38222000, 0x38224000, 0x38226000, 0x38228000, 0x3822A000, 0x3822C000, 0x3822E000, 0x38230000, 0x38232000, 0x38234000, 0x38236000, 0x38238000, 0x3823A000, 0x3823C000, 0x3823E000,
  0x38240000, 0x38242000, 0x38244000, 0x38246000, 0x38248000, 0x3824A000, 0x3824C000, 0x3824E000, 0x38250000, 0x38252000, 0x38254000, 0x38256000, 0x38258000, 0x3825A000, 0x3825C000, 0x3825E000,
  0x38260000, 0x38262000, 0x38264000, 0x38266000, 0x38268000, 0x3826A000, 0x3826C000, 0x3826E000, 0x38270000, 0x38272000, 0x38274000, 0x38276000, 0x38278000, 0x3827A000, 0x3827C000, 0x3827E000,
  0x38280000, 0x38282000, 0x38284000, 0x38286000, 0x38288000, 0x3828A000, 0x3828C000, 0x3828E000, 0x38290000, 0x38292000, 0x38294000, 0x38296000, 0x38298000, 0x3829A000, 0x3829C000, 0x3829E000,
  0x382A0000, 0x382A2000, 0x382A4000, 0x382A6000, 0x382A8000, 0x382AA000, 0x382AC000, 0x382AE000, 0x382B0000, 0x382B2000, 0x382B4000, 0x382B6000, 0x382B8000, 0x382BA000, 0x382BC000, 0x382BE000,
  0x382C0000, 0x382C2000, 0x382C4000, 0x382C6000, 0x382C8000, 0x382CA000, 0x382CC000, 0x382CE000, 0x382D0000, 0x382D2000, 0x382D4000, 0x382D6000, 0x382D8000, 0x382DA000, 0x382DC000, 0x382DE000,
  0x382E0000, 0x382E2000, 0x382E4000, 0x382E6000, 0x382E8000, 0x382EA000, 0x382EC000, 0x382EE000, 0x382F0000, 0x382F2000, 0x382F4000, 0x382F6000, 0x382F8000, 0x382FA000, 0x382FC000, 0x382FE000,
  0x38300000, 0x38302000, 0x38304000, 0x38306000, 0x38308000, 0x3830A000, 0x3830C000, 0x3830E000, 0x38310000, 0x38312000, 0x38314000, 0x38316000, 0x38318000, 0x3831A000, 0x3831C000, 0x3831E000,
  0x38320000, 0x38322000, 0x38324000, 0x38326000, 0x38328000, 0x3832A000, 0x3832C000, 0x3832E000, 0x38330000, 0x38332000, 0x38334000, 0x38336000, 0x38338000, 0x3833A000, 0x3833C000, 0x3833E000,
  0x38340000, 0x38342000, 0x38344000, 0x38346000, 0x38348000, 0x3834A000, 0x3834C000, 0x3834E000, 0x38350000, 0x38352000, 0x38354000, 0x38356000, 0x38358000, 0x3835A000, 0x3835C000, 0x3835E000,
  0x38360000, 0x38362000, 0x38364000, 0x38366000, 0x38368000, 0x3836A000, 0x3836C000, 0x3836E000, 0x38370000, 0x38372000, 0x38374000, 0x38376000, 0x38378000, 0x3837A000, 0x3837C000, 0x3837E000,
  0x38380000, 0x38382000, 0x38384000, 0x38386000, 0x38388000, 0x3838A000, 0x3838C000, 0x3838E000, 0x38390000, 0x38392000, 0x38394000, 0x38396000, 0x38398000, 0x3839A000, 0x3839C000, 0x3839E000,
  0x383A0000, 0x383A2000, 0x383A4000, 0x383A6000, 0x383A8000, 0x383AA000, 0x383AC000, 0x383AE000, 0x383B0000, 0x383B2000, 0x383B4000, 0x383B6000, 0x383B8000, 0x383BA000, 0x383BC000, 0x383BE000,
  0x383C0000, 0x383C2000, 0x383C4000, 0x383C6000, 0x383C8000, 0x383CA000, 0x383CC000, 0x383CE000, 0x383D0000, 0x383D2000, 0x383D4000, 0x383D6000, 0x383D8000, 0x383DA000, 0x383DC000, 0x383DE000,
  0x383E0000, 0x383E2000, 0x383E4000, 0x383E6000, 0x383E8000, 0x383EA000, 0x383EC000, 0x383EE000, 0x383F0000, 0x383F2000, 0x383F4000, 0x383F6000, 0x383F8000, 0x383FA000, 0x383FC000, 0x383FE000,
  0x38400000, 0x38402000, 0x38404000, 0x38406000, 0x38408000, 0x3840A000, 0x3840C000, 0x3840E000, 0x38410000, 0x38412000, 0x38414000, 0x38416000, 0x38418000, 0x3841A000, 0x3841C000, 0x3841E000,
  0x38420000, 0x38422000, 0x38424000, 0x38426000, 0x38428000, 0x3842A000, 0x3842C000, 0x3842E000, 0x38430000, 0x38432000, 0x38434000, 0x38436000, 0x38438000, 0x3843A000, 0x3843C000, 0x3843E000,
  0x38440000, 0x38442000, 0x38444000, 0x38446000, 0x38448000, 0x3844A000, 0x3844C000, 0x3844E000, 0x38450000, 0x38452000, 0x38454000, 0x38456000, 0x38458000, 0x3845A000, 0x3845C000, 0x3845E000,
  0x38460000, 0x38462000, 0x38464000, 0x38466000, 0x38468000, 0x3846A000, 0x3846C000, 0x3846E000, 0x38470000, 0x38472000, 0x38474000, 0x38476000, 0x38478000, 0x3847A000, 0x3847C000, 0x3847E000,
  0x38480000, 0x38482000, 0x38484000, 0x38486000, 0x38488000, 0x3848A000, 0x3848C000, 0x3848E000, 0x38490000, 0x38492000, 0x38494000, 0x38496000, 0x38498000, 0x3849A000, 0x3849C000, 0x3849E000,
  0x384A0000, 0x384A2000, 0x384A4000, 0x384A6000, 0x384A8000, 0x384AA000, 0x384AC000, 0x384AE000, 0x384B0000, 0x384B2000, 0x384B4000, 0x384B6000, 0x384B8000, 0x384BA000, 0x384BC000, 0x384BE000,
  0x384C0000, 0x384C2000, 0x384C4000, 0x384C6000, 0x384C8000, 0x384CA000, 0x384CC000, 0x384CE000, 0x384D0000, 0x384D2000, 0x384D4000, 0x384D6000, 0x384D8000, 0x384DA000, 0x384DC000, 0x384DE000,
  0x384E0000, 0x384E2000, 0x384E4000, 0x384E6000, 0x384E8000, 0x384EA000, 0x384EC000, 0x384EE000, 0x384F0000, 0x384F2000, 0x384F4000, 0x384F6000, 0x384F8000, 0x384FA000, 0x384FC000, 0x384FE000,
  0x38500000, 0x38502000, 0x38504000, 0x38506000, 0x38508000, 0x3850A000, 0x3850C000, 0x3850E000, 0x38510000, 0x38512000, 0x38514000, 0x38516000, 0x38518000, 0x3851A000, 0x3851C000, 0x3851E000,
  0x38520000, 0x38522000, 0x38524000, 0x38526000, 0x38528000, 0x3852A000, 0x3852C000, 0x3852E000, 0x38530000, 0x38532000, 0x38534000, 0x38536000, 0x38538000, 0x3853A000, 0x3853C000, 0x3853E000,
  0x38540000, 0x38542000, 0x38544000, 0x38546000, 0x38548000, 0x3854A000, 0x3854C000, 0x3854E000, 0x38550000, 0x38552000, 0x38554000, 0x38556000, 0x38558000, 0x3855A000, 0x3855C000, 0x3855E000,
  0x38560000, 0x38562000, 0x38564000, 0x38566000, 0x38568000, 0x3856A000, 0x3856C000, 0x3856E000, 0x38570000, 0x38572000, 0x38574000, 0x38576000, 0x38578000, 0x3857A000, 0x3857C000, 0x3857E000,
  0x38580000, 0x38582000, 0x38584000, 0x38586000, 0x38588000, 0x3858A000, 0x3858C000, 0x3858E000, 0x38590000, 0x38592000, 0x38594000, 0x38596000, 0x38598000, 0x3859A000, 0x3859C000, 0x3859E000,
  0x385A0000, 0x385A2000, 0x385A4000, 0x385A6000, 0x385A8000, 0x385AA000, 0x385AC000, 0x385AE000, 0x385B0000, 0x385B2000, 0x385B4000, 0x385B6000, 0x385B8000, 0x385BA000, 0x385BC000, 0x385BE000,
  0x385C0000, 0x385C2000, 0x385C4000, 0x385C6000, 0x385C8000, 0x385CA000, 0x385CC000, 0x385CE000, 0x385D0000, 0x385D2000, 0x385D4000, 0x385D6000, 0x385D8000, 0x385DA000, 0x385DC000, 0x385DE000,
  0x385E0000, 0x385E2000, 0x385E4000, 0x385E6000, 0x385E8000, 0x385EA000, 0x385EC000, 0x385EE000, 0x385F0000, 0x385F2000, 0x385F4000, 0x385F6000, 0x385F8000, 0x385FA000, 0x385FC000, 0x385FE000,
  0x38600000, 0x38602000, 0x38604000, 0x38606000, 0x38608000, 0x3860A000, 0x3860C000, 0x3860E000, 0x38610000, 0x38612000, 0x38614000, 0x38616000, 0x38618000, 0x3861A000, 0x3861C000, 0x3861E000,
  0x38620000, 0x38622000, 0x38624000, 0x38626000, 0x38628000, 0x3862A000, 0x3862C000, 0x3862E000, 0x38630000, 0x38632000, 0x38634000, 0x38636000, 0x38638000, 0x3863A000, 0x3863C000, 0x3863E000,
  0x38640000, 0x38642000, 0x38644000, 0x38646000, 0x38648000, 0x3864A000, 0x3864C000, 0x3864E000, 0x38650000, 0x38652000, 0x38654000, 0x38656000, 0x38658000, 0x3865A000, 0x3865C000, 0x3865E000,
  0x38660000, 0x38662000, 0x38664000, 0x38666000, 0x38668000, 0x3866A000, 0x3866C000, 0x3866E000, 0x38670000, 0x38672000, 0x38674000, 0x38676000, 0x38678000, 0x3867A000, 0x3867C000, 0x3867E000,
  0x38680000, 0x38682000, 0x38684000, 0x38686000, 0x38688000, 0x3868A000, 0x3868C000, 0x3868E000, 0x38690000, 0x38692000, 0x38694000, 0x38696000, 0x38698000, 0x3869A000, 0x3869C000, 0x3869E000,
  0x386A0000, 0x386A2000, 0x386A4000, 0x386A6000, 0x386A8000, 0x386AA000, 0x386AC000, 0x386AE000, 0x386B0000, 0x386B2000, 0x386B4000, 0x386B6000, 0x386B8000, 0x386BA000, 0x386BC000, 0x386BE000,
  0x386C0000, 0x386C2000, 0x386C4000, 0x386C6000, 0x386C8000, 0x386CA000, 0x386CC000, 0x386CE000, 0x386D0000, 0x386D2000, 0x386D4000, 0x386D6000, 0x386D8000, 0x386DA000, 0x386DC000, 0x386DE000,
  0x386E0000, 0x386E2000, 0x386E4000, 0x386E6000, 0x386E8000, 0x386EA000, 0x386EC000, 0x386EE000, 0x386F0000, 0x386F2000, 0x386F4000, 0x386F6000, 0x386F8000, 0x386FA000, 0x386FC000, 0x386FE000,
  0x38700000, 0x38702000, 0x38704000, 0x38706000, 0x38708000, 0x3870A000, 0x3870C000, 0x3870E000, 0x38710000, 0x38712000, 0x38714000, 0x38716000, 0x38718000, 0x3871A000, 0x3871C000, 0x3871E000,
  0x38720000, 0x38722000, 0x38724000, 0x38726000, 0x38728000, 0x3872A000, 0x3872C000, 0x3872E000, 0x38730000, 0x38732000, 0x38734000, 0x38736000, 0x38738000, 0x3873A000, 0x3873C000, 0x3873E000,
  0x38740000, 0x38742000, 0x38744000, 0x38746000, 0x38748000, 0x3874A000, 0x3874C000, 0x3874E000, 0x38750000, 0x38752000, 0x38754000, 0x38756000, 0x38758000, 0x3875A000, 0x3875C000, 0x3875E000,
  0x38760000, 0x38762000, 0x38764000, 0x38766000, 0x38768000, 0x3876A000, 0x3876C000, 0x3876E000, 0x38770000, 0x38772000, 0x38774000, 0x38776000, 0x38778000, 0x3877A000, 0x3877C000, 0x3877E000,
  0x38780000, 0x38782000, 0x38784000, 0x38786000, 0x38788000, 0x3878A000, 0x3878C000, 0x3878E000, 0x38790000, 0x38792000, 0x38794000, 0x38796000, 0x38798000, 0x3879A000, 0x3879C000, 0x3879E000,
  0x387A0000, 0x387A2000, 0x387A4000, 0x387A6000, 0x387A8000, 0x387AA000, 0x387AC000, 0x387AE000, 0x387B0000, 0x387B2000, 0x387B4000, 0x387B6000, 0x387B8000, 0x387BA000, 0x387BC000, 0x387BE000,
  0x387C0000, 0x387C2000, 0x387C4000, 0x387C6000, 0x387C8000, 0x387CA000, 0x387CC000, 0x387CE000, 0x387D0000, 0x387D2000, 0x387D4000, 0x387D6000, 0x387D8000, 0x387DA000, 0x387DC000, 0x387DE000,
  0x387E0000, 0x387E2000, 0x387E4000, 0x387E6000, 0x387E8000, 0x387EA000, 0x387EC000, 0x387EE000, 0x387F0000, 0x387F2000, 0x387F4000, 0x387F6000, 0x387F8000, 0x387FA000, 0x387FC000, 0x387FE000 };
__constant static const uint32_t exponent_table[64] = {
  0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000, 0x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000, 0x06000000, 0x06800000, 0x07000000, 0x07800000,
  0x08000000, 0x08800000, 0x09000000, 0x09800000, 0x0A000000, 0x0A800000, 0x0B000000, 0x0B800000, 0x0C000000, 0x0C800000, 0x0D000000, 0x0D800000, 0x0E000000, 0x0E800000, 0x0F000000, 0x47800000,
  0x80000000, 0x80800000, 0x81000000, 0x81800000, 0x82000000, 0x82800000, 0x83000000, 0x83800000, 0x84000000, 0x84800000, 0x85000000, 0x85800000, 0x86000000, 0x86800000, 0x87000000, 0x87800000,
  0x88000000, 0x88800000, 0x89000000, 0x89800000, 0x8A000000, 0x8A800000, 0x8B000000, 0x8B800000, 0x8C000000, 0x8C800000, 0x8D000000, 0x8D800000, 0x8E000000, 0x8E800000, 0x8F000000, 0xC7800000 };
__constant static const unsigned short offset_table[64] = {
  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 };

static uint16_t float2halfbits(float value) {
  union { float x; uint32_t y; } u;
  u.x = value;
  uint32_t bits = u.y;

  uint16_t hbits = base_table[bits>>23] + (uint16_t)((bits&0x7FFFFF)>>shift_table[bits>>23]);;

  return hbits;
}

static float halfbits2float(uint16_t value) {
  uint32_t bits = mantissa_table[offset_table[value>>10]+(value&0x3FF)] + exponent_table[value>>10];

  union { uint32_t x; float y; } u;
  u.x = bits;
  return u.y;
}

// End of half.h.
// Start of timing.h.

// The function get_wall_time() returns the wall time in microseconds
// (with an unspecified offset).

#ifdef _WIN32

#include <windows.h>

static int64_t get_wall_time(void) {
  LARGE_INTEGER time,freq;
  assert(QueryPerformanceFrequency(&freq));
  assert(QueryPerformanceCounter(&time));
  return ((double)time.QuadPart / freq.QuadPart) * 1000000;
}

#else
// Assuming POSIX

#include <time.h>
#include <sys/time.h>

static int64_t get_wall_time(void) {
  struct timeval time;
  assert(gettimeofday(&time,NULL) == 0);
  return time.tv_sec * 1000000 + time.tv_usec;
}

static int64_t get_wall_time_ns(void) {
  struct timespec time;
  assert(clock_gettime(CLOCK_REALTIME, &time) == 0);
  return time.tv_sec * 1000000000 + time.tv_nsec;
}

#endif

// End of timing.h.

#ifdef _MSC_VER
#define inline __inline
#endif
#include <string.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <ctype.h>



// Start of lock.h.

// A very simple cross-platform implementation of locks.  Uses
// pthreads on Unix and some Windows thing there.  Futhark's
// host-level code is not multithreaded, but user code may be, so we
// need some mechanism for ensuring atomic access to API functions.
// This is that mechanism.  It is not exposed to user code at all, so
// we do not have to worry about name collisions.

#ifdef _WIN32

typedef HANDLE lock_t;

static void create_lock(lock_t *lock) {
  *lock = CreateMutex(NULL,  // Default security attributes.
                      FALSE, // Initially unlocked.
                      NULL); // Unnamed.
}

static void lock_lock(lock_t *lock) {
  assert(WaitForSingleObject(*lock, INFINITE) == WAIT_OBJECT_0);
}

static void lock_unlock(lock_t *lock) {
  assert(ReleaseMutex(*lock));
}

static void free_lock(lock_t *lock) {
  CloseHandle(*lock);
}

#else
// Assuming POSIX

#include <pthread.h>

typedef pthread_mutex_t lock_t;

static void create_lock(lock_t *lock) {
  int r = pthread_mutex_init(lock, NULL);
  assert(r == 0);
}

static void lock_lock(lock_t *lock) {
  int r = pthread_mutex_lock(lock);
  assert(r == 0);
}

static void lock_unlock(lock_t *lock) {
  int r = pthread_mutex_unlock(lock);
  assert(r == 0);
}

static void free_lock(lock_t *lock) {
  // Nothing to do for pthreads.
  (void)lock;
}

#endif

// End of lock.h.

#define FUTHARK_F64_ENABLED

// Start of scalar.h.

// Implementation of the primitive scalar operations.  Very
// repetitive.  This code is inserted directly into both CUDA and
// OpenCL programs, as well as the CPU code, so it has some #ifdefs to
// work everywhere.  Some operations are defined as macros because
// this allows us to use them as constant expressions in things like
// array sizes and static initialisers.

// Some of the #ifdefs are because OpenCL uses type-generic functions
// for some operations (e.g. sqrt), while C and CUDA sensibly use
// distinct functions for different precisions (e.g. sqrtf() and
// sqrt()).  This is quite annoying.  Due to C's unfortunate casting
// rules, it is also really easy to accidentally implement
// floating-point functions in the wrong precision, so be careful.

// Double-precision definitions are only included if the preprocessor
// macro FUTHARK_F64_ENABLED is set.

static inline uint8_t add8(uint8_t x, uint8_t y) {
  return x + y;
}

static inline uint16_t add16(uint16_t x, uint16_t y) {
  return x + y;
}

static inline uint32_t add32(uint32_t x, uint32_t y) {
  return x + y;
}

static inline uint64_t add64(uint64_t x, uint64_t y) {
  return x + y;
}

static inline uint8_t sub8(uint8_t x, uint8_t y) {
  return x - y;
}

static inline uint16_t sub16(uint16_t x, uint16_t y) {
  return x - y;
}

static inline uint32_t sub32(uint32_t x, uint32_t y) {
  return x - y;
}

static inline uint64_t sub64(uint64_t x, uint64_t y) {
  return x - y;
}

static inline uint8_t mul8(uint8_t x, uint8_t y) {
  return x * y;
}

static inline uint16_t mul16(uint16_t x, uint16_t y) {
  return x * y;
}

static inline uint32_t mul32(uint32_t x, uint32_t y) {
  return x * y;
}

static inline uint64_t mul64(uint64_t x, uint64_t y) {
  return x * y;
}

static inline uint8_t udiv8(uint8_t x, uint8_t y) {
  return x / y;
}

static inline uint16_t udiv16(uint16_t x, uint16_t y) {
  return x / y;
}

static inline uint32_t udiv32(uint32_t x, uint32_t y) {
  return x / y;
}

static inline uint64_t udiv64(uint64_t x, uint64_t y) {
  return x / y;
}

static inline uint8_t udiv_up8(uint8_t x, uint8_t y) {
  return (x + y - 1) / y;
}

static inline uint16_t udiv_up16(uint16_t x, uint16_t y) {
  return (x + y - 1) / y;
}

static inline uint32_t udiv_up32(uint32_t x, uint32_t y) {
  return (x + y - 1) / y;
}

static inline uint64_t udiv_up64(uint64_t x, uint64_t y) {
  return (x + y - 1) / y;
}

static inline uint8_t umod8(uint8_t x, uint8_t y) {
  return x % y;
}

static inline uint16_t umod16(uint16_t x, uint16_t y) {
  return x % y;
}

static inline uint32_t umod32(uint32_t x, uint32_t y) {
  return x % y;
}

static inline uint64_t umod64(uint64_t x, uint64_t y) {
  return x % y;
}

static inline uint8_t udiv_safe8(uint8_t x, uint8_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint16_t udiv_safe16(uint16_t x, uint16_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint32_t udiv_safe32(uint32_t x, uint32_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint64_t udiv_safe64(uint64_t x, uint64_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint8_t udiv_up_safe8(uint8_t x, uint8_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint16_t udiv_up_safe16(uint16_t x, uint16_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint32_t udiv_up_safe32(uint32_t x, uint32_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint64_t udiv_up_safe64(uint64_t x, uint64_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint8_t umod_safe8(uint8_t x, uint8_t y) {
  return y == 0 ? 0 : x % y;
}

static inline uint16_t umod_safe16(uint16_t x, uint16_t y) {
  return y == 0 ? 0 : x % y;
}

static inline uint32_t umod_safe32(uint32_t x, uint32_t y) {
  return y == 0 ? 0 : x % y;
}

static inline uint64_t umod_safe64(uint64_t x, uint64_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int8_t sdiv8(int8_t x, int8_t y) {
  int8_t q = x / y;
  int8_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int16_t sdiv16(int16_t x, int16_t y) {
  int16_t q = x / y;
  int16_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int32_t sdiv32(int32_t x, int32_t y) {
  int32_t q = x / y;
  int32_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int64_t sdiv64(int64_t x, int64_t y) {
  int64_t q = x / y;
  int64_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int8_t sdiv_up8(int8_t x, int8_t y) {
  return sdiv8(x + y - 1, y);
}

static inline int16_t sdiv_up16(int16_t x, int16_t y) {
  return sdiv16(x + y - 1, y);
}

static inline int32_t sdiv_up32(int32_t x, int32_t y) {
  return sdiv32(x + y - 1, y);
}

static inline int64_t sdiv_up64(int64_t x, int64_t y) {
  return sdiv64(x + y - 1, y);
}

static inline int8_t smod8(int8_t x, int8_t y) {
  int8_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int16_t smod16(int16_t x, int16_t y) {
  int16_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int32_t smod32(int32_t x, int32_t y) {
  int32_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int64_t smod64(int64_t x, int64_t y) {
  int64_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int8_t sdiv_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : sdiv8(x, y);
}

static inline int16_t sdiv_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : sdiv16(x, y);
}

static inline int32_t sdiv_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : sdiv32(x, y);
}

static inline int64_t sdiv_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : sdiv64(x, y);
}

static inline int8_t sdiv_up_safe8(int8_t x, int8_t y) {
  return sdiv_safe8(x + y - 1, y);
}

static inline int16_t sdiv_up_safe16(int16_t x, int16_t y) {
  return sdiv_safe16(x + y - 1, y);
}

static inline int32_t sdiv_up_safe32(int32_t x, int32_t y) {
  return sdiv_safe32(x + y - 1, y);
}

static inline int64_t sdiv_up_safe64(int64_t x, int64_t y) {
  return sdiv_safe64(x + y - 1, y);
}

static inline int8_t smod_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : smod8(x, y);
}

static inline int16_t smod_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : smod16(x, y);
}

static inline int32_t smod_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : smod32(x, y);
}

static inline int64_t smod_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : smod64(x, y);
}

static inline int8_t squot8(int8_t x, int8_t y) {
  return x / y;
}

static inline int16_t squot16(int16_t x, int16_t y) {
  return x / y;
}

static inline int32_t squot32(int32_t x, int32_t y) {
  return x / y;
}

static inline int64_t squot64(int64_t x, int64_t y) {
  return x / y;
}

static inline int8_t srem8(int8_t x, int8_t y) {
  return x % y;
}

static inline int16_t srem16(int16_t x, int16_t y) {
  return x % y;
}

static inline int32_t srem32(int32_t x, int32_t y) {
  return x % y;
}

static inline int64_t srem64(int64_t x, int64_t y) {
  return x % y;
}

static inline int8_t squot_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int16_t squot_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int32_t squot_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int64_t squot_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int8_t srem_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int16_t srem_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int32_t srem_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int64_t srem_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int8_t smin8(int8_t x, int8_t y) {
  return x < y ? x : y;
}

static inline int16_t smin16(int16_t x, int16_t y) {
  return x < y ? x : y;
}

static inline int32_t smin32(int32_t x, int32_t y) {
  return x < y ? x : y;
}

static inline int64_t smin64(int64_t x, int64_t y) {
  return x < y ? x : y;
}

static inline uint8_t umin8(uint8_t x, uint8_t y) {
  return x < y ? x : y;
}

static inline uint16_t umin16(uint16_t x, uint16_t y) {
  return x < y ? x : y;
}

static inline uint32_t umin32(uint32_t x, uint32_t y) {
  return x < y ? x : y;
}

static inline uint64_t umin64(uint64_t x, uint64_t y) {
  return x < y ? x : y;
}

static inline int8_t smax8(int8_t x, int8_t y) {
  return x < y ? y : x;
}

static inline int16_t smax16(int16_t x, int16_t y) {
  return x < y ? y : x;
}

static inline int32_t smax32(int32_t x, int32_t y) {
  return x < y ? y : x;
}

static inline int64_t smax64(int64_t x, int64_t y) {
  return x < y ? y : x;
}

static inline uint8_t umax8(uint8_t x, uint8_t y) {
  return x < y ? y : x;
}

static inline uint16_t umax16(uint16_t x, uint16_t y) {
  return x < y ? y : x;
}

static inline uint32_t umax32(uint32_t x, uint32_t y) {
  return x < y ? y : x;
}

static inline uint64_t umax64(uint64_t x, uint64_t y) {
  return x < y ? y : x;
}

static inline uint8_t shl8(uint8_t x, uint8_t y) {
  return (uint8_t)(x << y);
}

static inline uint16_t shl16(uint16_t x, uint16_t y) {
  return (uint16_t)(x << y);
}

static inline uint32_t shl32(uint32_t x, uint32_t y) {
  return x << y;
}

static inline uint64_t shl64(uint64_t x, uint64_t y) {
  return x << y;
}

static inline uint8_t lshr8(uint8_t x, uint8_t y) {
  return x >> y;
}

static inline uint16_t lshr16(uint16_t x, uint16_t y) {
  return x >> y;
}

static inline uint32_t lshr32(uint32_t x, uint32_t y) {
  return x >> y;
}

static inline uint64_t lshr64(uint64_t x, uint64_t y) {
  return x >> y;
}

static inline int8_t ashr8(int8_t x, int8_t y) {
  return x >> y;
}

static inline int16_t ashr16(int16_t x, int16_t y) {
  return x >> y;
}

static inline int32_t ashr32(int32_t x, int32_t y) {
  return x >> y;
}

static inline int64_t ashr64(int64_t x, int64_t y) {
  return x >> y;
}

static inline uint8_t and8(uint8_t x, uint8_t y) {
  return x & y;
}

static inline uint16_t and16(uint16_t x, uint16_t y) {
  return x & y;
}

static inline uint32_t and32(uint32_t x, uint32_t y) {
  return x & y;
}

static inline uint64_t and64(uint64_t x, uint64_t y) {
  return x & y;
}

static inline uint8_t or8(uint8_t x, uint8_t y) {
  return x | y;
}

static inline uint16_t or16(uint16_t x, uint16_t y) {
  return x | y;
}

static inline uint32_t or32(uint32_t x, uint32_t y) {
  return x | y;
}

static inline uint64_t or64(uint64_t x, uint64_t y) {
  return x | y;
}

static inline uint8_t xor8(uint8_t x, uint8_t y) {
  return x ^ y;
}

static inline uint16_t xor16(uint16_t x, uint16_t y) {
  return x ^ y;
}

static inline uint32_t xor32(uint32_t x, uint32_t y) {
  return x ^ y;
}

static inline uint64_t xor64(uint64_t x, uint64_t y) {
  return x ^ y;
}

static inline bool ult8(uint8_t x, uint8_t y) {
  return x < y;
}

static inline bool ult16(uint16_t x, uint16_t y) {
  return x < y;
}

static inline bool ult32(uint32_t x, uint32_t y) {
  return x < y;
}

static inline bool ult64(uint64_t x, uint64_t y) {
  return x < y;
}

static inline bool ule8(uint8_t x, uint8_t y) {
  return x <= y;
}

static inline bool ule16(uint16_t x, uint16_t y) {
  return x <= y;
}

static inline bool ule32(uint32_t x, uint32_t y) {
  return x <= y;
}

static inline bool ule64(uint64_t x, uint64_t y) {
  return x <= y;
}

static inline bool slt8(int8_t x, int8_t y) {
  return x < y;
}

static inline bool slt16(int16_t x, int16_t y) {
  return x < y;
}

static inline bool slt32(int32_t x, int32_t y) {
  return x < y;
}

static inline bool slt64(int64_t x, int64_t y) {
  return x < y;
}

static inline bool sle8(int8_t x, int8_t y) {
  return x <= y;
}

static inline bool sle16(int16_t x, int16_t y) {
  return x <= y;
}

static inline bool sle32(int32_t x, int32_t y) {
  return x <= y;
}

static inline bool sle64(int64_t x, int64_t y) {
  return x <= y;
}

static inline uint8_t pow8(uint8_t x, uint8_t y) {
  uint8_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline uint16_t pow16(uint16_t x, uint16_t y) {
  uint16_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline uint32_t pow32(uint32_t x, uint32_t y) {
  uint32_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline uint64_t pow64(uint64_t x, uint64_t y) {
  uint64_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline bool itob_i8_bool(int8_t x) {
  return x;
}

static inline bool itob_i16_bool(int16_t x) {
  return x;
}

static inline bool itob_i32_bool(int32_t x) {
  return x;
}

static inline bool itob_i64_bool(int64_t x) {
  return x;
}

static inline int8_t btoi_bool_i8(bool x) {
  return x;
}

static inline int16_t btoi_bool_i16(bool x) {
  return x;
}

static inline int32_t btoi_bool_i32(bool x) {
  return x;
}

static inline int64_t btoi_bool_i64(bool x) {
  return x;
}

#define sext_i8_i8(x) ((int8_t) (int8_t) (x))
#define sext_i8_i16(x) ((int16_t) (int8_t) (x))
#define sext_i8_i32(x) ((int32_t) (int8_t) (x))
#define sext_i8_i64(x) ((int64_t) (int8_t) (x))
#define sext_i16_i8(x) ((int8_t) (int16_t) (x))
#define sext_i16_i16(x) ((int16_t) (int16_t) (x))
#define sext_i16_i32(x) ((int32_t) (int16_t) (x))
#define sext_i16_i64(x) ((int64_t) (int16_t) (x))
#define sext_i32_i8(x) ((int8_t) (int32_t) (x))
#define sext_i32_i16(x) ((int16_t) (int32_t) (x))
#define sext_i32_i32(x) ((int32_t) (int32_t) (x))
#define sext_i32_i64(x) ((int64_t) (int32_t) (x))
#define sext_i64_i8(x) ((int8_t) (int64_t) (x))
#define sext_i64_i16(x) ((int16_t) (int64_t) (x))
#define sext_i64_i32(x) ((int32_t) (int64_t) (x))
#define sext_i64_i64(x) ((int64_t) (int64_t) (x))
#define zext_i8_i8(x) ((int8_t) (uint8_t) (x))
#define zext_i8_i16(x) ((int16_t) (uint8_t) (x))
#define zext_i8_i32(x) ((int32_t) (uint8_t) (x))
#define zext_i8_i64(x) ((int64_t) (uint8_t) (x))
#define zext_i16_i8(x) ((int8_t) (uint16_t) (x))
#define zext_i16_i16(x) ((int16_t) (uint16_t) (x))
#define zext_i16_i32(x) ((int32_t) (uint16_t) (x))
#define zext_i16_i64(x) ((int64_t) (uint16_t) (x))
#define zext_i32_i8(x) ((int8_t) (uint32_t) (x))
#define zext_i32_i16(x) ((int16_t) (uint32_t) (x))
#define zext_i32_i32(x) ((int32_t) (uint32_t) (x))
#define zext_i32_i64(x) ((int64_t) (uint32_t) (x))
#define zext_i64_i8(x) ((int8_t) (uint64_t) (x))
#define zext_i64_i16(x) ((int16_t) (uint64_t) (x))
#define zext_i64_i32(x) ((int32_t) (uint64_t) (x))
#define zext_i64_i64(x) ((int64_t) (uint64_t) (x))

static int8_t abs8(int8_t x) {
  return (int8_t)abs(x);
}

static int16_t abs16(int16_t x) {
  return (int16_t)abs(x);
}

static int32_t abs32(int32_t x) {
  return abs(x);
}

static int64_t abs64(int64_t x) {
#if defined(__OPENCL_VERSION__)
  return abs(x);
#else
  return llabs(x);
#endif
}

#if defined(__OPENCL_VERSION__)
static int32_t futrts_popc8(int8_t x) {
  return popcount(x);
}

static int32_t futrts_popc16(int16_t x) {
  return popcount(x);
}

static int32_t futrts_popc32(int32_t x) {
  return popcount(x);
}

static int32_t futrts_popc64(int64_t x) {
  return popcount(x);
}
#elif defined(__CUDA_ARCH__)

static int32_t futrts_popc8(int8_t x) {
  return __popc(zext_i8_i32(x));
}

static int32_t futrts_popc16(int16_t x) {
  return __popc(zext_i16_i32(x));
}

static int32_t futrts_popc32(int32_t x) {
  return __popc(x);
}

static int32_t futrts_popc64(int64_t x) {
  return __popcll(x);
}

#else // Not OpenCL or CUDA, but plain C.

static int32_t futrts_popc8(uint8_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}

static int32_t futrts_popc16(uint16_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}

static int32_t futrts_popc32(uint32_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}

static int32_t futrts_popc64(uint64_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}
#endif

#if defined(__OPENCL_VERSION__)
static uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {
  return mul_hi(a, b);
}

static uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {
  return mul_hi(a, b);
}

static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
  return mul_hi(a, b);
}

static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
  return mul_hi(a, b);
}

#elif defined(__CUDA_ARCH__)

static uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {
  uint16_t aa = a;
  uint16_t bb = b;

  return aa * bb >> 8;
}

static uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {
  uint32_t aa = a;
  uint32_t bb = b;

  return aa * bb >> 16;
}

static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
  return mulhi(a, b);
}

static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
  return mul64hi(a, b);
}

#else // Not OpenCL or CUDA, but plain C.

static uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {
  uint16_t aa = a;
  uint16_t bb = b;

  return aa * bb >> 8;
}

static uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {
  uint32_t aa = a;
  uint32_t bb = b;

  return aa * bb >> 16;
}

static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
  uint64_t aa = a;
  uint64_t bb = b;

  return aa * bb >> 32;
}

static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
  __uint128_t aa = a;
  __uint128_t bb = b;

  return aa * bb >> 64;
}
#endif

#if defined(__OPENCL_VERSION__)
static uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {
  return mad_hi(a, b, c);
}

static uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {
  return mad_hi(a, b, c);
}

static uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {
  return mad_hi(a, b, c);
}

static uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {
  return mad_hi(a, b, c);
}

#else // Not OpenCL

static uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {
  return futrts_mul_hi8(a, b) + c;
}

static uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {
  return futrts_mul_hi16(a, b) + c;
}

static uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {
  return futrts_mul_hi32(a, b) + c;
}

static uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {
  return futrts_mul_hi64(a, b) + c;
}
#endif

#if defined(__OPENCL_VERSION__)
static int32_t futrts_clzz8(int8_t x) {
  return clz(x);
}

static int32_t futrts_clzz16(int16_t x) {
  return clz(x);
}

static int32_t futrts_clzz32(int32_t x) {
  return clz(x);
}

static int32_t futrts_clzz64(int64_t x) {
  return clz(x);
}

#elif defined(__CUDA_ARCH__)

static int32_t futrts_clzz8(int8_t x) {
  return __clz(zext_i8_i32(x)) - 24;
}

static int32_t futrts_clzz16(int16_t x) {
  return __clz(zext_i16_i32(x)) - 16;
}

static int32_t futrts_clzz32(int32_t x) {
  return __clz(x);
}

static int32_t futrts_clzz64(int64_t x) {
  return __clzll(x);
}

#else // Not OpenCL or CUDA, but plain C.

static int32_t futrts_clzz8(int8_t x) {
  return x == 0 ? 8 : __builtin_clz((uint32_t)zext_i8_i32(x)) - 24;
}

static int32_t futrts_clzz16(int16_t x) {
  return x == 0 ? 16 : __builtin_clz((uint32_t)zext_i16_i32(x)) - 16;
}

static int32_t futrts_clzz32(int32_t x) {
  return x == 0 ? 32 : __builtin_clz((uint32_t)x);
}

static int32_t futrts_clzz64(int64_t x) {
  return x == 0 ? 64 : __builtin_clzll((uint64_t)x);
}
#endif

#if defined(__OPENCL_VERSION__)
static int32_t futrts_ctzz8(int8_t x) {
  int i = 0;
  for (; i < 8 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

static int32_t futrts_ctzz16(int16_t x) {
  int i = 0;
  for (; i < 16 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

static int32_t futrts_ctzz32(int32_t x) {
  int i = 0;
  for (; i < 32 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

static int32_t futrts_ctzz64(int64_t x) {
  int i = 0;
  for (; i < 64 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

#elif defined(__CUDA_ARCH__)

static int32_t futrts_ctzz8(int8_t x) {
  int y = __ffs(x);
  return y == 0 ? 8 : y - 1;
}

static int32_t futrts_ctzz16(int16_t x) {
  int y = __ffs(x);
  return y == 0 ? 16 : y - 1;
}

static int32_t futrts_ctzz32(int32_t x) {
  int y = __ffs(x);
  return y == 0 ? 32 : y - 1;
}

static int32_t futrts_ctzz64(int64_t x) {
  int y = __ffsll(x);
  return y == 0 ? 64 : y - 1;
}

#else // Not OpenCL or CUDA, but plain C.

static int32_t futrts_ctzz8(int8_t x) {
  return x == 0 ? 8 : __builtin_ctz((uint32_t)x);
}

static int32_t futrts_ctzz16(int16_t x) {
  return x == 0 ? 16 : __builtin_ctz((uint32_t)x);
}

static int32_t futrts_ctzz32(int32_t x) {
  return x == 0 ? 32 : __builtin_ctz((uint32_t)x);
}

static int32_t futrts_ctzz64(int64_t x) {
  return x == 0 ? 64 : __builtin_ctzll((uint64_t)x);
}
#endif

static inline float fdiv32(float x, float y) {
  return x / y;
}

static inline float fadd32(float x, float y) {
  return x + y;
}

static inline float fsub32(float x, float y) {
  return x - y;
}

static inline float fmul32(float x, float y) {
  return x * y;
}

static inline bool cmplt32(float x, float y) {
  return x < y;
}

static inline bool cmple32(float x, float y) {
  return x <= y;
}

static inline float sitofp_i8_f32(int8_t x) {
  return (float) x;
}

static inline float sitofp_i16_f32(int16_t x) {
  return (float) x;
}

static inline float sitofp_i32_f32(int32_t x) {
  return (float) x;
}

static inline float sitofp_i64_f32(int64_t x) {
  return (float) x;
}

static inline float uitofp_i8_f32(uint8_t x) {
  return (float) x;
}

static inline float uitofp_i16_f32(uint16_t x) {
  return (float) x;
}

static inline float uitofp_i32_f32(uint32_t x) {
  return (float) x;
}

static inline float uitofp_i64_f32(uint64_t x) {
  return (float) x;
}

static inline int8_t fptosi_f32_i8(float x) {
  return (int8_t) x;
}

static inline int16_t fptosi_f32_i16(float x) {
  return (int16_t) x;
}

static inline int32_t fptosi_f32_i32(float x) {
  return (int32_t) x;
}

static inline int64_t fptosi_f32_i64(float x) {
  return (int64_t) x;
}

static inline uint8_t fptoui_f32_i8(float x) {
  return (uint8_t) x;
}

static inline uint16_t fptoui_f32_i16(float x) {
  return (uint16_t) x;
}

static inline uint32_t fptoui_f32_i32(float x) {
  return (uint32_t) x;
}

static inline uint64_t fptoui_f32_i64(float x) {
  return (uint64_t) x;
}

#ifdef __OPENCL_VERSION__
static inline float fabs32(float x) {
  return fabs(x);
}

static inline float fmax32(float x, float y) {
  return fmax(x, y);
}

static inline float fmin32(float x, float y) {
  return fmin(x, y);
}

static inline float fpow32(float x, float y) {
  return pow(x, y);
}

#else // Not OpenCL, but CUDA or plain C.

static inline float fabs32(float x) {
  return fabsf(x);
}

static inline float fmax32(float x, float y) {
  return fmaxf(x, y);
}

static inline float fmin32(float x, float y) {
  return fminf(x, y);
}

static inline float fpow32(float x, float y) {
  return powf(x, y);
}
#endif

static inline bool futrts_isnan32(float x) {
  return isnan(x);
}

static inline bool futrts_isinf32(float x) {
  return isinf(x);
}

#ifdef __OPENCL_VERSION__
static inline float futrts_log32(float x) {
  return log(x);
}

static inline float futrts_log2_32(float x) {
  return log2(x);
}

static inline float futrts_log10_32(float x) {
  return log10(x);
}

static inline float futrts_sqrt32(float x) {
  return sqrt(x);
}

static inline float futrts_exp32(float x) {
  return exp(x);
}

static inline float futrts_cos32(float x) {
  return cos(x);
}

static inline float futrts_sin32(float x) {
  return sin(x);
}

static inline float futrts_tan32(float x) {
  return tan(x);
}

static inline float futrts_acos32(float x) {
  return acos(x);
}

static inline float futrts_asin32(float x) {
  return asin(x);
}

static inline float futrts_atan32(float x) {
  return atan(x);
}

static inline float futrts_cosh32(float x) {
  return cosh(x);
}

static inline float futrts_sinh32(float x) {
  return sinh(x);
}

static inline float futrts_tanh32(float x) {
  return tanh(x);
}

static inline float futrts_acosh32(float x) {
  return acosh(x);
}

static inline float futrts_asinh32(float x) {
  return asinh(x);
}

static inline float futrts_atanh32(float x) {
  return atanh(x);
}

static inline float futrts_atan2_32(float x, float y) {
  return atan2(x, y);
}

static inline float futrts_hypot32(float x, float y) {
  return hypot(x, y);
}

static inline float futrts_gamma32(float x) {
  return tgamma(x);
}

static inline float futrts_lgamma32(float x) {
  return lgamma(x);
}

static inline float fmod32(float x, float y) {
  return fmod(x, y);
}

static inline float futrts_round32(float x) {
  return rint(x);
}

static inline float futrts_floor32(float x) {
  return floor(x);
}

static inline float futrts_ceil32(float x) {
  return ceil(x);
}

static inline float futrts_lerp32(float v0, float v1, float t) {
  return mix(v0, v1, t);
}

static inline float futrts_mad32(float a, float b, float c) {
  return mad(a, b, c);
}

static inline float futrts_fma32(float a, float b, float c) {
  return fma(a, b, c);
}

#else // Not OpenCL, but CUDA or plain C.

static inline float futrts_log32(float x) {
  return logf(x);
}

static inline float futrts_log2_32(float x) {
  return log2f(x);
}

static inline float futrts_log10_32(float x) {
  return log10f(x);
}

static inline float futrts_sqrt32(float x) {
  return sqrtf(x);
}

static inline float futrts_exp32(float x) {
  return expf(x);
}

static inline float futrts_cos32(float x) {
  return cosf(x);
}

static inline float futrts_sin32(float x) {
  return sinf(x);
}

static inline float futrts_tan32(float x) {
  return tanf(x);
}

static inline float futrts_acos32(float x) {
  return acosf(x);
}

static inline float futrts_asin32(float x) {
  return asinf(x);
}

static inline float futrts_atan32(float x) {
  return atanf(x);
}

static inline float futrts_cosh32(float x) {
  return coshf(x);
}

static inline float futrts_sinh32(float x) {
  return sinhf(x);
}

static inline float futrts_tanh32(float x) {
  return tanhf(x);
}

static inline float futrts_acosh32(float x) {
  return acoshf(x);
}

static inline float futrts_asinh32(float x) {
  return asinhf(x);
}

static inline float futrts_atanh32(float x) {
  return atanhf(x);
}

static inline float futrts_atan2_32(float x, float y) {
  return atan2f(x, y);
}

static inline float futrts_hypot32(float x, float y) {
  return hypotf(x, y);
}

static inline float futrts_gamma32(float x) {
  return tgammaf(x);
}

static inline float futrts_lgamma32(float x) {
  return lgammaf(x);
}

static inline float fmod32(float x, float y) {
  return fmodf(x, y);
}

static inline float futrts_round32(float x) {
  return rintf(x);
}

static inline float futrts_floor32(float x) {
  return floorf(x);
}

static inline float futrts_ceil32(float x) {
  return ceilf(x);
}

static inline float futrts_lerp32(float v0, float v1, float t) {
  return v0 + (v1 - v0) * t;
}

static inline float futrts_mad32(float a, float b, float c) {
  return a * b + c;
}

static inline float futrts_fma32(float a, float b, float c) {
  return fmaf(a, b, c);
}
#endif

static inline int32_t futrts_to_bits32(float x) {
  union {
    float f;
    int32_t t;
  } p;

  p.f = x;
  return p.t;
}

static inline float futrts_from_bits32(int32_t x) {
  union {
    int32_t f;
    float t;
  } p;

  p.f = x;
  return p.t;
}

static inline float fsignum32(float x) {
  return futrts_isnan32(x) ? x : (x > 0) - (x < 0);
}

#ifdef FUTHARK_F64_ENABLED

static inline double fdiv64(double x, double y) {
  return x / y;
}

static inline double fadd64(double x, double y) {
  return x + y;
}

static inline double fsub64(double x, double y) {
  return x - y;
}

static inline double fmul64(double x, double y) {
  return x * y;
}

static inline bool cmplt64(double x, double y) {
  return x < y;
}

static inline bool cmple64(double x, double y) {
  return x <= y;
}

static inline double sitofp_i8_f64(int8_t x) {
  return (double) x;
}

static inline double sitofp_i16_f64(int16_t x) {
  return (double) x;
}

static inline double sitofp_i32_f64(int32_t x) {
  return (double) x;
}

static inline double sitofp_i64_f64(int64_t x) {
  return (double) x;
}

static inline double uitofp_i8_f64(uint8_t x) {
  return (double) x;
}

static inline double uitofp_i16_f64(uint16_t x) {
  return (double) x;
}

static inline double uitofp_i32_f64(uint32_t x) {
  return (double) x;
}

static inline double uitofp_i64_f64(uint64_t x) {
  return (double) x;
}

static inline int8_t fptosi_f64_i8(double x) {
  return (int8_t) x;
}

static inline int16_t fptosi_f64_i16(double x) {
  return (int16_t) x;
}

static inline int32_t fptosi_f64_i32(double x) {
  return (int32_t) x;
}

static inline int64_t fptosi_f64_i64(double x) {
  return (int64_t) x;
}

static inline uint8_t fptoui_f64_i8(double x) {
  return (uint8_t) x;
}

static inline uint16_t fptoui_f64_i16(double x) {
  return (uint16_t) x;
}

static inline uint32_t fptoui_f64_i32(double x) {
  return (uint32_t) x;
}

static inline uint64_t fptoui_f64_i64(double x) {
  return (uint64_t) x;
}

static inline double fabs64(double x) {
  return fabs(x);
}

static inline double fmax64(double x, double y) {
  return fmax(x, y);
}

static inline double fmin64(double x, double y) {
  return fmin(x, y);
}

static inline double fpow64(double x, double y) {
  return pow(x, y);
}

static inline double futrts_log64(double x) {
  return log(x);
}

static inline double futrts_log2_64(double x) {
  return log2(x);
}

static inline double futrts_log10_64(double x) {
  return log10(x);
}

static inline double futrts_sqrt64(double x) {
  return sqrt(x);
}

static inline double futrts_exp64(double x) {
  return exp(x);
}

static inline double futrts_cos64(double x) {
  return cos(x);
}

static inline double futrts_sin64(double x) {
  return sin(x);
}

static inline double futrts_tan64(double x) {
  return tan(x);
}

static inline double futrts_acos64(double x) {
  return acos(x);
}

static inline double futrts_asin64(double x) {
  return asin(x);
}

static inline double futrts_atan64(double x) {
  return atan(x);
}

static inline double futrts_cosh64(double x) {
  return cosh(x);
}

static inline double futrts_sinh64(double x) {
  return sinh(x);
}

static inline double futrts_tanh64(double x) {
  return tanh(x);
}

static inline double futrts_acosh64(double x) {
  return acosh(x);
}

static inline double futrts_asinh64(double x) {
  return asinh(x);
}

static inline double futrts_atanh64(double x) {
  return atanh(x);
}

static inline double futrts_atan2_64(double x, double y) {
  return atan2(x, y);
}

static inline double futrts_hypot64(double x, double y) {
  return hypot(x, y);
}

static inline double futrts_gamma64(double x) {
  return tgamma(x);
}

static inline double futrts_lgamma64(double x) {
  return lgamma(x);
}

static inline double futrts_fma64(double a, double b, double c) {
  return fma(a, b, c);
}

static inline double futrts_round64(double x) {
  return rint(x);
}

static inline double futrts_ceil64(double x) {
  return ceil(x);
}

static inline double futrts_floor64(double x) {
  return floor(x);
}

static inline bool futrts_isnan64(double x) {
  return isnan(x);
}

static inline bool futrts_isinf64(double x) {
  return isinf(x);
}

static inline int64_t futrts_to_bits64(double x) {
  union {
    double f;
    int64_t t;
  } p;

  p.f = x;
  return p.t;
}

static inline double futrts_from_bits64(int64_t x) {
  union {
    int64_t f;
    double t;
  } p;

  p.f = x;
  return p.t;
}

static inline double fmod64(double x, double y) {
  return fmod(x, y);
}

static inline double fsignum64(double x) {
  return futrts_isnan64(x) ? x : (x > 0) - (x < 0);
}

static inline double futrts_lerp64(double v0, double v1, double t) {
#ifdef __OPENCL_VERSION__
  return mix(v0, v1, t);
#else
  return v0 + (v1 - v0) * t;
#endif
}

static inline double futrts_mad64(double a, double b, double c) {
#ifdef __OPENCL_VERSION__
  return mad(a, b, c);
#else
  return a * b + c;
#endif
}

static inline float fpconv_f32_f32(float x) {
  return (float) x;
}

static inline double fpconv_f32_f64(float x) {
  return (double) x;
}

static inline float fpconv_f64_f32(double x) {
  return (float) x;
}

static inline double fpconv_f64_f64(double x) {
  return (double) x;
}

#endif

// End of scalar.h.
// Start of scalar_f16.h.

// Half-precision is emulated if needed (e.g. in straight C) with the
// native type used if possible.  The emulation works by typedef'ing
// 'float' to 'f16', and then implementing all operations on single
// precision.  To cut down on duplication, we use the same code for
// those Futhark functions that require just operators or casts.  The
// in-memory representation for arrays will still be 16 bits even
// under emulation, so the compiler will have to be careful when
// generating reads or writes.

#if !defined(cl_khr_fp16) && !(defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 600)
#define EMULATE_F16
#endif

#if !defined(EMULATE_F16) && defined(__OPENCL_VERSION__)
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
#endif

#ifdef EMULATE_F16

// Note that the half-precision storage format is still 16 bits - the
// compiler will have to be real careful!
typedef float f16;

#else

#ifdef __CUDA_ARCH__
#include <cuda_fp16.h>
#endif

typedef half f16;

#endif

// Some of these functions convert to single precision because half
// precision versions are not available.

static inline f16 fadd16(f16 x, f16 y) {
  return x + y;
}

static inline f16 fsub16(f16 x, f16 y) {
  return x - y;
}

static inline f16 fmul16(f16 x, f16 y) {
  return x * y;
}

static inline bool cmplt16(f16 x, f16 y) {
  return x < y;
}

static inline bool cmple16(f16 x, f16 y) {
  return x <= y;
}

static inline f16 sitofp_i8_f16(int8_t x) {
  return (f16) x;
}

static inline f16 sitofp_i16_f16(int16_t x) {
  return (f16) x;
}

static inline f16 sitofp_i32_f16(int32_t x) {
  return (f16) x;
}

static inline f16 sitofp_i64_f16(int64_t x) {
  return (f16) x;
}

static inline f16 uitofp_i8_f16(uint8_t x) {
  return (f16) x;
}

static inline f16 uitofp_i16_f16(uint16_t x) {
  return (f16) x;
}

static inline f16 uitofp_i32_f16(uint32_t x) {
  return (f16) x;
}

static inline f16 uitofp_i64_f16(uint64_t x) {
  return (f16) x;
}

static inline int8_t fptosi_f16_i8(f16 x) {
  return (int8_t) (float) x;
}

static inline int16_t fptosi_f16_i16(f16 x) {
  return (int16_t) x;
}

static inline int32_t fptosi_f16_i32(f16 x) {
  return (int32_t) x;
}

static inline int64_t fptosi_f16_i64(f16 x) {
  return (int64_t) x;
}

static inline uint8_t fptoui_f16_i8(f16 x) {
  return (uint8_t) (float) x;
}

static inline uint16_t fptoui_f16_i16(f16 x) {
  return (uint16_t) x;
}

static inline uint32_t fptoui_f16_i32(f16 x) {
  return (uint32_t) x;
}

static inline uint64_t fptoui_f16_i64(f16 x) {
  return (uint64_t) x;
}

#ifndef EMULATE_F16

#ifdef __OPENCL_VERSION__
static inline f16 fabs16(f16 x) {
  return fabs(x);
}

static inline f16 fmax16(f16 x, f16 y) {
  return fmax(x, y);
}

static inline f16 fmin16(f16 x, f16 y) {
  return fmin(x, y);
}

static inline f16 fpow16(f16 x, f16 y) {
  return pow(x, y);
}

#else // Assuming CUDA.

static inline f16 fabs16(f16 x) {
  return fabsf(x);
}

static inline f16 fmax16(f16 x, f16 y) {
  return fmaxf(x, y);
}

static inline f16 fmin16(f16 x, f16 y) {
  return fminf(x, y);
}

static inline f16 fpow16(f16 x, f16 y) {
  return powf(x, y);
}
#endif

static inline bool futrts_isnan16(f16 x) {
  return isnan((float)x);
}

static inline bool futrts_isinf16(f16 x) {
  return isinf((float)x);
}

#ifdef __OPENCL_VERSION__
static inline f16 futrts_log16(f16 x) {
  return log(x);
}

static inline f16 futrts_log2_16(f16 x) {
  return log2(x);
}

static inline f16 futrts_log10_16(f16 x) {
  return log10(x);
}

static inline f16 futrts_sqrt16(f16 x) {
  return sqrt(x);
}

static inline f16 futrts_exp16(f16 x) {
  return exp(x);
}

static inline f16 futrts_cos16(f16 x) {
  return cos(x);
}

static inline f16 futrts_sin16(f16 x) {
  return sin(x);
}

static inline f16 futrts_tan16(f16 x) {
  return tan(x);
}

static inline f16 futrts_acos16(f16 x) {
  return acos(x);
}

static inline f16 futrts_asin16(f16 x) {
  return asin(x);
}

static inline f16 futrts_atan16(f16 x) {
  return atan(x);
}

static inline f16 futrts_cosh16(f16 x) {
  return cosh(x);
}

static inline f16 futrts_sinh16(f16 x) {
  return sinh(x);
}

static inline f16 futrts_tanh16(f16 x) {
  return tanh(x);
}

static inline f16 futrts_acosh16(f16 x) {
  return acosh(x);
}

static inline f16 futrts_asinh16(f16 x) {
  return asinh(x);
}

static inline f16 futrts_atanh16(f16 x) {
  return atanh(x);
}

static inline f16 futrts_atan2_16(f16 x, f16 y) {
  return atan2(x, y);
}

static inline f16 futrts_hypot16(f16 x, f16 y) {
  return hypot(x, y);
}

static inline f16 futrts_gamma16(f16 x) {
  return tgamma(x);
}

static inline f16 futrts_lgamma16(f16 x) {
  return lgamma(x);
}

static inline f16 fmod16(f16 x, f16 y) {
  return fmod(x, y);
}

static inline f16 futrts_round16(f16 x) {
  return rint(x);
}

static inline f16 futrts_floor16(f16 x) {
  return floor(x);
}

static inline f16 futrts_ceil16(f16 x) {
  return ceil(x);
}

static inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {
  return mix(v0, v1, t);
}

static inline f16 futrts_mad16(f16 a, f16 b, f16 c) {
  return mad(a, b, c);
}

static inline f16 futrts_fma16(f16 a, f16 b, f16 c) {
  return fma(a, b, c);
}

#else // Assume CUDA.

static inline f16 futrts_log16(f16 x) {
  return hlog(x);
}

static inline f16 futrts_log2_16(f16 x) {
  return hlog2(x);
}

static inline f16 futrts_log10_16(f16 x) {
  return hlog10(x);
}

static inline f16 futrts_sqrt16(f16 x) {
  return hsqrt(x);
}

static inline f16 futrts_exp16(f16 x) {
  return hexp(x);
}

static inline f16 futrts_cos16(f16 x) {
  return hcos(x);
}

static inline f16 futrts_sin16(f16 x) {
  return hsin(x);
}

static inline f16 futrts_tan16(f16 x) {
  return tanf(x);
}

static inline f16 futrts_acos16(f16 x) {
  return acosf(x);
}

static inline f16 futrts_asin16(f16 x) {
  return asinf(x);
}

static inline f16 futrts_atan16(f16 x) {
  return atanf(x);
}

static inline f16 futrts_cosh16(f16 x) {
  return coshf(x);
}

static inline f16 futrts_sinh16(f16 x) {
  return sinhf(x);
}

static inline f16 futrts_tanh16(f16 x) {
  return tanhf(x);
}

static inline f16 futrts_acosh16(f16 x) {
  return acoshf(x);
}

static inline f16 futrts_asinh16(f16 x) {
  return asinhf(x);
}

static inline f16 futrts_atanh16(f16 x) {
  return atanhf(x);
}

static inline f16 futrts_atan2_16(f16 x, f16 y) {
  return atan2f(x, y);
}

static inline f16 futrts_hypot16(f16 x, f16 y) {
  return hypotf(x, y);
}

static inline f16 futrts_gamma16(f16 x) {
  return tgammaf(x);
}

static inline f16 futrts_lgamma16(f16 x) {
  return lgammaf(x);
}

static inline f16 fmod16(f16 x, f16 y) {
  return fmodf(x, y);
}

static inline f16 futrts_round16(f16 x) {
  return rintf(x);
}

static inline f16 futrts_floor16(f16 x) {
  return hfloor(x);
}

static inline f16 futrts_ceil16(f16 x) {
  return hceil(x);
}

static inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {
  return v0 + (v1 - v0) * t;
}

static inline f16 futrts_mad16(f16 a, f16 b, f16 c) {
  return a * b + c;
}

static inline f16 futrts_fma16(f16 a, f16 b, f16 c) {
  return fmaf(a, b, c);
}

#endif

// The CUDA __half type cannot be put in unions for some reason, so we
// use bespoke conversion functions instead.
#ifdef __CUDA_ARCH__
static inline int16_t futrts_to_bits16(f16 x) {
  return __half_as_ushort(x);
}
static inline f16 futrts_from_bits16(int16_t x) {
  return __ushort_as_half(x);
}
#else
static inline int16_t futrts_to_bits16(f16 x) {
  union {
    f16 f;
    int16_t t;
  } p;

  p.f = x;
  return p.t;
}

static inline f16 futrts_from_bits16(int16_t x) {
  union {
    int16_t f;
    f16 t;
  } p;

  p.f = x;
  return p.t;
}
#endif

#else // No native f16 - emulate.

static inline f16 fabs16(f16 x) {
  return fabs32(x);
}

static inline f16 fmax16(f16 x, f16 y) {
  return fmax32(x, y);
}

static inline f16 fmin16(f16 x, f16 y) {
  return fmin32(x, y);
}

static inline f16 fpow16(f16 x, f16 y) {
  return fpow32(x, y);
}

static inline bool futrts_isnan16(f16 x) {
  return futrts_isnan32(x);
}

static inline bool futrts_isinf16(f16 x) {
  return futrts_isinf32(x);
}

static inline f16 futrts_log16(f16 x) {
  return futrts_log32(x);
}

static inline f16 futrts_log2_16(f16 x) {
  return futrts_log2_32(x);
}

static inline f16 futrts_log10_16(f16 x) {
  return futrts_log10_32(x);
}

static inline f16 futrts_sqrt16(f16 x) {
  return futrts_sqrt32(x);
}

static inline f16 futrts_exp16(f16 x) {
  return futrts_exp32(x);
}

static inline f16 futrts_cos16(f16 x) {
  return futrts_cos32(x);
}

static inline f16 futrts_sin16(f16 x) {
  return futrts_sin32(x);
}

static inline f16 futrts_tan16(f16 x) {
  return futrts_tan32(x);
}

static inline f16 futrts_acos16(f16 x) {
  return futrts_acos32(x);
}

static inline f16 futrts_asin16(f16 x) {
  return futrts_asin32(x);
}

static inline f16 futrts_atan16(f16 x) {
  return futrts_atan32(x);
}

static inline f16 futrts_cosh16(f16 x) {
  return futrts_cosh32(x);
}

static inline f16 futrts_sinh16(f16 x) {
  return futrts_sinh32(x);
}

static inline f16 futrts_tanh16(f16 x) {
  return futrts_tanh32(x);
}

static inline f16 futrts_acosh16(f16 x) {
  return futrts_acosh32(x);
}

static inline f16 futrts_asinh16(f16 x) {
  return futrts_asinh32(x);
}

static inline f16 futrts_atanh16(f16 x) {
  return futrts_atanh32(x);
}

static inline f16 futrts_atan2_16(f16 x, f16 y) {
  return futrts_atan2_32(x, y);
}

static inline f16 futrts_hypot16(f16 x, f16 y) {
  return futrts_hypot32(x, y);
}

static inline f16 futrts_gamma16(f16 x) {
  return futrts_gamma32(x);
}

static inline f16 futrts_lgamma16(f16 x) {
  return futrts_lgamma32(x);
}

static inline f16 fmod16(f16 x, f16 y) {
  return fmod32(x, y);
}

static inline f16 futrts_round16(f16 x) {
  return futrts_round32(x);
}

static inline f16 futrts_floor16(f16 x) {
  return futrts_floor32(x);
}

static inline f16 futrts_ceil16(f16 x) {
  return futrts_ceil32(x);
}

static inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {
  return futrts_lerp32(v0, v1, t);
}

static inline f16 futrts_mad16(f16 a, f16 b, f16 c) {
  return futrts_mad32(a, b, c);
}

static inline f16 futrts_fma16(f16 a, f16 b, f16 c) {
  return futrts_fma32(a, b, c);
}

// Even when we are using an OpenCL that does not support cl_khr_fp16,
// it must still support vload_half for actually creating a
// half-precision number, which can then be efficiently converted to a
// float.  Similarly for vstore_half.
#ifdef __OPENCL_VERSION__

static inline int16_t futrts_to_bits16(f16 x) {
  int16_t y;
  // Violating strict aliasing here.
  vstore_half((float)x, 0, (half*)&y);
  return y;
}

static inline f16 futrts_from_bits16(int16_t x) {
  return (f16)vload_half(0, (half*)&x);
}

#else

static inline int16_t futrts_to_bits16(f16 x) {
  return (int16_t)float2halfbits(x);
}

static inline f16 futrts_from_bits16(int16_t x) {
  return halfbits2float((uint16_t)x);
}

static inline f16 fsignum16(f16 x) {
  return futrts_isnan16(x) ? x : (x > 0) - (x < 0);
}

#endif

#endif

static inline float fpconv_f16_f16(f16 x) {
  return x;
}

static inline float fpconv_f16_f32(f16 x) {
  return x;
}

static inline f16 fpconv_f32_f16(float x) {
  return x;
}

#ifdef FUTHARK_F64_ENABLED

static inline double fpconv_f16_f64(f16 x) {
  return (double) x;
}

static inline f16 fpconv_f64_f16(double x) {
  return (f16) x;
}

#endif


// End of scalar_f16.h.

static int init_constants(struct futhark_context *);
static int free_constants(struct futhark_context *);
struct memblock {
    int *references;
    unsigned char *mem;
    int64_t size;
    const char *desc;
};
// start of scheduler.h

// First, the API that the generated code will access.  In principle,
// we could then compile the scheduler separately and link an object
// file with the generated code.  In practice, we will embed all of
// this in the generated code.

// Scheduler handle.
struct scheduler;

// Initialise a scheduler (and start worker threads).
static int scheduler_init(struct scheduler *scheduler,
                          int num_workers,
                          double kappa);

// Shut down a scheduler (and destroy worker threads).
static int scheduler_destroy(struct scheduler *scheduler);

// Figure out the smallest amount of work that amortises task
// creation.
static int determine_kappa(double *kappa);

// How a segop should be scheduled.
enum scheduling {
  DYNAMIC,
  STATIC
};

// How a given task should be executed.  Filled out by the scheduler
// and passed to the segop function
struct scheduler_info {
  int64_t iter_pr_subtask;
  int64_t remainder;
  int nsubtasks;
  enum scheduling sched;
  int wake_up_threads;

  int64_t *task_time;
  int64_t *task_iter;
};

// A segop function.  This is what you hand the scheduler for
// execution.
typedef int (*segop_fn)(void* args,
                        int64_t iterations,
                        int tid,
                        struct scheduler_info info);

// A task for the scheduler to execute.
struct scheduler_segop {
  void *args;
  segop_fn top_level_fn;
  segop_fn nested_fn;
  int64_t iterations;
  enum scheduling sched;

  // Pointers to timer and iter associated with the task
  int64_t *task_time;
  int64_t *task_iter;

  // For debugging
  const char* name;
};

static inline int scheduler_prepare_task(struct scheduler *scheduler,
                                         struct scheduler_segop *task);

typedef int (*parloop_fn)(void* args,
                          int64_t start,
                          int64_t end,
                          int subtask_id,
                          int tid);

// A parallel parloop task.
struct scheduler_parloop {
  void* args;
  parloop_fn fn;
  int64_t iterations;
  struct scheduler_info info;

  // For debugging
  const char* name;
};

static inline int scheduler_execute_task(struct scheduler *scheduler,
                                         struct scheduler_parloop *task);

// Then the API implementation.

#include <signal.h>

#if defined(_WIN32)
#include <windows.h>
#elif defined(__APPLE__)
#include <sys/sysctl.h>
// For getting cpu usage of threads
#include <mach/mach.h>
#include <sys/resource.h>
#elif defined(__linux__)
#include <sys/sysinfo.h>
#include <sys/resource.h>
#include <signal.h>
#elif defined(__EMSCRIPTEN__)
#include <emscripten/threading.h>
#include <sys/sysinfo.h>
#include <sys/resource.h>
#include <signal.h>
#endif

/* Multicore Utility functions */

/* A wrapper for getting rusage on Linux and MacOS */
/* TODO maybe figure out this for windows */
static inline int getrusage_thread(struct rusage *rusage)
{
  int err = -1;
#if  defined(__APPLE__)
    thread_basic_info_data_t info = { 0 };
    mach_msg_type_number_t info_count = THREAD_BASIC_INFO_COUNT;
    kern_return_t kern_err;

    kern_err = thread_info(mach_thread_self(),
                           THREAD_BASIC_INFO,
                           (thread_info_t)&info,
                           &info_count);
    if (kern_err == KERN_SUCCESS) {
        memset(rusage, 0, sizeof(struct rusage));
        rusage->ru_utime.tv_sec = info.user_time.seconds;
        rusage->ru_utime.tv_usec = info.user_time.microseconds;
        rusage->ru_stime.tv_sec = info.system_time.seconds;
        rusage->ru_stime.tv_usec = info.system_time.microseconds;
        err = 0;
    } else {
        errno = EINVAL;
    }
#elif defined(__linux__) || __EMSCRIPTEN__
    err = getrusage(RUSAGE_THREAD, rusage);
#endif
    return err;
}

/* returns the number of logical cores */
static int num_processors()
{
#if  defined(_WIN32)
/* https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info */
    SYSTEM_INFO sysinfo;
    GetSystemInfo(&sysinfo);
    int ncores = sysinfo.dwNumberOfProcessors;
    fprintf(stderr, "Found %d cores on your Windows machine\n Is that correct?\n", ncores);
    return ncores;
#elif defined(__APPLE__)
    int ncores;
    size_t ncores_size = sizeof(ncores);
    CHECK_ERRNO(sysctlbyname("hw.logicalcpu", &ncores, &ncores_size, NULL, 0),
                "sysctlbyname (hw.logicalcpu)");
    return ncores;
#elif defined(__linux__)
  return get_nprocs();
#elif __EMSCRIPTEN__
  return emscripten_num_logical_cores();
#else
  fprintf(stderr, "operating system not recognised\n");
  return -1;
#endif
}

static unsigned int g_seed;

// Used to seed the generator.
static inline void fast_srand(unsigned int seed) {
    g_seed = seed;
}

// Compute a pseudorandom integer.
// Output value in range [0, 32767]
static inline unsigned int fast_rand(void) {
    g_seed = (214013*g_seed+2531011);
    return (g_seed>>16)&0x7FFF;
}

struct subtask_queue {
  int capacity;             // Size of the buffer.
  int first;                // Index of the start of the ring buffer.
  int num_used;             // Number of used elements in the buffer.
  struct subtask **buffer;

  pthread_mutex_t mutex;    // Mutex used for synchronisation.
  pthread_cond_t cond;      // Condition variable used for synchronisation.
  int dead;

#if defined(MCPROFILE)
  /* Profiling fields */
  uint64_t time_enqueue;
  uint64_t time_dequeue;
  uint64_t n_dequeues;
  uint64_t n_enqueues;
#endif
};

/* A subtask that can be executed by a worker */
struct subtask {
  /* The parloop function */
  parloop_fn fn;
  /* Execution parameters */
  void* args;
  int64_t start, end;
  int id;

  /* Dynamic scheduling parameters */
  int chunkable;
  int64_t chunk_size;

  /* Shared variables across subtasks */
  volatile int *counter; // Counter for ongoing subtasks
  // Shared task timers and iterators
  int64_t *task_time;
  int64_t *task_iter;

  /* For debugging */
  const char *name;
};


struct worker {
  pthread_t thread;
  struct scheduler *scheduler;  /* Reference to the scheduler struct the worker belongs to*/
  struct subtask_queue q;
  int dead;
  int tid;                      /* Just a thread id */

  /* "thread local" time fields used for online algorithm */
  uint64_t timer;
  uint64_t total;
  int nested; /* How nested the current computation is */

  // Profiling fields
  int output_usage;            /* Whether to dump thread usage */
  uint64_t time_spent_working; /* Time spent in parloop functions */
};

static inline void output_worker_usage(struct worker *worker)
{
  struct rusage usage;
  CHECK_ERRNO(getrusage_thread(&usage), "getrusage_thread");
  struct timeval user_cpu_time = usage.ru_utime;
  struct timeval sys_cpu_time = usage.ru_stime;
  fprintf(stderr, "tid: %2d - work time %10llu us - user time: %10llu us - sys: %10llu us\n",
          worker->tid,
          (long long unsigned)worker->time_spent_working / 1000,
          (long long unsigned)(user_cpu_time.tv_sec * 1000000 + user_cpu_time.tv_usec),
          (long long unsigned)(sys_cpu_time.tv_sec * 1000000 + sys_cpu_time.tv_usec));
}

/* Doubles the size of the queue */
static inline int subtask_queue_grow_queue(struct subtask_queue *subtask_queue) {

  int new_capacity = 2 * subtask_queue->capacity;
#ifdef MCDEBUG
  fprintf(stderr, "Growing queue to %d\n", subtask_queue->capacity * 2);
#endif

  struct subtask **new_buffer = calloc(new_capacity, sizeof(struct subtask*));
  for (int i = 0; i < subtask_queue->num_used; i++) {
    new_buffer[i] = subtask_queue->buffer[(subtask_queue->first + i) % subtask_queue->capacity];
  }

  free(subtask_queue->buffer);
  subtask_queue->buffer = new_buffer;
  subtask_queue->capacity = new_capacity;
  subtask_queue->first = 0;

  return 0;
}

// Initialise a job queue with the given capacity.  The queue starts out
// empty.  Returns non-zero on error.
static inline int subtask_queue_init(struct subtask_queue *subtask_queue, int capacity)
{
  assert(subtask_queue != NULL);
  memset(subtask_queue, 0, sizeof(struct subtask_queue));

  subtask_queue->capacity = capacity;
  subtask_queue->buffer = calloc(capacity, sizeof(struct subtask*));
  if (subtask_queue->buffer == NULL) {
    return -1;
  }

  CHECK_ERRNO(pthread_mutex_init(&subtask_queue->mutex, NULL), "pthread_mutex_init");
  CHECK_ERRNO(pthread_cond_init(&subtask_queue->cond, NULL), "pthread_cond_init");

  return 0;
}

// Destroy the job queue.  Blocks until the queue is empty before it
// is destroyed.
static inline int subtask_queue_destroy(struct subtask_queue *subtask_queue)
{
  assert(subtask_queue != NULL);

  CHECK_ERR(pthread_mutex_lock(&subtask_queue->mutex), "pthread_mutex_lock");

  while (subtask_queue->num_used != 0) {
    CHECK_ERR(pthread_cond_wait(&subtask_queue->cond, &subtask_queue->mutex), "pthread_cond_wait");
  }

  // Queue is now empty.  Let's kill it!
  subtask_queue->dead = 1;
  free(subtask_queue->buffer);
  CHECK_ERR(pthread_cond_broadcast(&subtask_queue->cond), "pthread_cond_broadcast");
  CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");

  return 0;
}

static inline void dump_queue(struct worker *worker)
{
  struct subtask_queue *subtask_queue = &worker->q;
  CHECK_ERR(pthread_mutex_lock(&subtask_queue->mutex), "pthread_mutex_lock");
  for (int i = 0; i < subtask_queue->num_used; i++) {
    struct subtask * subtask = subtask_queue->buffer[(subtask_queue->first + i) % subtask_queue->capacity];
    printf("queue tid %d with %d task %s\n", worker->tid, i, subtask->name);
  }
  CHECK_ERR(pthread_cond_broadcast(&subtask_queue->cond), "pthread_cond_broadcast");
  CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");
}

// Push an element onto the end of the job queue.  Blocks if the
// subtask_queue is full (its size is equal to its capacity).  Returns
// non-zero on error.  It is an error to push a job onto a queue that
// has been destroyed.
static inline int subtask_queue_enqueue(struct worker *worker, struct subtask *subtask )
{
  assert(worker != NULL);
  struct subtask_queue *subtask_queue = &worker->q;

#ifdef MCPROFILE
  uint64_t start = get_wall_time();
#endif

  CHECK_ERR(pthread_mutex_lock(&subtask_queue->mutex), "pthread_mutex_lock");
  // Wait until there is room in the subtask_queue.
  while (subtask_queue->num_used == subtask_queue->capacity && !subtask_queue->dead) {
    if (subtask_queue->num_used == subtask_queue->capacity) {
      CHECK_ERR(subtask_queue_grow_queue(subtask_queue), "subtask_queue_grow_queue");
      continue;
    }
    CHECK_ERR(pthread_cond_wait(&subtask_queue->cond, &subtask_queue->mutex), "pthread_cond_wait");
  }

  if (subtask_queue->dead) {
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");
    return -1;
  }

  // If we made it past the loop, there is room in the subtask_queue.
  subtask_queue->buffer[(subtask_queue->first + subtask_queue->num_used) % subtask_queue->capacity] = subtask;
  subtask_queue->num_used++;

#ifdef MCPROFILE
  uint64_t end = get_wall_time();
  subtask_queue->time_enqueue += (end - start);
  subtask_queue->n_enqueues++;
#endif
  // Broadcast a reader (if any) that there is now an element.
  CHECK_ERR(pthread_cond_broadcast(&subtask_queue->cond), "pthread_cond_broadcast");
  CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");

  return 0;
}


/* Like subtask_queue_dequeue, but with two differences:
   1) the subtask is stolen from the __front__ of the queue
   2) returns immediately if there is no subtasks queued,
      as we dont' want to block on another workers queue and
*/
static inline int subtask_queue_steal(struct worker *worker,
                                      struct subtask **subtask)
{
  struct subtask_queue *subtask_queue = &worker->q;
  assert(subtask_queue != NULL);

#ifdef MCPROFILE
  uint64_t start = get_wall_time();
#endif
  CHECK_ERR(pthread_mutex_lock(&subtask_queue->mutex), "pthread_mutex_lock");

  if (subtask_queue->num_used == 0) {
    CHECK_ERR(pthread_cond_broadcast(&subtask_queue->cond), "pthread_cond_broadcast");
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");
    return 1;
  }

  if (subtask_queue->dead) {
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");
    return -1;
  }

  // Tasks gets stolen from the "front"
  struct subtask *cur_back = subtask_queue->buffer[subtask_queue->first];
  struct subtask *new_subtask = NULL;
  int remaining_iter = cur_back->end - cur_back->start;
  // If subtask is chunkable, we steal half of the iterations
  if (cur_back->chunkable && remaining_iter > 1) {
      int64_t half = remaining_iter / 2;
      new_subtask = malloc(sizeof(struct subtask));
      *new_subtask = *cur_back;
      new_subtask->start = cur_back->end - half;
      cur_back->end = new_subtask->start;
      __atomic_fetch_add(cur_back->counter, 1, __ATOMIC_RELAXED);
  } else {
    new_subtask = cur_back;
    subtask_queue->num_used--;
    subtask_queue->first = (subtask_queue->first + 1) % subtask_queue->capacity;
  }
  *subtask = new_subtask;

  if (*subtask == NULL) {
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthred_mutex_unlock");
    return 1;
  }

#ifdef MCPROFILE
  uint64_t end = get_wall_time();
  subtask_queue->time_dequeue += (end - start);
  subtask_queue->n_dequeues++;
#endif

  // Broadcast a writer (if any) that there is now room for more.
  CHECK_ERR(pthread_cond_broadcast(&subtask_queue->cond), "pthread_cond_broadcast");
  CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");

  return 0;
}


// Pop an element from the back of the job queue.
// Optional argument can be provided to block or not
static inline int subtask_queue_dequeue(struct worker *worker,
                                        struct subtask **subtask, int blocking)
{
  assert(worker != NULL);
  struct subtask_queue *subtask_queue = &worker->q;

#ifdef MCPROFILE
  uint64_t start = get_wall_time();
#endif

  CHECK_ERR(pthread_mutex_lock(&subtask_queue->mutex), "pthread_mutex_lock");
  if (subtask_queue->num_used == 0 && !blocking) {
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");
    return 1;
  }
  // Try to steal some work while the subtask_queue is empty
  while (subtask_queue->num_used == 0 && !subtask_queue->dead) {
    pthread_cond_wait(&subtask_queue->cond, &subtask_queue->mutex);
  }

  if (subtask_queue->dead) {
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");
    return -1;
  }

  // dequeue pops from the back
  *subtask = subtask_queue->buffer[(subtask_queue->first + subtask_queue->num_used - 1) % subtask_queue->capacity];
  subtask_queue->num_used--;

  if (*subtask == NULL) {
    assert(!"got NULL ptr");
    CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthred_mutex_unlock");
    return -1;
  }

#ifdef MCPROFILE
  uint64_t end = get_wall_time();
  subtask_queue->time_dequeue += (end - start);
  subtask_queue->n_dequeues++;
#endif

  // Broadcast a writer (if any) that there is now room for more.
  CHECK_ERR(pthread_cond_broadcast(&subtask_queue->cond), "pthread_cond_broadcast");
  CHECK_ERR(pthread_mutex_unlock(&subtask_queue->mutex), "pthread_mutex_unlock");

  return 0;
}

static inline int subtask_queue_is_empty(struct subtask_queue *subtask_queue)
{
  return subtask_queue->num_used == 0;
}

/* Scheduler definitions */

struct scheduler {
  struct worker *workers;
  int num_threads;

  // If there is work to steal => active_work > 0
  volatile int active_work;

  // Only one error can be returned at the time now.  Maybe we can
  // provide a stack like structure for pushing errors onto if we wish
  // to backpropagte multiple errors
  volatile int error;

  // kappa time unit in nanoseconds
  double kappa;
};


// Thread local variable worker struct
// Note that, accesses to tls variables are expensive
// Minimize direct references to this variable
__thread struct worker* worker_local = NULL;

static int64_t total_now(int64_t total, int64_t time) {
  return total + (get_wall_time_ns() - time);
}

static int random_other_worker(struct scheduler *scheduler, int my_id) {
  int my_num_workers = scheduler->num_threads;
  assert(my_num_workers != 1);
  int i = fast_rand() % (my_num_workers - 1);
  if (i >= my_id) {
    i++;
  }
#ifdef MCDEBUG
  assert(i >= 0);
  assert(i < my_num_workers);
  assert(i != my_id);
#endif

  return i;
}


static inline int64_t compute_chunk_size(double kappa, struct subtask* subtask)
{
  double C = (double)*subtask->task_time / (double)*subtask->task_iter;
  if (C == 0.0F) C += DBL_EPSILON;
  return smax64((int64_t)(kappa / C), 1);
}

/* Takes a chunk from subtask and enqueues the remaining iterations onto the worker's queue */
/* A no-op if the subtask is not chunkable */
static inline struct subtask* chunk_subtask(struct worker* worker, struct subtask *subtask)
{
  if (subtask->chunkable) {
    // Do we have information from previous runs avaliable
    if (*subtask->task_iter > 0) {
      subtask->chunk_size = compute_chunk_size(worker->scheduler->kappa, subtask);
      assert(subtask->chunk_size > 0);
    }
    int64_t remaining_iter = subtask->end - subtask->start;
    assert(remaining_iter > 0);
    if (remaining_iter > subtask->chunk_size) {
      struct subtask *new_subtask = malloc(sizeof(struct subtask));
      *new_subtask = *subtask;
      // increment the subtask join counter to account for new subtask
      __atomic_fetch_add(subtask->counter, 1, __ATOMIC_RELAXED);
      // Update range parameters
      subtask->end = subtask->start + subtask->chunk_size;
      new_subtask->start = subtask->end;
      subtask_queue_enqueue(worker, new_subtask);
    }
  }
  return subtask;
}

static inline int run_subtask(struct worker* worker, struct subtask* subtask)
{
  assert(subtask != NULL);
  assert(worker != NULL);

  subtask = chunk_subtask(worker, subtask);
  worker->total = 0;
  worker->timer = get_wall_time_ns();
#if defined(MCPROFILE)
  int64_t start = worker->timer;
#endif
  worker->nested++;
  int err = subtask->fn(subtask->args, subtask->start, subtask->end,
                        subtask->id,
                        worker->tid);
  worker->nested--;
  // Some error occured during some other subtask
  // so we just clean-up and return
  if (worker->scheduler->error != 0) {
    // Even a failed task counts as finished.
    __atomic_fetch_sub(subtask->counter, 1, __ATOMIC_RELAXED);
    free(subtask);
    return 0;
  }
  if (err != 0) {
    __atomic_store_n(&worker->scheduler->error, err, __ATOMIC_RELAXED);
  }
  // Total sequential time spent
  int64_t time_elapsed = total_now(worker->total, worker->timer);
#if defined(MCPROFILE)
  worker->time_spent_working += get_wall_time_ns() - start;
#endif
  int64_t iter = subtask->end - subtask->start;
  // report measurements
  // These updates should really be done using a single atomic CAS operation
  __atomic_fetch_add(subtask->task_time, time_elapsed, __ATOMIC_RELAXED);
  __atomic_fetch_add(subtask->task_iter, iter, __ATOMIC_RELAXED);
  // We need a fence here, since if the counter is decremented before either
  // of the two above are updated bad things can happen, e.g. if they are stack-allocated
  __atomic_thread_fence(__ATOMIC_SEQ_CST);
  __atomic_fetch_sub(subtask->counter, 1, __ATOMIC_RELAXED);
  free(subtask);
  return 0;
}


static inline int is_small(struct scheduler_segop *task, struct scheduler *scheduler, int *nsubtasks)
{
  int64_t time = *task->task_time;
  int64_t iter = *task->task_iter;

  if (task->sched == DYNAMIC || iter == 0) {
    *nsubtasks = scheduler->num_threads;
    return 0;
  }

  // Estimate the constant C
  double C = (double)time / (double)iter;
  double cur_task_iter = (double) task->iterations;

  // Returns true if the task is small i.e.
  // if the number of iterations times C is smaller
  // than the overhead of subtask creation
  if (C == 0.0F || C * cur_task_iter < scheduler->kappa) {
    *nsubtasks = 1;
    return 1;
  }

  // Else compute how many subtasks this tasks should create
  int64_t min_iter_pr_subtask = smax64(scheduler->kappa / C, 1);
  *nsubtasks = smin64(smax64(task->iterations / min_iter_pr_subtask, 1), scheduler->num_threads);

  return 0;
}

// TODO make this prettier
static inline struct subtask* create_subtask(parloop_fn fn,
                                             void* args,
                                             const char* name,
                                             volatile int* counter,
                                             int64_t *timer,
                                             int64_t *iter,
                                             int64_t start, int64_t end,
                                             int chunkable,
                                             int64_t chunk_size,
                                             int id)
{
  struct subtask* subtask = malloc(sizeof(struct subtask));
  if (subtask == NULL) {
    assert(!"malloc failed in create_subtask");
    return NULL;
  }
  subtask->fn         = fn;
  subtask->args       = args;

  subtask->counter    = counter;
  subtask->task_time  = timer;
  subtask->task_iter  = iter;

  subtask->start      = start;
  subtask->end        = end;
  subtask->id         = id;
  subtask->chunkable  = chunkable;
  subtask->chunk_size = chunk_size;

  subtask->name       = name;
  return subtask;
}

static int dummy_counter = 0;
static int64_t dummy_timer = 0;
static int64_t dummy_iter = 0;

static int dummy_fn(void *args, int64_t start, int64_t end, int subtask_id, int tid) {
  (void)args;
  (void)start;
  (void)end;
  (void)subtask_id;
  (void)tid;
  return 0;
}

// Wake up threads, who are blocking by pushing a dummy task
// onto their queue
static inline void wake_up_threads(struct scheduler *scheduler, int start_tid, int end_tid) {

#if defined(MCDEBUG)
  assert(start_tid >= 1);
  assert(end_tid <= scheduler->num_threads);
#endif
  for (int i = start_tid; i < end_tid; i++) {
    struct subtask *subtask = create_subtask(dummy_fn, NULL, "dummy_fn",
                                            &dummy_counter,
                                            &dummy_timer, &dummy_iter,
                                            0, 0,
                                            0, 0,
                                            0);
    CHECK_ERR(subtask_queue_enqueue(&scheduler->workers[i], subtask), "subtask_queue_enqueue");
  }
}

static inline int is_finished(struct worker *worker) {
  return worker->dead && subtask_queue_is_empty(&worker->q);
}

// Try to steal from a random queue
static inline int steal_from_random_worker(struct worker* worker)
{
  int my_id = worker->tid;
  struct scheduler* scheduler = worker->scheduler;
  int k = random_other_worker(scheduler, my_id);
  struct worker *worker_k = &scheduler->workers[k];
  struct subtask* subtask =  NULL;
  int retval = subtask_queue_steal(worker_k, &subtask);
  if (retval == 0) {
    subtask_queue_enqueue(worker, subtask);
    return 1;
  }
  return 0;
}


static inline void *scheduler_worker(void* args)
{
  struct worker *worker = (struct worker*) args;
  struct scheduler *scheduler = worker->scheduler;
  worker_local = worker;
  struct subtask *subtask = NULL;

  while(!is_finished(worker)) {
    if (!subtask_queue_is_empty(&worker->q)) {
      int retval = subtask_queue_dequeue(worker, &subtask, 0);
      if (retval == 0) {
        assert(subtask != NULL);
        CHECK_ERR(run_subtask(worker, subtask), "run_subtask");
      } // else someone stole our work

    } else if (scheduler->active_work) { /* steal */
      while (!is_finished(worker) && scheduler->active_work) {
        if (steal_from_random_worker(worker)) {
          break;
        }
      }
    } else { /* go back to sleep and wait for work */
      int retval = subtask_queue_dequeue(worker, &subtask, 1);
      if (retval == 0) {
        assert(subtask != NULL);
        CHECK_ERR(run_subtask(worker, subtask), "run_subtask");
      }
    }
  }

  assert(subtask_queue_is_empty(&worker->q));
#if defined(MCPROFILE)
  if (worker->output_usage)
    output_worker_usage(worker);
#endif
  return NULL;
}


static inline int scheduler_execute_parloop(struct scheduler *scheduler,
                                            struct scheduler_parloop *task,
                                            int64_t *timer)
{

  struct worker *worker = worker_local;

  struct scheduler_info info = task->info;
  int64_t iter_pr_subtask = info.iter_pr_subtask;
  int64_t remainder = info.remainder;
  int nsubtasks = info.nsubtasks;
  volatile int join_counter = nsubtasks;

  // Shared timer used to sum up all
  // sequential work from each subtask
  int64_t task_timer = 0;
  int64_t task_iter = 0;

  enum scheduling sched = info.sched;
  /* If each subtasks should be processed in chunks */
  int chunkable = sched == STATIC ? 0 : 1;
  int64_t chunk_size = 1; // The initial chunk size when no info is avaliable


  if (info.wake_up_threads || sched == DYNAMIC)
    __atomic_add_fetch(&scheduler->active_work, nsubtasks, __ATOMIC_RELAXED);

  int64_t start = 0;
  int64_t end = iter_pr_subtask + (int64_t)(remainder != 0);
  for (int subtask_id = 0; subtask_id < nsubtasks; subtask_id++) {
    struct subtask *subtask = create_subtask(task->fn, task->args, task->name,
                                              &join_counter,
                                              &task_timer, &task_iter,
                                              start, end,
                                              chunkable, chunk_size,
                                              subtask_id);
    assert(subtask != NULL);
    // In most cases we will never have more subtasks than workers,
    // but there can be exceptions (e.g. the kappa tuning function).
    struct worker *subtask_worker =
      worker->nested
      ? &scheduler->workers[worker->tid]
      : &scheduler->workers[subtask_id % scheduler->num_threads];
    CHECK_ERR(subtask_queue_enqueue(subtask_worker, subtask),
              "subtask_queue_enqueue");
    // Update range params
    start = end;
    end += iter_pr_subtask + ((subtask_id + 1) < remainder);
  }

  if (info.wake_up_threads) {
    wake_up_threads(scheduler, nsubtasks, scheduler->num_threads);
  }

  // Join (wait for subtasks to finish)
  while(join_counter != 0) {
    if (!subtask_queue_is_empty(&worker->q)) {
      struct subtask *subtask = NULL;
      int err = subtask_queue_dequeue(worker, &subtask, 0);
      if (err == 0 ) {
        CHECK_ERR(run_subtask(worker, subtask), "run_subtask");
      }
    } else {
      if (steal_from_random_worker(worker)) {
        struct subtask *subtask = NULL;
        int err = subtask_queue_dequeue(worker, &subtask, 0);
        if (err == 0) {
          CHECK_ERR(run_subtask(worker, subtask), "run_subtask");
        }
      }
    }
  }


  if (info.wake_up_threads || sched == DYNAMIC) {
    __atomic_sub_fetch(&scheduler->active_work, nsubtasks, __ATOMIC_RELAXED);
  }

  // Write back timing results of all sequential work
  (*timer) += task_timer;
  return scheduler->error;
}


static inline int scheduler_execute_task(struct scheduler *scheduler,
                                         struct scheduler_parloop *task)
{

  struct worker *worker = worker_local;

  int err = 0;

  // How much sequential work was performed by the task
  int64_t task_timer = 0;

  /* Execute task sequential or parallel based on decision made earlier */
  if (task->info.nsubtasks == 1) {
    int64_t start = get_wall_time_ns();
    err = task->fn(task->args, 0, task->iterations, 0, worker->tid);
    int64_t end = get_wall_time_ns();
    task_timer = end - start;
    worker->time_spent_working += task_timer;
    // Report time measurements
    // TODO the update of both of these should really be a single atomic!!
    __atomic_fetch_add(task->info.task_time, task_timer, __ATOMIC_RELAXED);
    __atomic_fetch_add(task->info.task_iter, task->iterations, __ATOMIC_RELAXED);
  } else {
    // Add "before" time if we already are inside a task
    int64_t time_before = 0;
    if (worker->nested > 0) {
      time_before = total_now(worker->total, worker->timer);
    }

    err = scheduler_execute_parloop(scheduler, task, &task_timer);

    // Report time measurements
    // TODO the update of both of these should really be a single atomic!!
    __atomic_fetch_add(task->info.task_time, task_timer, __ATOMIC_RELAXED);
    __atomic_fetch_add(task->info.task_iter, task->iterations, __ATOMIC_RELAXED);

    // Update timers to account for new timings
    worker->total = time_before + task_timer;
    worker->timer = get_wall_time_ns();
  }


  return err;
}

/* Decide on how schedule the incoming task i.e. how many subtasks and
   to run sequential or (potentially nested) parallel code body */
static inline int scheduler_prepare_task(struct scheduler* scheduler,
                                         struct scheduler_segop *task)
{
  assert(task != NULL);

  struct worker *worker = worker_local;
  struct scheduler_info info;
  info.task_time = task->task_time;
  info.task_iter = task->task_iter;

  int nsubtasks;
  // Decide if task should be scheduled sequentially
  if (is_small(task, scheduler, &nsubtasks)) {
    info.iter_pr_subtask = task->iterations;
    info.remainder = 0;
    info.nsubtasks = nsubtasks;
    return task->top_level_fn(task->args, task->iterations, worker->tid, info);
  } else {
    info.iter_pr_subtask = task->iterations / nsubtasks;
    info.remainder = task->iterations % nsubtasks;
    info.sched = task->sched;
    switch (task->sched) {
    case STATIC:
      info.nsubtasks = info.iter_pr_subtask == 0 ? info.remainder : ((task->iterations - info.remainder) / info.iter_pr_subtask);
      break;
    case DYNAMIC:
      // As any thread can take any subtasks, we are being safe with using
      // an upper bound on the number of tasks such that the task allocate enough memory
      info.nsubtasks = info.iter_pr_subtask == 0 ? info.remainder : nsubtasks;
      break;
    default:
      assert(!"Got unknown scheduling");
    }
  }

  info.wake_up_threads = 0;
  // We only use the nested parallel segop function if we can't exchaust all cores
  // using the outer most level
  if (task->nested_fn != NULL && info.nsubtasks < scheduler->num_threads && info.nsubtasks == task->iterations) {
    if (worker->nested == 0)
      info.wake_up_threads = 1;
    return task->nested_fn(task->args, task->iterations, worker->tid, info);
  }

  return task->top_level_fn(task->args, task->iterations, worker->tid, info);
}

// Now some code for finding the proper value of kappa on a given
// machine (the smallest amount of work that amortises the cost of
// task creation).

struct tuning_struct {
  int32_t *free_tuning_res;
  int32_t *array;
};

// Reduction function over an integer array
static int tuning_loop(void *args, int64_t start, int64_t end,
                                     int flat_tid, int tid) {
  (void)flat_tid;
  (void)tid;

  int err = 0;
  struct tuning_struct *tuning_struct = (struct tuning_struct *) args;
  int32_t *array = tuning_struct->array;
  int32_t *tuning_res = tuning_struct->free_tuning_res;

  int32_t sum = 0;
  for (int i = start; i < end; i++) {
    int32_t y = array[i];
    sum = add32(sum, y);
  }
  *tuning_res = sum;
  return err;
}

// The main entry point for the tuning process.  Sets the provided
// variable ``kappa``.
static int determine_kappa(double *kappa) {
  int err = 0;

  int64_t iterations = 100000000;
  int64_t tuning_time = 0;
  int64_t tuning_iter = 0;

  int32_t *array = malloc(sizeof(int32_t) * iterations);
  for (int64_t i = 0; i < iterations; i++) {
    array[i] = fast_rand();
  }

  int64_t start_tuning = get_wall_time_ns();
  /* **************************** */
  /* Run sequential reduce first' */
  /* **************************** */
  int64_t tuning_sequentiual_start = get_wall_time_ns();
  struct tuning_struct tuning_struct;
  int32_t tuning_res;
  tuning_struct.free_tuning_res = &tuning_res;
  tuning_struct.array = array;

  err = tuning_loop(&tuning_struct, 0, iterations, 0, 0);
  int64_t tuning_sequentiual_end = get_wall_time_ns();
  int64_t sequential_elapsed = tuning_sequentiual_end - tuning_sequentiual_start;

  double C = (double)sequential_elapsed / (double)iterations;
  fprintf(stderr, " Time for sequential run is %lld - Found C %f\n", (long long)sequential_elapsed, C);

  /* ********************** */
  /* Now run tuning process */
  /* ********************** */
  // Setup a scheduler with a single worker
  struct scheduler scheduler;
  scheduler.num_threads = 1;
  scheduler.workers = malloc(sizeof(struct worker));
  worker_local = &scheduler.workers[0];
  worker_local->tid = 0;
  CHECK_ERR(subtask_queue_init(&scheduler.workers[0].q, 1024),
            "failed to init queue for worker %d\n", 0);

  // Start tuning for kappa
  double kappa_tune = 1000; // Initial kappa is 1 us
  double ratio;
  int64_t time_elapsed;
  while(1) {
    int64_t min_iter_pr_subtask = (int64_t) (kappa_tune / C) == 0 ? 1 : (kappa_tune / C);
    int nsubtasks = iterations / min_iter_pr_subtask;
    struct scheduler_info info;
    info.iter_pr_subtask = min_iter_pr_subtask;

    info.nsubtasks = iterations / min_iter_pr_subtask;
    info.remainder = iterations % min_iter_pr_subtask;
    info.task_time = &tuning_time;
    info.task_iter = &tuning_iter;
    info.sched = STATIC;

    struct scheduler_parloop parloop;
    parloop.name = "tuning_loop";
    parloop.fn = tuning_loop;
    parloop.args = &tuning_struct;
    parloop.iterations = iterations;
    parloop.info = info;

    int64_t tuning_chunked_start = get_wall_time_ns();
    int determine_kappa_err =
      scheduler_execute_task(&scheduler,
                             &parloop);
    assert(determine_kappa_err == 0);
    int64_t tuning_chunked_end = get_wall_time_ns();
    time_elapsed =  tuning_chunked_end - tuning_chunked_start;

    ratio = (double)time_elapsed / (double)sequential_elapsed;
    if (ratio < 1.055) {
      break;
    }
    kappa_tune += 100; // Increase by 100 ns at the time
    fprintf(stderr, "nsubtask %d - kappa %f - ratio %f\n", nsubtasks, kappa_tune, ratio);
  }

  int64_t end_tuning = get_wall_time_ns();
  fprintf(stderr, "tuning took %lld ns and found kappa %f - time %lld - ratio %f\n",
          (long long)end_tuning - start_tuning,
          kappa_tune,
          (long long)time_elapsed,
          ratio);
  *kappa = kappa_tune;

  // Clean-up
  CHECK_ERR(subtask_queue_destroy(&scheduler.workers[0].q), "failed to destroy queue");
  free(array);
  free(scheduler.workers);
  return err;
}

static int scheduler_init(struct scheduler *scheduler,
                          int num_workers,
                          double kappa) {
  assert(num_workers > 0);

  scheduler->kappa = kappa;
  scheduler->num_threads = num_workers;
  scheduler->active_work = 0;
  scheduler->error = 0;

  scheduler->workers = calloc(num_workers, sizeof(struct worker));

  const int queue_capacity = 1024;

  worker_local = &scheduler->workers[0];
  worker_local->tid = 0;
  worker_local->scheduler = scheduler;
  CHECK_ERR(subtask_queue_init(&worker_local->q, queue_capacity),
            "failed to init queue for worker %d\n", 0);

  for (int i = 1; i < num_workers; i++) {
    struct worker *cur_worker = &scheduler->workers[i];
    memset(cur_worker, 0, sizeof(struct worker));
    cur_worker->tid = i;
    cur_worker->output_usage = 0;
    cur_worker->scheduler = scheduler;
    CHECK_ERR(subtask_queue_init(&cur_worker->q, queue_capacity),
              "failed to init queue for worker %d\n", i);

    CHECK_ERR(pthread_create(&cur_worker->thread,
                             NULL,
                             &scheduler_worker,
                             cur_worker),
              "Failed to create worker %d\n", i);
  }

  return 0;
}

static int scheduler_destroy(struct scheduler *scheduler) {
  // We assume that this function is called by the thread controlling
  // the first worker, which is why we treat scheduler->workers[0]
  // specially here.

  // First mark them all as dead.
  for (int i = 1; i < scheduler->num_threads; i++) {
    struct worker *cur_worker = &scheduler->workers[i];
    cur_worker->dead = 1;
  }

  // Then destroy their task queues (this will wake up the threads and
  // make them do their shutdown).
  for (int i = 1; i < scheduler->num_threads; i++) {
    struct worker *cur_worker = &scheduler->workers[i];
    subtask_queue_destroy(&cur_worker->q);
  }

  // Then actually wait for them to stop.
  for (int i = 1; i < scheduler->num_threads; i++) {
    struct worker *cur_worker = &scheduler->workers[i];
    CHECK_ERR(pthread_join(scheduler->workers[i].thread, NULL), "pthread_join");
  }

  // And then destroy our own queue.
  subtask_queue_destroy(&scheduler->workers[0].q);

  free(scheduler->workers);

  return 0;
}

// End of scheduler.h

struct futhark_context_config {
    int in_use;
    int debugging;
    int profiling;
    int num_threads;
};
struct futhark_context_config *futhark_context_config_new(void)
{
    struct futhark_context_config *cfg =
                                  (struct futhark_context_config *) malloc(sizeof(struct futhark_context_config));
    
    if (cfg == NULL)
        return NULL;
    cfg->in_use = 0;
    cfg->debugging = 0;
    cfg->profiling = 0;
    cfg->num_threads = 0;
    return cfg;
}
void futhark_context_config_free(struct futhark_context_config *cfg)
{
    assert(!cfg->in_use);
    free(cfg);
}
void futhark_context_config_set_debugging(struct futhark_context_config *cfg,
                                          int detail)
{
    cfg->debugging = detail;
}
void futhark_context_config_set_profiling(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->profiling = flag;
}
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int detail)
{
    // Does nothing for this backend.
    (void) cfg;
    (void) detail;
}
void futhark_context_config_set_num_threads(struct futhark_context_config *cfg,
                                            int n)
{
    cfg->num_threads = n;
}
struct futhark_context {
    struct futhark_context_config *cfg;
    struct scheduler scheduler;
    int detail_memory;
    int debugging;
    int profiling;
    int profiling_paused;
    int logging;
    lock_t lock;
    char *error;
    FILE *log;
    int total_runs;
    long total_runtime;
    int64_t peak_mem_usage_default;
    int64_t cur_mem_usage_default;
    struct {
        int dummy;
    } constants;
    int64_t *futhark_mc_segmap_parloop_228377_total_runtime;
    int *futhark_mc_segmap_parloop_228377_runs;
    int64_t *futhark_mc_segmap_parloop_228377_iter;
    int64_t futhark_mc_segmap_parloop_228377_total_total_runtime;
    int futhark_mc_segmap_parloop_228377_total_runs;
    int64_t futhark_mc_segmap_parloop_228377_total_iter;
    int64_t *futhark_mc_segmap_task_228375_total_runtime;
    int *futhark_mc_segmap_task_228375_runs;
    int64_t *futhark_mc_segmap_task_228375_iter;
    int64_t futhark_mc_segmap_task_228375_total_time;
    int64_t futhark_mc_segmap_task_228375_total_iter;
    int64_t *futhark_mc_scan_stage_1_parloop_228389_total_runtime;
    int *futhark_mc_scan_stage_1_parloop_228389_runs;
    int64_t *futhark_mc_scan_stage_1_parloop_228389_iter;
    int64_t futhark_mc_scan_stage_1_parloop_228389_total_total_runtime;
    int futhark_mc_scan_stage_1_parloop_228389_total_runs;
    int64_t futhark_mc_scan_stage_1_parloop_228389_total_iter;
    int64_t *futhark_mc_scan_stage_3_parloop_228391_total_runtime;
    int *futhark_mc_scan_stage_3_parloop_228391_runs;
    int64_t *futhark_mc_scan_stage_3_parloop_228391_iter;
    int64_t futhark_mc_scan_stage_3_parloop_228391_total_total_runtime;
    int futhark_mc_scan_stage_3_parloop_228391_total_runs;
    int64_t futhark_mc_scan_stage_3_parloop_228391_total_iter;
    int64_t *futhark_mc_segscan_task_228386_total_runtime;
    int *futhark_mc_segscan_task_228386_runs;
    int64_t *futhark_mc_segscan_task_228386_iter;
    int64_t futhark_mc_segscan_task_228386_total_time;
    int64_t futhark_mc_segscan_task_228386_total_iter;
    int64_t *futhark_mc_segmap_parloop_228395_total_runtime;
    int *futhark_mc_segmap_parloop_228395_runs;
    int64_t *futhark_mc_segmap_parloop_228395_iter;
    int64_t futhark_mc_segmap_parloop_228395_total_total_runtime;
    int futhark_mc_segmap_parloop_228395_total_runs;
    int64_t futhark_mc_segmap_parloop_228395_total_iter;
    int64_t *futhark_mc_segmap_task_228393_total_runtime;
    int *futhark_mc_segmap_task_228393_runs;
    int64_t *futhark_mc_segmap_task_228393_iter;
    int64_t futhark_mc_segmap_task_228393_total_time;
    int64_t futhark_mc_segmap_task_228393_total_iter;
    int64_t *futhark_mc_segmap_parloop_228382_total_runtime;
    int *futhark_mc_segmap_parloop_228382_runs;
    int64_t *futhark_mc_segmap_parloop_228382_iter;
    int64_t futhark_mc_segmap_parloop_228382_total_total_runtime;
    int futhark_mc_segmap_parloop_228382_total_runs;
    int64_t futhark_mc_segmap_parloop_228382_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228380_total_runtime;
    int *futhark_mc_segmap_nested_task_228380_runs;
    int64_t *futhark_mc_segmap_nested_task_228380_iter;
    int64_t *futhark_mc_segmap_parloop_228399_total_runtime;
    int *futhark_mc_segmap_parloop_228399_runs;
    int64_t *futhark_mc_segmap_parloop_228399_iter;
    int64_t futhark_mc_segmap_parloop_228399_total_total_runtime;
    int futhark_mc_segmap_parloop_228399_total_runs;
    int64_t futhark_mc_segmap_parloop_228399_total_iter;
    int64_t *futhark_mc_segmap_task_228397_total_runtime;
    int *futhark_mc_segmap_task_228397_runs;
    int64_t *futhark_mc_segmap_task_228397_iter;
    int64_t futhark_mc_segmap_task_228397_total_time;
    int64_t futhark_mc_segmap_task_228397_total_iter;
    int64_t *futhark_mc_segmap_parloop_228408_total_runtime;
    int *futhark_mc_segmap_parloop_228408_runs;
    int64_t *futhark_mc_segmap_parloop_228408_iter;
    int64_t futhark_mc_segmap_parloop_228408_total_total_runtime;
    int futhark_mc_segmap_parloop_228408_total_runs;
    int64_t futhark_mc_segmap_parloop_228408_total_iter;
    int64_t *futhark_mc_segmap_task_228406_total_runtime;
    int *futhark_mc_segmap_task_228406_runs;
    int64_t *futhark_mc_segmap_task_228406_iter;
    int64_t futhark_mc_segmap_task_228406_total_time;
    int64_t futhark_mc_segmap_task_228406_total_iter;
    int64_t *futhark_mc_segmap_parloop_228417_total_runtime;
    int *futhark_mc_segmap_parloop_228417_runs;
    int64_t *futhark_mc_segmap_parloop_228417_iter;
    int64_t futhark_mc_segmap_parloop_228417_total_total_runtime;
    int futhark_mc_segmap_parloop_228417_total_runs;
    int64_t futhark_mc_segmap_parloop_228417_total_iter;
    int64_t *futhark_mc_segmap_task_228415_total_runtime;
    int *futhark_mc_segmap_task_228415_runs;
    int64_t *futhark_mc_segmap_task_228415_iter;
    int64_t futhark_mc_segmap_task_228415_total_time;
    int64_t futhark_mc_segmap_task_228415_total_iter;
    int64_t *futhark_mc_segmap_parloop_228412_total_runtime;
    int *futhark_mc_segmap_parloop_228412_runs;
    int64_t *futhark_mc_segmap_parloop_228412_iter;
    int64_t futhark_mc_segmap_parloop_228412_total_total_runtime;
    int futhark_mc_segmap_parloop_228412_total_runs;
    int64_t futhark_mc_segmap_parloop_228412_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228410_total_runtime;
    int *futhark_mc_segmap_nested_task_228410_runs;
    int64_t *futhark_mc_segmap_nested_task_228410_iter;
    int64_t *futhark_mc_segmap_parloop_228403_total_runtime;
    int *futhark_mc_segmap_parloop_228403_runs;
    int64_t *futhark_mc_segmap_parloop_228403_iter;
    int64_t futhark_mc_segmap_parloop_228403_total_total_runtime;
    int futhark_mc_segmap_parloop_228403_total_runs;
    int64_t futhark_mc_segmap_parloop_228403_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228401_total_runtime;
    int *futhark_mc_segmap_nested_task_228401_runs;
    int64_t *futhark_mc_segmap_nested_task_228401_iter;
    int64_t *futhark_mc_segmap_parloop_228421_total_runtime;
    int *futhark_mc_segmap_parloop_228421_runs;
    int64_t *futhark_mc_segmap_parloop_228421_iter;
    int64_t futhark_mc_segmap_parloop_228421_total_total_runtime;
    int futhark_mc_segmap_parloop_228421_total_runs;
    int64_t futhark_mc_segmap_parloop_228421_total_iter;
    int64_t *futhark_mc_segmap_task_228419_total_runtime;
    int *futhark_mc_segmap_task_228419_runs;
    int64_t *futhark_mc_segmap_task_228419_iter;
    int64_t futhark_mc_segmap_task_228419_total_time;
    int64_t futhark_mc_segmap_task_228419_total_iter;
    int64_t *futhark_mc_segmap_parloop_228434_total_runtime;
    int *futhark_mc_segmap_parloop_228434_runs;
    int64_t *futhark_mc_segmap_parloop_228434_iter;
    int64_t futhark_mc_segmap_parloop_228434_total_total_runtime;
    int futhark_mc_segmap_parloop_228434_total_runs;
    int64_t futhark_mc_segmap_parloop_228434_total_iter;
    int64_t *futhark_mc_segmap_task_228432_total_runtime;
    int *futhark_mc_segmap_task_228432_runs;
    int64_t *futhark_mc_segmap_task_228432_iter;
    int64_t futhark_mc_segmap_task_228432_total_time;
    int64_t futhark_mc_segmap_task_228432_total_iter;
    int64_t *futhark_mc_scan_stage_1_parloop_228446_total_runtime;
    int *futhark_mc_scan_stage_1_parloop_228446_runs;
    int64_t *futhark_mc_scan_stage_1_parloop_228446_iter;
    int64_t futhark_mc_scan_stage_1_parloop_228446_total_total_runtime;
    int futhark_mc_scan_stage_1_parloop_228446_total_runs;
    int64_t futhark_mc_scan_stage_1_parloop_228446_total_iter;
    int64_t *futhark_mc_scan_stage_3_parloop_228448_total_runtime;
    int *futhark_mc_scan_stage_3_parloop_228448_runs;
    int64_t *futhark_mc_scan_stage_3_parloop_228448_iter;
    int64_t futhark_mc_scan_stage_3_parloop_228448_total_total_runtime;
    int futhark_mc_scan_stage_3_parloop_228448_total_runs;
    int64_t futhark_mc_scan_stage_3_parloop_228448_total_iter;
    int64_t *futhark_mc_segscan_task_228443_total_runtime;
    int *futhark_mc_segscan_task_228443_runs;
    int64_t *futhark_mc_segscan_task_228443_iter;
    int64_t futhark_mc_segscan_task_228443_total_time;
    int64_t futhark_mc_segscan_task_228443_total_iter;
    int64_t *futhark_mc_segmap_parloop_228452_total_runtime;
    int *futhark_mc_segmap_parloop_228452_runs;
    int64_t *futhark_mc_segmap_parloop_228452_iter;
    int64_t futhark_mc_segmap_parloop_228452_total_total_runtime;
    int futhark_mc_segmap_parloop_228452_total_runs;
    int64_t futhark_mc_segmap_parloop_228452_total_iter;
    int64_t *futhark_mc_segmap_task_228450_total_runtime;
    int *futhark_mc_segmap_task_228450_runs;
    int64_t *futhark_mc_segmap_task_228450_iter;
    int64_t futhark_mc_segmap_task_228450_total_time;
    int64_t futhark_mc_segmap_task_228450_total_iter;
    int64_t *futhark_mc_segmap_parloop_228439_total_runtime;
    int *futhark_mc_segmap_parloop_228439_runs;
    int64_t *futhark_mc_segmap_parloop_228439_iter;
    int64_t futhark_mc_segmap_parloop_228439_total_total_runtime;
    int futhark_mc_segmap_parloop_228439_total_runs;
    int64_t futhark_mc_segmap_parloop_228439_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228437_total_runtime;
    int *futhark_mc_segmap_nested_task_228437_runs;
    int64_t *futhark_mc_segmap_nested_task_228437_iter;
    int64_t *futhark_mc_segmap_parloop_228428_total_runtime;
    int *futhark_mc_segmap_parloop_228428_runs;
    int64_t *futhark_mc_segmap_parloop_228428_iter;
    int64_t futhark_mc_segmap_parloop_228428_total_total_runtime;
    int futhark_mc_segmap_parloop_228428_total_runs;
    int64_t futhark_mc_segmap_parloop_228428_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228426_total_runtime;
    int *futhark_mc_segmap_nested_task_228426_runs;
    int64_t *futhark_mc_segmap_nested_task_228426_iter;
    int64_t *futhark_mc_segmap_parloop_228456_total_runtime;
    int *futhark_mc_segmap_parloop_228456_runs;
    int64_t *futhark_mc_segmap_parloop_228456_iter;
    int64_t futhark_mc_segmap_parloop_228456_total_total_runtime;
    int futhark_mc_segmap_parloop_228456_total_runs;
    int64_t futhark_mc_segmap_parloop_228456_total_iter;
    int64_t *futhark_mc_segmap_task_228454_total_runtime;
    int *futhark_mc_segmap_task_228454_runs;
    int64_t *futhark_mc_segmap_task_228454_iter;
    int64_t futhark_mc_segmap_task_228454_total_time;
    int64_t futhark_mc_segmap_task_228454_total_iter;
    int64_t *futhark_mc_segmap_parloop_228468_total_runtime;
    int *futhark_mc_segmap_parloop_228468_runs;
    int64_t *futhark_mc_segmap_parloop_228468_iter;
    int64_t futhark_mc_segmap_parloop_228468_total_total_runtime;
    int futhark_mc_segmap_parloop_228468_total_runs;
    int64_t futhark_mc_segmap_parloop_228468_total_iter;
    int64_t *futhark_mc_segmap_task_228466_total_runtime;
    int *futhark_mc_segmap_task_228466_runs;
    int64_t *futhark_mc_segmap_task_228466_iter;
    int64_t futhark_mc_segmap_task_228466_total_time;
    int64_t futhark_mc_segmap_task_228466_total_iter;
    int64_t *futhark_mc_segmap_parloop_228481_total_runtime;
    int *futhark_mc_segmap_parloop_228481_runs;
    int64_t *futhark_mc_segmap_parloop_228481_iter;
    int64_t futhark_mc_segmap_parloop_228481_total_total_runtime;
    int futhark_mc_segmap_parloop_228481_total_runs;
    int64_t futhark_mc_segmap_parloop_228481_total_iter;
    int64_t *futhark_mc_segmap_task_228479_total_runtime;
    int *futhark_mc_segmap_task_228479_runs;
    int64_t *futhark_mc_segmap_task_228479_iter;
    int64_t futhark_mc_segmap_task_228479_total_time;
    int64_t futhark_mc_segmap_task_228479_total_iter;
    int64_t *futhark_mc_segmap_parloop_228485_total_runtime;
    int *futhark_mc_segmap_parloop_228485_runs;
    int64_t *futhark_mc_segmap_parloop_228485_iter;
    int64_t futhark_mc_segmap_parloop_228485_total_total_runtime;
    int futhark_mc_segmap_parloop_228485_total_runs;
    int64_t futhark_mc_segmap_parloop_228485_total_iter;
    int64_t *futhark_mc_segmap_task_228483_total_runtime;
    int *futhark_mc_segmap_task_228483_runs;
    int64_t *futhark_mc_segmap_task_228483_iter;
    int64_t futhark_mc_segmap_task_228483_total_time;
    int64_t futhark_mc_segmap_task_228483_total_iter;
    int64_t *futhark_mc_segmap_parloop_228474_total_runtime;
    int *futhark_mc_segmap_parloop_228474_runs;
    int64_t *futhark_mc_segmap_parloop_228474_iter;
    int64_t futhark_mc_segmap_parloop_228474_total_total_runtime;
    int futhark_mc_segmap_parloop_228474_total_runs;
    int64_t futhark_mc_segmap_parloop_228474_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228472_total_runtime;
    int *futhark_mc_segmap_nested_task_228472_runs;
    int64_t *futhark_mc_segmap_nested_task_228472_iter;
    int64_t *futhark_mc_segmap_parloop_228462_total_runtime;
    int *futhark_mc_segmap_parloop_228462_runs;
    int64_t *futhark_mc_segmap_parloop_228462_iter;
    int64_t futhark_mc_segmap_parloop_228462_total_total_runtime;
    int futhark_mc_segmap_parloop_228462_total_runs;
    int64_t futhark_mc_segmap_parloop_228462_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228460_total_runtime;
    int *futhark_mc_segmap_nested_task_228460_runs;
    int64_t *futhark_mc_segmap_nested_task_228460_iter;
    int64_t *futhark_mc_segmap_parloop_228489_total_runtime;
    int *futhark_mc_segmap_parloop_228489_runs;
    int64_t *futhark_mc_segmap_parloop_228489_iter;
    int64_t futhark_mc_segmap_parloop_228489_total_total_runtime;
    int futhark_mc_segmap_parloop_228489_total_runs;
    int64_t futhark_mc_segmap_parloop_228489_total_iter;
    int64_t *futhark_mc_segmap_task_228487_total_runtime;
    int *futhark_mc_segmap_task_228487_runs;
    int64_t *futhark_mc_segmap_task_228487_iter;
    int64_t futhark_mc_segmap_task_228487_total_time;
    int64_t futhark_mc_segmap_task_228487_total_iter;
    int64_t *futhark_mc_segmap_parloop_228502_total_runtime;
    int *futhark_mc_segmap_parloop_228502_runs;
    int64_t *futhark_mc_segmap_parloop_228502_iter;
    int64_t futhark_mc_segmap_parloop_228502_total_total_runtime;
    int futhark_mc_segmap_parloop_228502_total_runs;
    int64_t futhark_mc_segmap_parloop_228502_total_iter;
    int64_t *futhark_mc_segmap_task_228500_total_runtime;
    int *futhark_mc_segmap_task_228500_runs;
    int64_t *futhark_mc_segmap_task_228500_iter;
    int64_t futhark_mc_segmap_task_228500_total_time;
    int64_t futhark_mc_segmap_task_228500_total_iter;
    int64_t *futhark_mc_segmap_parloop_228506_total_runtime;
    int *futhark_mc_segmap_parloop_228506_runs;
    int64_t *futhark_mc_segmap_parloop_228506_iter;
    int64_t futhark_mc_segmap_parloop_228506_total_total_runtime;
    int futhark_mc_segmap_parloop_228506_total_runs;
    int64_t futhark_mc_segmap_parloop_228506_total_iter;
    int64_t *futhark_mc_segmap_task_228504_total_runtime;
    int *futhark_mc_segmap_task_228504_runs;
    int64_t *futhark_mc_segmap_task_228504_iter;
    int64_t futhark_mc_segmap_task_228504_total_time;
    int64_t futhark_mc_segmap_task_228504_total_iter;
    int64_t *futhark_mc_segmap_parloop_228495_total_runtime;
    int *futhark_mc_segmap_parloop_228495_runs;
    int64_t *futhark_mc_segmap_parloop_228495_iter;
    int64_t futhark_mc_segmap_parloop_228495_total_total_runtime;
    int futhark_mc_segmap_parloop_228495_total_runs;
    int64_t futhark_mc_segmap_parloop_228495_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228493_total_runtime;
    int *futhark_mc_segmap_nested_task_228493_runs;
    int64_t *futhark_mc_segmap_nested_task_228493_iter;
    int64_t *futhark_mc_segmap_parloop_228510_total_runtime;
    int *futhark_mc_segmap_parloop_228510_runs;
    int64_t *futhark_mc_segmap_parloop_228510_iter;
    int64_t futhark_mc_segmap_parloop_228510_total_total_runtime;
    int futhark_mc_segmap_parloop_228510_total_runs;
    int64_t futhark_mc_segmap_parloop_228510_total_iter;
    int64_t *futhark_mc_segmap_task_228508_total_runtime;
    int *futhark_mc_segmap_task_228508_runs;
    int64_t *futhark_mc_segmap_task_228508_iter;
    int64_t futhark_mc_segmap_task_228508_total_time;
    int64_t futhark_mc_segmap_task_228508_total_iter;
    int64_t *futhark_mc_segmap_parloop_228523_total_runtime;
    int *futhark_mc_segmap_parloop_228523_runs;
    int64_t *futhark_mc_segmap_parloop_228523_iter;
    int64_t futhark_mc_segmap_parloop_228523_total_total_runtime;
    int futhark_mc_segmap_parloop_228523_total_runs;
    int64_t futhark_mc_segmap_parloop_228523_total_iter;
    int64_t *futhark_mc_segmap_task_228521_total_runtime;
    int *futhark_mc_segmap_task_228521_runs;
    int64_t *futhark_mc_segmap_task_228521_iter;
    int64_t futhark_mc_segmap_task_228521_total_time;
    int64_t futhark_mc_segmap_task_228521_total_iter;
    int64_t *futhark_mc_segmap_parloop_228527_total_runtime;
    int *futhark_mc_segmap_parloop_228527_runs;
    int64_t *futhark_mc_segmap_parloop_228527_iter;
    int64_t futhark_mc_segmap_parloop_228527_total_total_runtime;
    int futhark_mc_segmap_parloop_228527_total_runs;
    int64_t futhark_mc_segmap_parloop_228527_total_iter;
    int64_t *futhark_mc_segmap_task_228525_total_runtime;
    int *futhark_mc_segmap_task_228525_runs;
    int64_t *futhark_mc_segmap_task_228525_iter;
    int64_t futhark_mc_segmap_task_228525_total_time;
    int64_t futhark_mc_segmap_task_228525_total_iter;
    int64_t *futhark_mc_segmap_parloop_228516_total_runtime;
    int *futhark_mc_segmap_parloop_228516_runs;
    int64_t *futhark_mc_segmap_parloop_228516_iter;
    int64_t futhark_mc_segmap_parloop_228516_total_total_runtime;
    int futhark_mc_segmap_parloop_228516_total_runs;
    int64_t futhark_mc_segmap_parloop_228516_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228514_total_runtime;
    int *futhark_mc_segmap_nested_task_228514_runs;
    int64_t *futhark_mc_segmap_nested_task_228514_iter;
    int64_t *futhark_mc_segmap_parloop_228531_total_runtime;
    int *futhark_mc_segmap_parloop_228531_runs;
    int64_t *futhark_mc_segmap_parloop_228531_iter;
    int64_t futhark_mc_segmap_parloop_228531_total_total_runtime;
    int futhark_mc_segmap_parloop_228531_total_runs;
    int64_t futhark_mc_segmap_parloop_228531_total_iter;
    int64_t *futhark_mc_segmap_task_228529_total_runtime;
    int *futhark_mc_segmap_task_228529_runs;
    int64_t *futhark_mc_segmap_task_228529_iter;
    int64_t futhark_mc_segmap_task_228529_total_time;
    int64_t futhark_mc_segmap_task_228529_total_iter;
    int64_t *futhark_mc_segmap_parloop_228540_total_runtime;
    int *futhark_mc_segmap_parloop_228540_runs;
    int64_t *futhark_mc_segmap_parloop_228540_iter;
    int64_t futhark_mc_segmap_parloop_228540_total_total_runtime;
    int futhark_mc_segmap_parloop_228540_total_runs;
    int64_t futhark_mc_segmap_parloop_228540_total_iter;
    int64_t *futhark_mc_segmap_task_228538_total_runtime;
    int *futhark_mc_segmap_task_228538_runs;
    int64_t *futhark_mc_segmap_task_228538_iter;
    int64_t futhark_mc_segmap_task_228538_total_time;
    int64_t futhark_mc_segmap_task_228538_total_iter;
    int64_t *futhark_mc_segmap_parloop_228535_total_runtime;
    int *futhark_mc_segmap_parloop_228535_runs;
    int64_t *futhark_mc_segmap_parloop_228535_iter;
    int64_t futhark_mc_segmap_parloop_228535_total_total_runtime;
    int futhark_mc_segmap_parloop_228535_total_runs;
    int64_t futhark_mc_segmap_parloop_228535_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228533_total_runtime;
    int *futhark_mc_segmap_nested_task_228533_runs;
    int64_t *futhark_mc_segmap_nested_task_228533_iter;
    int64_t *futhark_mc_segmap_parloop_228544_total_runtime;
    int *futhark_mc_segmap_parloop_228544_runs;
    int64_t *futhark_mc_segmap_parloop_228544_iter;
    int64_t futhark_mc_segmap_parloop_228544_total_total_runtime;
    int futhark_mc_segmap_parloop_228544_total_runs;
    int64_t futhark_mc_segmap_parloop_228544_total_iter;
    int64_t *futhark_mc_segmap_task_228542_total_runtime;
    int *futhark_mc_segmap_task_228542_runs;
    int64_t *futhark_mc_segmap_task_228542_iter;
    int64_t futhark_mc_segmap_task_228542_total_time;
    int64_t futhark_mc_segmap_task_228542_total_iter;
    int64_t *futhark_mc_segmap_parloop_228555_total_runtime;
    int *futhark_mc_segmap_parloop_228555_runs;
    int64_t *futhark_mc_segmap_parloop_228555_iter;
    int64_t futhark_mc_segmap_parloop_228555_total_total_runtime;
    int futhark_mc_segmap_parloop_228555_total_runs;
    int64_t futhark_mc_segmap_parloop_228555_total_iter;
    int64_t *futhark_mc_segmap_task_228553_total_runtime;
    int *futhark_mc_segmap_task_228553_runs;
    int64_t *futhark_mc_segmap_task_228553_iter;
    int64_t futhark_mc_segmap_task_228553_total_time;
    int64_t futhark_mc_segmap_task_228553_total_iter;
    int64_t *futhark_mc_segmap_parloop_228566_total_runtime;
    int *futhark_mc_segmap_parloop_228566_runs;
    int64_t *futhark_mc_segmap_parloop_228566_iter;
    int64_t futhark_mc_segmap_parloop_228566_total_total_runtime;
    int futhark_mc_segmap_parloop_228566_total_runs;
    int64_t futhark_mc_segmap_parloop_228566_total_iter;
    int64_t *futhark_mc_segmap_task_228564_total_runtime;
    int *futhark_mc_segmap_task_228564_runs;
    int64_t *futhark_mc_segmap_task_228564_iter;
    int64_t futhark_mc_segmap_task_228564_total_time;
    int64_t futhark_mc_segmap_task_228564_total_iter;
    int64_t *futhark_mc_segmap_parloop_228560_total_runtime;
    int *futhark_mc_segmap_parloop_228560_runs;
    int64_t *futhark_mc_segmap_parloop_228560_iter;
    int64_t futhark_mc_segmap_parloop_228560_total_total_runtime;
    int futhark_mc_segmap_parloop_228560_total_runs;
    int64_t futhark_mc_segmap_parloop_228560_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228558_total_runtime;
    int *futhark_mc_segmap_nested_task_228558_runs;
    int64_t *futhark_mc_segmap_nested_task_228558_iter;
    int64_t *futhark_mc_segmap_parloop_228549_total_runtime;
    int *futhark_mc_segmap_parloop_228549_runs;
    int64_t *futhark_mc_segmap_parloop_228549_iter;
    int64_t futhark_mc_segmap_parloop_228549_total_total_runtime;
    int futhark_mc_segmap_parloop_228549_total_runs;
    int64_t futhark_mc_segmap_parloop_228549_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228547_total_runtime;
    int *futhark_mc_segmap_nested_task_228547_runs;
    int64_t *futhark_mc_segmap_nested_task_228547_iter;
    int64_t *futhark_mc_segmap_parloop_228570_total_runtime;
    int *futhark_mc_segmap_parloop_228570_runs;
    int64_t *futhark_mc_segmap_parloop_228570_iter;
    int64_t futhark_mc_segmap_parloop_228570_total_total_runtime;
    int futhark_mc_segmap_parloop_228570_total_runs;
    int64_t futhark_mc_segmap_parloop_228570_total_iter;
    int64_t *futhark_mc_segmap_task_228568_total_runtime;
    int *futhark_mc_segmap_task_228568_runs;
    int64_t *futhark_mc_segmap_task_228568_iter;
    int64_t futhark_mc_segmap_task_228568_total_time;
    int64_t futhark_mc_segmap_task_228568_total_iter;
    int64_t *futhark_mc_segmap_parloop_228579_total_runtime;
    int *futhark_mc_segmap_parloop_228579_runs;
    int64_t *futhark_mc_segmap_parloop_228579_iter;
    int64_t futhark_mc_segmap_parloop_228579_total_total_runtime;
    int futhark_mc_segmap_parloop_228579_total_runs;
    int64_t futhark_mc_segmap_parloop_228579_total_iter;
    int64_t *futhark_mc_segmap_task_228577_total_runtime;
    int *futhark_mc_segmap_task_228577_runs;
    int64_t *futhark_mc_segmap_task_228577_iter;
    int64_t futhark_mc_segmap_task_228577_total_time;
    int64_t futhark_mc_segmap_task_228577_total_iter;
    int64_t *futhark_mc_segmap_parloop_228588_total_runtime;
    int *futhark_mc_segmap_parloop_228588_runs;
    int64_t *futhark_mc_segmap_parloop_228588_iter;
    int64_t futhark_mc_segmap_parloop_228588_total_total_runtime;
    int futhark_mc_segmap_parloop_228588_total_runs;
    int64_t futhark_mc_segmap_parloop_228588_total_iter;
    int64_t *futhark_mc_segmap_task_228586_total_runtime;
    int *futhark_mc_segmap_task_228586_runs;
    int64_t *futhark_mc_segmap_task_228586_iter;
    int64_t futhark_mc_segmap_task_228586_total_time;
    int64_t futhark_mc_segmap_task_228586_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228596_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228596_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228596_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228596_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228596_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228596_total_iter;
    int64_t *futhark_mc_segred_task_228593_total_runtime;
    int *futhark_mc_segred_task_228593_runs;
    int64_t *futhark_mc_segred_task_228593_iter;
    int64_t futhark_mc_segred_task_228593_total_time;
    int64_t futhark_mc_segred_task_228593_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228601_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228601_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228601_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228601_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228601_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228601_total_iter;
    int64_t *futhark_mc_segred_task_228598_total_runtime;
    int *futhark_mc_segred_task_228598_runs;
    int64_t *futhark_mc_segred_task_228598_iter;
    int64_t futhark_mc_segred_task_228598_total_time;
    int64_t futhark_mc_segred_task_228598_total_iter;
    int64_t *futhark_mc_segmap_parloop_228591_total_runtime;
    int *futhark_mc_segmap_parloop_228591_runs;
    int64_t *futhark_mc_segmap_parloop_228591_iter;
    int64_t futhark_mc_segmap_parloop_228591_total_total_runtime;
    int futhark_mc_segmap_parloop_228591_total_runs;
    int64_t futhark_mc_segmap_parloop_228591_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228589_total_runtime;
    int *futhark_mc_segmap_nested_task_228589_runs;
    int64_t *futhark_mc_segmap_nested_task_228589_iter;
    int64_t *futhark_mc_segmap_parloop_228583_total_runtime;
    int *futhark_mc_segmap_parloop_228583_runs;
    int64_t *futhark_mc_segmap_parloop_228583_iter;
    int64_t futhark_mc_segmap_parloop_228583_total_total_runtime;
    int futhark_mc_segmap_parloop_228583_total_runs;
    int64_t futhark_mc_segmap_parloop_228583_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228581_total_runtime;
    int *futhark_mc_segmap_nested_task_228581_runs;
    int64_t *futhark_mc_segmap_nested_task_228581_iter;
    int64_t *futhark_mc_segmap_parloop_228574_total_runtime;
    int *futhark_mc_segmap_parloop_228574_runs;
    int64_t *futhark_mc_segmap_parloop_228574_iter;
    int64_t futhark_mc_segmap_parloop_228574_total_total_runtime;
    int futhark_mc_segmap_parloop_228574_total_runs;
    int64_t futhark_mc_segmap_parloop_228574_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228572_total_runtime;
    int *futhark_mc_segmap_nested_task_228572_runs;
    int64_t *futhark_mc_segmap_nested_task_228572_iter;
    int64_t *futhark_mc_segmap_parloop_228605_total_runtime;
    int *futhark_mc_segmap_parloop_228605_runs;
    int64_t *futhark_mc_segmap_parloop_228605_iter;
    int64_t futhark_mc_segmap_parloop_228605_total_total_runtime;
    int futhark_mc_segmap_parloop_228605_total_runs;
    int64_t futhark_mc_segmap_parloop_228605_total_iter;
    int64_t *futhark_mc_segmap_task_228603_total_runtime;
    int *futhark_mc_segmap_task_228603_runs;
    int64_t *futhark_mc_segmap_task_228603_iter;
    int64_t futhark_mc_segmap_task_228603_total_time;
    int64_t futhark_mc_segmap_task_228603_total_iter;
    int64_t *futhark_mc_segmap_parloop_228616_total_runtime;
    int *futhark_mc_segmap_parloop_228616_runs;
    int64_t *futhark_mc_segmap_parloop_228616_iter;
    int64_t futhark_mc_segmap_parloop_228616_total_total_runtime;
    int futhark_mc_segmap_parloop_228616_total_runs;
    int64_t futhark_mc_segmap_parloop_228616_total_iter;
    int64_t *futhark_mc_segmap_task_228614_total_runtime;
    int *futhark_mc_segmap_task_228614_runs;
    int64_t *futhark_mc_segmap_task_228614_iter;
    int64_t futhark_mc_segmap_task_228614_total_time;
    int64_t futhark_mc_segmap_task_228614_total_iter;
    int64_t *futhark_mc_segmap_parloop_228627_total_runtime;
    int *futhark_mc_segmap_parloop_228627_runs;
    int64_t *futhark_mc_segmap_parloop_228627_iter;
    int64_t futhark_mc_segmap_parloop_228627_total_total_runtime;
    int futhark_mc_segmap_parloop_228627_total_runs;
    int64_t futhark_mc_segmap_parloop_228627_total_iter;
    int64_t *futhark_mc_segmap_task_228625_total_runtime;
    int *futhark_mc_segmap_task_228625_runs;
    int64_t *futhark_mc_segmap_task_228625_iter;
    int64_t futhark_mc_segmap_task_228625_total_time;
    int64_t futhark_mc_segmap_task_228625_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228637_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228637_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228637_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228637_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228637_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228637_total_iter;
    int64_t *futhark_mc_segred_task_228632_total_runtime;
    int *futhark_mc_segred_task_228632_runs;
    int64_t *futhark_mc_segred_task_228632_iter;
    int64_t futhark_mc_segred_task_228632_total_time;
    int64_t futhark_mc_segred_task_228632_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228643_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228643_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228643_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228643_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228643_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228643_total_iter;
    int64_t *futhark_mc_segred_task_228639_total_runtime;
    int *futhark_mc_segred_task_228639_runs;
    int64_t *futhark_mc_segred_task_228639_iter;
    int64_t futhark_mc_segred_task_228639_total_time;
    int64_t futhark_mc_segred_task_228639_total_iter;
    int64_t *futhark_mc_segmap_parloop_228630_total_runtime;
    int *futhark_mc_segmap_parloop_228630_runs;
    int64_t *futhark_mc_segmap_parloop_228630_iter;
    int64_t futhark_mc_segmap_parloop_228630_total_total_runtime;
    int futhark_mc_segmap_parloop_228630_total_runs;
    int64_t futhark_mc_segmap_parloop_228630_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228628_total_runtime;
    int *futhark_mc_segmap_nested_task_228628_runs;
    int64_t *futhark_mc_segmap_nested_task_228628_iter;
    int64_t *futhark_mc_segmap_parloop_228621_total_runtime;
    int *futhark_mc_segmap_parloop_228621_runs;
    int64_t *futhark_mc_segmap_parloop_228621_iter;
    int64_t futhark_mc_segmap_parloop_228621_total_total_runtime;
    int futhark_mc_segmap_parloop_228621_total_runs;
    int64_t futhark_mc_segmap_parloop_228621_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228619_total_runtime;
    int *futhark_mc_segmap_nested_task_228619_runs;
    int64_t *futhark_mc_segmap_nested_task_228619_iter;
    int64_t *futhark_mc_segmap_parloop_228610_total_runtime;
    int *futhark_mc_segmap_parloop_228610_runs;
    int64_t *futhark_mc_segmap_parloop_228610_iter;
    int64_t futhark_mc_segmap_parloop_228610_total_total_runtime;
    int futhark_mc_segmap_parloop_228610_total_runs;
    int64_t futhark_mc_segmap_parloop_228610_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228608_total_runtime;
    int *futhark_mc_segmap_nested_task_228608_runs;
    int64_t *futhark_mc_segmap_nested_task_228608_iter;
    int64_t *futhark_mc_segmap_parloop_228647_total_runtime;
    int *futhark_mc_segmap_parloop_228647_runs;
    int64_t *futhark_mc_segmap_parloop_228647_iter;
    int64_t futhark_mc_segmap_parloop_228647_total_total_runtime;
    int futhark_mc_segmap_parloop_228647_total_runs;
    int64_t futhark_mc_segmap_parloop_228647_total_iter;
    int64_t *futhark_mc_segmap_task_228645_total_runtime;
    int *futhark_mc_segmap_task_228645_runs;
    int64_t *futhark_mc_segmap_task_228645_iter;
    int64_t futhark_mc_segmap_task_228645_total_time;
    int64_t futhark_mc_segmap_task_228645_total_iter;
    int64_t *futhark_mc_segmap_parloop_228658_total_runtime;
    int *futhark_mc_segmap_parloop_228658_runs;
    int64_t *futhark_mc_segmap_parloop_228658_iter;
    int64_t futhark_mc_segmap_parloop_228658_total_total_runtime;
    int futhark_mc_segmap_parloop_228658_total_runs;
    int64_t futhark_mc_segmap_parloop_228658_total_iter;
    int64_t *futhark_mc_segmap_task_228656_total_runtime;
    int *futhark_mc_segmap_task_228656_runs;
    int64_t *futhark_mc_segmap_task_228656_iter;
    int64_t futhark_mc_segmap_task_228656_total_time;
    int64_t futhark_mc_segmap_task_228656_total_iter;
    int64_t *futhark_mc_segmap_parloop_228669_total_runtime;
    int *futhark_mc_segmap_parloop_228669_runs;
    int64_t *futhark_mc_segmap_parloop_228669_iter;
    int64_t futhark_mc_segmap_parloop_228669_total_total_runtime;
    int futhark_mc_segmap_parloop_228669_total_runs;
    int64_t futhark_mc_segmap_parloop_228669_total_iter;
    int64_t *futhark_mc_segmap_task_228667_total_runtime;
    int *futhark_mc_segmap_task_228667_runs;
    int64_t *futhark_mc_segmap_task_228667_iter;
    int64_t futhark_mc_segmap_task_228667_total_time;
    int64_t futhark_mc_segmap_task_228667_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228681_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228681_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228681_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228681_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228681_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228681_total_iter;
    int64_t *futhark_mc_segred_task_228674_total_runtime;
    int *futhark_mc_segred_task_228674_runs;
    int64_t *futhark_mc_segred_task_228674_iter;
    int64_t futhark_mc_segred_task_228674_total_time;
    int64_t futhark_mc_segred_task_228674_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228687_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228687_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228687_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228687_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228687_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228687_total_iter;
    int64_t *futhark_mc_segred_task_228683_total_runtime;
    int *futhark_mc_segred_task_228683_runs;
    int64_t *futhark_mc_segred_task_228683_iter;
    int64_t futhark_mc_segred_task_228683_total_time;
    int64_t futhark_mc_segred_task_228683_total_iter;
    int64_t *futhark_mc_segmap_parloop_228672_total_runtime;
    int *futhark_mc_segmap_parloop_228672_runs;
    int64_t *futhark_mc_segmap_parloop_228672_iter;
    int64_t futhark_mc_segmap_parloop_228672_total_total_runtime;
    int futhark_mc_segmap_parloop_228672_total_runs;
    int64_t futhark_mc_segmap_parloop_228672_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228670_total_runtime;
    int *futhark_mc_segmap_nested_task_228670_runs;
    int64_t *futhark_mc_segmap_nested_task_228670_iter;
    int64_t *futhark_mc_segmap_parloop_228663_total_runtime;
    int *futhark_mc_segmap_parloop_228663_runs;
    int64_t *futhark_mc_segmap_parloop_228663_iter;
    int64_t futhark_mc_segmap_parloop_228663_total_total_runtime;
    int futhark_mc_segmap_parloop_228663_total_runs;
    int64_t futhark_mc_segmap_parloop_228663_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228661_total_runtime;
    int *futhark_mc_segmap_nested_task_228661_runs;
    int64_t *futhark_mc_segmap_nested_task_228661_iter;
    int64_t *futhark_mc_segmap_parloop_228652_total_runtime;
    int *futhark_mc_segmap_parloop_228652_runs;
    int64_t *futhark_mc_segmap_parloop_228652_iter;
    int64_t futhark_mc_segmap_parloop_228652_total_total_runtime;
    int futhark_mc_segmap_parloop_228652_total_runs;
    int64_t futhark_mc_segmap_parloop_228652_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228650_total_runtime;
    int *futhark_mc_segmap_nested_task_228650_runs;
    int64_t *futhark_mc_segmap_nested_task_228650_iter;
    int64_t *futhark_mc_segmap_parloop_228691_total_runtime;
    int *futhark_mc_segmap_parloop_228691_runs;
    int64_t *futhark_mc_segmap_parloop_228691_iter;
    int64_t futhark_mc_segmap_parloop_228691_total_total_runtime;
    int futhark_mc_segmap_parloop_228691_total_runs;
    int64_t futhark_mc_segmap_parloop_228691_total_iter;
    int64_t *futhark_mc_segmap_task_228689_total_runtime;
    int *futhark_mc_segmap_task_228689_runs;
    int64_t *futhark_mc_segmap_task_228689_iter;
    int64_t futhark_mc_segmap_task_228689_total_time;
    int64_t futhark_mc_segmap_task_228689_total_iter;
    int64_t *futhark_mc_segmap_parloop_228701_total_runtime;
    int *futhark_mc_segmap_parloop_228701_runs;
    int64_t *futhark_mc_segmap_parloop_228701_iter;
    int64_t futhark_mc_segmap_parloop_228701_total_total_runtime;
    int futhark_mc_segmap_parloop_228701_total_runs;
    int64_t futhark_mc_segmap_parloop_228701_total_iter;
    int64_t *futhark_mc_segmap_task_228699_total_runtime;
    int *futhark_mc_segmap_task_228699_runs;
    int64_t *futhark_mc_segmap_task_228699_iter;
    int64_t futhark_mc_segmap_task_228699_total_time;
    int64_t futhark_mc_segmap_task_228699_total_iter;
    int64_t *futhark_mc_segmap_parloop_228711_total_runtime;
    int *futhark_mc_segmap_parloop_228711_runs;
    int64_t *futhark_mc_segmap_parloop_228711_iter;
    int64_t futhark_mc_segmap_parloop_228711_total_total_runtime;
    int futhark_mc_segmap_parloop_228711_total_runs;
    int64_t futhark_mc_segmap_parloop_228711_total_iter;
    int64_t *futhark_mc_segmap_task_228709_total_runtime;
    int *futhark_mc_segmap_task_228709_runs;
    int64_t *futhark_mc_segmap_task_228709_iter;
    int64_t futhark_mc_segmap_task_228709_total_time;
    int64_t futhark_mc_segmap_task_228709_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228721_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228721_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228721_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228721_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228721_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228721_total_iter;
    int64_t *futhark_mc_segred_task_228718_total_runtime;
    int *futhark_mc_segred_task_228718_runs;
    int64_t *futhark_mc_segred_task_228718_iter;
    int64_t futhark_mc_segred_task_228718_total_time;
    int64_t futhark_mc_segred_task_228718_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228726_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228726_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228726_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228726_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228726_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228726_total_iter;
    int64_t *futhark_mc_segred_task_228723_total_runtime;
    int *futhark_mc_segred_task_228723_runs;
    int64_t *futhark_mc_segred_task_228723_iter;
    int64_t futhark_mc_segred_task_228723_total_time;
    int64_t futhark_mc_segred_task_228723_total_iter;
    int64_t *futhark_mc_segmap_parloop_228715_total_runtime;
    int *futhark_mc_segmap_parloop_228715_runs;
    int64_t *futhark_mc_segmap_parloop_228715_iter;
    int64_t futhark_mc_segmap_parloop_228715_total_total_runtime;
    int futhark_mc_segmap_parloop_228715_total_runs;
    int64_t futhark_mc_segmap_parloop_228715_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228713_total_runtime;
    int *futhark_mc_segmap_nested_task_228713_runs;
    int64_t *futhark_mc_segmap_nested_task_228713_iter;
    int64_t *futhark_mc_segmap_parloop_228706_total_runtime;
    int *futhark_mc_segmap_parloop_228706_runs;
    int64_t *futhark_mc_segmap_parloop_228706_iter;
    int64_t futhark_mc_segmap_parloop_228706_total_total_runtime;
    int futhark_mc_segmap_parloop_228706_total_runs;
    int64_t futhark_mc_segmap_parloop_228706_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228704_total_runtime;
    int *futhark_mc_segmap_nested_task_228704_runs;
    int64_t *futhark_mc_segmap_nested_task_228704_iter;
    int64_t *futhark_mc_segmap_parloop_228696_total_runtime;
    int *futhark_mc_segmap_parloop_228696_runs;
    int64_t *futhark_mc_segmap_parloop_228696_iter;
    int64_t futhark_mc_segmap_parloop_228696_total_total_runtime;
    int futhark_mc_segmap_parloop_228696_total_runs;
    int64_t futhark_mc_segmap_parloop_228696_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228694_total_runtime;
    int *futhark_mc_segmap_nested_task_228694_runs;
    int64_t *futhark_mc_segmap_nested_task_228694_iter;
    int64_t *futhark_mc_segmap_parloop_228730_total_runtime;
    int *futhark_mc_segmap_parloop_228730_runs;
    int64_t *futhark_mc_segmap_parloop_228730_iter;
    int64_t futhark_mc_segmap_parloop_228730_total_total_runtime;
    int futhark_mc_segmap_parloop_228730_total_runs;
    int64_t futhark_mc_segmap_parloop_228730_total_iter;
    int64_t *futhark_mc_segmap_task_228728_total_runtime;
    int *futhark_mc_segmap_task_228728_runs;
    int64_t *futhark_mc_segmap_task_228728_iter;
    int64_t futhark_mc_segmap_task_228728_total_time;
    int64_t futhark_mc_segmap_task_228728_total_iter;
    int64_t *futhark_mc_segmap_parloop_228743_total_runtime;
    int *futhark_mc_segmap_parloop_228743_runs;
    int64_t *futhark_mc_segmap_parloop_228743_iter;
    int64_t futhark_mc_segmap_parloop_228743_total_total_runtime;
    int futhark_mc_segmap_parloop_228743_total_runs;
    int64_t futhark_mc_segmap_parloop_228743_total_iter;
    int64_t *futhark_mc_segmap_task_228741_total_runtime;
    int *futhark_mc_segmap_task_228741_runs;
    int64_t *futhark_mc_segmap_task_228741_iter;
    int64_t futhark_mc_segmap_task_228741_total_time;
    int64_t futhark_mc_segmap_task_228741_total_iter;
    int64_t *futhark_mc_segmap_parloop_228756_total_runtime;
    int *futhark_mc_segmap_parloop_228756_runs;
    int64_t *futhark_mc_segmap_parloop_228756_iter;
    int64_t futhark_mc_segmap_parloop_228756_total_total_runtime;
    int futhark_mc_segmap_parloop_228756_total_runs;
    int64_t futhark_mc_segmap_parloop_228756_total_iter;
    int64_t *futhark_mc_segmap_task_228754_total_runtime;
    int *futhark_mc_segmap_task_228754_runs;
    int64_t *futhark_mc_segmap_task_228754_iter;
    int64_t futhark_mc_segmap_task_228754_total_time;
    int64_t futhark_mc_segmap_task_228754_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228770_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228770_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228770_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228770_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228770_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228770_total_iter;
    int64_t *futhark_mc_segred_task_228765_total_runtime;
    int *futhark_mc_segred_task_228765_runs;
    int64_t *futhark_mc_segred_task_228765_iter;
    int64_t futhark_mc_segred_task_228765_total_time;
    int64_t futhark_mc_segred_task_228765_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228776_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228776_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228776_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228776_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228776_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228776_total_iter;
    int64_t *futhark_mc_segred_task_228772_total_runtime;
    int *futhark_mc_segred_task_228772_runs;
    int64_t *futhark_mc_segred_task_228772_iter;
    int64_t futhark_mc_segred_task_228772_total_time;
    int64_t futhark_mc_segred_task_228772_total_iter;
    int64_t *futhark_mc_segmap_parloop_228761_total_runtime;
    int *futhark_mc_segmap_parloop_228761_runs;
    int64_t *futhark_mc_segmap_parloop_228761_iter;
    int64_t futhark_mc_segmap_parloop_228761_total_total_runtime;
    int futhark_mc_segmap_parloop_228761_total_runs;
    int64_t futhark_mc_segmap_parloop_228761_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228759_total_runtime;
    int *futhark_mc_segmap_nested_task_228759_runs;
    int64_t *futhark_mc_segmap_nested_task_228759_iter;
    int64_t *futhark_mc_segmap_parloop_228750_total_runtime;
    int *futhark_mc_segmap_parloop_228750_runs;
    int64_t *futhark_mc_segmap_parloop_228750_iter;
    int64_t futhark_mc_segmap_parloop_228750_total_total_runtime;
    int futhark_mc_segmap_parloop_228750_total_runs;
    int64_t futhark_mc_segmap_parloop_228750_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228748_total_runtime;
    int *futhark_mc_segmap_nested_task_228748_runs;
    int64_t *futhark_mc_segmap_nested_task_228748_iter;
    int64_t *futhark_mc_segmap_parloop_228737_total_runtime;
    int *futhark_mc_segmap_parloop_228737_runs;
    int64_t *futhark_mc_segmap_parloop_228737_iter;
    int64_t futhark_mc_segmap_parloop_228737_total_total_runtime;
    int futhark_mc_segmap_parloop_228737_total_runs;
    int64_t futhark_mc_segmap_parloop_228737_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228735_total_runtime;
    int *futhark_mc_segmap_nested_task_228735_runs;
    int64_t *futhark_mc_segmap_nested_task_228735_iter;
    int64_t *futhark_mc_segmap_parloop_228780_total_runtime;
    int *futhark_mc_segmap_parloop_228780_runs;
    int64_t *futhark_mc_segmap_parloop_228780_iter;
    int64_t futhark_mc_segmap_parloop_228780_total_total_runtime;
    int futhark_mc_segmap_parloop_228780_total_runs;
    int64_t futhark_mc_segmap_parloop_228780_total_iter;
    int64_t *futhark_mc_segmap_task_228778_total_runtime;
    int *futhark_mc_segmap_task_228778_runs;
    int64_t *futhark_mc_segmap_task_228778_iter;
    int64_t futhark_mc_segmap_task_228778_total_time;
    int64_t futhark_mc_segmap_task_228778_total_iter;
    int64_t *futhark_mc_segmap_parloop_228795_total_runtime;
    int *futhark_mc_segmap_parloop_228795_runs;
    int64_t *futhark_mc_segmap_parloop_228795_iter;
    int64_t futhark_mc_segmap_parloop_228795_total_total_runtime;
    int futhark_mc_segmap_parloop_228795_total_runs;
    int64_t futhark_mc_segmap_parloop_228795_total_iter;
    int64_t *futhark_mc_segmap_task_228793_total_runtime;
    int *futhark_mc_segmap_task_228793_runs;
    int64_t *futhark_mc_segmap_task_228793_iter;
    int64_t futhark_mc_segmap_task_228793_total_time;
    int64_t futhark_mc_segmap_task_228793_total_iter;
    int64_t *futhark_mc_segmap_parloop_228810_total_runtime;
    int *futhark_mc_segmap_parloop_228810_runs;
    int64_t *futhark_mc_segmap_parloop_228810_iter;
    int64_t futhark_mc_segmap_parloop_228810_total_total_runtime;
    int futhark_mc_segmap_parloop_228810_total_runs;
    int64_t futhark_mc_segmap_parloop_228810_total_iter;
    int64_t *futhark_mc_segmap_task_228808_total_runtime;
    int *futhark_mc_segmap_task_228808_runs;
    int64_t *futhark_mc_segmap_task_228808_iter;
    int64_t futhark_mc_segmap_task_228808_total_time;
    int64_t futhark_mc_segmap_task_228808_total_iter;
    int64_t *futhark_mc_segmap_parloop_228825_total_runtime;
    int *futhark_mc_segmap_parloop_228825_runs;
    int64_t *futhark_mc_segmap_parloop_228825_iter;
    int64_t futhark_mc_segmap_parloop_228825_total_total_runtime;
    int futhark_mc_segmap_parloop_228825_total_runs;
    int64_t futhark_mc_segmap_parloop_228825_total_iter;
    int64_t *futhark_mc_segmap_task_228823_total_runtime;
    int *futhark_mc_segmap_task_228823_runs;
    int64_t *futhark_mc_segmap_task_228823_iter;
    int64_t futhark_mc_segmap_task_228823_total_time;
    int64_t futhark_mc_segmap_task_228823_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228834_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228834_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228834_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228834_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228834_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228834_total_iter;
    int64_t *futhark_mc_segred_task_228827_total_runtime;
    int *futhark_mc_segred_task_228827_runs;
    int64_t *futhark_mc_segred_task_228827_iter;
    int64_t futhark_mc_segred_task_228827_total_time;
    int64_t futhark_mc_segred_task_228827_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228840_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228840_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228840_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228840_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228840_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228840_total_iter;
    int64_t *futhark_mc_segred_task_228836_total_runtime;
    int *futhark_mc_segred_task_228836_runs;
    int64_t *futhark_mc_segred_task_228836_iter;
    int64_t futhark_mc_segred_task_228836_total_time;
    int64_t futhark_mc_segred_task_228836_total_iter;
    int64_t *futhark_mc_segmap_parloop_228817_total_runtime;
    int *futhark_mc_segmap_parloop_228817_runs;
    int64_t *futhark_mc_segmap_parloop_228817_iter;
    int64_t futhark_mc_segmap_parloop_228817_total_total_runtime;
    int futhark_mc_segmap_parloop_228817_total_runs;
    int64_t futhark_mc_segmap_parloop_228817_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228815_total_runtime;
    int *futhark_mc_segmap_nested_task_228815_runs;
    int64_t *futhark_mc_segmap_nested_task_228815_iter;
    int64_t *futhark_mc_segmap_parloop_228804_total_runtime;
    int *futhark_mc_segmap_parloop_228804_runs;
    int64_t *futhark_mc_segmap_parloop_228804_iter;
    int64_t futhark_mc_segmap_parloop_228804_total_total_runtime;
    int futhark_mc_segmap_parloop_228804_total_runs;
    int64_t futhark_mc_segmap_parloop_228804_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228802_total_runtime;
    int *futhark_mc_segmap_nested_task_228802_runs;
    int64_t *futhark_mc_segmap_nested_task_228802_iter;
    int64_t *futhark_mc_segmap_parloop_228789_total_runtime;
    int *futhark_mc_segmap_parloop_228789_runs;
    int64_t *futhark_mc_segmap_parloop_228789_iter;
    int64_t futhark_mc_segmap_parloop_228789_total_total_runtime;
    int futhark_mc_segmap_parloop_228789_total_runs;
    int64_t futhark_mc_segmap_parloop_228789_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228787_total_runtime;
    int *futhark_mc_segmap_nested_task_228787_runs;
    int64_t *futhark_mc_segmap_nested_task_228787_iter;
    int64_t *futhark_mc_segmap_parloop_228844_total_runtime;
    int *futhark_mc_segmap_parloop_228844_runs;
    int64_t *futhark_mc_segmap_parloop_228844_iter;
    int64_t futhark_mc_segmap_parloop_228844_total_total_runtime;
    int futhark_mc_segmap_parloop_228844_total_runs;
    int64_t futhark_mc_segmap_parloop_228844_total_iter;
    int64_t *futhark_mc_segmap_task_228842_total_runtime;
    int *futhark_mc_segmap_task_228842_runs;
    int64_t *futhark_mc_segmap_task_228842_iter;
    int64_t futhark_mc_segmap_task_228842_total_time;
    int64_t futhark_mc_segmap_task_228842_total_iter;
    int64_t *futhark_mc_segmap_parloop_228853_total_runtime;
    int *futhark_mc_segmap_parloop_228853_runs;
    int64_t *futhark_mc_segmap_parloop_228853_iter;
    int64_t futhark_mc_segmap_parloop_228853_total_total_runtime;
    int futhark_mc_segmap_parloop_228853_total_runs;
    int64_t futhark_mc_segmap_parloop_228853_total_iter;
    int64_t *futhark_mc_segmap_task_228851_total_runtime;
    int *futhark_mc_segmap_task_228851_runs;
    int64_t *futhark_mc_segmap_task_228851_iter;
    int64_t futhark_mc_segmap_task_228851_total_time;
    int64_t futhark_mc_segmap_task_228851_total_iter;
    int64_t *futhark_mc_segmap_parloop_228862_total_runtime;
    int *futhark_mc_segmap_parloop_228862_runs;
    int64_t *futhark_mc_segmap_parloop_228862_iter;
    int64_t futhark_mc_segmap_parloop_228862_total_total_runtime;
    int futhark_mc_segmap_parloop_228862_total_runs;
    int64_t futhark_mc_segmap_parloop_228862_total_iter;
    int64_t *futhark_mc_segmap_task_228860_total_runtime;
    int *futhark_mc_segmap_task_228860_runs;
    int64_t *futhark_mc_segmap_task_228860_iter;
    int64_t futhark_mc_segmap_task_228860_total_time;
    int64_t futhark_mc_segmap_task_228860_total_iter;
    int64_t *futhark_mc_segmap_parloop_228857_total_runtime;
    int *futhark_mc_segmap_parloop_228857_runs;
    int64_t *futhark_mc_segmap_parloop_228857_iter;
    int64_t futhark_mc_segmap_parloop_228857_total_total_runtime;
    int futhark_mc_segmap_parloop_228857_total_runs;
    int64_t futhark_mc_segmap_parloop_228857_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228855_total_runtime;
    int *futhark_mc_segmap_nested_task_228855_runs;
    int64_t *futhark_mc_segmap_nested_task_228855_iter;
    int64_t *futhark_mc_segmap_parloop_228848_total_runtime;
    int *futhark_mc_segmap_parloop_228848_runs;
    int64_t *futhark_mc_segmap_parloop_228848_iter;
    int64_t futhark_mc_segmap_parloop_228848_total_total_runtime;
    int futhark_mc_segmap_parloop_228848_total_runs;
    int64_t futhark_mc_segmap_parloop_228848_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228846_total_runtime;
    int *futhark_mc_segmap_nested_task_228846_runs;
    int64_t *futhark_mc_segmap_nested_task_228846_iter;
    int64_t *futhark_mc_segmap_parloop_228866_total_runtime;
    int *futhark_mc_segmap_parloop_228866_runs;
    int64_t *futhark_mc_segmap_parloop_228866_iter;
    int64_t futhark_mc_segmap_parloop_228866_total_total_runtime;
    int futhark_mc_segmap_parloop_228866_total_runs;
    int64_t futhark_mc_segmap_parloop_228866_total_iter;
    int64_t *futhark_mc_segmap_task_228864_total_runtime;
    int *futhark_mc_segmap_task_228864_runs;
    int64_t *futhark_mc_segmap_task_228864_iter;
    int64_t futhark_mc_segmap_task_228864_total_time;
    int64_t futhark_mc_segmap_task_228864_total_iter;
    int64_t *futhark_mc_segmap_parloop_228875_total_runtime;
    int *futhark_mc_segmap_parloop_228875_runs;
    int64_t *futhark_mc_segmap_parloop_228875_iter;
    int64_t futhark_mc_segmap_parloop_228875_total_total_runtime;
    int futhark_mc_segmap_parloop_228875_total_runs;
    int64_t futhark_mc_segmap_parloop_228875_total_iter;
    int64_t *futhark_mc_segmap_task_228873_total_runtime;
    int *futhark_mc_segmap_task_228873_runs;
    int64_t *futhark_mc_segmap_task_228873_iter;
    int64_t futhark_mc_segmap_task_228873_total_time;
    int64_t futhark_mc_segmap_task_228873_total_iter;
    int64_t *futhark_mc_segmap_parloop_228870_total_runtime;
    int *futhark_mc_segmap_parloop_228870_runs;
    int64_t *futhark_mc_segmap_parloop_228870_iter;
    int64_t futhark_mc_segmap_parloop_228870_total_total_runtime;
    int futhark_mc_segmap_parloop_228870_total_runs;
    int64_t futhark_mc_segmap_parloop_228870_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228868_total_runtime;
    int *futhark_mc_segmap_nested_task_228868_runs;
    int64_t *futhark_mc_segmap_nested_task_228868_iter;
    int64_t *futhark_mc_segmap_parloop_228879_total_runtime;
    int *futhark_mc_segmap_parloop_228879_runs;
    int64_t *futhark_mc_segmap_parloop_228879_iter;
    int64_t futhark_mc_segmap_parloop_228879_total_total_runtime;
    int futhark_mc_segmap_parloop_228879_total_runs;
    int64_t futhark_mc_segmap_parloop_228879_total_iter;
    int64_t *futhark_mc_segmap_task_228877_total_runtime;
    int *futhark_mc_segmap_task_228877_runs;
    int64_t *futhark_mc_segmap_task_228877_iter;
    int64_t futhark_mc_segmap_task_228877_total_time;
    int64_t futhark_mc_segmap_task_228877_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228887_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228887_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228887_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228887_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228887_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228887_total_iter;
    int64_t *futhark_mc_segred_task_228884_total_runtime;
    int *futhark_mc_segred_task_228884_runs;
    int64_t *futhark_mc_segred_task_228884_iter;
    int64_t futhark_mc_segred_task_228884_total_time;
    int64_t futhark_mc_segred_task_228884_total_iter;
    int64_t *futhark_mc_segmap_parloop_228882_total_runtime;
    int *futhark_mc_segmap_parloop_228882_runs;
    int64_t *futhark_mc_segmap_parloop_228882_iter;
    int64_t futhark_mc_segmap_parloop_228882_total_total_runtime;
    int futhark_mc_segmap_parloop_228882_total_runs;
    int64_t futhark_mc_segmap_parloop_228882_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228880_total_runtime;
    int *futhark_mc_segmap_nested_task_228880_runs;
    int64_t *futhark_mc_segmap_nested_task_228880_iter;
    int64_t *futhark_mc_segmap_parloop_228891_total_runtime;
    int *futhark_mc_segmap_parloop_228891_runs;
    int64_t *futhark_mc_segmap_parloop_228891_iter;
    int64_t futhark_mc_segmap_parloop_228891_total_total_runtime;
    int futhark_mc_segmap_parloop_228891_total_runs;
    int64_t futhark_mc_segmap_parloop_228891_total_iter;
    int64_t *futhark_mc_segmap_task_228889_total_runtime;
    int *futhark_mc_segmap_task_228889_runs;
    int64_t *futhark_mc_segmap_task_228889_iter;
    int64_t futhark_mc_segmap_task_228889_total_time;
    int64_t futhark_mc_segmap_task_228889_total_iter;
    int64_t *futhark_mc_scan_stage_1_parloop_228901_total_runtime;
    int *futhark_mc_scan_stage_1_parloop_228901_runs;
    int64_t *futhark_mc_scan_stage_1_parloop_228901_iter;
    int64_t futhark_mc_scan_stage_1_parloop_228901_total_total_runtime;
    int futhark_mc_scan_stage_1_parloop_228901_total_runs;
    int64_t futhark_mc_scan_stage_1_parloop_228901_total_iter;
    int64_t *futhark_mc_scan_stage_3_parloop_228903_total_runtime;
    int *futhark_mc_scan_stage_3_parloop_228903_runs;
    int64_t *futhark_mc_scan_stage_3_parloop_228903_iter;
    int64_t futhark_mc_scan_stage_3_parloop_228903_total_total_runtime;
    int futhark_mc_scan_stage_3_parloop_228903_total_runs;
    int64_t futhark_mc_scan_stage_3_parloop_228903_total_iter;
    int64_t *futhark_mc_segscan_task_228898_total_runtime;
    int *futhark_mc_segscan_task_228898_runs;
    int64_t *futhark_mc_segscan_task_228898_iter;
    int64_t futhark_mc_segscan_task_228898_total_time;
    int64_t futhark_mc_segscan_task_228898_total_iter;
    int64_t *futhark_mc_segmap_parloop_228895_total_runtime;
    int *futhark_mc_segmap_parloop_228895_runs;
    int64_t *futhark_mc_segmap_parloop_228895_iter;
    int64_t futhark_mc_segmap_parloop_228895_total_total_runtime;
    int futhark_mc_segmap_parloop_228895_total_runs;
    int64_t futhark_mc_segmap_parloop_228895_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228893_total_runtime;
    int *futhark_mc_segmap_nested_task_228893_runs;
    int64_t *futhark_mc_segmap_nested_task_228893_iter;
    int64_t *futhark_mc_segmap_parloop_228907_total_runtime;
    int *futhark_mc_segmap_parloop_228907_runs;
    int64_t *futhark_mc_segmap_parloop_228907_iter;
    int64_t futhark_mc_segmap_parloop_228907_total_total_runtime;
    int futhark_mc_segmap_parloop_228907_total_runs;
    int64_t futhark_mc_segmap_parloop_228907_total_iter;
    int64_t *futhark_mc_segmap_task_228905_total_runtime;
    int *futhark_mc_segmap_task_228905_runs;
    int64_t *futhark_mc_segmap_task_228905_iter;
    int64_t futhark_mc_segmap_task_228905_total_time;
    int64_t futhark_mc_segmap_task_228905_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228915_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228915_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228915_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228915_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228915_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228915_total_iter;
    int64_t *futhark_mc_segred_task_228912_total_runtime;
    int *futhark_mc_segred_task_228912_runs;
    int64_t *futhark_mc_segred_task_228912_iter;
    int64_t futhark_mc_segred_task_228912_total_time;
    int64_t futhark_mc_segred_task_228912_total_iter;
    int64_t *futhark_mc_segmap_parloop_228910_total_runtime;
    int *futhark_mc_segmap_parloop_228910_runs;
    int64_t *futhark_mc_segmap_parloop_228910_iter;
    int64_t futhark_mc_segmap_parloop_228910_total_total_runtime;
    int futhark_mc_segmap_parloop_228910_total_runs;
    int64_t futhark_mc_segmap_parloop_228910_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228908_total_runtime;
    int *futhark_mc_segmap_nested_task_228908_runs;
    int64_t *futhark_mc_segmap_nested_task_228908_iter;
    int64_t *futhark_mc_segmap_parloop_228919_total_runtime;
    int *futhark_mc_segmap_parloop_228919_runs;
    int64_t *futhark_mc_segmap_parloop_228919_iter;
    int64_t futhark_mc_segmap_parloop_228919_total_total_runtime;
    int futhark_mc_segmap_parloop_228919_total_runs;
    int64_t futhark_mc_segmap_parloop_228919_total_iter;
    int64_t *futhark_mc_segmap_task_228917_total_runtime;
    int *futhark_mc_segmap_task_228917_runs;
    int64_t *futhark_mc_segmap_task_228917_iter;
    int64_t futhark_mc_segmap_task_228917_total_time;
    int64_t futhark_mc_segmap_task_228917_total_iter;
    int64_t *futhark_mc_scan_stage_1_parloop_228929_total_runtime;
    int *futhark_mc_scan_stage_1_parloop_228929_runs;
    int64_t *futhark_mc_scan_stage_1_parloop_228929_iter;
    int64_t futhark_mc_scan_stage_1_parloop_228929_total_total_runtime;
    int futhark_mc_scan_stage_1_parloop_228929_total_runs;
    int64_t futhark_mc_scan_stage_1_parloop_228929_total_iter;
    int64_t *futhark_mc_scan_stage_3_parloop_228931_total_runtime;
    int *futhark_mc_scan_stage_3_parloop_228931_runs;
    int64_t *futhark_mc_scan_stage_3_parloop_228931_iter;
    int64_t futhark_mc_scan_stage_3_parloop_228931_total_total_runtime;
    int futhark_mc_scan_stage_3_parloop_228931_total_runs;
    int64_t futhark_mc_scan_stage_3_parloop_228931_total_iter;
    int64_t *futhark_mc_segscan_task_228926_total_runtime;
    int *futhark_mc_segscan_task_228926_runs;
    int64_t *futhark_mc_segscan_task_228926_iter;
    int64_t futhark_mc_segscan_task_228926_total_time;
    int64_t futhark_mc_segscan_task_228926_total_iter;
    int64_t *futhark_mc_segmap_parloop_228923_total_runtime;
    int *futhark_mc_segmap_parloop_228923_runs;
    int64_t *futhark_mc_segmap_parloop_228923_iter;
    int64_t futhark_mc_segmap_parloop_228923_total_total_runtime;
    int futhark_mc_segmap_parloop_228923_total_runs;
    int64_t futhark_mc_segmap_parloop_228923_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228921_total_runtime;
    int *futhark_mc_segmap_nested_task_228921_runs;
    int64_t *futhark_mc_segmap_nested_task_228921_iter;
    int64_t *futhark_mc_segmap_parloop_228935_total_runtime;
    int *futhark_mc_segmap_parloop_228935_runs;
    int64_t *futhark_mc_segmap_parloop_228935_iter;
    int64_t futhark_mc_segmap_parloop_228935_total_total_runtime;
    int futhark_mc_segmap_parloop_228935_total_runs;
    int64_t futhark_mc_segmap_parloop_228935_total_iter;
    int64_t *futhark_mc_segmap_task_228933_total_runtime;
    int *futhark_mc_segmap_task_228933_runs;
    int64_t *futhark_mc_segmap_task_228933_iter;
    int64_t futhark_mc_segmap_task_228933_total_time;
    int64_t futhark_mc_segmap_task_228933_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228943_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228943_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228943_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228943_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228943_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228943_total_iter;
    int64_t *futhark_mc_segred_task_228940_total_runtime;
    int *futhark_mc_segred_task_228940_runs;
    int64_t *futhark_mc_segred_task_228940_iter;
    int64_t futhark_mc_segred_task_228940_total_time;
    int64_t futhark_mc_segred_task_228940_total_iter;
    int64_t *futhark_mc_segmap_parloop_228938_total_runtime;
    int *futhark_mc_segmap_parloop_228938_runs;
    int64_t *futhark_mc_segmap_parloop_228938_iter;
    int64_t futhark_mc_segmap_parloop_228938_total_total_runtime;
    int futhark_mc_segmap_parloop_228938_total_runs;
    int64_t futhark_mc_segmap_parloop_228938_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228936_total_runtime;
    int *futhark_mc_segmap_nested_task_228936_runs;
    int64_t *futhark_mc_segmap_nested_task_228936_iter;
    int64_t *futhark_mc_segmap_parloop_228947_total_runtime;
    int *futhark_mc_segmap_parloop_228947_runs;
    int64_t *futhark_mc_segmap_parloop_228947_iter;
    int64_t futhark_mc_segmap_parloop_228947_total_total_runtime;
    int futhark_mc_segmap_parloop_228947_total_runs;
    int64_t futhark_mc_segmap_parloop_228947_total_iter;
    int64_t *futhark_mc_segmap_task_228945_total_runtime;
    int *futhark_mc_segmap_task_228945_runs;
    int64_t *futhark_mc_segmap_task_228945_iter;
    int64_t futhark_mc_segmap_task_228945_total_time;
    int64_t futhark_mc_segmap_task_228945_total_iter;
    int64_t *futhark_mc_scan_stage_1_parloop_228957_total_runtime;
    int *futhark_mc_scan_stage_1_parloop_228957_runs;
    int64_t *futhark_mc_scan_stage_1_parloop_228957_iter;
    int64_t futhark_mc_scan_stage_1_parloop_228957_total_total_runtime;
    int futhark_mc_scan_stage_1_parloop_228957_total_runs;
    int64_t futhark_mc_scan_stage_1_parloop_228957_total_iter;
    int64_t *futhark_mc_scan_stage_3_parloop_228959_total_runtime;
    int *futhark_mc_scan_stage_3_parloop_228959_runs;
    int64_t *futhark_mc_scan_stage_3_parloop_228959_iter;
    int64_t futhark_mc_scan_stage_3_parloop_228959_total_total_runtime;
    int futhark_mc_scan_stage_3_parloop_228959_total_runs;
    int64_t futhark_mc_scan_stage_3_parloop_228959_total_iter;
    int64_t *futhark_mc_segscan_task_228954_total_runtime;
    int *futhark_mc_segscan_task_228954_runs;
    int64_t *futhark_mc_segscan_task_228954_iter;
    int64_t futhark_mc_segscan_task_228954_total_time;
    int64_t futhark_mc_segscan_task_228954_total_iter;
    int64_t *futhark_mc_segmap_parloop_228951_total_runtime;
    int *futhark_mc_segmap_parloop_228951_runs;
    int64_t *futhark_mc_segmap_parloop_228951_iter;
    int64_t futhark_mc_segmap_parloop_228951_total_total_runtime;
    int futhark_mc_segmap_parloop_228951_total_runs;
    int64_t futhark_mc_segmap_parloop_228951_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228949_total_runtime;
    int *futhark_mc_segmap_nested_task_228949_runs;
    int64_t *futhark_mc_segmap_nested_task_228949_iter;
    int64_t *futhark_mc_segmap_parloop_228963_total_runtime;
    int *futhark_mc_segmap_parloop_228963_runs;
    int64_t *futhark_mc_segmap_parloop_228963_iter;
    int64_t futhark_mc_segmap_parloop_228963_total_total_runtime;
    int futhark_mc_segmap_parloop_228963_total_runs;
    int64_t futhark_mc_segmap_parloop_228963_total_iter;
    int64_t *futhark_mc_segmap_task_228961_total_runtime;
    int *futhark_mc_segmap_task_228961_runs;
    int64_t *futhark_mc_segmap_task_228961_iter;
    int64_t futhark_mc_segmap_task_228961_total_time;
    int64_t futhark_mc_segmap_task_228961_total_iter;
    int64_t *futhark_mc_segmap_parloop_228972_total_runtime;
    int *futhark_mc_segmap_parloop_228972_runs;
    int64_t *futhark_mc_segmap_parloop_228972_iter;
    int64_t futhark_mc_segmap_parloop_228972_total_total_runtime;
    int futhark_mc_segmap_parloop_228972_total_runs;
    int64_t futhark_mc_segmap_parloop_228972_total_iter;
    int64_t *futhark_mc_segmap_task_228970_total_runtime;
    int *futhark_mc_segmap_task_228970_runs;
    int64_t *futhark_mc_segmap_task_228970_iter;
    int64_t futhark_mc_segmap_task_228970_total_time;
    int64_t futhark_mc_segmap_task_228970_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228980_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228980_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228980_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228980_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228980_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228980_total_iter;
    int64_t *futhark_mc_segred_task_228977_total_runtime;
    int *futhark_mc_segred_task_228977_runs;
    int64_t *futhark_mc_segred_task_228977_iter;
    int64_t futhark_mc_segred_task_228977_total_time;
    int64_t futhark_mc_segred_task_228977_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_228985_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_228985_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_228985_iter;
    int64_t futhark_mc_segred_stage_1_parloop_228985_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_228985_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_228985_total_iter;
    int64_t *futhark_mc_segred_task_228982_total_runtime;
    int *futhark_mc_segred_task_228982_runs;
    int64_t *futhark_mc_segred_task_228982_iter;
    int64_t futhark_mc_segred_task_228982_total_time;
    int64_t futhark_mc_segred_task_228982_total_iter;
    int64_t *futhark_mc_segmap_parloop_228975_total_runtime;
    int *futhark_mc_segmap_parloop_228975_runs;
    int64_t *futhark_mc_segmap_parloop_228975_iter;
    int64_t futhark_mc_segmap_parloop_228975_total_total_runtime;
    int futhark_mc_segmap_parloop_228975_total_runs;
    int64_t futhark_mc_segmap_parloop_228975_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228973_total_runtime;
    int *futhark_mc_segmap_nested_task_228973_runs;
    int64_t *futhark_mc_segmap_nested_task_228973_iter;
    int64_t *futhark_mc_segmap_parloop_228967_total_runtime;
    int *futhark_mc_segmap_parloop_228967_runs;
    int64_t *futhark_mc_segmap_parloop_228967_iter;
    int64_t futhark_mc_segmap_parloop_228967_total_total_runtime;
    int futhark_mc_segmap_parloop_228967_total_runs;
    int64_t futhark_mc_segmap_parloop_228967_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228965_total_runtime;
    int *futhark_mc_segmap_nested_task_228965_runs;
    int64_t *futhark_mc_segmap_nested_task_228965_iter;
    int64_t *futhark_mc_segmap_parloop_228989_total_runtime;
    int *futhark_mc_segmap_parloop_228989_runs;
    int64_t *futhark_mc_segmap_parloop_228989_iter;
    int64_t futhark_mc_segmap_parloop_228989_total_total_runtime;
    int futhark_mc_segmap_parloop_228989_total_runs;
    int64_t futhark_mc_segmap_parloop_228989_total_iter;
    int64_t *futhark_mc_segmap_task_228987_total_runtime;
    int *futhark_mc_segmap_task_228987_runs;
    int64_t *futhark_mc_segmap_task_228987_iter;
    int64_t futhark_mc_segmap_task_228987_total_time;
    int64_t futhark_mc_segmap_task_228987_total_iter;
    int64_t *futhark_mc_segmap_parloop_229000_total_runtime;
    int *futhark_mc_segmap_parloop_229000_runs;
    int64_t *futhark_mc_segmap_parloop_229000_iter;
    int64_t futhark_mc_segmap_parloop_229000_total_total_runtime;
    int futhark_mc_segmap_parloop_229000_total_runs;
    int64_t futhark_mc_segmap_parloop_229000_total_iter;
    int64_t *futhark_mc_segmap_task_228998_total_runtime;
    int *futhark_mc_segmap_task_228998_runs;
    int64_t *futhark_mc_segmap_task_228998_iter;
    int64_t futhark_mc_segmap_task_228998_total_time;
    int64_t futhark_mc_segmap_task_228998_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229010_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229010_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229010_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229010_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229010_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229010_total_iter;
    int64_t *futhark_mc_segred_task_229005_total_runtime;
    int *futhark_mc_segred_task_229005_runs;
    int64_t *futhark_mc_segred_task_229005_iter;
    int64_t futhark_mc_segred_task_229005_total_time;
    int64_t futhark_mc_segred_task_229005_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229016_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229016_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229016_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229016_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229016_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229016_total_iter;
    int64_t *futhark_mc_segred_task_229012_total_runtime;
    int *futhark_mc_segred_task_229012_runs;
    int64_t *futhark_mc_segred_task_229012_iter;
    int64_t futhark_mc_segred_task_229012_total_time;
    int64_t futhark_mc_segred_task_229012_total_iter;
    int64_t *futhark_mc_segmap_parloop_229003_total_runtime;
    int *futhark_mc_segmap_parloop_229003_runs;
    int64_t *futhark_mc_segmap_parloop_229003_iter;
    int64_t futhark_mc_segmap_parloop_229003_total_total_runtime;
    int futhark_mc_segmap_parloop_229003_total_runs;
    int64_t futhark_mc_segmap_parloop_229003_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229001_total_runtime;
    int *futhark_mc_segmap_nested_task_229001_runs;
    int64_t *futhark_mc_segmap_nested_task_229001_iter;
    int64_t *futhark_mc_segmap_parloop_228994_total_runtime;
    int *futhark_mc_segmap_parloop_228994_runs;
    int64_t *futhark_mc_segmap_parloop_228994_iter;
    int64_t futhark_mc_segmap_parloop_228994_total_total_runtime;
    int futhark_mc_segmap_parloop_228994_total_runs;
    int64_t futhark_mc_segmap_parloop_228994_total_iter;
    int64_t *futhark_mc_segmap_nested_task_228992_total_runtime;
    int *futhark_mc_segmap_nested_task_228992_runs;
    int64_t *futhark_mc_segmap_nested_task_228992_iter;
    int64_t *futhark_mc_segmap_parloop_229020_total_runtime;
    int *futhark_mc_segmap_parloop_229020_runs;
    int64_t *futhark_mc_segmap_parloop_229020_iter;
    int64_t futhark_mc_segmap_parloop_229020_total_total_runtime;
    int futhark_mc_segmap_parloop_229020_total_runs;
    int64_t futhark_mc_segmap_parloop_229020_total_iter;
    int64_t *futhark_mc_segmap_task_229018_total_runtime;
    int *futhark_mc_segmap_task_229018_runs;
    int64_t *futhark_mc_segmap_task_229018_iter;
    int64_t futhark_mc_segmap_task_229018_total_time;
    int64_t futhark_mc_segmap_task_229018_total_iter;
    int64_t *futhark_mc_segmap_parloop_229031_total_runtime;
    int *futhark_mc_segmap_parloop_229031_runs;
    int64_t *futhark_mc_segmap_parloop_229031_iter;
    int64_t futhark_mc_segmap_parloop_229031_total_total_runtime;
    int futhark_mc_segmap_parloop_229031_total_runs;
    int64_t futhark_mc_segmap_parloop_229031_total_iter;
    int64_t *futhark_mc_segmap_task_229029_total_runtime;
    int *futhark_mc_segmap_task_229029_runs;
    int64_t *futhark_mc_segmap_task_229029_iter;
    int64_t futhark_mc_segmap_task_229029_total_time;
    int64_t futhark_mc_segmap_task_229029_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229043_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229043_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229043_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229043_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229043_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229043_total_iter;
    int64_t *futhark_mc_segred_task_229036_total_runtime;
    int *futhark_mc_segred_task_229036_runs;
    int64_t *futhark_mc_segred_task_229036_iter;
    int64_t futhark_mc_segred_task_229036_total_time;
    int64_t futhark_mc_segred_task_229036_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229049_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229049_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229049_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229049_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229049_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229049_total_iter;
    int64_t *futhark_mc_segred_task_229045_total_runtime;
    int *futhark_mc_segred_task_229045_runs;
    int64_t *futhark_mc_segred_task_229045_iter;
    int64_t futhark_mc_segred_task_229045_total_time;
    int64_t futhark_mc_segred_task_229045_total_iter;
    int64_t *futhark_mc_segmap_parloop_229034_total_runtime;
    int *futhark_mc_segmap_parloop_229034_runs;
    int64_t *futhark_mc_segmap_parloop_229034_iter;
    int64_t futhark_mc_segmap_parloop_229034_total_total_runtime;
    int futhark_mc_segmap_parloop_229034_total_runs;
    int64_t futhark_mc_segmap_parloop_229034_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229032_total_runtime;
    int *futhark_mc_segmap_nested_task_229032_runs;
    int64_t *futhark_mc_segmap_nested_task_229032_iter;
    int64_t *futhark_mc_segmap_parloop_229025_total_runtime;
    int *futhark_mc_segmap_parloop_229025_runs;
    int64_t *futhark_mc_segmap_parloop_229025_iter;
    int64_t futhark_mc_segmap_parloop_229025_total_total_runtime;
    int futhark_mc_segmap_parloop_229025_total_runs;
    int64_t futhark_mc_segmap_parloop_229025_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229023_total_runtime;
    int *futhark_mc_segmap_nested_task_229023_runs;
    int64_t *futhark_mc_segmap_nested_task_229023_iter;
    int64_t *futhark_mc_segmap_parloop_229053_total_runtime;
    int *futhark_mc_segmap_parloop_229053_runs;
    int64_t *futhark_mc_segmap_parloop_229053_iter;
    int64_t futhark_mc_segmap_parloop_229053_total_total_runtime;
    int futhark_mc_segmap_parloop_229053_total_runs;
    int64_t futhark_mc_segmap_parloop_229053_total_iter;
    int64_t *futhark_mc_segmap_task_229051_total_runtime;
    int *futhark_mc_segmap_task_229051_runs;
    int64_t *futhark_mc_segmap_task_229051_iter;
    int64_t futhark_mc_segmap_task_229051_total_time;
    int64_t futhark_mc_segmap_task_229051_total_iter;
    int64_t *futhark_mc_segmap_parloop_229063_total_runtime;
    int *futhark_mc_segmap_parloop_229063_runs;
    int64_t *futhark_mc_segmap_parloop_229063_iter;
    int64_t futhark_mc_segmap_parloop_229063_total_total_runtime;
    int futhark_mc_segmap_parloop_229063_total_runs;
    int64_t futhark_mc_segmap_parloop_229063_total_iter;
    int64_t *futhark_mc_segmap_task_229061_total_runtime;
    int *futhark_mc_segmap_task_229061_runs;
    int64_t *futhark_mc_segmap_task_229061_iter;
    int64_t futhark_mc_segmap_task_229061_total_time;
    int64_t futhark_mc_segmap_task_229061_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229073_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229073_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229073_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229073_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229073_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229073_total_iter;
    int64_t *futhark_mc_segred_task_229070_total_runtime;
    int *futhark_mc_segred_task_229070_runs;
    int64_t *futhark_mc_segred_task_229070_iter;
    int64_t futhark_mc_segred_task_229070_total_time;
    int64_t futhark_mc_segred_task_229070_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229078_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229078_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229078_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229078_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229078_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229078_total_iter;
    int64_t *futhark_mc_segred_task_229075_total_runtime;
    int *futhark_mc_segred_task_229075_runs;
    int64_t *futhark_mc_segred_task_229075_iter;
    int64_t futhark_mc_segred_task_229075_total_time;
    int64_t futhark_mc_segred_task_229075_total_iter;
    int64_t *futhark_mc_segmap_parloop_229067_total_runtime;
    int *futhark_mc_segmap_parloop_229067_runs;
    int64_t *futhark_mc_segmap_parloop_229067_iter;
    int64_t futhark_mc_segmap_parloop_229067_total_total_runtime;
    int futhark_mc_segmap_parloop_229067_total_runs;
    int64_t futhark_mc_segmap_parloop_229067_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229065_total_runtime;
    int *futhark_mc_segmap_nested_task_229065_runs;
    int64_t *futhark_mc_segmap_nested_task_229065_iter;
    int64_t *futhark_mc_segmap_parloop_229058_total_runtime;
    int *futhark_mc_segmap_parloop_229058_runs;
    int64_t *futhark_mc_segmap_parloop_229058_iter;
    int64_t futhark_mc_segmap_parloop_229058_total_total_runtime;
    int futhark_mc_segmap_parloop_229058_total_runs;
    int64_t futhark_mc_segmap_parloop_229058_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229056_total_runtime;
    int *futhark_mc_segmap_nested_task_229056_runs;
    int64_t *futhark_mc_segmap_nested_task_229056_iter;
    int64_t *futhark_mc_segmap_parloop_229082_total_runtime;
    int *futhark_mc_segmap_parloop_229082_runs;
    int64_t *futhark_mc_segmap_parloop_229082_iter;
    int64_t futhark_mc_segmap_parloop_229082_total_total_runtime;
    int futhark_mc_segmap_parloop_229082_total_runs;
    int64_t futhark_mc_segmap_parloop_229082_total_iter;
    int64_t *futhark_mc_segmap_task_229080_total_runtime;
    int *futhark_mc_segmap_task_229080_runs;
    int64_t *futhark_mc_segmap_task_229080_iter;
    int64_t futhark_mc_segmap_task_229080_total_time;
    int64_t futhark_mc_segmap_task_229080_total_iter;
    int64_t *futhark_mc_segmap_parloop_229095_total_runtime;
    int *futhark_mc_segmap_parloop_229095_runs;
    int64_t *futhark_mc_segmap_parloop_229095_iter;
    int64_t futhark_mc_segmap_parloop_229095_total_total_runtime;
    int futhark_mc_segmap_parloop_229095_total_runs;
    int64_t futhark_mc_segmap_parloop_229095_total_iter;
    int64_t *futhark_mc_segmap_task_229093_total_runtime;
    int *futhark_mc_segmap_task_229093_runs;
    int64_t *futhark_mc_segmap_task_229093_iter;
    int64_t futhark_mc_segmap_task_229093_total_time;
    int64_t futhark_mc_segmap_task_229093_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229109_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229109_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229109_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229109_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229109_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229109_total_iter;
    int64_t *futhark_mc_segred_task_229104_total_runtime;
    int *futhark_mc_segred_task_229104_runs;
    int64_t *futhark_mc_segred_task_229104_iter;
    int64_t futhark_mc_segred_task_229104_total_time;
    int64_t futhark_mc_segred_task_229104_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229115_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229115_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229115_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229115_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229115_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229115_total_iter;
    int64_t *futhark_mc_segred_task_229111_total_runtime;
    int *futhark_mc_segred_task_229111_runs;
    int64_t *futhark_mc_segred_task_229111_iter;
    int64_t futhark_mc_segred_task_229111_total_time;
    int64_t futhark_mc_segred_task_229111_total_iter;
    int64_t *futhark_mc_segmap_parloop_229100_total_runtime;
    int *futhark_mc_segmap_parloop_229100_runs;
    int64_t *futhark_mc_segmap_parloop_229100_iter;
    int64_t futhark_mc_segmap_parloop_229100_total_total_runtime;
    int futhark_mc_segmap_parloop_229100_total_runs;
    int64_t futhark_mc_segmap_parloop_229100_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229098_total_runtime;
    int *futhark_mc_segmap_nested_task_229098_runs;
    int64_t *futhark_mc_segmap_nested_task_229098_iter;
    int64_t *futhark_mc_segmap_parloop_229089_total_runtime;
    int *futhark_mc_segmap_parloop_229089_runs;
    int64_t *futhark_mc_segmap_parloop_229089_iter;
    int64_t futhark_mc_segmap_parloop_229089_total_total_runtime;
    int futhark_mc_segmap_parloop_229089_total_runs;
    int64_t futhark_mc_segmap_parloop_229089_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229087_total_runtime;
    int *futhark_mc_segmap_nested_task_229087_runs;
    int64_t *futhark_mc_segmap_nested_task_229087_iter;
    int64_t *futhark_mc_segmap_parloop_229119_total_runtime;
    int *futhark_mc_segmap_parloop_229119_runs;
    int64_t *futhark_mc_segmap_parloop_229119_iter;
    int64_t futhark_mc_segmap_parloop_229119_total_total_runtime;
    int futhark_mc_segmap_parloop_229119_total_runs;
    int64_t futhark_mc_segmap_parloop_229119_total_iter;
    int64_t *futhark_mc_segmap_task_229117_total_runtime;
    int *futhark_mc_segmap_task_229117_runs;
    int64_t *futhark_mc_segmap_task_229117_iter;
    int64_t futhark_mc_segmap_task_229117_total_time;
    int64_t futhark_mc_segmap_task_229117_total_iter;
    int64_t *futhark_mc_segmap_parloop_229134_total_runtime;
    int *futhark_mc_segmap_parloop_229134_runs;
    int64_t *futhark_mc_segmap_parloop_229134_iter;
    int64_t futhark_mc_segmap_parloop_229134_total_total_runtime;
    int futhark_mc_segmap_parloop_229134_total_runs;
    int64_t futhark_mc_segmap_parloop_229134_total_iter;
    int64_t *futhark_mc_segmap_task_229132_total_runtime;
    int *futhark_mc_segmap_task_229132_runs;
    int64_t *futhark_mc_segmap_task_229132_iter;
    int64_t futhark_mc_segmap_task_229132_total_time;
    int64_t futhark_mc_segmap_task_229132_total_iter;
    int64_t *futhark_mc_segmap_parloop_229149_total_runtime;
    int *futhark_mc_segmap_parloop_229149_runs;
    int64_t *futhark_mc_segmap_parloop_229149_iter;
    int64_t futhark_mc_segmap_parloop_229149_total_total_runtime;
    int futhark_mc_segmap_parloop_229149_total_runs;
    int64_t futhark_mc_segmap_parloop_229149_total_iter;
    int64_t *futhark_mc_segmap_task_229147_total_runtime;
    int *futhark_mc_segmap_task_229147_runs;
    int64_t *futhark_mc_segmap_task_229147_iter;
    int64_t futhark_mc_segmap_task_229147_total_time;
    int64_t futhark_mc_segmap_task_229147_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229158_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229158_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229158_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229158_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229158_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229158_total_iter;
    int64_t *futhark_mc_segred_task_229151_total_runtime;
    int *futhark_mc_segred_task_229151_runs;
    int64_t *futhark_mc_segred_task_229151_iter;
    int64_t futhark_mc_segred_task_229151_total_time;
    int64_t futhark_mc_segred_task_229151_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229164_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229164_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229164_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229164_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229164_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229164_total_iter;
    int64_t *futhark_mc_segred_task_229160_total_runtime;
    int *futhark_mc_segred_task_229160_runs;
    int64_t *futhark_mc_segred_task_229160_iter;
    int64_t futhark_mc_segred_task_229160_total_time;
    int64_t futhark_mc_segred_task_229160_total_iter;
    int64_t *futhark_mc_segmap_parloop_229141_total_runtime;
    int *futhark_mc_segmap_parloop_229141_runs;
    int64_t *futhark_mc_segmap_parloop_229141_iter;
    int64_t futhark_mc_segmap_parloop_229141_total_total_runtime;
    int futhark_mc_segmap_parloop_229141_total_runs;
    int64_t futhark_mc_segmap_parloop_229141_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229139_total_runtime;
    int *futhark_mc_segmap_nested_task_229139_runs;
    int64_t *futhark_mc_segmap_nested_task_229139_iter;
    int64_t *futhark_mc_segmap_parloop_229128_total_runtime;
    int *futhark_mc_segmap_parloop_229128_runs;
    int64_t *futhark_mc_segmap_parloop_229128_iter;
    int64_t futhark_mc_segmap_parloop_229128_total_total_runtime;
    int futhark_mc_segmap_parloop_229128_total_runs;
    int64_t futhark_mc_segmap_parloop_229128_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229126_total_runtime;
    int *futhark_mc_segmap_nested_task_229126_runs;
    int64_t *futhark_mc_segmap_nested_task_229126_iter;
    int64_t *futhark_mc_segmap_parloop_229168_total_runtime;
    int *futhark_mc_segmap_parloop_229168_runs;
    int64_t *futhark_mc_segmap_parloop_229168_iter;
    int64_t futhark_mc_segmap_parloop_229168_total_total_runtime;
    int futhark_mc_segmap_parloop_229168_total_runs;
    int64_t futhark_mc_segmap_parloop_229168_total_iter;
    int64_t *futhark_mc_segmap_task_229166_total_runtime;
    int *futhark_mc_segmap_task_229166_runs;
    int64_t *futhark_mc_segmap_task_229166_iter;
    int64_t futhark_mc_segmap_task_229166_total_time;
    int64_t futhark_mc_segmap_task_229166_total_iter;
    int64_t *futhark_mc_segmap_parloop_229177_total_runtime;
    int *futhark_mc_segmap_parloop_229177_runs;
    int64_t *futhark_mc_segmap_parloop_229177_iter;
    int64_t futhark_mc_segmap_parloop_229177_total_total_runtime;
    int futhark_mc_segmap_parloop_229177_total_runs;
    int64_t futhark_mc_segmap_parloop_229177_total_iter;
    int64_t *futhark_mc_segmap_task_229175_total_runtime;
    int *futhark_mc_segmap_task_229175_runs;
    int64_t *futhark_mc_segmap_task_229175_iter;
    int64_t futhark_mc_segmap_task_229175_total_time;
    int64_t futhark_mc_segmap_task_229175_total_iter;
    int64_t *futhark_mc_segmap_parloop_229172_total_runtime;
    int *futhark_mc_segmap_parloop_229172_runs;
    int64_t *futhark_mc_segmap_parloop_229172_iter;
    int64_t futhark_mc_segmap_parloop_229172_total_total_runtime;
    int futhark_mc_segmap_parloop_229172_total_runs;
    int64_t futhark_mc_segmap_parloop_229172_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229170_total_runtime;
    int *futhark_mc_segmap_nested_task_229170_runs;
    int64_t *futhark_mc_segmap_nested_task_229170_iter;
    int64_t *futhark_mc_segmap_parloop_229181_total_runtime;
    int *futhark_mc_segmap_parloop_229181_runs;
    int64_t *futhark_mc_segmap_parloop_229181_iter;
    int64_t futhark_mc_segmap_parloop_229181_total_total_runtime;
    int futhark_mc_segmap_parloop_229181_total_runs;
    int64_t futhark_mc_segmap_parloop_229181_total_iter;
    int64_t *futhark_mc_segmap_task_229179_total_runtime;
    int *futhark_mc_segmap_task_229179_runs;
    int64_t *futhark_mc_segmap_task_229179_iter;
    int64_t futhark_mc_segmap_task_229179_total_time;
    int64_t futhark_mc_segmap_task_229179_total_iter;
    int64_t *futhark_mc_segmap_parloop_229190_total_runtime;
    int *futhark_mc_segmap_parloop_229190_runs;
    int64_t *futhark_mc_segmap_parloop_229190_iter;
    int64_t futhark_mc_segmap_parloop_229190_total_total_runtime;
    int futhark_mc_segmap_parloop_229190_total_runs;
    int64_t futhark_mc_segmap_parloop_229190_total_iter;
    int64_t *futhark_mc_segmap_task_229188_total_runtime;
    int *futhark_mc_segmap_task_229188_runs;
    int64_t *futhark_mc_segmap_task_229188_iter;
    int64_t futhark_mc_segmap_task_229188_total_time;
    int64_t futhark_mc_segmap_task_229188_total_iter;
    int64_t *futhark_mc_segmap_parloop_229185_total_runtime;
    int *futhark_mc_segmap_parloop_229185_runs;
    int64_t *futhark_mc_segmap_parloop_229185_iter;
    int64_t futhark_mc_segmap_parloop_229185_total_total_runtime;
    int futhark_mc_segmap_parloop_229185_total_runs;
    int64_t futhark_mc_segmap_parloop_229185_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229183_total_runtime;
    int *futhark_mc_segmap_nested_task_229183_runs;
    int64_t *futhark_mc_segmap_nested_task_229183_iter;
    int64_t *futhark_mc_segmap_parloop_229194_total_runtime;
    int *futhark_mc_segmap_parloop_229194_runs;
    int64_t *futhark_mc_segmap_parloop_229194_iter;
    int64_t futhark_mc_segmap_parloop_229194_total_total_runtime;
    int futhark_mc_segmap_parloop_229194_total_runs;
    int64_t futhark_mc_segmap_parloop_229194_total_iter;
    int64_t *futhark_mc_segmap_task_229192_total_runtime;
    int *futhark_mc_segmap_task_229192_runs;
    int64_t *futhark_mc_segmap_task_229192_iter;
    int64_t futhark_mc_segmap_task_229192_total_time;
    int64_t futhark_mc_segmap_task_229192_total_iter;
    int64_t *futhark_mc_segmap_parloop_229209_total_runtime;
    int *futhark_mc_segmap_parloop_229209_runs;
    int64_t *futhark_mc_segmap_parloop_229209_iter;
    int64_t futhark_mc_segmap_parloop_229209_total_total_runtime;
    int futhark_mc_segmap_parloop_229209_total_runs;
    int64_t futhark_mc_segmap_parloop_229209_total_iter;
    int64_t *futhark_mc_segmap_task_229207_total_runtime;
    int *futhark_mc_segmap_task_229207_runs;
    int64_t *futhark_mc_segmap_task_229207_iter;
    int64_t futhark_mc_segmap_task_229207_total_time;
    int64_t futhark_mc_segmap_task_229207_total_iter;
    int64_t *futhark_mc_segmap_parloop_229213_total_runtime;
    int *futhark_mc_segmap_parloop_229213_runs;
    int64_t *futhark_mc_segmap_parloop_229213_iter;
    int64_t futhark_mc_segmap_parloop_229213_total_total_runtime;
    int futhark_mc_segmap_parloop_229213_total_runs;
    int64_t futhark_mc_segmap_parloop_229213_total_iter;
    int64_t *futhark_mc_segmap_task_229211_total_runtime;
    int *futhark_mc_segmap_task_229211_runs;
    int64_t *futhark_mc_segmap_task_229211_iter;
    int64_t futhark_mc_segmap_task_229211_total_time;
    int64_t futhark_mc_segmap_task_229211_total_iter;
    int64_t *futhark_mc_segmap_parloop_229217_total_runtime;
    int *futhark_mc_segmap_parloop_229217_runs;
    int64_t *futhark_mc_segmap_parloop_229217_iter;
    int64_t futhark_mc_segmap_parloop_229217_total_total_runtime;
    int futhark_mc_segmap_parloop_229217_total_runs;
    int64_t futhark_mc_segmap_parloop_229217_total_iter;
    int64_t *futhark_mc_segmap_task_229215_total_runtime;
    int *futhark_mc_segmap_task_229215_runs;
    int64_t *futhark_mc_segmap_task_229215_iter;
    int64_t futhark_mc_segmap_task_229215_total_time;
    int64_t futhark_mc_segmap_task_229215_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229225_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229225_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229225_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229225_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229225_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229225_total_iter;
    int64_t *futhark_mc_segred_task_229222_total_runtime;
    int *futhark_mc_segred_task_229222_runs;
    int64_t *futhark_mc_segred_task_229222_iter;
    int64_t futhark_mc_segred_task_229222_total_time;
    int64_t futhark_mc_segred_task_229222_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229230_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229230_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229230_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229230_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229230_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229230_total_iter;
    int64_t *futhark_mc_segred_task_229227_total_runtime;
    int *futhark_mc_segred_task_229227_runs;
    int64_t *futhark_mc_segred_task_229227_iter;
    int64_t futhark_mc_segred_task_229227_total_time;
    int64_t futhark_mc_segred_task_229227_total_iter;
    int64_t *futhark_mc_segmap_parloop_229220_total_runtime;
    int *futhark_mc_segmap_parloop_229220_runs;
    int64_t *futhark_mc_segmap_parloop_229220_iter;
    int64_t futhark_mc_segmap_parloop_229220_total_total_runtime;
    int futhark_mc_segmap_parloop_229220_total_runs;
    int64_t futhark_mc_segmap_parloop_229220_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229218_total_runtime;
    int *futhark_mc_segmap_nested_task_229218_runs;
    int64_t *futhark_mc_segmap_nested_task_229218_iter;
    int64_t *futhark_mc_segmap_parloop_229201_total_runtime;
    int *futhark_mc_segmap_parloop_229201_runs;
    int64_t *futhark_mc_segmap_parloop_229201_iter;
    int64_t futhark_mc_segmap_parloop_229201_total_total_runtime;
    int futhark_mc_segmap_parloop_229201_total_runs;
    int64_t futhark_mc_segmap_parloop_229201_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229199_total_runtime;
    int *futhark_mc_segmap_nested_task_229199_runs;
    int64_t *futhark_mc_segmap_nested_task_229199_iter;
    int64_t *futhark_mc_segmap_parloop_229234_total_runtime;
    int *futhark_mc_segmap_parloop_229234_runs;
    int64_t *futhark_mc_segmap_parloop_229234_iter;
    int64_t futhark_mc_segmap_parloop_229234_total_total_runtime;
    int futhark_mc_segmap_parloop_229234_total_runs;
    int64_t futhark_mc_segmap_parloop_229234_total_iter;
    int64_t *futhark_mc_segmap_task_229232_total_runtime;
    int *futhark_mc_segmap_task_229232_runs;
    int64_t *futhark_mc_segmap_task_229232_iter;
    int64_t futhark_mc_segmap_task_229232_total_time;
    int64_t futhark_mc_segmap_task_229232_total_iter;
    int64_t *futhark_mc_segmap_parloop_229251_total_runtime;
    int *futhark_mc_segmap_parloop_229251_runs;
    int64_t *futhark_mc_segmap_parloop_229251_iter;
    int64_t futhark_mc_segmap_parloop_229251_total_total_runtime;
    int futhark_mc_segmap_parloop_229251_total_runs;
    int64_t futhark_mc_segmap_parloop_229251_total_iter;
    int64_t *futhark_mc_segmap_task_229249_total_runtime;
    int *futhark_mc_segmap_task_229249_runs;
    int64_t *futhark_mc_segmap_task_229249_iter;
    int64_t futhark_mc_segmap_task_229249_total_time;
    int64_t futhark_mc_segmap_task_229249_total_iter;
    int64_t *futhark_mc_segmap_parloop_229255_total_runtime;
    int *futhark_mc_segmap_parloop_229255_runs;
    int64_t *futhark_mc_segmap_parloop_229255_iter;
    int64_t futhark_mc_segmap_parloop_229255_total_total_runtime;
    int futhark_mc_segmap_parloop_229255_total_runs;
    int64_t futhark_mc_segmap_parloop_229255_total_iter;
    int64_t *futhark_mc_segmap_task_229253_total_runtime;
    int *futhark_mc_segmap_task_229253_runs;
    int64_t *futhark_mc_segmap_task_229253_iter;
    int64_t futhark_mc_segmap_task_229253_total_time;
    int64_t futhark_mc_segmap_task_229253_total_iter;
    int64_t *futhark_mc_segmap_parloop_229259_total_runtime;
    int *futhark_mc_segmap_parloop_229259_runs;
    int64_t *futhark_mc_segmap_parloop_229259_iter;
    int64_t futhark_mc_segmap_parloop_229259_total_total_runtime;
    int futhark_mc_segmap_parloop_229259_total_runs;
    int64_t futhark_mc_segmap_parloop_229259_total_iter;
    int64_t *futhark_mc_segmap_task_229257_total_runtime;
    int *futhark_mc_segmap_task_229257_runs;
    int64_t *futhark_mc_segmap_task_229257_iter;
    int64_t futhark_mc_segmap_task_229257_total_time;
    int64_t futhark_mc_segmap_task_229257_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229269_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229269_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229269_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229269_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229269_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229269_total_iter;
    int64_t *futhark_mc_segred_task_229264_total_runtime;
    int *futhark_mc_segred_task_229264_runs;
    int64_t *futhark_mc_segred_task_229264_iter;
    int64_t futhark_mc_segred_task_229264_total_time;
    int64_t futhark_mc_segred_task_229264_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229275_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229275_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229275_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229275_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229275_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229275_total_iter;
    int64_t *futhark_mc_segred_task_229271_total_runtime;
    int *futhark_mc_segred_task_229271_runs;
    int64_t *futhark_mc_segred_task_229271_iter;
    int64_t futhark_mc_segred_task_229271_total_time;
    int64_t futhark_mc_segred_task_229271_total_iter;
    int64_t *futhark_mc_segmap_parloop_229262_total_runtime;
    int *futhark_mc_segmap_parloop_229262_runs;
    int64_t *futhark_mc_segmap_parloop_229262_iter;
    int64_t futhark_mc_segmap_parloop_229262_total_total_runtime;
    int futhark_mc_segmap_parloop_229262_total_runs;
    int64_t futhark_mc_segmap_parloop_229262_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229260_total_runtime;
    int *futhark_mc_segmap_nested_task_229260_runs;
    int64_t *futhark_mc_segmap_nested_task_229260_iter;
    int64_t *futhark_mc_segmap_parloop_229242_total_runtime;
    int *futhark_mc_segmap_parloop_229242_runs;
    int64_t *futhark_mc_segmap_parloop_229242_iter;
    int64_t futhark_mc_segmap_parloop_229242_total_total_runtime;
    int futhark_mc_segmap_parloop_229242_total_runs;
    int64_t futhark_mc_segmap_parloop_229242_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229240_total_runtime;
    int *futhark_mc_segmap_nested_task_229240_runs;
    int64_t *futhark_mc_segmap_nested_task_229240_iter;
    int64_t *futhark_mc_segmap_parloop_229279_total_runtime;
    int *futhark_mc_segmap_parloop_229279_runs;
    int64_t *futhark_mc_segmap_parloop_229279_iter;
    int64_t futhark_mc_segmap_parloop_229279_total_total_runtime;
    int futhark_mc_segmap_parloop_229279_total_runs;
    int64_t futhark_mc_segmap_parloop_229279_total_iter;
    int64_t *futhark_mc_segmap_task_229277_total_runtime;
    int *futhark_mc_segmap_task_229277_runs;
    int64_t *futhark_mc_segmap_task_229277_iter;
    int64_t futhark_mc_segmap_task_229277_total_time;
    int64_t futhark_mc_segmap_task_229277_total_iter;
    int64_t *futhark_mc_segmap_parloop_229296_total_runtime;
    int *futhark_mc_segmap_parloop_229296_runs;
    int64_t *futhark_mc_segmap_parloop_229296_iter;
    int64_t futhark_mc_segmap_parloop_229296_total_total_runtime;
    int futhark_mc_segmap_parloop_229296_total_runs;
    int64_t futhark_mc_segmap_parloop_229296_total_iter;
    int64_t *futhark_mc_segmap_task_229294_total_runtime;
    int *futhark_mc_segmap_task_229294_runs;
    int64_t *futhark_mc_segmap_task_229294_iter;
    int64_t futhark_mc_segmap_task_229294_total_time;
    int64_t futhark_mc_segmap_task_229294_total_iter;
    int64_t *futhark_mc_segmap_parloop_229300_total_runtime;
    int *futhark_mc_segmap_parloop_229300_runs;
    int64_t *futhark_mc_segmap_parloop_229300_iter;
    int64_t futhark_mc_segmap_parloop_229300_total_total_runtime;
    int futhark_mc_segmap_parloop_229300_total_runs;
    int64_t futhark_mc_segmap_parloop_229300_total_iter;
    int64_t *futhark_mc_segmap_task_229298_total_runtime;
    int *futhark_mc_segmap_task_229298_runs;
    int64_t *futhark_mc_segmap_task_229298_iter;
    int64_t futhark_mc_segmap_task_229298_total_time;
    int64_t futhark_mc_segmap_task_229298_total_iter;
    int64_t *futhark_mc_segmap_parloop_229304_total_runtime;
    int *futhark_mc_segmap_parloop_229304_runs;
    int64_t *futhark_mc_segmap_parloop_229304_iter;
    int64_t futhark_mc_segmap_parloop_229304_total_total_runtime;
    int futhark_mc_segmap_parloop_229304_total_runs;
    int64_t futhark_mc_segmap_parloop_229304_total_iter;
    int64_t *futhark_mc_segmap_task_229302_total_runtime;
    int *futhark_mc_segmap_task_229302_runs;
    int64_t *futhark_mc_segmap_task_229302_iter;
    int64_t futhark_mc_segmap_task_229302_total_time;
    int64_t futhark_mc_segmap_task_229302_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229316_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229316_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229316_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229316_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229316_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229316_total_iter;
    int64_t *futhark_mc_segred_task_229309_total_runtime;
    int *futhark_mc_segred_task_229309_runs;
    int64_t *futhark_mc_segred_task_229309_iter;
    int64_t futhark_mc_segred_task_229309_total_time;
    int64_t futhark_mc_segred_task_229309_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229322_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229322_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229322_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229322_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229322_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229322_total_iter;
    int64_t *futhark_mc_segred_task_229318_total_runtime;
    int *futhark_mc_segred_task_229318_runs;
    int64_t *futhark_mc_segred_task_229318_iter;
    int64_t futhark_mc_segred_task_229318_total_time;
    int64_t futhark_mc_segred_task_229318_total_iter;
    int64_t *futhark_mc_segmap_parloop_229307_total_runtime;
    int *futhark_mc_segmap_parloop_229307_runs;
    int64_t *futhark_mc_segmap_parloop_229307_iter;
    int64_t futhark_mc_segmap_parloop_229307_total_total_runtime;
    int futhark_mc_segmap_parloop_229307_total_runs;
    int64_t futhark_mc_segmap_parloop_229307_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229305_total_runtime;
    int *futhark_mc_segmap_nested_task_229305_runs;
    int64_t *futhark_mc_segmap_nested_task_229305_iter;
    int64_t *futhark_mc_segmap_parloop_229287_total_runtime;
    int *futhark_mc_segmap_parloop_229287_runs;
    int64_t *futhark_mc_segmap_parloop_229287_iter;
    int64_t futhark_mc_segmap_parloop_229287_total_total_runtime;
    int futhark_mc_segmap_parloop_229287_total_runs;
    int64_t futhark_mc_segmap_parloop_229287_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229285_total_runtime;
    int *futhark_mc_segmap_nested_task_229285_runs;
    int64_t *futhark_mc_segmap_nested_task_229285_iter;
    int64_t *futhark_mc_segmap_parloop_229326_total_runtime;
    int *futhark_mc_segmap_parloop_229326_runs;
    int64_t *futhark_mc_segmap_parloop_229326_iter;
    int64_t futhark_mc_segmap_parloop_229326_total_total_runtime;
    int futhark_mc_segmap_parloop_229326_total_runs;
    int64_t futhark_mc_segmap_parloop_229326_total_iter;
    int64_t *futhark_mc_segmap_task_229324_total_runtime;
    int *futhark_mc_segmap_task_229324_runs;
    int64_t *futhark_mc_segmap_task_229324_iter;
    int64_t futhark_mc_segmap_task_229324_total_time;
    int64_t futhark_mc_segmap_task_229324_total_iter;
    int64_t *futhark_mc_segmap_parloop_229342_total_runtime;
    int *futhark_mc_segmap_parloop_229342_runs;
    int64_t *futhark_mc_segmap_parloop_229342_iter;
    int64_t futhark_mc_segmap_parloop_229342_total_total_runtime;
    int futhark_mc_segmap_parloop_229342_total_runs;
    int64_t futhark_mc_segmap_parloop_229342_total_iter;
    int64_t *futhark_mc_segmap_task_229340_total_runtime;
    int *futhark_mc_segmap_task_229340_runs;
    int64_t *futhark_mc_segmap_task_229340_iter;
    int64_t futhark_mc_segmap_task_229340_total_time;
    int64_t futhark_mc_segmap_task_229340_total_iter;
    int64_t *futhark_mc_segmap_parloop_229346_total_runtime;
    int *futhark_mc_segmap_parloop_229346_runs;
    int64_t *futhark_mc_segmap_parloop_229346_iter;
    int64_t futhark_mc_segmap_parloop_229346_total_total_runtime;
    int futhark_mc_segmap_parloop_229346_total_runs;
    int64_t futhark_mc_segmap_parloop_229346_total_iter;
    int64_t *futhark_mc_segmap_task_229344_total_runtime;
    int *futhark_mc_segmap_task_229344_runs;
    int64_t *futhark_mc_segmap_task_229344_iter;
    int64_t futhark_mc_segmap_task_229344_total_time;
    int64_t futhark_mc_segmap_task_229344_total_iter;
    int64_t *futhark_mc_segmap_parloop_229350_total_runtime;
    int *futhark_mc_segmap_parloop_229350_runs;
    int64_t *futhark_mc_segmap_parloop_229350_iter;
    int64_t futhark_mc_segmap_parloop_229350_total_total_runtime;
    int futhark_mc_segmap_parloop_229350_total_runs;
    int64_t futhark_mc_segmap_parloop_229350_total_iter;
    int64_t *futhark_mc_segmap_task_229348_total_runtime;
    int *futhark_mc_segmap_task_229348_runs;
    int64_t *futhark_mc_segmap_task_229348_iter;
    int64_t futhark_mc_segmap_task_229348_total_time;
    int64_t futhark_mc_segmap_task_229348_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229360_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229360_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229360_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229360_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229360_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229360_total_iter;
    int64_t *futhark_mc_segred_task_229357_total_runtime;
    int *futhark_mc_segred_task_229357_runs;
    int64_t *futhark_mc_segred_task_229357_iter;
    int64_t futhark_mc_segred_task_229357_total_time;
    int64_t futhark_mc_segred_task_229357_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229365_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229365_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229365_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229365_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229365_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229365_total_iter;
    int64_t *futhark_mc_segred_task_229362_total_runtime;
    int *futhark_mc_segred_task_229362_runs;
    int64_t *futhark_mc_segred_task_229362_iter;
    int64_t futhark_mc_segred_task_229362_total_time;
    int64_t futhark_mc_segred_task_229362_total_iter;
    int64_t *futhark_mc_segmap_parloop_229354_total_runtime;
    int *futhark_mc_segmap_parloop_229354_runs;
    int64_t *futhark_mc_segmap_parloop_229354_iter;
    int64_t futhark_mc_segmap_parloop_229354_total_total_runtime;
    int futhark_mc_segmap_parloop_229354_total_runs;
    int64_t futhark_mc_segmap_parloop_229354_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229352_total_runtime;
    int *futhark_mc_segmap_nested_task_229352_runs;
    int64_t *futhark_mc_segmap_nested_task_229352_iter;
    int64_t *futhark_mc_segmap_parloop_229334_total_runtime;
    int *futhark_mc_segmap_parloop_229334_runs;
    int64_t *futhark_mc_segmap_parloop_229334_iter;
    int64_t futhark_mc_segmap_parloop_229334_total_total_runtime;
    int futhark_mc_segmap_parloop_229334_total_runs;
    int64_t futhark_mc_segmap_parloop_229334_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229332_total_runtime;
    int *futhark_mc_segmap_nested_task_229332_runs;
    int64_t *futhark_mc_segmap_nested_task_229332_iter;
    int64_t *futhark_mc_segmap_parloop_229369_total_runtime;
    int *futhark_mc_segmap_parloop_229369_runs;
    int64_t *futhark_mc_segmap_parloop_229369_iter;
    int64_t futhark_mc_segmap_parloop_229369_total_total_runtime;
    int futhark_mc_segmap_parloop_229369_total_runs;
    int64_t futhark_mc_segmap_parloop_229369_total_iter;
    int64_t *futhark_mc_segmap_task_229367_total_runtime;
    int *futhark_mc_segmap_task_229367_runs;
    int64_t *futhark_mc_segmap_task_229367_iter;
    int64_t futhark_mc_segmap_task_229367_total_time;
    int64_t futhark_mc_segmap_task_229367_total_iter;
    int64_t *futhark_mc_segmap_parloop_229388_total_runtime;
    int *futhark_mc_segmap_parloop_229388_runs;
    int64_t *futhark_mc_segmap_parloop_229388_iter;
    int64_t futhark_mc_segmap_parloop_229388_total_total_runtime;
    int futhark_mc_segmap_parloop_229388_total_runs;
    int64_t futhark_mc_segmap_parloop_229388_total_iter;
    int64_t *futhark_mc_segmap_task_229386_total_runtime;
    int *futhark_mc_segmap_task_229386_runs;
    int64_t *futhark_mc_segmap_task_229386_iter;
    int64_t futhark_mc_segmap_task_229386_total_time;
    int64_t futhark_mc_segmap_task_229386_total_iter;
    int64_t *futhark_mc_segmap_parloop_229392_total_runtime;
    int *futhark_mc_segmap_parloop_229392_runs;
    int64_t *futhark_mc_segmap_parloop_229392_iter;
    int64_t futhark_mc_segmap_parloop_229392_total_total_runtime;
    int futhark_mc_segmap_parloop_229392_total_runs;
    int64_t futhark_mc_segmap_parloop_229392_total_iter;
    int64_t *futhark_mc_segmap_task_229390_total_runtime;
    int *futhark_mc_segmap_task_229390_runs;
    int64_t *futhark_mc_segmap_task_229390_iter;
    int64_t futhark_mc_segmap_task_229390_total_time;
    int64_t futhark_mc_segmap_task_229390_total_iter;
    int64_t *futhark_mc_segmap_parloop_229396_total_runtime;
    int *futhark_mc_segmap_parloop_229396_runs;
    int64_t *futhark_mc_segmap_parloop_229396_iter;
    int64_t futhark_mc_segmap_parloop_229396_total_total_runtime;
    int futhark_mc_segmap_parloop_229396_total_runs;
    int64_t futhark_mc_segmap_parloop_229396_total_iter;
    int64_t *futhark_mc_segmap_task_229394_total_runtime;
    int *futhark_mc_segmap_task_229394_runs;
    int64_t *futhark_mc_segmap_task_229394_iter;
    int64_t futhark_mc_segmap_task_229394_total_time;
    int64_t futhark_mc_segmap_task_229394_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229410_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229410_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229410_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229410_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229410_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229410_total_iter;
    int64_t *futhark_mc_segred_task_229405_total_runtime;
    int *futhark_mc_segred_task_229405_runs;
    int64_t *futhark_mc_segred_task_229405_iter;
    int64_t futhark_mc_segred_task_229405_total_time;
    int64_t futhark_mc_segred_task_229405_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229416_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229416_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229416_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229416_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229416_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229416_total_iter;
    int64_t *futhark_mc_segred_task_229412_total_runtime;
    int *futhark_mc_segred_task_229412_runs;
    int64_t *futhark_mc_segred_task_229412_iter;
    int64_t futhark_mc_segred_task_229412_total_time;
    int64_t futhark_mc_segred_task_229412_total_iter;
    int64_t *futhark_mc_segmap_parloop_229401_total_runtime;
    int *futhark_mc_segmap_parloop_229401_runs;
    int64_t *futhark_mc_segmap_parloop_229401_iter;
    int64_t futhark_mc_segmap_parloop_229401_total_total_runtime;
    int futhark_mc_segmap_parloop_229401_total_runs;
    int64_t futhark_mc_segmap_parloop_229401_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229399_total_runtime;
    int *futhark_mc_segmap_nested_task_229399_runs;
    int64_t *futhark_mc_segmap_nested_task_229399_iter;
    int64_t *futhark_mc_segmap_parloop_229379_total_runtime;
    int *futhark_mc_segmap_parloop_229379_runs;
    int64_t *futhark_mc_segmap_parloop_229379_iter;
    int64_t futhark_mc_segmap_parloop_229379_total_total_runtime;
    int futhark_mc_segmap_parloop_229379_total_runs;
    int64_t futhark_mc_segmap_parloop_229379_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229377_total_runtime;
    int *futhark_mc_segmap_nested_task_229377_runs;
    int64_t *futhark_mc_segmap_nested_task_229377_iter;
    int64_t *futhark_mc_segmap_parloop_229420_total_runtime;
    int *futhark_mc_segmap_parloop_229420_runs;
    int64_t *futhark_mc_segmap_parloop_229420_iter;
    int64_t futhark_mc_segmap_parloop_229420_total_total_runtime;
    int futhark_mc_segmap_parloop_229420_total_runs;
    int64_t futhark_mc_segmap_parloop_229420_total_iter;
    int64_t *futhark_mc_segmap_task_229418_total_runtime;
    int *futhark_mc_segmap_task_229418_runs;
    int64_t *futhark_mc_segmap_task_229418_iter;
    int64_t futhark_mc_segmap_task_229418_total_time;
    int64_t futhark_mc_segmap_task_229418_total_iter;
    int64_t *futhark_mc_segmap_parloop_229441_total_runtime;
    int *futhark_mc_segmap_parloop_229441_runs;
    int64_t *futhark_mc_segmap_parloop_229441_iter;
    int64_t futhark_mc_segmap_parloop_229441_total_total_runtime;
    int futhark_mc_segmap_parloop_229441_total_runs;
    int64_t futhark_mc_segmap_parloop_229441_total_iter;
    int64_t *futhark_mc_segmap_task_229439_total_runtime;
    int *futhark_mc_segmap_task_229439_runs;
    int64_t *futhark_mc_segmap_task_229439_iter;
    int64_t futhark_mc_segmap_task_229439_total_time;
    int64_t futhark_mc_segmap_task_229439_total_iter;
    int64_t *futhark_mc_segmap_parloop_229445_total_runtime;
    int *futhark_mc_segmap_parloop_229445_runs;
    int64_t *futhark_mc_segmap_parloop_229445_iter;
    int64_t futhark_mc_segmap_parloop_229445_total_total_runtime;
    int futhark_mc_segmap_parloop_229445_total_runs;
    int64_t futhark_mc_segmap_parloop_229445_total_iter;
    int64_t *futhark_mc_segmap_task_229443_total_runtime;
    int *futhark_mc_segmap_task_229443_runs;
    int64_t *futhark_mc_segmap_task_229443_iter;
    int64_t futhark_mc_segmap_task_229443_total_time;
    int64_t futhark_mc_segmap_task_229443_total_iter;
    int64_t *futhark_mc_segmap_parloop_229449_total_runtime;
    int *futhark_mc_segmap_parloop_229449_runs;
    int64_t *futhark_mc_segmap_parloop_229449_iter;
    int64_t futhark_mc_segmap_parloop_229449_total_total_runtime;
    int futhark_mc_segmap_parloop_229449_total_runs;
    int64_t futhark_mc_segmap_parloop_229449_total_iter;
    int64_t *futhark_mc_segmap_task_229447_total_runtime;
    int *futhark_mc_segmap_task_229447_runs;
    int64_t *futhark_mc_segmap_task_229447_iter;
    int64_t futhark_mc_segmap_task_229447_total_time;
    int64_t futhark_mc_segmap_task_229447_total_iter;
    int64_t *futhark_mc_segmap_parloop_229464_total_runtime;
    int *futhark_mc_segmap_parloop_229464_runs;
    int64_t *futhark_mc_segmap_parloop_229464_iter;
    int64_t futhark_mc_segmap_parloop_229464_total_total_runtime;
    int futhark_mc_segmap_parloop_229464_total_runs;
    int64_t futhark_mc_segmap_parloop_229464_total_iter;
    int64_t *futhark_mc_segmap_task_229462_total_runtime;
    int *futhark_mc_segmap_task_229462_runs;
    int64_t *futhark_mc_segmap_task_229462_iter;
    int64_t futhark_mc_segmap_task_229462_total_time;
    int64_t futhark_mc_segmap_task_229462_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229473_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229473_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229473_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229473_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229473_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229473_total_iter;
    int64_t *futhark_mc_segred_task_229466_total_runtime;
    int *futhark_mc_segred_task_229466_runs;
    int64_t *futhark_mc_segred_task_229466_iter;
    int64_t futhark_mc_segred_task_229466_total_time;
    int64_t futhark_mc_segred_task_229466_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229479_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229479_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229479_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229479_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229479_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229479_total_iter;
    int64_t *futhark_mc_segred_task_229475_total_runtime;
    int *futhark_mc_segred_task_229475_runs;
    int64_t *futhark_mc_segred_task_229475_iter;
    int64_t futhark_mc_segred_task_229475_total_time;
    int64_t futhark_mc_segred_task_229475_total_iter;
    int64_t *futhark_mc_segmap_parloop_229456_total_runtime;
    int *futhark_mc_segmap_parloop_229456_runs;
    int64_t *futhark_mc_segmap_parloop_229456_iter;
    int64_t futhark_mc_segmap_parloop_229456_total_total_runtime;
    int futhark_mc_segmap_parloop_229456_total_runs;
    int64_t futhark_mc_segmap_parloop_229456_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229454_total_runtime;
    int *futhark_mc_segmap_nested_task_229454_runs;
    int64_t *futhark_mc_segmap_nested_task_229454_iter;
    int64_t *futhark_mc_segmap_parloop_229432_total_runtime;
    int *futhark_mc_segmap_parloop_229432_runs;
    int64_t *futhark_mc_segmap_parloop_229432_iter;
    int64_t futhark_mc_segmap_parloop_229432_total_total_runtime;
    int futhark_mc_segmap_parloop_229432_total_runs;
    int64_t futhark_mc_segmap_parloop_229432_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229430_total_runtime;
    int *futhark_mc_segmap_nested_task_229430_runs;
    int64_t *futhark_mc_segmap_nested_task_229430_iter;
    int64_t *futhark_mc_segmap_parloop_229483_total_runtime;
    int *futhark_mc_segmap_parloop_229483_runs;
    int64_t *futhark_mc_segmap_parloop_229483_iter;
    int64_t futhark_mc_segmap_parloop_229483_total_total_runtime;
    int futhark_mc_segmap_parloop_229483_total_runs;
    int64_t futhark_mc_segmap_parloop_229483_total_iter;
    int64_t *futhark_mc_segmap_task_229481_total_runtime;
    int *futhark_mc_segmap_task_229481_runs;
    int64_t *futhark_mc_segmap_task_229481_iter;
    int64_t futhark_mc_segmap_task_229481_total_time;
    int64_t futhark_mc_segmap_task_229481_total_iter;
    int64_t *futhark_mc_segmap_parloop_229492_total_runtime;
    int *futhark_mc_segmap_parloop_229492_runs;
    int64_t *futhark_mc_segmap_parloop_229492_iter;
    int64_t futhark_mc_segmap_parloop_229492_total_total_runtime;
    int futhark_mc_segmap_parloop_229492_total_runs;
    int64_t futhark_mc_segmap_parloop_229492_total_iter;
    int64_t *futhark_mc_segmap_task_229490_total_runtime;
    int *futhark_mc_segmap_task_229490_runs;
    int64_t *futhark_mc_segmap_task_229490_iter;
    int64_t futhark_mc_segmap_task_229490_total_time;
    int64_t futhark_mc_segmap_task_229490_total_iter;
    int64_t *futhark_mc_segmap_parloop_229487_total_runtime;
    int *futhark_mc_segmap_parloop_229487_runs;
    int64_t *futhark_mc_segmap_parloop_229487_iter;
    int64_t futhark_mc_segmap_parloop_229487_total_total_runtime;
    int futhark_mc_segmap_parloop_229487_total_runs;
    int64_t futhark_mc_segmap_parloop_229487_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229485_total_runtime;
    int *futhark_mc_segmap_nested_task_229485_runs;
    int64_t *futhark_mc_segmap_nested_task_229485_iter;
    int64_t *futhark_mc_segmap_parloop_229496_total_runtime;
    int *futhark_mc_segmap_parloop_229496_runs;
    int64_t *futhark_mc_segmap_parloop_229496_iter;
    int64_t futhark_mc_segmap_parloop_229496_total_total_runtime;
    int futhark_mc_segmap_parloop_229496_total_runs;
    int64_t futhark_mc_segmap_parloop_229496_total_iter;
    int64_t *futhark_mc_segmap_task_229494_total_runtime;
    int *futhark_mc_segmap_task_229494_runs;
    int64_t *futhark_mc_segmap_task_229494_iter;
    int64_t futhark_mc_segmap_task_229494_total_time;
    int64_t futhark_mc_segmap_task_229494_total_iter;
    int64_t *futhark_mc_segmap_parloop_229507_total_runtime;
    int *futhark_mc_segmap_parloop_229507_runs;
    int64_t *futhark_mc_segmap_parloop_229507_iter;
    int64_t futhark_mc_segmap_parloop_229507_total_total_runtime;
    int futhark_mc_segmap_parloop_229507_total_runs;
    int64_t futhark_mc_segmap_parloop_229507_total_iter;
    int64_t *futhark_mc_segmap_task_229505_total_runtime;
    int *futhark_mc_segmap_task_229505_runs;
    int64_t *futhark_mc_segmap_task_229505_iter;
    int64_t futhark_mc_segmap_task_229505_total_time;
    int64_t futhark_mc_segmap_task_229505_total_iter;
    int64_t *futhark_mc_segmap_parloop_229511_total_runtime;
    int *futhark_mc_segmap_parloop_229511_runs;
    int64_t *futhark_mc_segmap_parloop_229511_iter;
    int64_t futhark_mc_segmap_parloop_229511_total_total_runtime;
    int futhark_mc_segmap_parloop_229511_total_runs;
    int64_t futhark_mc_segmap_parloop_229511_total_iter;
    int64_t *futhark_mc_segmap_task_229509_total_runtime;
    int *futhark_mc_segmap_task_229509_runs;
    int64_t *futhark_mc_segmap_task_229509_iter;
    int64_t futhark_mc_segmap_task_229509_total_time;
    int64_t futhark_mc_segmap_task_229509_total_iter;
    int64_t *futhark_mc_segmap_parloop_229501_total_runtime;
    int *futhark_mc_segmap_parloop_229501_runs;
    int64_t *futhark_mc_segmap_parloop_229501_iter;
    int64_t futhark_mc_segmap_parloop_229501_total_total_runtime;
    int futhark_mc_segmap_parloop_229501_total_runs;
    int64_t futhark_mc_segmap_parloop_229501_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229499_total_runtime;
    int *futhark_mc_segmap_nested_task_229499_runs;
    int64_t *futhark_mc_segmap_nested_task_229499_iter;
    int64_t *futhark_mc_segmap_parloop_229515_total_runtime;
    int *futhark_mc_segmap_parloop_229515_runs;
    int64_t *futhark_mc_segmap_parloop_229515_iter;
    int64_t futhark_mc_segmap_parloop_229515_total_total_runtime;
    int futhark_mc_segmap_parloop_229515_total_runs;
    int64_t futhark_mc_segmap_parloop_229515_total_iter;
    int64_t *futhark_mc_segmap_task_229513_total_runtime;
    int *futhark_mc_segmap_task_229513_runs;
    int64_t *futhark_mc_segmap_task_229513_iter;
    int64_t futhark_mc_segmap_task_229513_total_time;
    int64_t futhark_mc_segmap_task_229513_total_iter;
    int64_t *futhark_mc_scan_stage_1_parloop_229536_total_runtime;
    int *futhark_mc_scan_stage_1_parloop_229536_runs;
    int64_t *futhark_mc_scan_stage_1_parloop_229536_iter;
    int64_t futhark_mc_scan_stage_1_parloop_229536_total_total_runtime;
    int futhark_mc_scan_stage_1_parloop_229536_total_runs;
    int64_t futhark_mc_scan_stage_1_parloop_229536_total_iter;
    int64_t *futhark_mc_scan_stage_3_parloop_229538_total_runtime;
    int *futhark_mc_scan_stage_3_parloop_229538_runs;
    int64_t *futhark_mc_scan_stage_3_parloop_229538_iter;
    int64_t futhark_mc_scan_stage_3_parloop_229538_total_total_runtime;
    int futhark_mc_scan_stage_3_parloop_229538_total_runs;
    int64_t futhark_mc_scan_stage_3_parloop_229538_total_iter;
    int64_t *futhark_mc_segscan_task_229530_total_runtime;
    int *futhark_mc_segscan_task_229530_runs;
    int64_t *futhark_mc_segscan_task_229530_iter;
    int64_t futhark_mc_segscan_task_229530_total_time;
    int64_t futhark_mc_segscan_task_229530_total_iter;
    int64_t *futhark_mc_segmap_parloop_229542_total_runtime;
    int *futhark_mc_segmap_parloop_229542_runs;
    int64_t *futhark_mc_segmap_parloop_229542_iter;
    int64_t futhark_mc_segmap_parloop_229542_total_total_runtime;
    int futhark_mc_segmap_parloop_229542_total_runs;
    int64_t futhark_mc_segmap_parloop_229542_total_iter;
    int64_t *futhark_mc_segmap_task_229540_total_runtime;
    int *futhark_mc_segmap_task_229540_runs;
    int64_t *futhark_mc_segmap_task_229540_iter;
    int64_t futhark_mc_segmap_task_229540_total_time;
    int64_t futhark_mc_segmap_task_229540_total_iter;
    int64_t *futhark_mc_segmap_parloop_229523_total_runtime;
    int *futhark_mc_segmap_parloop_229523_runs;
    int64_t *futhark_mc_segmap_parloop_229523_iter;
    int64_t futhark_mc_segmap_parloop_229523_total_total_runtime;
    int futhark_mc_segmap_parloop_229523_total_runs;
    int64_t futhark_mc_segmap_parloop_229523_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229521_total_runtime;
    int *futhark_mc_segmap_nested_task_229521_runs;
    int64_t *futhark_mc_segmap_nested_task_229521_iter;
    int64_t *futhark_mc_segmap_parloop_229546_total_runtime;
    int *futhark_mc_segmap_parloop_229546_runs;
    int64_t *futhark_mc_segmap_parloop_229546_iter;
    int64_t futhark_mc_segmap_parloop_229546_total_total_runtime;
    int futhark_mc_segmap_parloop_229546_total_runs;
    int64_t futhark_mc_segmap_parloop_229546_total_iter;
    int64_t *futhark_mc_segmap_task_229544_total_runtime;
    int *futhark_mc_segmap_task_229544_runs;
    int64_t *futhark_mc_segmap_task_229544_iter;
    int64_t futhark_mc_segmap_task_229544_total_time;
    int64_t futhark_mc_segmap_task_229544_total_iter;
    int64_t *futhark_mc_segred_stage_1_parloop_229554_total_runtime;
    int *futhark_mc_segred_stage_1_parloop_229554_runs;
    int64_t *futhark_mc_segred_stage_1_parloop_229554_iter;
    int64_t futhark_mc_segred_stage_1_parloop_229554_total_total_runtime;
    int futhark_mc_segred_stage_1_parloop_229554_total_runs;
    int64_t futhark_mc_segred_stage_1_parloop_229554_total_iter;
    int64_t *futhark_mc_segred_task_229551_total_runtime;
    int *futhark_mc_segred_task_229551_runs;
    int64_t *futhark_mc_segred_task_229551_iter;
    int64_t futhark_mc_segred_task_229551_total_time;
    int64_t futhark_mc_segred_task_229551_total_iter;
    int64_t *futhark_mc_segmap_parloop_229549_total_runtime;
    int *futhark_mc_segmap_parloop_229549_runs;
    int64_t *futhark_mc_segmap_parloop_229549_iter;
    int64_t futhark_mc_segmap_parloop_229549_total_total_runtime;
    int futhark_mc_segmap_parloop_229549_total_runs;
    int64_t futhark_mc_segmap_parloop_229549_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229547_total_runtime;
    int *futhark_mc_segmap_nested_task_229547_runs;
    int64_t *futhark_mc_segmap_nested_task_229547_iter;
    int64_t *futhark_mc_segmap_parloop_229558_total_runtime;
    int *futhark_mc_segmap_parloop_229558_runs;
    int64_t *futhark_mc_segmap_parloop_229558_iter;
    int64_t futhark_mc_segmap_parloop_229558_total_total_runtime;
    int futhark_mc_segmap_parloop_229558_total_runs;
    int64_t futhark_mc_segmap_parloop_229558_total_iter;
    int64_t *futhark_mc_segmap_task_229556_total_runtime;
    int *futhark_mc_segmap_task_229556_runs;
    int64_t *futhark_mc_segmap_task_229556_iter;
    int64_t futhark_mc_segmap_task_229556_total_time;
    int64_t futhark_mc_segmap_task_229556_total_iter;
    int64_t *futhark_mc_segmap_parloop_229567_total_runtime;
    int *futhark_mc_segmap_parloop_229567_runs;
    int64_t *futhark_mc_segmap_parloop_229567_iter;
    int64_t futhark_mc_segmap_parloop_229567_total_total_runtime;
    int futhark_mc_segmap_parloop_229567_total_runs;
    int64_t futhark_mc_segmap_parloop_229567_total_iter;
    int64_t *futhark_mc_segmap_task_229565_total_runtime;
    int *futhark_mc_segmap_task_229565_runs;
    int64_t *futhark_mc_segmap_task_229565_iter;
    int64_t futhark_mc_segmap_task_229565_total_time;
    int64_t futhark_mc_segmap_task_229565_total_iter;
    int64_t *futhark_mc_segmap_parloop_229562_total_runtime;
    int *futhark_mc_segmap_parloop_229562_runs;
    int64_t *futhark_mc_segmap_parloop_229562_iter;
    int64_t futhark_mc_segmap_parloop_229562_total_total_runtime;
    int futhark_mc_segmap_parloop_229562_total_runs;
    int64_t futhark_mc_segmap_parloop_229562_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229560_total_runtime;
    int *futhark_mc_segmap_nested_task_229560_runs;
    int64_t *futhark_mc_segmap_nested_task_229560_iter;
    int64_t *futhark_mc_segmap_parloop_229571_total_runtime;
    int *futhark_mc_segmap_parloop_229571_runs;
    int64_t *futhark_mc_segmap_parloop_229571_iter;
    int64_t futhark_mc_segmap_parloop_229571_total_total_runtime;
    int futhark_mc_segmap_parloop_229571_total_runs;
    int64_t futhark_mc_segmap_parloop_229571_total_iter;
    int64_t *futhark_mc_segmap_task_229569_total_runtime;
    int *futhark_mc_segmap_task_229569_runs;
    int64_t *futhark_mc_segmap_task_229569_iter;
    int64_t futhark_mc_segmap_task_229569_total_time;
    int64_t futhark_mc_segmap_task_229569_total_iter;
    int64_t *futhark_mc_segmap_parloop_229580_total_runtime;
    int *futhark_mc_segmap_parloop_229580_runs;
    int64_t *futhark_mc_segmap_parloop_229580_iter;
    int64_t futhark_mc_segmap_parloop_229580_total_total_runtime;
    int futhark_mc_segmap_parloop_229580_total_runs;
    int64_t futhark_mc_segmap_parloop_229580_total_iter;
    int64_t *futhark_mc_segmap_task_229578_total_runtime;
    int *futhark_mc_segmap_task_229578_runs;
    int64_t *futhark_mc_segmap_task_229578_iter;
    int64_t futhark_mc_segmap_task_229578_total_time;
    int64_t futhark_mc_segmap_task_229578_total_iter;
    int64_t *futhark_mc_segmap_parloop_229575_total_runtime;
    int *futhark_mc_segmap_parloop_229575_runs;
    int64_t *futhark_mc_segmap_parloop_229575_iter;
    int64_t futhark_mc_segmap_parloop_229575_total_total_runtime;
    int futhark_mc_segmap_parloop_229575_total_runs;
    int64_t futhark_mc_segmap_parloop_229575_total_iter;
    int64_t *futhark_mc_segmap_nested_task_229573_total_runtime;
    int *futhark_mc_segmap_nested_task_229573_runs;
    int64_t *futhark_mc_segmap_nested_task_229573_iter;
    int64_t tuning_timing;
    int64_t tuning_iter;
};
struct futhark_context *futhark_context_new(struct futhark_context_config *cfg)
{
    assert(!cfg->in_use);
    
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    ctx->cfg = cfg;
    ctx->cfg->in_use = 1;
    // Initialize rand()
    fast_srand(time(0));
    ctx->detail_memory = cfg->debugging;
    ctx->debugging = cfg->debugging;
    ctx->profiling = cfg->profiling;
    ctx->profiling_paused = 0;
    ctx->logging = 0;
    ctx->error = NULL;
    ctx->log = stderr;
    create_lock(&ctx->lock);
    
    int tune_kappa = 0;
    double kappa = 5.1f * 1000;
    
    if (tune_kappa) {
        if (determine_kappa(&kappa) != 0)
            return NULL;
    }
    if (scheduler_init(&ctx->scheduler, cfg->num_threads >
                       0 ? cfg->num_threads : num_processors(), kappa) != 0)
        return NULL;
    ctx->peak_mem_usage_default = 0;
    ctx->cur_mem_usage_default = 0;
    ctx->futhark_mc_segmap_parloop_228377_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228377_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228377_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228377_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228377_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228377_total_iter = 0;
    ctx->futhark_mc_segmap_task_228375_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228375_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228375_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228375_total_time = 0;
    ctx->futhark_mc_segmap_task_228375_total_iter = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228389_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228389_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228389_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228389_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228389_total_iter = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228391_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228391_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228391_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228391_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228391_total_iter = 0;
    ctx->futhark_mc_segscan_task_228386_total_runtime = calloc(sizeof(int64_t),
                                                               ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228386_runs = calloc(sizeof(int),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228386_iter = calloc(sizeof(sizeof(int64_t)),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228386_total_time = 0;
    ctx->futhark_mc_segscan_task_228386_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228395_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228395_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228395_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228395_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228395_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228395_total_iter = 0;
    ctx->futhark_mc_segmap_task_228393_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228393_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228393_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228393_total_time = 0;
    ctx->futhark_mc_segmap_task_228393_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228382_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228382_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228382_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228382_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228382_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228382_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228380_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228380_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228380_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228399_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228399_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228399_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228399_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228399_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228399_total_iter = 0;
    ctx->futhark_mc_segmap_task_228397_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228397_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228397_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228397_total_time = 0;
    ctx->futhark_mc_segmap_task_228397_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228408_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228408_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228408_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228408_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228408_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228408_total_iter = 0;
    ctx->futhark_mc_segmap_task_228406_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228406_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228406_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228406_total_time = 0;
    ctx->futhark_mc_segmap_task_228406_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228417_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228417_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228417_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228417_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228417_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228417_total_iter = 0;
    ctx->futhark_mc_segmap_task_228415_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228415_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228415_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228415_total_time = 0;
    ctx->futhark_mc_segmap_task_228415_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228412_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228412_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228412_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228412_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228412_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228412_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228410_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228410_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228410_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228403_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228403_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228403_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228403_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228403_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228403_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228401_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228401_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228401_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228421_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228421_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228421_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228421_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228421_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228421_total_iter = 0;
    ctx->futhark_mc_segmap_task_228419_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228419_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228419_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228419_total_time = 0;
    ctx->futhark_mc_segmap_task_228419_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228434_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228434_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228434_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228434_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228434_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228434_total_iter = 0;
    ctx->futhark_mc_segmap_task_228432_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228432_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228432_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228432_total_time = 0;
    ctx->futhark_mc_segmap_task_228432_total_iter = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228446_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228446_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228446_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228446_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228446_total_iter = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228448_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228448_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228448_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228448_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228448_total_iter = 0;
    ctx->futhark_mc_segscan_task_228443_total_runtime = calloc(sizeof(int64_t),
                                                               ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228443_runs = calloc(sizeof(int),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228443_iter = calloc(sizeof(sizeof(int64_t)),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228443_total_time = 0;
    ctx->futhark_mc_segscan_task_228443_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228452_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228452_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228452_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228452_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228452_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228452_total_iter = 0;
    ctx->futhark_mc_segmap_task_228450_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228450_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228450_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228450_total_time = 0;
    ctx->futhark_mc_segmap_task_228450_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228439_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228439_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228439_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228439_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228439_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228439_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228437_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228437_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228437_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228428_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228428_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228428_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228428_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228428_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228428_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228426_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228426_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228426_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228456_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228456_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228456_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228456_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228456_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228456_total_iter = 0;
    ctx->futhark_mc_segmap_task_228454_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228454_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228454_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228454_total_time = 0;
    ctx->futhark_mc_segmap_task_228454_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228468_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228468_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228468_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228468_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228468_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228468_total_iter = 0;
    ctx->futhark_mc_segmap_task_228466_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228466_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228466_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228466_total_time = 0;
    ctx->futhark_mc_segmap_task_228466_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228481_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228481_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228481_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228481_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228481_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228481_total_iter = 0;
    ctx->futhark_mc_segmap_task_228479_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228479_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228479_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228479_total_time = 0;
    ctx->futhark_mc_segmap_task_228479_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228485_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228485_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228485_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228485_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228485_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228485_total_iter = 0;
    ctx->futhark_mc_segmap_task_228483_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228483_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228483_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228483_total_time = 0;
    ctx->futhark_mc_segmap_task_228483_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228474_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228474_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228474_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228474_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228474_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228474_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228472_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228472_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228472_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228462_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228462_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228462_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228462_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228462_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228462_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228460_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228460_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228460_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228489_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228489_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228489_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228489_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228489_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228489_total_iter = 0;
    ctx->futhark_mc_segmap_task_228487_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228487_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228487_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228487_total_time = 0;
    ctx->futhark_mc_segmap_task_228487_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228502_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228502_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228502_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228502_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228502_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228502_total_iter = 0;
    ctx->futhark_mc_segmap_task_228500_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228500_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228500_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228500_total_time = 0;
    ctx->futhark_mc_segmap_task_228500_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228506_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228506_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228506_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228506_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228506_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228506_total_iter = 0;
    ctx->futhark_mc_segmap_task_228504_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228504_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228504_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228504_total_time = 0;
    ctx->futhark_mc_segmap_task_228504_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228495_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228495_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228495_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228495_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228495_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228495_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228493_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228493_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228493_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228510_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228510_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228510_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228510_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228510_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228510_total_iter = 0;
    ctx->futhark_mc_segmap_task_228508_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228508_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228508_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228508_total_time = 0;
    ctx->futhark_mc_segmap_task_228508_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228523_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228523_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228523_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228523_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228523_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228523_total_iter = 0;
    ctx->futhark_mc_segmap_task_228521_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228521_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228521_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228521_total_time = 0;
    ctx->futhark_mc_segmap_task_228521_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228527_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228527_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228527_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228527_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228527_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228527_total_iter = 0;
    ctx->futhark_mc_segmap_task_228525_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228525_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228525_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228525_total_time = 0;
    ctx->futhark_mc_segmap_task_228525_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228516_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228516_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228516_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228516_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228516_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228516_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228514_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228514_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228514_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228531_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228531_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228531_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228531_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228531_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228531_total_iter = 0;
    ctx->futhark_mc_segmap_task_228529_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228529_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228529_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228529_total_time = 0;
    ctx->futhark_mc_segmap_task_228529_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228540_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228540_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228540_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228540_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228540_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228540_total_iter = 0;
    ctx->futhark_mc_segmap_task_228538_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228538_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228538_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228538_total_time = 0;
    ctx->futhark_mc_segmap_task_228538_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228535_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228535_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228535_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228535_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228535_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228535_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228533_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228533_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228533_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228544_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228544_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228544_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228544_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228544_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228544_total_iter = 0;
    ctx->futhark_mc_segmap_task_228542_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228542_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228542_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228542_total_time = 0;
    ctx->futhark_mc_segmap_task_228542_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228555_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228555_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228555_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228555_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228555_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228555_total_iter = 0;
    ctx->futhark_mc_segmap_task_228553_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228553_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228553_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228553_total_time = 0;
    ctx->futhark_mc_segmap_task_228553_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228566_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228566_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228566_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228566_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228566_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228566_total_iter = 0;
    ctx->futhark_mc_segmap_task_228564_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228564_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228564_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228564_total_time = 0;
    ctx->futhark_mc_segmap_task_228564_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228560_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228560_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228560_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228560_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228560_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228560_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228558_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228558_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228558_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228549_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228549_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228549_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228549_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228549_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228549_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228547_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228547_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228547_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228570_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228570_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228570_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228570_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228570_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228570_total_iter = 0;
    ctx->futhark_mc_segmap_task_228568_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228568_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228568_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228568_total_time = 0;
    ctx->futhark_mc_segmap_task_228568_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228579_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228579_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228579_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228579_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228579_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228579_total_iter = 0;
    ctx->futhark_mc_segmap_task_228577_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228577_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228577_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228577_total_time = 0;
    ctx->futhark_mc_segmap_task_228577_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228588_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228588_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228588_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228588_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228588_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228588_total_iter = 0;
    ctx->futhark_mc_segmap_task_228586_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228586_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228586_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228586_total_time = 0;
    ctx->futhark_mc_segmap_task_228586_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228596_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228596_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228596_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228596_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228596_total_iter = 0;
    ctx->futhark_mc_segred_task_228593_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228593_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228593_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228593_total_time = 0;
    ctx->futhark_mc_segred_task_228593_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228601_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228601_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228601_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228601_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228601_total_iter = 0;
    ctx->futhark_mc_segred_task_228598_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228598_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228598_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228598_total_time = 0;
    ctx->futhark_mc_segred_task_228598_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228591_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228591_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228591_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228591_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228591_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228591_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228589_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228589_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228589_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228583_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228583_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228583_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228583_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228583_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228583_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228581_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228581_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228581_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228574_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228574_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228574_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228574_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228574_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228574_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228572_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228572_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228572_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228605_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228605_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228605_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228605_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228605_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228605_total_iter = 0;
    ctx->futhark_mc_segmap_task_228603_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228603_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228603_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228603_total_time = 0;
    ctx->futhark_mc_segmap_task_228603_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228616_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228616_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228616_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228616_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228616_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228616_total_iter = 0;
    ctx->futhark_mc_segmap_task_228614_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228614_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228614_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228614_total_time = 0;
    ctx->futhark_mc_segmap_task_228614_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228627_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228627_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228627_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228627_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228627_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228627_total_iter = 0;
    ctx->futhark_mc_segmap_task_228625_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228625_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228625_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228625_total_time = 0;
    ctx->futhark_mc_segmap_task_228625_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228637_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228637_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228637_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228637_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228637_total_iter = 0;
    ctx->futhark_mc_segred_task_228632_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228632_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228632_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228632_total_time = 0;
    ctx->futhark_mc_segred_task_228632_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228643_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228643_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228643_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228643_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228643_total_iter = 0;
    ctx->futhark_mc_segred_task_228639_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228639_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228639_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228639_total_time = 0;
    ctx->futhark_mc_segred_task_228639_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228630_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228630_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228630_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228630_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228630_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228630_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228628_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228628_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228628_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228621_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228621_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228621_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228621_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228621_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228621_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228619_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228619_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228619_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228610_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228610_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228610_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228610_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228610_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228610_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228608_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228608_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228608_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228647_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228647_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228647_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228647_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228647_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228647_total_iter = 0;
    ctx->futhark_mc_segmap_task_228645_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228645_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228645_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228645_total_time = 0;
    ctx->futhark_mc_segmap_task_228645_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228658_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228658_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228658_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228658_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228658_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228658_total_iter = 0;
    ctx->futhark_mc_segmap_task_228656_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228656_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228656_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228656_total_time = 0;
    ctx->futhark_mc_segmap_task_228656_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228669_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228669_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228669_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228669_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228669_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228669_total_iter = 0;
    ctx->futhark_mc_segmap_task_228667_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228667_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228667_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228667_total_time = 0;
    ctx->futhark_mc_segmap_task_228667_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228681_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228681_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228681_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228681_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228681_total_iter = 0;
    ctx->futhark_mc_segred_task_228674_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228674_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228674_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228674_total_time = 0;
    ctx->futhark_mc_segred_task_228674_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228687_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228687_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228687_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228687_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228687_total_iter = 0;
    ctx->futhark_mc_segred_task_228683_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228683_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228683_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228683_total_time = 0;
    ctx->futhark_mc_segred_task_228683_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228672_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228672_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228672_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228672_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228672_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228672_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228670_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228670_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228670_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228663_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228663_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228663_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228663_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228663_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228663_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228661_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228661_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228661_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228652_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228652_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228652_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228652_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228652_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228652_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228650_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228650_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228650_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228691_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228691_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228691_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228691_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228691_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228691_total_iter = 0;
    ctx->futhark_mc_segmap_task_228689_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228689_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228689_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228689_total_time = 0;
    ctx->futhark_mc_segmap_task_228689_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228701_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228701_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228701_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228701_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228701_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228701_total_iter = 0;
    ctx->futhark_mc_segmap_task_228699_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228699_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228699_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228699_total_time = 0;
    ctx->futhark_mc_segmap_task_228699_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228711_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228711_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228711_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228711_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228711_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228711_total_iter = 0;
    ctx->futhark_mc_segmap_task_228709_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228709_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228709_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228709_total_time = 0;
    ctx->futhark_mc_segmap_task_228709_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228721_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228721_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228721_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228721_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228721_total_iter = 0;
    ctx->futhark_mc_segred_task_228718_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228718_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228718_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228718_total_time = 0;
    ctx->futhark_mc_segred_task_228718_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228726_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228726_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228726_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228726_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228726_total_iter = 0;
    ctx->futhark_mc_segred_task_228723_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228723_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228723_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228723_total_time = 0;
    ctx->futhark_mc_segred_task_228723_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228715_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228715_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228715_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228715_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228715_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228715_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228713_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228713_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228713_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228706_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228706_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228706_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228706_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228706_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228706_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228704_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228704_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228704_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228696_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228696_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228696_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228696_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228696_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228696_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228694_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228694_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228694_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228730_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228730_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228730_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228730_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228730_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228730_total_iter = 0;
    ctx->futhark_mc_segmap_task_228728_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228728_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228728_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228728_total_time = 0;
    ctx->futhark_mc_segmap_task_228728_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228743_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228743_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228743_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228743_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228743_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228743_total_iter = 0;
    ctx->futhark_mc_segmap_task_228741_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228741_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228741_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228741_total_time = 0;
    ctx->futhark_mc_segmap_task_228741_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228756_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228756_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228756_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228756_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228756_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228756_total_iter = 0;
    ctx->futhark_mc_segmap_task_228754_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228754_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228754_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228754_total_time = 0;
    ctx->futhark_mc_segmap_task_228754_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228770_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228770_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228770_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228770_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228770_total_iter = 0;
    ctx->futhark_mc_segred_task_228765_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228765_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228765_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228765_total_time = 0;
    ctx->futhark_mc_segred_task_228765_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228776_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228776_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228776_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228776_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228776_total_iter = 0;
    ctx->futhark_mc_segred_task_228772_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228772_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228772_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228772_total_time = 0;
    ctx->futhark_mc_segred_task_228772_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228761_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228761_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228761_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228761_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228761_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228761_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228759_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228759_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228759_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228750_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228750_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228750_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228750_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228750_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228750_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228748_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228748_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228748_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228737_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228737_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228737_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228737_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228737_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228737_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228735_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228735_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228735_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228780_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228780_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228780_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228780_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228780_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228780_total_iter = 0;
    ctx->futhark_mc_segmap_task_228778_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228778_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228778_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228778_total_time = 0;
    ctx->futhark_mc_segmap_task_228778_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228795_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228795_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228795_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228795_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228795_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228795_total_iter = 0;
    ctx->futhark_mc_segmap_task_228793_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228793_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228793_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228793_total_time = 0;
    ctx->futhark_mc_segmap_task_228793_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228810_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228810_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228810_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228810_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228810_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228810_total_iter = 0;
    ctx->futhark_mc_segmap_task_228808_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228808_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228808_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228808_total_time = 0;
    ctx->futhark_mc_segmap_task_228808_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228825_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228825_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228825_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228825_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228825_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228825_total_iter = 0;
    ctx->futhark_mc_segmap_task_228823_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228823_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228823_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228823_total_time = 0;
    ctx->futhark_mc_segmap_task_228823_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228834_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228834_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228834_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228834_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228834_total_iter = 0;
    ctx->futhark_mc_segred_task_228827_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228827_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228827_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228827_total_time = 0;
    ctx->futhark_mc_segred_task_228827_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228840_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228840_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228840_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228840_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228840_total_iter = 0;
    ctx->futhark_mc_segred_task_228836_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228836_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228836_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228836_total_time = 0;
    ctx->futhark_mc_segred_task_228836_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228817_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228817_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228817_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228817_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228817_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228817_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228815_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228815_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228815_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228804_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228804_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228804_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228804_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228804_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228804_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228802_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228802_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228802_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228789_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228789_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228789_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228789_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228789_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228789_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228787_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228787_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228787_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228844_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228844_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228844_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228844_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228844_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228844_total_iter = 0;
    ctx->futhark_mc_segmap_task_228842_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228842_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228842_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228842_total_time = 0;
    ctx->futhark_mc_segmap_task_228842_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228853_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228853_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228853_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228853_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228853_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228853_total_iter = 0;
    ctx->futhark_mc_segmap_task_228851_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228851_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228851_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228851_total_time = 0;
    ctx->futhark_mc_segmap_task_228851_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228862_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228862_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228862_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228862_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228862_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228862_total_iter = 0;
    ctx->futhark_mc_segmap_task_228860_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228860_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228860_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228860_total_time = 0;
    ctx->futhark_mc_segmap_task_228860_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228857_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228857_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228857_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228857_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228857_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228857_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228855_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228855_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228855_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228848_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228848_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228848_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228848_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228848_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228848_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228846_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228846_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228846_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228866_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228866_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228866_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228866_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228866_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228866_total_iter = 0;
    ctx->futhark_mc_segmap_task_228864_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228864_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228864_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228864_total_time = 0;
    ctx->futhark_mc_segmap_task_228864_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228875_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228875_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228875_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228875_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228875_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228875_total_iter = 0;
    ctx->futhark_mc_segmap_task_228873_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228873_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228873_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228873_total_time = 0;
    ctx->futhark_mc_segmap_task_228873_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228870_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228870_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228870_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228870_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228870_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228870_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228868_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228868_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228868_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228879_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228879_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228879_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228879_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228879_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228879_total_iter = 0;
    ctx->futhark_mc_segmap_task_228877_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228877_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228877_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228877_total_time = 0;
    ctx->futhark_mc_segmap_task_228877_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228887_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228887_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228887_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228887_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228887_total_iter = 0;
    ctx->futhark_mc_segred_task_228884_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228884_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228884_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228884_total_time = 0;
    ctx->futhark_mc_segred_task_228884_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228882_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228882_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228882_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228882_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228882_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228882_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228880_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228880_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228880_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228891_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228891_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228891_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228891_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228891_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228891_total_iter = 0;
    ctx->futhark_mc_segmap_task_228889_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228889_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228889_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228889_total_time = 0;
    ctx->futhark_mc_segmap_task_228889_total_iter = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228901_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228901_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228901_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228901_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228901_total_iter = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228903_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228903_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228903_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228903_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228903_total_iter = 0;
    ctx->futhark_mc_segscan_task_228898_total_runtime = calloc(sizeof(int64_t),
                                                               ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228898_runs = calloc(sizeof(int),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228898_iter = calloc(sizeof(sizeof(int64_t)),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228898_total_time = 0;
    ctx->futhark_mc_segscan_task_228898_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228895_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228895_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228895_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228895_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228895_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228895_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228893_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228893_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228893_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228907_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228907_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228907_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228907_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228907_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228907_total_iter = 0;
    ctx->futhark_mc_segmap_task_228905_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228905_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228905_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228905_total_time = 0;
    ctx->futhark_mc_segmap_task_228905_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228915_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228915_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228915_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228915_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228915_total_iter = 0;
    ctx->futhark_mc_segred_task_228912_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228912_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228912_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228912_total_time = 0;
    ctx->futhark_mc_segred_task_228912_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228910_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228910_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228910_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228910_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228910_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228910_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228908_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228908_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228908_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228919_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228919_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228919_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228919_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228919_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228919_total_iter = 0;
    ctx->futhark_mc_segmap_task_228917_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228917_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228917_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228917_total_time = 0;
    ctx->futhark_mc_segmap_task_228917_total_iter = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228929_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228929_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228929_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228929_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228929_total_iter = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228931_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228931_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228931_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228931_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228931_total_iter = 0;
    ctx->futhark_mc_segscan_task_228926_total_runtime = calloc(sizeof(int64_t),
                                                               ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228926_runs = calloc(sizeof(int),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228926_iter = calloc(sizeof(sizeof(int64_t)),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228926_total_time = 0;
    ctx->futhark_mc_segscan_task_228926_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228923_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228923_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228923_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228923_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228923_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228923_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228921_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228921_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228921_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228935_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228935_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228935_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228935_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228935_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228935_total_iter = 0;
    ctx->futhark_mc_segmap_task_228933_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228933_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228933_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228933_total_time = 0;
    ctx->futhark_mc_segmap_task_228933_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228943_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228943_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228943_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228943_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228943_total_iter = 0;
    ctx->futhark_mc_segred_task_228940_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228940_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228940_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228940_total_time = 0;
    ctx->futhark_mc_segred_task_228940_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228938_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228938_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228938_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228938_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228938_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228938_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228936_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228936_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228936_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228947_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228947_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228947_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228947_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228947_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228947_total_iter = 0;
    ctx->futhark_mc_segmap_task_228945_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228945_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228945_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228945_total_time = 0;
    ctx->futhark_mc_segmap_task_228945_total_iter = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228957_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228957_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228957_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_228957_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs = 0;
    ctx->futhark_mc_scan_stage_1_parloop_228957_total_iter = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228959_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228959_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228959_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_228959_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs = 0;
    ctx->futhark_mc_scan_stage_3_parloop_228959_total_iter = 0;
    ctx->futhark_mc_segscan_task_228954_total_runtime = calloc(sizeof(int64_t),
                                                               ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228954_runs = calloc(sizeof(int),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228954_iter = calloc(sizeof(sizeof(int64_t)),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_228954_total_time = 0;
    ctx->futhark_mc_segscan_task_228954_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228951_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228951_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228951_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228951_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228951_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228951_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228949_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228949_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228949_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228963_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228963_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228963_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228963_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228963_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228963_total_iter = 0;
    ctx->futhark_mc_segmap_task_228961_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228961_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228961_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228961_total_time = 0;
    ctx->futhark_mc_segmap_task_228961_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228972_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228972_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228972_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228972_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228972_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228972_total_iter = 0;
    ctx->futhark_mc_segmap_task_228970_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228970_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228970_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228970_total_time = 0;
    ctx->futhark_mc_segmap_task_228970_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228980_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228980_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228980_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228980_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228980_total_iter = 0;
    ctx->futhark_mc_segred_task_228977_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228977_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228977_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228977_total_time = 0;
    ctx->futhark_mc_segred_task_228977_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228985_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228985_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228985_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_228985_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_228985_total_iter = 0;
    ctx->futhark_mc_segred_task_228982_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228982_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228982_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_228982_total_time = 0;
    ctx->futhark_mc_segred_task_228982_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_228975_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228975_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228975_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228975_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228975_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228975_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228973_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228973_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228973_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228967_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228967_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228967_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228967_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228967_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228967_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228965_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228965_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228965_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228989_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228989_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228989_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228989_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228989_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228989_total_iter = 0;
    ctx->futhark_mc_segmap_task_228987_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228987_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228987_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228987_total_time = 0;
    ctx->futhark_mc_segmap_task_228987_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229000_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229000_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229000_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229000_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229000_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229000_total_iter = 0;
    ctx->futhark_mc_segmap_task_228998_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228998_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228998_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_228998_total_time = 0;
    ctx->futhark_mc_segmap_task_228998_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229010_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229010_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229010_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229010_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229010_total_iter = 0;
    ctx->futhark_mc_segred_task_229005_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229005_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229005_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229005_total_time = 0;
    ctx->futhark_mc_segred_task_229005_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229016_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229016_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229016_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229016_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229016_total_iter = 0;
    ctx->futhark_mc_segred_task_229012_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229012_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229012_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229012_total_time = 0;
    ctx->futhark_mc_segred_task_229012_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229003_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229003_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229003_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229003_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229003_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229003_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229001_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229001_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229001_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228994_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228994_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228994_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_228994_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_228994_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_228994_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_228992_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228992_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_228992_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229020_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229020_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229020_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229020_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229020_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229020_total_iter = 0;
    ctx->futhark_mc_segmap_task_229018_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229018_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229018_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229018_total_time = 0;
    ctx->futhark_mc_segmap_task_229018_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229031_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229031_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229031_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229031_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229031_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229031_total_iter = 0;
    ctx->futhark_mc_segmap_task_229029_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229029_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229029_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229029_total_time = 0;
    ctx->futhark_mc_segmap_task_229029_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229043_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229043_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229043_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229043_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229043_total_iter = 0;
    ctx->futhark_mc_segred_task_229036_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229036_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229036_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229036_total_time = 0;
    ctx->futhark_mc_segred_task_229036_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229049_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229049_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229049_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229049_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229049_total_iter = 0;
    ctx->futhark_mc_segred_task_229045_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229045_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229045_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229045_total_time = 0;
    ctx->futhark_mc_segred_task_229045_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229034_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229034_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229034_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229034_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229034_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229034_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229032_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229032_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229032_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229025_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229025_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229025_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229025_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229025_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229025_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229023_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229023_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229023_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229053_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229053_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229053_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229053_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229053_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229053_total_iter = 0;
    ctx->futhark_mc_segmap_task_229051_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229051_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229051_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229051_total_time = 0;
    ctx->futhark_mc_segmap_task_229051_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229063_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229063_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229063_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229063_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229063_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229063_total_iter = 0;
    ctx->futhark_mc_segmap_task_229061_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229061_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229061_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229061_total_time = 0;
    ctx->futhark_mc_segmap_task_229061_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229073_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229073_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229073_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229073_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229073_total_iter = 0;
    ctx->futhark_mc_segred_task_229070_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229070_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229070_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229070_total_time = 0;
    ctx->futhark_mc_segred_task_229070_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229078_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229078_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229078_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229078_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229078_total_iter = 0;
    ctx->futhark_mc_segred_task_229075_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229075_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229075_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229075_total_time = 0;
    ctx->futhark_mc_segred_task_229075_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229067_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229067_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229067_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229067_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229067_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229067_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229065_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229065_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229065_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229058_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229058_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229058_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229058_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229058_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229058_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229056_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229056_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229056_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229082_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229082_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229082_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229082_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229082_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229082_total_iter = 0;
    ctx->futhark_mc_segmap_task_229080_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229080_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229080_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229080_total_time = 0;
    ctx->futhark_mc_segmap_task_229080_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229095_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229095_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229095_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229095_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229095_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229095_total_iter = 0;
    ctx->futhark_mc_segmap_task_229093_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229093_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229093_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229093_total_time = 0;
    ctx->futhark_mc_segmap_task_229093_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229109_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229109_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229109_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229109_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229109_total_iter = 0;
    ctx->futhark_mc_segred_task_229104_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229104_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229104_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229104_total_time = 0;
    ctx->futhark_mc_segred_task_229104_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229115_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229115_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229115_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229115_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229115_total_iter = 0;
    ctx->futhark_mc_segred_task_229111_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229111_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229111_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229111_total_time = 0;
    ctx->futhark_mc_segred_task_229111_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229100_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229100_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229100_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229100_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229100_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229100_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229098_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229098_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229098_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229089_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229089_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229089_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229089_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229089_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229089_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229087_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229087_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229087_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229119_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229119_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229119_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229119_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229119_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229119_total_iter = 0;
    ctx->futhark_mc_segmap_task_229117_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229117_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229117_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229117_total_time = 0;
    ctx->futhark_mc_segmap_task_229117_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229134_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229134_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229134_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229134_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229134_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229134_total_iter = 0;
    ctx->futhark_mc_segmap_task_229132_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229132_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229132_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229132_total_time = 0;
    ctx->futhark_mc_segmap_task_229132_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229149_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229149_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229149_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229149_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229149_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229149_total_iter = 0;
    ctx->futhark_mc_segmap_task_229147_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229147_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229147_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229147_total_time = 0;
    ctx->futhark_mc_segmap_task_229147_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229158_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229158_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229158_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229158_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229158_total_iter = 0;
    ctx->futhark_mc_segred_task_229151_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229151_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229151_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229151_total_time = 0;
    ctx->futhark_mc_segred_task_229151_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229164_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229164_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229164_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229164_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229164_total_iter = 0;
    ctx->futhark_mc_segred_task_229160_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229160_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229160_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229160_total_time = 0;
    ctx->futhark_mc_segred_task_229160_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229141_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229141_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229141_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229141_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229141_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229141_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229139_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229139_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229139_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229128_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229128_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229128_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229128_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229128_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229128_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229126_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229126_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229126_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229168_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229168_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229168_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229168_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229168_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229168_total_iter = 0;
    ctx->futhark_mc_segmap_task_229166_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229166_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229166_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229166_total_time = 0;
    ctx->futhark_mc_segmap_task_229166_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229177_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229177_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229177_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229177_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229177_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229177_total_iter = 0;
    ctx->futhark_mc_segmap_task_229175_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229175_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229175_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229175_total_time = 0;
    ctx->futhark_mc_segmap_task_229175_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229172_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229172_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229172_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229172_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229172_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229172_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229170_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229170_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229170_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229181_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229181_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229181_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229181_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229181_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229181_total_iter = 0;
    ctx->futhark_mc_segmap_task_229179_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229179_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229179_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229179_total_time = 0;
    ctx->futhark_mc_segmap_task_229179_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229190_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229190_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229190_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229190_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229190_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229190_total_iter = 0;
    ctx->futhark_mc_segmap_task_229188_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229188_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229188_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229188_total_time = 0;
    ctx->futhark_mc_segmap_task_229188_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229185_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229185_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229185_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229185_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229185_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229185_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229183_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229183_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229183_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229194_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229194_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229194_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229194_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229194_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229194_total_iter = 0;
    ctx->futhark_mc_segmap_task_229192_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229192_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229192_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229192_total_time = 0;
    ctx->futhark_mc_segmap_task_229192_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229209_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229209_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229209_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229209_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229209_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229209_total_iter = 0;
    ctx->futhark_mc_segmap_task_229207_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229207_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229207_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229207_total_time = 0;
    ctx->futhark_mc_segmap_task_229207_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229213_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229213_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229213_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229213_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229213_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229213_total_iter = 0;
    ctx->futhark_mc_segmap_task_229211_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229211_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229211_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229211_total_time = 0;
    ctx->futhark_mc_segmap_task_229211_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229217_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229217_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229217_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229217_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229217_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229217_total_iter = 0;
    ctx->futhark_mc_segmap_task_229215_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229215_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229215_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229215_total_time = 0;
    ctx->futhark_mc_segmap_task_229215_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229225_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229225_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229225_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229225_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229225_total_iter = 0;
    ctx->futhark_mc_segred_task_229222_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229222_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229222_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229222_total_time = 0;
    ctx->futhark_mc_segred_task_229222_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229230_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229230_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229230_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229230_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229230_total_iter = 0;
    ctx->futhark_mc_segred_task_229227_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229227_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229227_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229227_total_time = 0;
    ctx->futhark_mc_segred_task_229227_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229220_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229220_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229220_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229220_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229220_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229220_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229218_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229218_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229218_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229201_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229201_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229201_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229201_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229201_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229201_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229199_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229199_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229199_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229234_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229234_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229234_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229234_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229234_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229234_total_iter = 0;
    ctx->futhark_mc_segmap_task_229232_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229232_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229232_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229232_total_time = 0;
    ctx->futhark_mc_segmap_task_229232_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229251_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229251_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229251_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229251_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229251_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229251_total_iter = 0;
    ctx->futhark_mc_segmap_task_229249_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229249_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229249_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229249_total_time = 0;
    ctx->futhark_mc_segmap_task_229249_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229255_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229255_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229255_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229255_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229255_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229255_total_iter = 0;
    ctx->futhark_mc_segmap_task_229253_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229253_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229253_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229253_total_time = 0;
    ctx->futhark_mc_segmap_task_229253_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229259_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229259_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229259_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229259_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229259_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229259_total_iter = 0;
    ctx->futhark_mc_segmap_task_229257_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229257_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229257_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229257_total_time = 0;
    ctx->futhark_mc_segmap_task_229257_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229269_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229269_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229269_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229269_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229269_total_iter = 0;
    ctx->futhark_mc_segred_task_229264_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229264_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229264_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229264_total_time = 0;
    ctx->futhark_mc_segred_task_229264_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229275_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229275_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229275_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229275_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229275_total_iter = 0;
    ctx->futhark_mc_segred_task_229271_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229271_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229271_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229271_total_time = 0;
    ctx->futhark_mc_segred_task_229271_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229262_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229262_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229262_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229262_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229262_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229262_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229260_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229260_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229260_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229242_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229242_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229242_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229242_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229242_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229242_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229240_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229240_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229240_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229279_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229279_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229279_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229279_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229279_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229279_total_iter = 0;
    ctx->futhark_mc_segmap_task_229277_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229277_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229277_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229277_total_time = 0;
    ctx->futhark_mc_segmap_task_229277_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229296_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229296_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229296_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229296_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229296_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229296_total_iter = 0;
    ctx->futhark_mc_segmap_task_229294_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229294_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229294_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229294_total_time = 0;
    ctx->futhark_mc_segmap_task_229294_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229300_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229300_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229300_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229300_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229300_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229300_total_iter = 0;
    ctx->futhark_mc_segmap_task_229298_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229298_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229298_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229298_total_time = 0;
    ctx->futhark_mc_segmap_task_229298_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229304_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229304_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229304_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229304_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229304_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229304_total_iter = 0;
    ctx->futhark_mc_segmap_task_229302_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229302_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229302_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229302_total_time = 0;
    ctx->futhark_mc_segmap_task_229302_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229316_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229316_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229316_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229316_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229316_total_iter = 0;
    ctx->futhark_mc_segred_task_229309_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229309_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229309_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229309_total_time = 0;
    ctx->futhark_mc_segred_task_229309_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229322_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229322_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229322_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229322_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229322_total_iter = 0;
    ctx->futhark_mc_segred_task_229318_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229318_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229318_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229318_total_time = 0;
    ctx->futhark_mc_segred_task_229318_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229307_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229307_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229307_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229307_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229307_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229307_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229305_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229305_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229305_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229287_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229287_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229287_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229287_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229287_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229287_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229285_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229285_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229285_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229326_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229326_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229326_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229326_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229326_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229326_total_iter = 0;
    ctx->futhark_mc_segmap_task_229324_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229324_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229324_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229324_total_time = 0;
    ctx->futhark_mc_segmap_task_229324_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229342_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229342_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229342_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229342_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229342_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229342_total_iter = 0;
    ctx->futhark_mc_segmap_task_229340_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229340_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229340_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229340_total_time = 0;
    ctx->futhark_mc_segmap_task_229340_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229346_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229346_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229346_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229346_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229346_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229346_total_iter = 0;
    ctx->futhark_mc_segmap_task_229344_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229344_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229344_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229344_total_time = 0;
    ctx->futhark_mc_segmap_task_229344_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229350_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229350_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229350_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229350_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229350_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229350_total_iter = 0;
    ctx->futhark_mc_segmap_task_229348_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229348_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229348_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229348_total_time = 0;
    ctx->futhark_mc_segmap_task_229348_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229360_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229360_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229360_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229360_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229360_total_iter = 0;
    ctx->futhark_mc_segred_task_229357_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229357_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229357_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229357_total_time = 0;
    ctx->futhark_mc_segred_task_229357_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229365_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229365_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229365_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229365_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229365_total_iter = 0;
    ctx->futhark_mc_segred_task_229362_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229362_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229362_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229362_total_time = 0;
    ctx->futhark_mc_segred_task_229362_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229354_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229354_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229354_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229354_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229354_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229354_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229352_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229352_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229352_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229334_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229334_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229334_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229334_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229334_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229334_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229332_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229332_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229332_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229369_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229369_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229369_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229369_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229369_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229369_total_iter = 0;
    ctx->futhark_mc_segmap_task_229367_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229367_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229367_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229367_total_time = 0;
    ctx->futhark_mc_segmap_task_229367_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229388_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229388_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229388_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229388_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229388_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229388_total_iter = 0;
    ctx->futhark_mc_segmap_task_229386_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229386_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229386_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229386_total_time = 0;
    ctx->futhark_mc_segmap_task_229386_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229392_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229392_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229392_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229392_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229392_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229392_total_iter = 0;
    ctx->futhark_mc_segmap_task_229390_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229390_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229390_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229390_total_time = 0;
    ctx->futhark_mc_segmap_task_229390_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229396_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229396_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229396_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229396_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229396_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229396_total_iter = 0;
    ctx->futhark_mc_segmap_task_229394_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229394_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229394_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229394_total_time = 0;
    ctx->futhark_mc_segmap_task_229394_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229410_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229410_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229410_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229410_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229410_total_iter = 0;
    ctx->futhark_mc_segred_task_229405_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229405_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229405_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229405_total_time = 0;
    ctx->futhark_mc_segred_task_229405_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229416_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229416_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229416_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229416_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229416_total_iter = 0;
    ctx->futhark_mc_segred_task_229412_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229412_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229412_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229412_total_time = 0;
    ctx->futhark_mc_segred_task_229412_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229401_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229401_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229401_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229401_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229401_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229401_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229399_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229399_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229399_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229379_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229379_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229379_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229379_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229379_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229379_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229377_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229377_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229377_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229420_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229420_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229420_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229420_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229420_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229420_total_iter = 0;
    ctx->futhark_mc_segmap_task_229418_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229418_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229418_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229418_total_time = 0;
    ctx->futhark_mc_segmap_task_229418_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229441_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229441_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229441_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229441_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229441_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229441_total_iter = 0;
    ctx->futhark_mc_segmap_task_229439_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229439_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229439_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229439_total_time = 0;
    ctx->futhark_mc_segmap_task_229439_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229445_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229445_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229445_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229445_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229445_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229445_total_iter = 0;
    ctx->futhark_mc_segmap_task_229443_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229443_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229443_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229443_total_time = 0;
    ctx->futhark_mc_segmap_task_229443_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229449_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229449_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229449_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229449_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229449_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229449_total_iter = 0;
    ctx->futhark_mc_segmap_task_229447_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229447_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229447_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229447_total_time = 0;
    ctx->futhark_mc_segmap_task_229447_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229464_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229464_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229464_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229464_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229464_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229464_total_iter = 0;
    ctx->futhark_mc_segmap_task_229462_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229462_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229462_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229462_total_time = 0;
    ctx->futhark_mc_segmap_task_229462_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229473_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229473_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229473_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229473_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229473_total_iter = 0;
    ctx->futhark_mc_segred_task_229466_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229466_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229466_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229466_total_time = 0;
    ctx->futhark_mc_segred_task_229466_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229479_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229479_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229479_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229479_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229479_total_iter = 0;
    ctx->futhark_mc_segred_task_229475_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229475_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229475_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229475_total_time = 0;
    ctx->futhark_mc_segred_task_229475_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229456_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229456_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229456_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229456_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229456_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229456_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229454_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229454_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229454_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229432_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229432_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229432_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229432_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229432_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229432_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229430_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229430_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229430_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229483_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229483_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229483_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229483_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229483_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229483_total_iter = 0;
    ctx->futhark_mc_segmap_task_229481_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229481_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229481_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229481_total_time = 0;
    ctx->futhark_mc_segmap_task_229481_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229492_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229492_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229492_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229492_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229492_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229492_total_iter = 0;
    ctx->futhark_mc_segmap_task_229490_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229490_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229490_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229490_total_time = 0;
    ctx->futhark_mc_segmap_task_229490_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229487_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229487_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229487_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229487_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229487_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229487_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229485_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229485_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229485_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229496_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229496_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229496_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229496_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229496_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229496_total_iter = 0;
    ctx->futhark_mc_segmap_task_229494_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229494_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229494_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229494_total_time = 0;
    ctx->futhark_mc_segmap_task_229494_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229507_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229507_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229507_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229507_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229507_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229507_total_iter = 0;
    ctx->futhark_mc_segmap_task_229505_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229505_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229505_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229505_total_time = 0;
    ctx->futhark_mc_segmap_task_229505_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229511_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229511_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229511_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229511_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229511_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229511_total_iter = 0;
    ctx->futhark_mc_segmap_task_229509_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229509_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229509_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229509_total_time = 0;
    ctx->futhark_mc_segmap_task_229509_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229501_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229501_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229501_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229501_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229501_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229501_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229499_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229499_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229499_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229515_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229515_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229515_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229515_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229515_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229515_total_iter = 0;
    ctx->futhark_mc_segmap_task_229513_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229513_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229513_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229513_total_time = 0;
    ctx->futhark_mc_segmap_task_229513_total_iter = 0;
    ctx->futhark_mc_scan_stage_1_parloop_229536_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_229536_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_229536_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_1_parloop_229536_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs = 0;
    ctx->futhark_mc_scan_stage_1_parloop_229536_total_iter = 0;
    ctx->futhark_mc_scan_stage_3_parloop_229538_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_229538_runs = calloc(sizeof(int),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_229538_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_scan_stage_3_parloop_229538_total_total_runtime = 0;
    ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs = 0;
    ctx->futhark_mc_scan_stage_3_parloop_229538_total_iter = 0;
    ctx->futhark_mc_segscan_task_229530_total_runtime = calloc(sizeof(int64_t),
                                                               ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_229530_runs = calloc(sizeof(int),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_229530_iter = calloc(sizeof(sizeof(int64_t)),
                                                      ctx->scheduler.num_threads);
    ctx->futhark_mc_segscan_task_229530_total_time = 0;
    ctx->futhark_mc_segscan_task_229530_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229542_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229542_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229542_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229542_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229542_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229542_total_iter = 0;
    ctx->futhark_mc_segmap_task_229540_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229540_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229540_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229540_total_time = 0;
    ctx->futhark_mc_segmap_task_229540_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229523_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229523_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229523_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229523_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229523_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229523_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229521_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229521_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229521_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229546_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229546_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229546_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229546_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229546_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229546_total_iter = 0;
    ctx->futhark_mc_segmap_task_229544_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229544_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229544_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229544_total_time = 0;
    ctx->futhark_mc_segmap_task_229544_total_iter = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229554_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229554_runs = calloc(sizeof(int),
                                                                ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229554_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_stage_1_parloop_229554_total_total_runtime = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs = 0;
    ctx->futhark_mc_segred_stage_1_parloop_229554_total_iter = 0;
    ctx->futhark_mc_segred_task_229551_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229551_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229551_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segred_task_229551_total_time = 0;
    ctx->futhark_mc_segred_task_229551_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229549_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229549_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229549_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229549_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229549_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229549_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229547_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229547_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229547_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229558_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229558_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229558_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229558_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229558_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229558_total_iter = 0;
    ctx->futhark_mc_segmap_task_229556_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229556_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229556_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229556_total_time = 0;
    ctx->futhark_mc_segmap_task_229556_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229567_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229567_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229567_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229567_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229567_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229567_total_iter = 0;
    ctx->futhark_mc_segmap_task_229565_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229565_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229565_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229565_total_time = 0;
    ctx->futhark_mc_segmap_task_229565_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229562_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229562_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229562_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229562_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229562_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229562_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229560_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229560_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229560_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229571_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229571_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229571_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229571_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229571_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229571_total_iter = 0;
    ctx->futhark_mc_segmap_task_229569_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229569_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229569_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229569_total_time = 0;
    ctx->futhark_mc_segmap_task_229569_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229580_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229580_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229580_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229580_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229580_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229580_total_iter = 0;
    ctx->futhark_mc_segmap_task_229578_total_runtime = calloc(sizeof(int64_t),
                                                              ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229578_runs = calloc(sizeof(int),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229578_iter = calloc(sizeof(sizeof(int64_t)),
                                                     ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_task_229578_total_time = 0;
    ctx->futhark_mc_segmap_task_229578_total_iter = 0;
    ctx->futhark_mc_segmap_parloop_229575_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229575_runs = calloc(sizeof(int),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229575_iter = calloc(sizeof(sizeof(int64_t)),
                                                        ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_parloop_229575_total_total_runtime = 0;
    ctx->futhark_mc_segmap_parloop_229575_total_runs = 0;
    ctx->futhark_mc_segmap_parloop_229575_total_iter = 0;
    ctx->futhark_mc_segmap_nested_task_229573_total_runtime =
        calloc(sizeof(int64_t), ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229573_runs = calloc(sizeof(int),
                                                            ctx->scheduler.num_threads);
    ctx->futhark_mc_segmap_nested_task_229573_iter =
        calloc(sizeof(sizeof(int64_t)), ctx->scheduler.num_threads);
    init_constants(ctx);
    return ctx;
}
void futhark_context_free(struct futhark_context *ctx)
{
    free(ctx->futhark_mc_segmap_parloop_228377_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228377_runs);
    free(ctx->futhark_mc_segmap_parloop_228377_iter);
    free(ctx->futhark_mc_segmap_task_228375_total_runtime);
    free(ctx->futhark_mc_segmap_task_228375_runs);
    free(ctx->futhark_mc_segmap_task_228375_iter);
    free(ctx->futhark_mc_scan_stage_1_parloop_228389_total_runtime);
    free(ctx->futhark_mc_scan_stage_1_parloop_228389_runs);
    free(ctx->futhark_mc_scan_stage_1_parloop_228389_iter);
    free(ctx->futhark_mc_scan_stage_3_parloop_228391_total_runtime);
    free(ctx->futhark_mc_scan_stage_3_parloop_228391_runs);
    free(ctx->futhark_mc_scan_stage_3_parloop_228391_iter);
    free(ctx->futhark_mc_segscan_task_228386_total_runtime);
    free(ctx->futhark_mc_segscan_task_228386_runs);
    free(ctx->futhark_mc_segscan_task_228386_iter);
    free(ctx->futhark_mc_segmap_parloop_228395_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228395_runs);
    free(ctx->futhark_mc_segmap_parloop_228395_iter);
    free(ctx->futhark_mc_segmap_task_228393_total_runtime);
    free(ctx->futhark_mc_segmap_task_228393_runs);
    free(ctx->futhark_mc_segmap_task_228393_iter);
    free(ctx->futhark_mc_segmap_parloop_228382_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228382_runs);
    free(ctx->futhark_mc_segmap_parloop_228382_iter);
    free(ctx->futhark_mc_segmap_nested_task_228380_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228380_runs);
    free(ctx->futhark_mc_segmap_nested_task_228380_iter);
    free(ctx->futhark_mc_segmap_parloop_228399_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228399_runs);
    free(ctx->futhark_mc_segmap_parloop_228399_iter);
    free(ctx->futhark_mc_segmap_task_228397_total_runtime);
    free(ctx->futhark_mc_segmap_task_228397_runs);
    free(ctx->futhark_mc_segmap_task_228397_iter);
    free(ctx->futhark_mc_segmap_parloop_228408_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228408_runs);
    free(ctx->futhark_mc_segmap_parloop_228408_iter);
    free(ctx->futhark_mc_segmap_task_228406_total_runtime);
    free(ctx->futhark_mc_segmap_task_228406_runs);
    free(ctx->futhark_mc_segmap_task_228406_iter);
    free(ctx->futhark_mc_segmap_parloop_228417_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228417_runs);
    free(ctx->futhark_mc_segmap_parloop_228417_iter);
    free(ctx->futhark_mc_segmap_task_228415_total_runtime);
    free(ctx->futhark_mc_segmap_task_228415_runs);
    free(ctx->futhark_mc_segmap_task_228415_iter);
    free(ctx->futhark_mc_segmap_parloop_228412_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228412_runs);
    free(ctx->futhark_mc_segmap_parloop_228412_iter);
    free(ctx->futhark_mc_segmap_nested_task_228410_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228410_runs);
    free(ctx->futhark_mc_segmap_nested_task_228410_iter);
    free(ctx->futhark_mc_segmap_parloop_228403_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228403_runs);
    free(ctx->futhark_mc_segmap_parloop_228403_iter);
    free(ctx->futhark_mc_segmap_nested_task_228401_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228401_runs);
    free(ctx->futhark_mc_segmap_nested_task_228401_iter);
    free(ctx->futhark_mc_segmap_parloop_228421_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228421_runs);
    free(ctx->futhark_mc_segmap_parloop_228421_iter);
    free(ctx->futhark_mc_segmap_task_228419_total_runtime);
    free(ctx->futhark_mc_segmap_task_228419_runs);
    free(ctx->futhark_mc_segmap_task_228419_iter);
    free(ctx->futhark_mc_segmap_parloop_228434_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228434_runs);
    free(ctx->futhark_mc_segmap_parloop_228434_iter);
    free(ctx->futhark_mc_segmap_task_228432_total_runtime);
    free(ctx->futhark_mc_segmap_task_228432_runs);
    free(ctx->futhark_mc_segmap_task_228432_iter);
    free(ctx->futhark_mc_scan_stage_1_parloop_228446_total_runtime);
    free(ctx->futhark_mc_scan_stage_1_parloop_228446_runs);
    free(ctx->futhark_mc_scan_stage_1_parloop_228446_iter);
    free(ctx->futhark_mc_scan_stage_3_parloop_228448_total_runtime);
    free(ctx->futhark_mc_scan_stage_3_parloop_228448_runs);
    free(ctx->futhark_mc_scan_stage_3_parloop_228448_iter);
    free(ctx->futhark_mc_segscan_task_228443_total_runtime);
    free(ctx->futhark_mc_segscan_task_228443_runs);
    free(ctx->futhark_mc_segscan_task_228443_iter);
    free(ctx->futhark_mc_segmap_parloop_228452_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228452_runs);
    free(ctx->futhark_mc_segmap_parloop_228452_iter);
    free(ctx->futhark_mc_segmap_task_228450_total_runtime);
    free(ctx->futhark_mc_segmap_task_228450_runs);
    free(ctx->futhark_mc_segmap_task_228450_iter);
    free(ctx->futhark_mc_segmap_parloop_228439_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228439_runs);
    free(ctx->futhark_mc_segmap_parloop_228439_iter);
    free(ctx->futhark_mc_segmap_nested_task_228437_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228437_runs);
    free(ctx->futhark_mc_segmap_nested_task_228437_iter);
    free(ctx->futhark_mc_segmap_parloop_228428_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228428_runs);
    free(ctx->futhark_mc_segmap_parloop_228428_iter);
    free(ctx->futhark_mc_segmap_nested_task_228426_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228426_runs);
    free(ctx->futhark_mc_segmap_nested_task_228426_iter);
    free(ctx->futhark_mc_segmap_parloop_228456_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228456_runs);
    free(ctx->futhark_mc_segmap_parloop_228456_iter);
    free(ctx->futhark_mc_segmap_task_228454_total_runtime);
    free(ctx->futhark_mc_segmap_task_228454_runs);
    free(ctx->futhark_mc_segmap_task_228454_iter);
    free(ctx->futhark_mc_segmap_parloop_228468_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228468_runs);
    free(ctx->futhark_mc_segmap_parloop_228468_iter);
    free(ctx->futhark_mc_segmap_task_228466_total_runtime);
    free(ctx->futhark_mc_segmap_task_228466_runs);
    free(ctx->futhark_mc_segmap_task_228466_iter);
    free(ctx->futhark_mc_segmap_parloop_228481_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228481_runs);
    free(ctx->futhark_mc_segmap_parloop_228481_iter);
    free(ctx->futhark_mc_segmap_task_228479_total_runtime);
    free(ctx->futhark_mc_segmap_task_228479_runs);
    free(ctx->futhark_mc_segmap_task_228479_iter);
    free(ctx->futhark_mc_segmap_parloop_228485_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228485_runs);
    free(ctx->futhark_mc_segmap_parloop_228485_iter);
    free(ctx->futhark_mc_segmap_task_228483_total_runtime);
    free(ctx->futhark_mc_segmap_task_228483_runs);
    free(ctx->futhark_mc_segmap_task_228483_iter);
    free(ctx->futhark_mc_segmap_parloop_228474_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228474_runs);
    free(ctx->futhark_mc_segmap_parloop_228474_iter);
    free(ctx->futhark_mc_segmap_nested_task_228472_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228472_runs);
    free(ctx->futhark_mc_segmap_nested_task_228472_iter);
    free(ctx->futhark_mc_segmap_parloop_228462_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228462_runs);
    free(ctx->futhark_mc_segmap_parloop_228462_iter);
    free(ctx->futhark_mc_segmap_nested_task_228460_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228460_runs);
    free(ctx->futhark_mc_segmap_nested_task_228460_iter);
    free(ctx->futhark_mc_segmap_parloop_228489_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228489_runs);
    free(ctx->futhark_mc_segmap_parloop_228489_iter);
    free(ctx->futhark_mc_segmap_task_228487_total_runtime);
    free(ctx->futhark_mc_segmap_task_228487_runs);
    free(ctx->futhark_mc_segmap_task_228487_iter);
    free(ctx->futhark_mc_segmap_parloop_228502_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228502_runs);
    free(ctx->futhark_mc_segmap_parloop_228502_iter);
    free(ctx->futhark_mc_segmap_task_228500_total_runtime);
    free(ctx->futhark_mc_segmap_task_228500_runs);
    free(ctx->futhark_mc_segmap_task_228500_iter);
    free(ctx->futhark_mc_segmap_parloop_228506_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228506_runs);
    free(ctx->futhark_mc_segmap_parloop_228506_iter);
    free(ctx->futhark_mc_segmap_task_228504_total_runtime);
    free(ctx->futhark_mc_segmap_task_228504_runs);
    free(ctx->futhark_mc_segmap_task_228504_iter);
    free(ctx->futhark_mc_segmap_parloop_228495_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228495_runs);
    free(ctx->futhark_mc_segmap_parloop_228495_iter);
    free(ctx->futhark_mc_segmap_nested_task_228493_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228493_runs);
    free(ctx->futhark_mc_segmap_nested_task_228493_iter);
    free(ctx->futhark_mc_segmap_parloop_228510_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228510_runs);
    free(ctx->futhark_mc_segmap_parloop_228510_iter);
    free(ctx->futhark_mc_segmap_task_228508_total_runtime);
    free(ctx->futhark_mc_segmap_task_228508_runs);
    free(ctx->futhark_mc_segmap_task_228508_iter);
    free(ctx->futhark_mc_segmap_parloop_228523_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228523_runs);
    free(ctx->futhark_mc_segmap_parloop_228523_iter);
    free(ctx->futhark_mc_segmap_task_228521_total_runtime);
    free(ctx->futhark_mc_segmap_task_228521_runs);
    free(ctx->futhark_mc_segmap_task_228521_iter);
    free(ctx->futhark_mc_segmap_parloop_228527_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228527_runs);
    free(ctx->futhark_mc_segmap_parloop_228527_iter);
    free(ctx->futhark_mc_segmap_task_228525_total_runtime);
    free(ctx->futhark_mc_segmap_task_228525_runs);
    free(ctx->futhark_mc_segmap_task_228525_iter);
    free(ctx->futhark_mc_segmap_parloop_228516_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228516_runs);
    free(ctx->futhark_mc_segmap_parloop_228516_iter);
    free(ctx->futhark_mc_segmap_nested_task_228514_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228514_runs);
    free(ctx->futhark_mc_segmap_nested_task_228514_iter);
    free(ctx->futhark_mc_segmap_parloop_228531_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228531_runs);
    free(ctx->futhark_mc_segmap_parloop_228531_iter);
    free(ctx->futhark_mc_segmap_task_228529_total_runtime);
    free(ctx->futhark_mc_segmap_task_228529_runs);
    free(ctx->futhark_mc_segmap_task_228529_iter);
    free(ctx->futhark_mc_segmap_parloop_228540_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228540_runs);
    free(ctx->futhark_mc_segmap_parloop_228540_iter);
    free(ctx->futhark_mc_segmap_task_228538_total_runtime);
    free(ctx->futhark_mc_segmap_task_228538_runs);
    free(ctx->futhark_mc_segmap_task_228538_iter);
    free(ctx->futhark_mc_segmap_parloop_228535_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228535_runs);
    free(ctx->futhark_mc_segmap_parloop_228535_iter);
    free(ctx->futhark_mc_segmap_nested_task_228533_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228533_runs);
    free(ctx->futhark_mc_segmap_nested_task_228533_iter);
    free(ctx->futhark_mc_segmap_parloop_228544_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228544_runs);
    free(ctx->futhark_mc_segmap_parloop_228544_iter);
    free(ctx->futhark_mc_segmap_task_228542_total_runtime);
    free(ctx->futhark_mc_segmap_task_228542_runs);
    free(ctx->futhark_mc_segmap_task_228542_iter);
    free(ctx->futhark_mc_segmap_parloop_228555_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228555_runs);
    free(ctx->futhark_mc_segmap_parloop_228555_iter);
    free(ctx->futhark_mc_segmap_task_228553_total_runtime);
    free(ctx->futhark_mc_segmap_task_228553_runs);
    free(ctx->futhark_mc_segmap_task_228553_iter);
    free(ctx->futhark_mc_segmap_parloop_228566_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228566_runs);
    free(ctx->futhark_mc_segmap_parloop_228566_iter);
    free(ctx->futhark_mc_segmap_task_228564_total_runtime);
    free(ctx->futhark_mc_segmap_task_228564_runs);
    free(ctx->futhark_mc_segmap_task_228564_iter);
    free(ctx->futhark_mc_segmap_parloop_228560_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228560_runs);
    free(ctx->futhark_mc_segmap_parloop_228560_iter);
    free(ctx->futhark_mc_segmap_nested_task_228558_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228558_runs);
    free(ctx->futhark_mc_segmap_nested_task_228558_iter);
    free(ctx->futhark_mc_segmap_parloop_228549_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228549_runs);
    free(ctx->futhark_mc_segmap_parloop_228549_iter);
    free(ctx->futhark_mc_segmap_nested_task_228547_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228547_runs);
    free(ctx->futhark_mc_segmap_nested_task_228547_iter);
    free(ctx->futhark_mc_segmap_parloop_228570_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228570_runs);
    free(ctx->futhark_mc_segmap_parloop_228570_iter);
    free(ctx->futhark_mc_segmap_task_228568_total_runtime);
    free(ctx->futhark_mc_segmap_task_228568_runs);
    free(ctx->futhark_mc_segmap_task_228568_iter);
    free(ctx->futhark_mc_segmap_parloop_228579_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228579_runs);
    free(ctx->futhark_mc_segmap_parloop_228579_iter);
    free(ctx->futhark_mc_segmap_task_228577_total_runtime);
    free(ctx->futhark_mc_segmap_task_228577_runs);
    free(ctx->futhark_mc_segmap_task_228577_iter);
    free(ctx->futhark_mc_segmap_parloop_228588_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228588_runs);
    free(ctx->futhark_mc_segmap_parloop_228588_iter);
    free(ctx->futhark_mc_segmap_task_228586_total_runtime);
    free(ctx->futhark_mc_segmap_task_228586_runs);
    free(ctx->futhark_mc_segmap_task_228586_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228596_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228596_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228596_iter);
    free(ctx->futhark_mc_segred_task_228593_total_runtime);
    free(ctx->futhark_mc_segred_task_228593_runs);
    free(ctx->futhark_mc_segred_task_228593_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228601_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228601_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228601_iter);
    free(ctx->futhark_mc_segred_task_228598_total_runtime);
    free(ctx->futhark_mc_segred_task_228598_runs);
    free(ctx->futhark_mc_segred_task_228598_iter);
    free(ctx->futhark_mc_segmap_parloop_228591_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228591_runs);
    free(ctx->futhark_mc_segmap_parloop_228591_iter);
    free(ctx->futhark_mc_segmap_nested_task_228589_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228589_runs);
    free(ctx->futhark_mc_segmap_nested_task_228589_iter);
    free(ctx->futhark_mc_segmap_parloop_228583_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228583_runs);
    free(ctx->futhark_mc_segmap_parloop_228583_iter);
    free(ctx->futhark_mc_segmap_nested_task_228581_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228581_runs);
    free(ctx->futhark_mc_segmap_nested_task_228581_iter);
    free(ctx->futhark_mc_segmap_parloop_228574_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228574_runs);
    free(ctx->futhark_mc_segmap_parloop_228574_iter);
    free(ctx->futhark_mc_segmap_nested_task_228572_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228572_runs);
    free(ctx->futhark_mc_segmap_nested_task_228572_iter);
    free(ctx->futhark_mc_segmap_parloop_228605_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228605_runs);
    free(ctx->futhark_mc_segmap_parloop_228605_iter);
    free(ctx->futhark_mc_segmap_task_228603_total_runtime);
    free(ctx->futhark_mc_segmap_task_228603_runs);
    free(ctx->futhark_mc_segmap_task_228603_iter);
    free(ctx->futhark_mc_segmap_parloop_228616_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228616_runs);
    free(ctx->futhark_mc_segmap_parloop_228616_iter);
    free(ctx->futhark_mc_segmap_task_228614_total_runtime);
    free(ctx->futhark_mc_segmap_task_228614_runs);
    free(ctx->futhark_mc_segmap_task_228614_iter);
    free(ctx->futhark_mc_segmap_parloop_228627_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228627_runs);
    free(ctx->futhark_mc_segmap_parloop_228627_iter);
    free(ctx->futhark_mc_segmap_task_228625_total_runtime);
    free(ctx->futhark_mc_segmap_task_228625_runs);
    free(ctx->futhark_mc_segmap_task_228625_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228637_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228637_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228637_iter);
    free(ctx->futhark_mc_segred_task_228632_total_runtime);
    free(ctx->futhark_mc_segred_task_228632_runs);
    free(ctx->futhark_mc_segred_task_228632_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228643_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228643_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228643_iter);
    free(ctx->futhark_mc_segred_task_228639_total_runtime);
    free(ctx->futhark_mc_segred_task_228639_runs);
    free(ctx->futhark_mc_segred_task_228639_iter);
    free(ctx->futhark_mc_segmap_parloop_228630_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228630_runs);
    free(ctx->futhark_mc_segmap_parloop_228630_iter);
    free(ctx->futhark_mc_segmap_nested_task_228628_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228628_runs);
    free(ctx->futhark_mc_segmap_nested_task_228628_iter);
    free(ctx->futhark_mc_segmap_parloop_228621_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228621_runs);
    free(ctx->futhark_mc_segmap_parloop_228621_iter);
    free(ctx->futhark_mc_segmap_nested_task_228619_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228619_runs);
    free(ctx->futhark_mc_segmap_nested_task_228619_iter);
    free(ctx->futhark_mc_segmap_parloop_228610_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228610_runs);
    free(ctx->futhark_mc_segmap_parloop_228610_iter);
    free(ctx->futhark_mc_segmap_nested_task_228608_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228608_runs);
    free(ctx->futhark_mc_segmap_nested_task_228608_iter);
    free(ctx->futhark_mc_segmap_parloop_228647_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228647_runs);
    free(ctx->futhark_mc_segmap_parloop_228647_iter);
    free(ctx->futhark_mc_segmap_task_228645_total_runtime);
    free(ctx->futhark_mc_segmap_task_228645_runs);
    free(ctx->futhark_mc_segmap_task_228645_iter);
    free(ctx->futhark_mc_segmap_parloop_228658_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228658_runs);
    free(ctx->futhark_mc_segmap_parloop_228658_iter);
    free(ctx->futhark_mc_segmap_task_228656_total_runtime);
    free(ctx->futhark_mc_segmap_task_228656_runs);
    free(ctx->futhark_mc_segmap_task_228656_iter);
    free(ctx->futhark_mc_segmap_parloop_228669_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228669_runs);
    free(ctx->futhark_mc_segmap_parloop_228669_iter);
    free(ctx->futhark_mc_segmap_task_228667_total_runtime);
    free(ctx->futhark_mc_segmap_task_228667_runs);
    free(ctx->futhark_mc_segmap_task_228667_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228681_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228681_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228681_iter);
    free(ctx->futhark_mc_segred_task_228674_total_runtime);
    free(ctx->futhark_mc_segred_task_228674_runs);
    free(ctx->futhark_mc_segred_task_228674_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228687_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228687_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228687_iter);
    free(ctx->futhark_mc_segred_task_228683_total_runtime);
    free(ctx->futhark_mc_segred_task_228683_runs);
    free(ctx->futhark_mc_segred_task_228683_iter);
    free(ctx->futhark_mc_segmap_parloop_228672_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228672_runs);
    free(ctx->futhark_mc_segmap_parloop_228672_iter);
    free(ctx->futhark_mc_segmap_nested_task_228670_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228670_runs);
    free(ctx->futhark_mc_segmap_nested_task_228670_iter);
    free(ctx->futhark_mc_segmap_parloop_228663_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228663_runs);
    free(ctx->futhark_mc_segmap_parloop_228663_iter);
    free(ctx->futhark_mc_segmap_nested_task_228661_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228661_runs);
    free(ctx->futhark_mc_segmap_nested_task_228661_iter);
    free(ctx->futhark_mc_segmap_parloop_228652_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228652_runs);
    free(ctx->futhark_mc_segmap_parloop_228652_iter);
    free(ctx->futhark_mc_segmap_nested_task_228650_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228650_runs);
    free(ctx->futhark_mc_segmap_nested_task_228650_iter);
    free(ctx->futhark_mc_segmap_parloop_228691_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228691_runs);
    free(ctx->futhark_mc_segmap_parloop_228691_iter);
    free(ctx->futhark_mc_segmap_task_228689_total_runtime);
    free(ctx->futhark_mc_segmap_task_228689_runs);
    free(ctx->futhark_mc_segmap_task_228689_iter);
    free(ctx->futhark_mc_segmap_parloop_228701_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228701_runs);
    free(ctx->futhark_mc_segmap_parloop_228701_iter);
    free(ctx->futhark_mc_segmap_task_228699_total_runtime);
    free(ctx->futhark_mc_segmap_task_228699_runs);
    free(ctx->futhark_mc_segmap_task_228699_iter);
    free(ctx->futhark_mc_segmap_parloop_228711_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228711_runs);
    free(ctx->futhark_mc_segmap_parloop_228711_iter);
    free(ctx->futhark_mc_segmap_task_228709_total_runtime);
    free(ctx->futhark_mc_segmap_task_228709_runs);
    free(ctx->futhark_mc_segmap_task_228709_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228721_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228721_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228721_iter);
    free(ctx->futhark_mc_segred_task_228718_total_runtime);
    free(ctx->futhark_mc_segred_task_228718_runs);
    free(ctx->futhark_mc_segred_task_228718_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228726_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228726_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228726_iter);
    free(ctx->futhark_mc_segred_task_228723_total_runtime);
    free(ctx->futhark_mc_segred_task_228723_runs);
    free(ctx->futhark_mc_segred_task_228723_iter);
    free(ctx->futhark_mc_segmap_parloop_228715_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228715_runs);
    free(ctx->futhark_mc_segmap_parloop_228715_iter);
    free(ctx->futhark_mc_segmap_nested_task_228713_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228713_runs);
    free(ctx->futhark_mc_segmap_nested_task_228713_iter);
    free(ctx->futhark_mc_segmap_parloop_228706_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228706_runs);
    free(ctx->futhark_mc_segmap_parloop_228706_iter);
    free(ctx->futhark_mc_segmap_nested_task_228704_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228704_runs);
    free(ctx->futhark_mc_segmap_nested_task_228704_iter);
    free(ctx->futhark_mc_segmap_parloop_228696_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228696_runs);
    free(ctx->futhark_mc_segmap_parloop_228696_iter);
    free(ctx->futhark_mc_segmap_nested_task_228694_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228694_runs);
    free(ctx->futhark_mc_segmap_nested_task_228694_iter);
    free(ctx->futhark_mc_segmap_parloop_228730_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228730_runs);
    free(ctx->futhark_mc_segmap_parloop_228730_iter);
    free(ctx->futhark_mc_segmap_task_228728_total_runtime);
    free(ctx->futhark_mc_segmap_task_228728_runs);
    free(ctx->futhark_mc_segmap_task_228728_iter);
    free(ctx->futhark_mc_segmap_parloop_228743_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228743_runs);
    free(ctx->futhark_mc_segmap_parloop_228743_iter);
    free(ctx->futhark_mc_segmap_task_228741_total_runtime);
    free(ctx->futhark_mc_segmap_task_228741_runs);
    free(ctx->futhark_mc_segmap_task_228741_iter);
    free(ctx->futhark_mc_segmap_parloop_228756_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228756_runs);
    free(ctx->futhark_mc_segmap_parloop_228756_iter);
    free(ctx->futhark_mc_segmap_task_228754_total_runtime);
    free(ctx->futhark_mc_segmap_task_228754_runs);
    free(ctx->futhark_mc_segmap_task_228754_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228770_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228770_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228770_iter);
    free(ctx->futhark_mc_segred_task_228765_total_runtime);
    free(ctx->futhark_mc_segred_task_228765_runs);
    free(ctx->futhark_mc_segred_task_228765_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228776_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228776_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228776_iter);
    free(ctx->futhark_mc_segred_task_228772_total_runtime);
    free(ctx->futhark_mc_segred_task_228772_runs);
    free(ctx->futhark_mc_segred_task_228772_iter);
    free(ctx->futhark_mc_segmap_parloop_228761_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228761_runs);
    free(ctx->futhark_mc_segmap_parloop_228761_iter);
    free(ctx->futhark_mc_segmap_nested_task_228759_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228759_runs);
    free(ctx->futhark_mc_segmap_nested_task_228759_iter);
    free(ctx->futhark_mc_segmap_parloop_228750_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228750_runs);
    free(ctx->futhark_mc_segmap_parloop_228750_iter);
    free(ctx->futhark_mc_segmap_nested_task_228748_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228748_runs);
    free(ctx->futhark_mc_segmap_nested_task_228748_iter);
    free(ctx->futhark_mc_segmap_parloop_228737_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228737_runs);
    free(ctx->futhark_mc_segmap_parloop_228737_iter);
    free(ctx->futhark_mc_segmap_nested_task_228735_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228735_runs);
    free(ctx->futhark_mc_segmap_nested_task_228735_iter);
    free(ctx->futhark_mc_segmap_parloop_228780_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228780_runs);
    free(ctx->futhark_mc_segmap_parloop_228780_iter);
    free(ctx->futhark_mc_segmap_task_228778_total_runtime);
    free(ctx->futhark_mc_segmap_task_228778_runs);
    free(ctx->futhark_mc_segmap_task_228778_iter);
    free(ctx->futhark_mc_segmap_parloop_228795_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228795_runs);
    free(ctx->futhark_mc_segmap_parloop_228795_iter);
    free(ctx->futhark_mc_segmap_task_228793_total_runtime);
    free(ctx->futhark_mc_segmap_task_228793_runs);
    free(ctx->futhark_mc_segmap_task_228793_iter);
    free(ctx->futhark_mc_segmap_parloop_228810_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228810_runs);
    free(ctx->futhark_mc_segmap_parloop_228810_iter);
    free(ctx->futhark_mc_segmap_task_228808_total_runtime);
    free(ctx->futhark_mc_segmap_task_228808_runs);
    free(ctx->futhark_mc_segmap_task_228808_iter);
    free(ctx->futhark_mc_segmap_parloop_228825_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228825_runs);
    free(ctx->futhark_mc_segmap_parloop_228825_iter);
    free(ctx->futhark_mc_segmap_task_228823_total_runtime);
    free(ctx->futhark_mc_segmap_task_228823_runs);
    free(ctx->futhark_mc_segmap_task_228823_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228834_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228834_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228834_iter);
    free(ctx->futhark_mc_segred_task_228827_total_runtime);
    free(ctx->futhark_mc_segred_task_228827_runs);
    free(ctx->futhark_mc_segred_task_228827_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228840_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228840_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228840_iter);
    free(ctx->futhark_mc_segred_task_228836_total_runtime);
    free(ctx->futhark_mc_segred_task_228836_runs);
    free(ctx->futhark_mc_segred_task_228836_iter);
    free(ctx->futhark_mc_segmap_parloop_228817_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228817_runs);
    free(ctx->futhark_mc_segmap_parloop_228817_iter);
    free(ctx->futhark_mc_segmap_nested_task_228815_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228815_runs);
    free(ctx->futhark_mc_segmap_nested_task_228815_iter);
    free(ctx->futhark_mc_segmap_parloop_228804_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228804_runs);
    free(ctx->futhark_mc_segmap_parloop_228804_iter);
    free(ctx->futhark_mc_segmap_nested_task_228802_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228802_runs);
    free(ctx->futhark_mc_segmap_nested_task_228802_iter);
    free(ctx->futhark_mc_segmap_parloop_228789_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228789_runs);
    free(ctx->futhark_mc_segmap_parloop_228789_iter);
    free(ctx->futhark_mc_segmap_nested_task_228787_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228787_runs);
    free(ctx->futhark_mc_segmap_nested_task_228787_iter);
    free(ctx->futhark_mc_segmap_parloop_228844_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228844_runs);
    free(ctx->futhark_mc_segmap_parloop_228844_iter);
    free(ctx->futhark_mc_segmap_task_228842_total_runtime);
    free(ctx->futhark_mc_segmap_task_228842_runs);
    free(ctx->futhark_mc_segmap_task_228842_iter);
    free(ctx->futhark_mc_segmap_parloop_228853_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228853_runs);
    free(ctx->futhark_mc_segmap_parloop_228853_iter);
    free(ctx->futhark_mc_segmap_task_228851_total_runtime);
    free(ctx->futhark_mc_segmap_task_228851_runs);
    free(ctx->futhark_mc_segmap_task_228851_iter);
    free(ctx->futhark_mc_segmap_parloop_228862_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228862_runs);
    free(ctx->futhark_mc_segmap_parloop_228862_iter);
    free(ctx->futhark_mc_segmap_task_228860_total_runtime);
    free(ctx->futhark_mc_segmap_task_228860_runs);
    free(ctx->futhark_mc_segmap_task_228860_iter);
    free(ctx->futhark_mc_segmap_parloop_228857_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228857_runs);
    free(ctx->futhark_mc_segmap_parloop_228857_iter);
    free(ctx->futhark_mc_segmap_nested_task_228855_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228855_runs);
    free(ctx->futhark_mc_segmap_nested_task_228855_iter);
    free(ctx->futhark_mc_segmap_parloop_228848_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228848_runs);
    free(ctx->futhark_mc_segmap_parloop_228848_iter);
    free(ctx->futhark_mc_segmap_nested_task_228846_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228846_runs);
    free(ctx->futhark_mc_segmap_nested_task_228846_iter);
    free(ctx->futhark_mc_segmap_parloop_228866_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228866_runs);
    free(ctx->futhark_mc_segmap_parloop_228866_iter);
    free(ctx->futhark_mc_segmap_task_228864_total_runtime);
    free(ctx->futhark_mc_segmap_task_228864_runs);
    free(ctx->futhark_mc_segmap_task_228864_iter);
    free(ctx->futhark_mc_segmap_parloop_228875_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228875_runs);
    free(ctx->futhark_mc_segmap_parloop_228875_iter);
    free(ctx->futhark_mc_segmap_task_228873_total_runtime);
    free(ctx->futhark_mc_segmap_task_228873_runs);
    free(ctx->futhark_mc_segmap_task_228873_iter);
    free(ctx->futhark_mc_segmap_parloop_228870_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228870_runs);
    free(ctx->futhark_mc_segmap_parloop_228870_iter);
    free(ctx->futhark_mc_segmap_nested_task_228868_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228868_runs);
    free(ctx->futhark_mc_segmap_nested_task_228868_iter);
    free(ctx->futhark_mc_segmap_parloop_228879_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228879_runs);
    free(ctx->futhark_mc_segmap_parloop_228879_iter);
    free(ctx->futhark_mc_segmap_task_228877_total_runtime);
    free(ctx->futhark_mc_segmap_task_228877_runs);
    free(ctx->futhark_mc_segmap_task_228877_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228887_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228887_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228887_iter);
    free(ctx->futhark_mc_segred_task_228884_total_runtime);
    free(ctx->futhark_mc_segred_task_228884_runs);
    free(ctx->futhark_mc_segred_task_228884_iter);
    free(ctx->futhark_mc_segmap_parloop_228882_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228882_runs);
    free(ctx->futhark_mc_segmap_parloop_228882_iter);
    free(ctx->futhark_mc_segmap_nested_task_228880_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228880_runs);
    free(ctx->futhark_mc_segmap_nested_task_228880_iter);
    free(ctx->futhark_mc_segmap_parloop_228891_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228891_runs);
    free(ctx->futhark_mc_segmap_parloop_228891_iter);
    free(ctx->futhark_mc_segmap_task_228889_total_runtime);
    free(ctx->futhark_mc_segmap_task_228889_runs);
    free(ctx->futhark_mc_segmap_task_228889_iter);
    free(ctx->futhark_mc_scan_stage_1_parloop_228901_total_runtime);
    free(ctx->futhark_mc_scan_stage_1_parloop_228901_runs);
    free(ctx->futhark_mc_scan_stage_1_parloop_228901_iter);
    free(ctx->futhark_mc_scan_stage_3_parloop_228903_total_runtime);
    free(ctx->futhark_mc_scan_stage_3_parloop_228903_runs);
    free(ctx->futhark_mc_scan_stage_3_parloop_228903_iter);
    free(ctx->futhark_mc_segscan_task_228898_total_runtime);
    free(ctx->futhark_mc_segscan_task_228898_runs);
    free(ctx->futhark_mc_segscan_task_228898_iter);
    free(ctx->futhark_mc_segmap_parloop_228895_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228895_runs);
    free(ctx->futhark_mc_segmap_parloop_228895_iter);
    free(ctx->futhark_mc_segmap_nested_task_228893_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228893_runs);
    free(ctx->futhark_mc_segmap_nested_task_228893_iter);
    free(ctx->futhark_mc_segmap_parloop_228907_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228907_runs);
    free(ctx->futhark_mc_segmap_parloop_228907_iter);
    free(ctx->futhark_mc_segmap_task_228905_total_runtime);
    free(ctx->futhark_mc_segmap_task_228905_runs);
    free(ctx->futhark_mc_segmap_task_228905_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228915_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228915_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228915_iter);
    free(ctx->futhark_mc_segred_task_228912_total_runtime);
    free(ctx->futhark_mc_segred_task_228912_runs);
    free(ctx->futhark_mc_segred_task_228912_iter);
    free(ctx->futhark_mc_segmap_parloop_228910_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228910_runs);
    free(ctx->futhark_mc_segmap_parloop_228910_iter);
    free(ctx->futhark_mc_segmap_nested_task_228908_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228908_runs);
    free(ctx->futhark_mc_segmap_nested_task_228908_iter);
    free(ctx->futhark_mc_segmap_parloop_228919_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228919_runs);
    free(ctx->futhark_mc_segmap_parloop_228919_iter);
    free(ctx->futhark_mc_segmap_task_228917_total_runtime);
    free(ctx->futhark_mc_segmap_task_228917_runs);
    free(ctx->futhark_mc_segmap_task_228917_iter);
    free(ctx->futhark_mc_scan_stage_1_parloop_228929_total_runtime);
    free(ctx->futhark_mc_scan_stage_1_parloop_228929_runs);
    free(ctx->futhark_mc_scan_stage_1_parloop_228929_iter);
    free(ctx->futhark_mc_scan_stage_3_parloop_228931_total_runtime);
    free(ctx->futhark_mc_scan_stage_3_parloop_228931_runs);
    free(ctx->futhark_mc_scan_stage_3_parloop_228931_iter);
    free(ctx->futhark_mc_segscan_task_228926_total_runtime);
    free(ctx->futhark_mc_segscan_task_228926_runs);
    free(ctx->futhark_mc_segscan_task_228926_iter);
    free(ctx->futhark_mc_segmap_parloop_228923_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228923_runs);
    free(ctx->futhark_mc_segmap_parloop_228923_iter);
    free(ctx->futhark_mc_segmap_nested_task_228921_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228921_runs);
    free(ctx->futhark_mc_segmap_nested_task_228921_iter);
    free(ctx->futhark_mc_segmap_parloop_228935_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228935_runs);
    free(ctx->futhark_mc_segmap_parloop_228935_iter);
    free(ctx->futhark_mc_segmap_task_228933_total_runtime);
    free(ctx->futhark_mc_segmap_task_228933_runs);
    free(ctx->futhark_mc_segmap_task_228933_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228943_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228943_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228943_iter);
    free(ctx->futhark_mc_segred_task_228940_total_runtime);
    free(ctx->futhark_mc_segred_task_228940_runs);
    free(ctx->futhark_mc_segred_task_228940_iter);
    free(ctx->futhark_mc_segmap_parloop_228938_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228938_runs);
    free(ctx->futhark_mc_segmap_parloop_228938_iter);
    free(ctx->futhark_mc_segmap_nested_task_228936_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228936_runs);
    free(ctx->futhark_mc_segmap_nested_task_228936_iter);
    free(ctx->futhark_mc_segmap_parloop_228947_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228947_runs);
    free(ctx->futhark_mc_segmap_parloop_228947_iter);
    free(ctx->futhark_mc_segmap_task_228945_total_runtime);
    free(ctx->futhark_mc_segmap_task_228945_runs);
    free(ctx->futhark_mc_segmap_task_228945_iter);
    free(ctx->futhark_mc_scan_stage_1_parloop_228957_total_runtime);
    free(ctx->futhark_mc_scan_stage_1_parloop_228957_runs);
    free(ctx->futhark_mc_scan_stage_1_parloop_228957_iter);
    free(ctx->futhark_mc_scan_stage_3_parloop_228959_total_runtime);
    free(ctx->futhark_mc_scan_stage_3_parloop_228959_runs);
    free(ctx->futhark_mc_scan_stage_3_parloop_228959_iter);
    free(ctx->futhark_mc_segscan_task_228954_total_runtime);
    free(ctx->futhark_mc_segscan_task_228954_runs);
    free(ctx->futhark_mc_segscan_task_228954_iter);
    free(ctx->futhark_mc_segmap_parloop_228951_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228951_runs);
    free(ctx->futhark_mc_segmap_parloop_228951_iter);
    free(ctx->futhark_mc_segmap_nested_task_228949_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228949_runs);
    free(ctx->futhark_mc_segmap_nested_task_228949_iter);
    free(ctx->futhark_mc_segmap_parloop_228963_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228963_runs);
    free(ctx->futhark_mc_segmap_parloop_228963_iter);
    free(ctx->futhark_mc_segmap_task_228961_total_runtime);
    free(ctx->futhark_mc_segmap_task_228961_runs);
    free(ctx->futhark_mc_segmap_task_228961_iter);
    free(ctx->futhark_mc_segmap_parloop_228972_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228972_runs);
    free(ctx->futhark_mc_segmap_parloop_228972_iter);
    free(ctx->futhark_mc_segmap_task_228970_total_runtime);
    free(ctx->futhark_mc_segmap_task_228970_runs);
    free(ctx->futhark_mc_segmap_task_228970_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228980_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228980_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228980_iter);
    free(ctx->futhark_mc_segred_task_228977_total_runtime);
    free(ctx->futhark_mc_segred_task_228977_runs);
    free(ctx->futhark_mc_segred_task_228977_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_228985_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_228985_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_228985_iter);
    free(ctx->futhark_mc_segred_task_228982_total_runtime);
    free(ctx->futhark_mc_segred_task_228982_runs);
    free(ctx->futhark_mc_segred_task_228982_iter);
    free(ctx->futhark_mc_segmap_parloop_228975_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228975_runs);
    free(ctx->futhark_mc_segmap_parloop_228975_iter);
    free(ctx->futhark_mc_segmap_nested_task_228973_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228973_runs);
    free(ctx->futhark_mc_segmap_nested_task_228973_iter);
    free(ctx->futhark_mc_segmap_parloop_228967_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228967_runs);
    free(ctx->futhark_mc_segmap_parloop_228967_iter);
    free(ctx->futhark_mc_segmap_nested_task_228965_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228965_runs);
    free(ctx->futhark_mc_segmap_nested_task_228965_iter);
    free(ctx->futhark_mc_segmap_parloop_228989_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228989_runs);
    free(ctx->futhark_mc_segmap_parloop_228989_iter);
    free(ctx->futhark_mc_segmap_task_228987_total_runtime);
    free(ctx->futhark_mc_segmap_task_228987_runs);
    free(ctx->futhark_mc_segmap_task_228987_iter);
    free(ctx->futhark_mc_segmap_parloop_229000_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229000_runs);
    free(ctx->futhark_mc_segmap_parloop_229000_iter);
    free(ctx->futhark_mc_segmap_task_228998_total_runtime);
    free(ctx->futhark_mc_segmap_task_228998_runs);
    free(ctx->futhark_mc_segmap_task_228998_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229010_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229010_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229010_iter);
    free(ctx->futhark_mc_segred_task_229005_total_runtime);
    free(ctx->futhark_mc_segred_task_229005_runs);
    free(ctx->futhark_mc_segred_task_229005_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229016_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229016_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229016_iter);
    free(ctx->futhark_mc_segred_task_229012_total_runtime);
    free(ctx->futhark_mc_segred_task_229012_runs);
    free(ctx->futhark_mc_segred_task_229012_iter);
    free(ctx->futhark_mc_segmap_parloop_229003_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229003_runs);
    free(ctx->futhark_mc_segmap_parloop_229003_iter);
    free(ctx->futhark_mc_segmap_nested_task_229001_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229001_runs);
    free(ctx->futhark_mc_segmap_nested_task_229001_iter);
    free(ctx->futhark_mc_segmap_parloop_228994_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_228994_runs);
    free(ctx->futhark_mc_segmap_parloop_228994_iter);
    free(ctx->futhark_mc_segmap_nested_task_228992_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_228992_runs);
    free(ctx->futhark_mc_segmap_nested_task_228992_iter);
    free(ctx->futhark_mc_segmap_parloop_229020_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229020_runs);
    free(ctx->futhark_mc_segmap_parloop_229020_iter);
    free(ctx->futhark_mc_segmap_task_229018_total_runtime);
    free(ctx->futhark_mc_segmap_task_229018_runs);
    free(ctx->futhark_mc_segmap_task_229018_iter);
    free(ctx->futhark_mc_segmap_parloop_229031_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229031_runs);
    free(ctx->futhark_mc_segmap_parloop_229031_iter);
    free(ctx->futhark_mc_segmap_task_229029_total_runtime);
    free(ctx->futhark_mc_segmap_task_229029_runs);
    free(ctx->futhark_mc_segmap_task_229029_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229043_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229043_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229043_iter);
    free(ctx->futhark_mc_segred_task_229036_total_runtime);
    free(ctx->futhark_mc_segred_task_229036_runs);
    free(ctx->futhark_mc_segred_task_229036_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229049_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229049_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229049_iter);
    free(ctx->futhark_mc_segred_task_229045_total_runtime);
    free(ctx->futhark_mc_segred_task_229045_runs);
    free(ctx->futhark_mc_segred_task_229045_iter);
    free(ctx->futhark_mc_segmap_parloop_229034_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229034_runs);
    free(ctx->futhark_mc_segmap_parloop_229034_iter);
    free(ctx->futhark_mc_segmap_nested_task_229032_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229032_runs);
    free(ctx->futhark_mc_segmap_nested_task_229032_iter);
    free(ctx->futhark_mc_segmap_parloop_229025_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229025_runs);
    free(ctx->futhark_mc_segmap_parloop_229025_iter);
    free(ctx->futhark_mc_segmap_nested_task_229023_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229023_runs);
    free(ctx->futhark_mc_segmap_nested_task_229023_iter);
    free(ctx->futhark_mc_segmap_parloop_229053_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229053_runs);
    free(ctx->futhark_mc_segmap_parloop_229053_iter);
    free(ctx->futhark_mc_segmap_task_229051_total_runtime);
    free(ctx->futhark_mc_segmap_task_229051_runs);
    free(ctx->futhark_mc_segmap_task_229051_iter);
    free(ctx->futhark_mc_segmap_parloop_229063_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229063_runs);
    free(ctx->futhark_mc_segmap_parloop_229063_iter);
    free(ctx->futhark_mc_segmap_task_229061_total_runtime);
    free(ctx->futhark_mc_segmap_task_229061_runs);
    free(ctx->futhark_mc_segmap_task_229061_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229073_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229073_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229073_iter);
    free(ctx->futhark_mc_segred_task_229070_total_runtime);
    free(ctx->futhark_mc_segred_task_229070_runs);
    free(ctx->futhark_mc_segred_task_229070_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229078_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229078_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229078_iter);
    free(ctx->futhark_mc_segred_task_229075_total_runtime);
    free(ctx->futhark_mc_segred_task_229075_runs);
    free(ctx->futhark_mc_segred_task_229075_iter);
    free(ctx->futhark_mc_segmap_parloop_229067_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229067_runs);
    free(ctx->futhark_mc_segmap_parloop_229067_iter);
    free(ctx->futhark_mc_segmap_nested_task_229065_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229065_runs);
    free(ctx->futhark_mc_segmap_nested_task_229065_iter);
    free(ctx->futhark_mc_segmap_parloop_229058_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229058_runs);
    free(ctx->futhark_mc_segmap_parloop_229058_iter);
    free(ctx->futhark_mc_segmap_nested_task_229056_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229056_runs);
    free(ctx->futhark_mc_segmap_nested_task_229056_iter);
    free(ctx->futhark_mc_segmap_parloop_229082_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229082_runs);
    free(ctx->futhark_mc_segmap_parloop_229082_iter);
    free(ctx->futhark_mc_segmap_task_229080_total_runtime);
    free(ctx->futhark_mc_segmap_task_229080_runs);
    free(ctx->futhark_mc_segmap_task_229080_iter);
    free(ctx->futhark_mc_segmap_parloop_229095_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229095_runs);
    free(ctx->futhark_mc_segmap_parloop_229095_iter);
    free(ctx->futhark_mc_segmap_task_229093_total_runtime);
    free(ctx->futhark_mc_segmap_task_229093_runs);
    free(ctx->futhark_mc_segmap_task_229093_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229109_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229109_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229109_iter);
    free(ctx->futhark_mc_segred_task_229104_total_runtime);
    free(ctx->futhark_mc_segred_task_229104_runs);
    free(ctx->futhark_mc_segred_task_229104_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229115_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229115_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229115_iter);
    free(ctx->futhark_mc_segred_task_229111_total_runtime);
    free(ctx->futhark_mc_segred_task_229111_runs);
    free(ctx->futhark_mc_segred_task_229111_iter);
    free(ctx->futhark_mc_segmap_parloop_229100_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229100_runs);
    free(ctx->futhark_mc_segmap_parloop_229100_iter);
    free(ctx->futhark_mc_segmap_nested_task_229098_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229098_runs);
    free(ctx->futhark_mc_segmap_nested_task_229098_iter);
    free(ctx->futhark_mc_segmap_parloop_229089_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229089_runs);
    free(ctx->futhark_mc_segmap_parloop_229089_iter);
    free(ctx->futhark_mc_segmap_nested_task_229087_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229087_runs);
    free(ctx->futhark_mc_segmap_nested_task_229087_iter);
    free(ctx->futhark_mc_segmap_parloop_229119_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229119_runs);
    free(ctx->futhark_mc_segmap_parloop_229119_iter);
    free(ctx->futhark_mc_segmap_task_229117_total_runtime);
    free(ctx->futhark_mc_segmap_task_229117_runs);
    free(ctx->futhark_mc_segmap_task_229117_iter);
    free(ctx->futhark_mc_segmap_parloop_229134_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229134_runs);
    free(ctx->futhark_mc_segmap_parloop_229134_iter);
    free(ctx->futhark_mc_segmap_task_229132_total_runtime);
    free(ctx->futhark_mc_segmap_task_229132_runs);
    free(ctx->futhark_mc_segmap_task_229132_iter);
    free(ctx->futhark_mc_segmap_parloop_229149_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229149_runs);
    free(ctx->futhark_mc_segmap_parloop_229149_iter);
    free(ctx->futhark_mc_segmap_task_229147_total_runtime);
    free(ctx->futhark_mc_segmap_task_229147_runs);
    free(ctx->futhark_mc_segmap_task_229147_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229158_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229158_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229158_iter);
    free(ctx->futhark_mc_segred_task_229151_total_runtime);
    free(ctx->futhark_mc_segred_task_229151_runs);
    free(ctx->futhark_mc_segred_task_229151_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229164_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229164_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229164_iter);
    free(ctx->futhark_mc_segred_task_229160_total_runtime);
    free(ctx->futhark_mc_segred_task_229160_runs);
    free(ctx->futhark_mc_segred_task_229160_iter);
    free(ctx->futhark_mc_segmap_parloop_229141_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229141_runs);
    free(ctx->futhark_mc_segmap_parloop_229141_iter);
    free(ctx->futhark_mc_segmap_nested_task_229139_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229139_runs);
    free(ctx->futhark_mc_segmap_nested_task_229139_iter);
    free(ctx->futhark_mc_segmap_parloop_229128_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229128_runs);
    free(ctx->futhark_mc_segmap_parloop_229128_iter);
    free(ctx->futhark_mc_segmap_nested_task_229126_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229126_runs);
    free(ctx->futhark_mc_segmap_nested_task_229126_iter);
    free(ctx->futhark_mc_segmap_parloop_229168_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229168_runs);
    free(ctx->futhark_mc_segmap_parloop_229168_iter);
    free(ctx->futhark_mc_segmap_task_229166_total_runtime);
    free(ctx->futhark_mc_segmap_task_229166_runs);
    free(ctx->futhark_mc_segmap_task_229166_iter);
    free(ctx->futhark_mc_segmap_parloop_229177_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229177_runs);
    free(ctx->futhark_mc_segmap_parloop_229177_iter);
    free(ctx->futhark_mc_segmap_task_229175_total_runtime);
    free(ctx->futhark_mc_segmap_task_229175_runs);
    free(ctx->futhark_mc_segmap_task_229175_iter);
    free(ctx->futhark_mc_segmap_parloop_229172_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229172_runs);
    free(ctx->futhark_mc_segmap_parloop_229172_iter);
    free(ctx->futhark_mc_segmap_nested_task_229170_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229170_runs);
    free(ctx->futhark_mc_segmap_nested_task_229170_iter);
    free(ctx->futhark_mc_segmap_parloop_229181_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229181_runs);
    free(ctx->futhark_mc_segmap_parloop_229181_iter);
    free(ctx->futhark_mc_segmap_task_229179_total_runtime);
    free(ctx->futhark_mc_segmap_task_229179_runs);
    free(ctx->futhark_mc_segmap_task_229179_iter);
    free(ctx->futhark_mc_segmap_parloop_229190_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229190_runs);
    free(ctx->futhark_mc_segmap_parloop_229190_iter);
    free(ctx->futhark_mc_segmap_task_229188_total_runtime);
    free(ctx->futhark_mc_segmap_task_229188_runs);
    free(ctx->futhark_mc_segmap_task_229188_iter);
    free(ctx->futhark_mc_segmap_parloop_229185_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229185_runs);
    free(ctx->futhark_mc_segmap_parloop_229185_iter);
    free(ctx->futhark_mc_segmap_nested_task_229183_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229183_runs);
    free(ctx->futhark_mc_segmap_nested_task_229183_iter);
    free(ctx->futhark_mc_segmap_parloop_229194_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229194_runs);
    free(ctx->futhark_mc_segmap_parloop_229194_iter);
    free(ctx->futhark_mc_segmap_task_229192_total_runtime);
    free(ctx->futhark_mc_segmap_task_229192_runs);
    free(ctx->futhark_mc_segmap_task_229192_iter);
    free(ctx->futhark_mc_segmap_parloop_229209_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229209_runs);
    free(ctx->futhark_mc_segmap_parloop_229209_iter);
    free(ctx->futhark_mc_segmap_task_229207_total_runtime);
    free(ctx->futhark_mc_segmap_task_229207_runs);
    free(ctx->futhark_mc_segmap_task_229207_iter);
    free(ctx->futhark_mc_segmap_parloop_229213_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229213_runs);
    free(ctx->futhark_mc_segmap_parloop_229213_iter);
    free(ctx->futhark_mc_segmap_task_229211_total_runtime);
    free(ctx->futhark_mc_segmap_task_229211_runs);
    free(ctx->futhark_mc_segmap_task_229211_iter);
    free(ctx->futhark_mc_segmap_parloop_229217_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229217_runs);
    free(ctx->futhark_mc_segmap_parloop_229217_iter);
    free(ctx->futhark_mc_segmap_task_229215_total_runtime);
    free(ctx->futhark_mc_segmap_task_229215_runs);
    free(ctx->futhark_mc_segmap_task_229215_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229225_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229225_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229225_iter);
    free(ctx->futhark_mc_segred_task_229222_total_runtime);
    free(ctx->futhark_mc_segred_task_229222_runs);
    free(ctx->futhark_mc_segred_task_229222_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229230_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229230_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229230_iter);
    free(ctx->futhark_mc_segred_task_229227_total_runtime);
    free(ctx->futhark_mc_segred_task_229227_runs);
    free(ctx->futhark_mc_segred_task_229227_iter);
    free(ctx->futhark_mc_segmap_parloop_229220_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229220_runs);
    free(ctx->futhark_mc_segmap_parloop_229220_iter);
    free(ctx->futhark_mc_segmap_nested_task_229218_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229218_runs);
    free(ctx->futhark_mc_segmap_nested_task_229218_iter);
    free(ctx->futhark_mc_segmap_parloop_229201_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229201_runs);
    free(ctx->futhark_mc_segmap_parloop_229201_iter);
    free(ctx->futhark_mc_segmap_nested_task_229199_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229199_runs);
    free(ctx->futhark_mc_segmap_nested_task_229199_iter);
    free(ctx->futhark_mc_segmap_parloop_229234_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229234_runs);
    free(ctx->futhark_mc_segmap_parloop_229234_iter);
    free(ctx->futhark_mc_segmap_task_229232_total_runtime);
    free(ctx->futhark_mc_segmap_task_229232_runs);
    free(ctx->futhark_mc_segmap_task_229232_iter);
    free(ctx->futhark_mc_segmap_parloop_229251_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229251_runs);
    free(ctx->futhark_mc_segmap_parloop_229251_iter);
    free(ctx->futhark_mc_segmap_task_229249_total_runtime);
    free(ctx->futhark_mc_segmap_task_229249_runs);
    free(ctx->futhark_mc_segmap_task_229249_iter);
    free(ctx->futhark_mc_segmap_parloop_229255_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229255_runs);
    free(ctx->futhark_mc_segmap_parloop_229255_iter);
    free(ctx->futhark_mc_segmap_task_229253_total_runtime);
    free(ctx->futhark_mc_segmap_task_229253_runs);
    free(ctx->futhark_mc_segmap_task_229253_iter);
    free(ctx->futhark_mc_segmap_parloop_229259_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229259_runs);
    free(ctx->futhark_mc_segmap_parloop_229259_iter);
    free(ctx->futhark_mc_segmap_task_229257_total_runtime);
    free(ctx->futhark_mc_segmap_task_229257_runs);
    free(ctx->futhark_mc_segmap_task_229257_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229269_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229269_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229269_iter);
    free(ctx->futhark_mc_segred_task_229264_total_runtime);
    free(ctx->futhark_mc_segred_task_229264_runs);
    free(ctx->futhark_mc_segred_task_229264_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229275_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229275_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229275_iter);
    free(ctx->futhark_mc_segred_task_229271_total_runtime);
    free(ctx->futhark_mc_segred_task_229271_runs);
    free(ctx->futhark_mc_segred_task_229271_iter);
    free(ctx->futhark_mc_segmap_parloop_229262_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229262_runs);
    free(ctx->futhark_mc_segmap_parloop_229262_iter);
    free(ctx->futhark_mc_segmap_nested_task_229260_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229260_runs);
    free(ctx->futhark_mc_segmap_nested_task_229260_iter);
    free(ctx->futhark_mc_segmap_parloop_229242_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229242_runs);
    free(ctx->futhark_mc_segmap_parloop_229242_iter);
    free(ctx->futhark_mc_segmap_nested_task_229240_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229240_runs);
    free(ctx->futhark_mc_segmap_nested_task_229240_iter);
    free(ctx->futhark_mc_segmap_parloop_229279_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229279_runs);
    free(ctx->futhark_mc_segmap_parloop_229279_iter);
    free(ctx->futhark_mc_segmap_task_229277_total_runtime);
    free(ctx->futhark_mc_segmap_task_229277_runs);
    free(ctx->futhark_mc_segmap_task_229277_iter);
    free(ctx->futhark_mc_segmap_parloop_229296_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229296_runs);
    free(ctx->futhark_mc_segmap_parloop_229296_iter);
    free(ctx->futhark_mc_segmap_task_229294_total_runtime);
    free(ctx->futhark_mc_segmap_task_229294_runs);
    free(ctx->futhark_mc_segmap_task_229294_iter);
    free(ctx->futhark_mc_segmap_parloop_229300_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229300_runs);
    free(ctx->futhark_mc_segmap_parloop_229300_iter);
    free(ctx->futhark_mc_segmap_task_229298_total_runtime);
    free(ctx->futhark_mc_segmap_task_229298_runs);
    free(ctx->futhark_mc_segmap_task_229298_iter);
    free(ctx->futhark_mc_segmap_parloop_229304_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229304_runs);
    free(ctx->futhark_mc_segmap_parloop_229304_iter);
    free(ctx->futhark_mc_segmap_task_229302_total_runtime);
    free(ctx->futhark_mc_segmap_task_229302_runs);
    free(ctx->futhark_mc_segmap_task_229302_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229316_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229316_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229316_iter);
    free(ctx->futhark_mc_segred_task_229309_total_runtime);
    free(ctx->futhark_mc_segred_task_229309_runs);
    free(ctx->futhark_mc_segred_task_229309_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229322_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229322_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229322_iter);
    free(ctx->futhark_mc_segred_task_229318_total_runtime);
    free(ctx->futhark_mc_segred_task_229318_runs);
    free(ctx->futhark_mc_segred_task_229318_iter);
    free(ctx->futhark_mc_segmap_parloop_229307_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229307_runs);
    free(ctx->futhark_mc_segmap_parloop_229307_iter);
    free(ctx->futhark_mc_segmap_nested_task_229305_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229305_runs);
    free(ctx->futhark_mc_segmap_nested_task_229305_iter);
    free(ctx->futhark_mc_segmap_parloop_229287_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229287_runs);
    free(ctx->futhark_mc_segmap_parloop_229287_iter);
    free(ctx->futhark_mc_segmap_nested_task_229285_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229285_runs);
    free(ctx->futhark_mc_segmap_nested_task_229285_iter);
    free(ctx->futhark_mc_segmap_parloop_229326_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229326_runs);
    free(ctx->futhark_mc_segmap_parloop_229326_iter);
    free(ctx->futhark_mc_segmap_task_229324_total_runtime);
    free(ctx->futhark_mc_segmap_task_229324_runs);
    free(ctx->futhark_mc_segmap_task_229324_iter);
    free(ctx->futhark_mc_segmap_parloop_229342_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229342_runs);
    free(ctx->futhark_mc_segmap_parloop_229342_iter);
    free(ctx->futhark_mc_segmap_task_229340_total_runtime);
    free(ctx->futhark_mc_segmap_task_229340_runs);
    free(ctx->futhark_mc_segmap_task_229340_iter);
    free(ctx->futhark_mc_segmap_parloop_229346_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229346_runs);
    free(ctx->futhark_mc_segmap_parloop_229346_iter);
    free(ctx->futhark_mc_segmap_task_229344_total_runtime);
    free(ctx->futhark_mc_segmap_task_229344_runs);
    free(ctx->futhark_mc_segmap_task_229344_iter);
    free(ctx->futhark_mc_segmap_parloop_229350_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229350_runs);
    free(ctx->futhark_mc_segmap_parloop_229350_iter);
    free(ctx->futhark_mc_segmap_task_229348_total_runtime);
    free(ctx->futhark_mc_segmap_task_229348_runs);
    free(ctx->futhark_mc_segmap_task_229348_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229360_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229360_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229360_iter);
    free(ctx->futhark_mc_segred_task_229357_total_runtime);
    free(ctx->futhark_mc_segred_task_229357_runs);
    free(ctx->futhark_mc_segred_task_229357_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229365_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229365_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229365_iter);
    free(ctx->futhark_mc_segred_task_229362_total_runtime);
    free(ctx->futhark_mc_segred_task_229362_runs);
    free(ctx->futhark_mc_segred_task_229362_iter);
    free(ctx->futhark_mc_segmap_parloop_229354_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229354_runs);
    free(ctx->futhark_mc_segmap_parloop_229354_iter);
    free(ctx->futhark_mc_segmap_nested_task_229352_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229352_runs);
    free(ctx->futhark_mc_segmap_nested_task_229352_iter);
    free(ctx->futhark_mc_segmap_parloop_229334_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229334_runs);
    free(ctx->futhark_mc_segmap_parloop_229334_iter);
    free(ctx->futhark_mc_segmap_nested_task_229332_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229332_runs);
    free(ctx->futhark_mc_segmap_nested_task_229332_iter);
    free(ctx->futhark_mc_segmap_parloop_229369_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229369_runs);
    free(ctx->futhark_mc_segmap_parloop_229369_iter);
    free(ctx->futhark_mc_segmap_task_229367_total_runtime);
    free(ctx->futhark_mc_segmap_task_229367_runs);
    free(ctx->futhark_mc_segmap_task_229367_iter);
    free(ctx->futhark_mc_segmap_parloop_229388_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229388_runs);
    free(ctx->futhark_mc_segmap_parloop_229388_iter);
    free(ctx->futhark_mc_segmap_task_229386_total_runtime);
    free(ctx->futhark_mc_segmap_task_229386_runs);
    free(ctx->futhark_mc_segmap_task_229386_iter);
    free(ctx->futhark_mc_segmap_parloop_229392_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229392_runs);
    free(ctx->futhark_mc_segmap_parloop_229392_iter);
    free(ctx->futhark_mc_segmap_task_229390_total_runtime);
    free(ctx->futhark_mc_segmap_task_229390_runs);
    free(ctx->futhark_mc_segmap_task_229390_iter);
    free(ctx->futhark_mc_segmap_parloop_229396_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229396_runs);
    free(ctx->futhark_mc_segmap_parloop_229396_iter);
    free(ctx->futhark_mc_segmap_task_229394_total_runtime);
    free(ctx->futhark_mc_segmap_task_229394_runs);
    free(ctx->futhark_mc_segmap_task_229394_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229410_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229410_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229410_iter);
    free(ctx->futhark_mc_segred_task_229405_total_runtime);
    free(ctx->futhark_mc_segred_task_229405_runs);
    free(ctx->futhark_mc_segred_task_229405_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229416_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229416_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229416_iter);
    free(ctx->futhark_mc_segred_task_229412_total_runtime);
    free(ctx->futhark_mc_segred_task_229412_runs);
    free(ctx->futhark_mc_segred_task_229412_iter);
    free(ctx->futhark_mc_segmap_parloop_229401_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229401_runs);
    free(ctx->futhark_mc_segmap_parloop_229401_iter);
    free(ctx->futhark_mc_segmap_nested_task_229399_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229399_runs);
    free(ctx->futhark_mc_segmap_nested_task_229399_iter);
    free(ctx->futhark_mc_segmap_parloop_229379_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229379_runs);
    free(ctx->futhark_mc_segmap_parloop_229379_iter);
    free(ctx->futhark_mc_segmap_nested_task_229377_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229377_runs);
    free(ctx->futhark_mc_segmap_nested_task_229377_iter);
    free(ctx->futhark_mc_segmap_parloop_229420_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229420_runs);
    free(ctx->futhark_mc_segmap_parloop_229420_iter);
    free(ctx->futhark_mc_segmap_task_229418_total_runtime);
    free(ctx->futhark_mc_segmap_task_229418_runs);
    free(ctx->futhark_mc_segmap_task_229418_iter);
    free(ctx->futhark_mc_segmap_parloop_229441_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229441_runs);
    free(ctx->futhark_mc_segmap_parloop_229441_iter);
    free(ctx->futhark_mc_segmap_task_229439_total_runtime);
    free(ctx->futhark_mc_segmap_task_229439_runs);
    free(ctx->futhark_mc_segmap_task_229439_iter);
    free(ctx->futhark_mc_segmap_parloop_229445_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229445_runs);
    free(ctx->futhark_mc_segmap_parloop_229445_iter);
    free(ctx->futhark_mc_segmap_task_229443_total_runtime);
    free(ctx->futhark_mc_segmap_task_229443_runs);
    free(ctx->futhark_mc_segmap_task_229443_iter);
    free(ctx->futhark_mc_segmap_parloop_229449_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229449_runs);
    free(ctx->futhark_mc_segmap_parloop_229449_iter);
    free(ctx->futhark_mc_segmap_task_229447_total_runtime);
    free(ctx->futhark_mc_segmap_task_229447_runs);
    free(ctx->futhark_mc_segmap_task_229447_iter);
    free(ctx->futhark_mc_segmap_parloop_229464_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229464_runs);
    free(ctx->futhark_mc_segmap_parloop_229464_iter);
    free(ctx->futhark_mc_segmap_task_229462_total_runtime);
    free(ctx->futhark_mc_segmap_task_229462_runs);
    free(ctx->futhark_mc_segmap_task_229462_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229473_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229473_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229473_iter);
    free(ctx->futhark_mc_segred_task_229466_total_runtime);
    free(ctx->futhark_mc_segred_task_229466_runs);
    free(ctx->futhark_mc_segred_task_229466_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229479_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229479_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229479_iter);
    free(ctx->futhark_mc_segred_task_229475_total_runtime);
    free(ctx->futhark_mc_segred_task_229475_runs);
    free(ctx->futhark_mc_segred_task_229475_iter);
    free(ctx->futhark_mc_segmap_parloop_229456_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229456_runs);
    free(ctx->futhark_mc_segmap_parloop_229456_iter);
    free(ctx->futhark_mc_segmap_nested_task_229454_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229454_runs);
    free(ctx->futhark_mc_segmap_nested_task_229454_iter);
    free(ctx->futhark_mc_segmap_parloop_229432_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229432_runs);
    free(ctx->futhark_mc_segmap_parloop_229432_iter);
    free(ctx->futhark_mc_segmap_nested_task_229430_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229430_runs);
    free(ctx->futhark_mc_segmap_nested_task_229430_iter);
    free(ctx->futhark_mc_segmap_parloop_229483_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229483_runs);
    free(ctx->futhark_mc_segmap_parloop_229483_iter);
    free(ctx->futhark_mc_segmap_task_229481_total_runtime);
    free(ctx->futhark_mc_segmap_task_229481_runs);
    free(ctx->futhark_mc_segmap_task_229481_iter);
    free(ctx->futhark_mc_segmap_parloop_229492_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229492_runs);
    free(ctx->futhark_mc_segmap_parloop_229492_iter);
    free(ctx->futhark_mc_segmap_task_229490_total_runtime);
    free(ctx->futhark_mc_segmap_task_229490_runs);
    free(ctx->futhark_mc_segmap_task_229490_iter);
    free(ctx->futhark_mc_segmap_parloop_229487_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229487_runs);
    free(ctx->futhark_mc_segmap_parloop_229487_iter);
    free(ctx->futhark_mc_segmap_nested_task_229485_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229485_runs);
    free(ctx->futhark_mc_segmap_nested_task_229485_iter);
    free(ctx->futhark_mc_segmap_parloop_229496_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229496_runs);
    free(ctx->futhark_mc_segmap_parloop_229496_iter);
    free(ctx->futhark_mc_segmap_task_229494_total_runtime);
    free(ctx->futhark_mc_segmap_task_229494_runs);
    free(ctx->futhark_mc_segmap_task_229494_iter);
    free(ctx->futhark_mc_segmap_parloop_229507_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229507_runs);
    free(ctx->futhark_mc_segmap_parloop_229507_iter);
    free(ctx->futhark_mc_segmap_task_229505_total_runtime);
    free(ctx->futhark_mc_segmap_task_229505_runs);
    free(ctx->futhark_mc_segmap_task_229505_iter);
    free(ctx->futhark_mc_segmap_parloop_229511_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229511_runs);
    free(ctx->futhark_mc_segmap_parloop_229511_iter);
    free(ctx->futhark_mc_segmap_task_229509_total_runtime);
    free(ctx->futhark_mc_segmap_task_229509_runs);
    free(ctx->futhark_mc_segmap_task_229509_iter);
    free(ctx->futhark_mc_segmap_parloop_229501_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229501_runs);
    free(ctx->futhark_mc_segmap_parloop_229501_iter);
    free(ctx->futhark_mc_segmap_nested_task_229499_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229499_runs);
    free(ctx->futhark_mc_segmap_nested_task_229499_iter);
    free(ctx->futhark_mc_segmap_parloop_229515_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229515_runs);
    free(ctx->futhark_mc_segmap_parloop_229515_iter);
    free(ctx->futhark_mc_segmap_task_229513_total_runtime);
    free(ctx->futhark_mc_segmap_task_229513_runs);
    free(ctx->futhark_mc_segmap_task_229513_iter);
    free(ctx->futhark_mc_scan_stage_1_parloop_229536_total_runtime);
    free(ctx->futhark_mc_scan_stage_1_parloop_229536_runs);
    free(ctx->futhark_mc_scan_stage_1_parloop_229536_iter);
    free(ctx->futhark_mc_scan_stage_3_parloop_229538_total_runtime);
    free(ctx->futhark_mc_scan_stage_3_parloop_229538_runs);
    free(ctx->futhark_mc_scan_stage_3_parloop_229538_iter);
    free(ctx->futhark_mc_segscan_task_229530_total_runtime);
    free(ctx->futhark_mc_segscan_task_229530_runs);
    free(ctx->futhark_mc_segscan_task_229530_iter);
    free(ctx->futhark_mc_segmap_parloop_229542_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229542_runs);
    free(ctx->futhark_mc_segmap_parloop_229542_iter);
    free(ctx->futhark_mc_segmap_task_229540_total_runtime);
    free(ctx->futhark_mc_segmap_task_229540_runs);
    free(ctx->futhark_mc_segmap_task_229540_iter);
    free(ctx->futhark_mc_segmap_parloop_229523_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229523_runs);
    free(ctx->futhark_mc_segmap_parloop_229523_iter);
    free(ctx->futhark_mc_segmap_nested_task_229521_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229521_runs);
    free(ctx->futhark_mc_segmap_nested_task_229521_iter);
    free(ctx->futhark_mc_segmap_parloop_229546_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229546_runs);
    free(ctx->futhark_mc_segmap_parloop_229546_iter);
    free(ctx->futhark_mc_segmap_task_229544_total_runtime);
    free(ctx->futhark_mc_segmap_task_229544_runs);
    free(ctx->futhark_mc_segmap_task_229544_iter);
    free(ctx->futhark_mc_segred_stage_1_parloop_229554_total_runtime);
    free(ctx->futhark_mc_segred_stage_1_parloop_229554_runs);
    free(ctx->futhark_mc_segred_stage_1_parloop_229554_iter);
    free(ctx->futhark_mc_segred_task_229551_total_runtime);
    free(ctx->futhark_mc_segred_task_229551_runs);
    free(ctx->futhark_mc_segred_task_229551_iter);
    free(ctx->futhark_mc_segmap_parloop_229549_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229549_runs);
    free(ctx->futhark_mc_segmap_parloop_229549_iter);
    free(ctx->futhark_mc_segmap_nested_task_229547_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229547_runs);
    free(ctx->futhark_mc_segmap_nested_task_229547_iter);
    free(ctx->futhark_mc_segmap_parloop_229558_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229558_runs);
    free(ctx->futhark_mc_segmap_parloop_229558_iter);
    free(ctx->futhark_mc_segmap_task_229556_total_runtime);
    free(ctx->futhark_mc_segmap_task_229556_runs);
    free(ctx->futhark_mc_segmap_task_229556_iter);
    free(ctx->futhark_mc_segmap_parloop_229567_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229567_runs);
    free(ctx->futhark_mc_segmap_parloop_229567_iter);
    free(ctx->futhark_mc_segmap_task_229565_total_runtime);
    free(ctx->futhark_mc_segmap_task_229565_runs);
    free(ctx->futhark_mc_segmap_task_229565_iter);
    free(ctx->futhark_mc_segmap_parloop_229562_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229562_runs);
    free(ctx->futhark_mc_segmap_parloop_229562_iter);
    free(ctx->futhark_mc_segmap_nested_task_229560_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229560_runs);
    free(ctx->futhark_mc_segmap_nested_task_229560_iter);
    free(ctx->futhark_mc_segmap_parloop_229571_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229571_runs);
    free(ctx->futhark_mc_segmap_parloop_229571_iter);
    free(ctx->futhark_mc_segmap_task_229569_total_runtime);
    free(ctx->futhark_mc_segmap_task_229569_runs);
    free(ctx->futhark_mc_segmap_task_229569_iter);
    free(ctx->futhark_mc_segmap_parloop_229580_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229580_runs);
    free(ctx->futhark_mc_segmap_parloop_229580_iter);
    free(ctx->futhark_mc_segmap_task_229578_total_runtime);
    free(ctx->futhark_mc_segmap_task_229578_runs);
    free(ctx->futhark_mc_segmap_task_229578_iter);
    free(ctx->futhark_mc_segmap_parloop_229575_total_runtime);
    free(ctx->futhark_mc_segmap_parloop_229575_runs);
    free(ctx->futhark_mc_segmap_parloop_229575_iter);
    free(ctx->futhark_mc_segmap_nested_task_229573_total_runtime);
    free(ctx->futhark_mc_segmap_nested_task_229573_runs);
    free(ctx->futhark_mc_segmap_nested_task_229573_iter);
    free_constants(ctx);
    (void) scheduler_destroy(&ctx->scheduler);
    free_lock(&ctx->lock);
    ctx->cfg->in_use = 0;
    free(ctx);
}
int futhark_context_sync(struct futhark_context *ctx)
{
    (void) ctx;
    return 0;
}
static const char *tuning_param_names[0];
static const char *tuning_param_vars[0];
static const char *tuning_param_classes[0];
int futhark_context_config_set_tuning_param(struct futhark_context_config *cfg,
                                            const char *param_name,
                                            size_t param_value)
{
    (void) cfg;
    (void) param_name;
    (void) param_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 = (unsigned char *) malloc((size_t) size);
    block->references = (int *) malloc(sizeof(int));
    *block->references = 1;
    block->size = size;
    block->desc = desc;
    return ret;
}
static int memblock_set(struct futhark_context *ctx, struct memblock *lhs,
                        struct memblock *rhs, const char *lhs_desc)
{
    int ret = memblock_unref(ctx, lhs, lhs_desc);
    
    if (rhs->references != NULL)
        (*rhs->references)++;
    *lhs = *rhs;
    return ret;
}
int futhark_get_tuning_param_count(void)
{
    return sizeof(tuning_param_names) / sizeof(tuning_param_names[0]);
}
const char *futhark_get_tuning_param_name(int i)
{
    return tuning_param_names[i];
}
const char *futhark_get_tuning_param_class(int i)
{
    return tuning_param_classes[i];
}
char *futhark_context_report(struct futhark_context *ctx)
{
    if (futhark_context_sync(ctx) != 0)
        return NULL;
    
    struct str_builder builder;
    
    str_builder_init(&builder);
    if (ctx->detail_memory || ctx->profiling || ctx->logging) {
        { }
    }
    if (ctx->profiling) {
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228377         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228377_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228377_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228377_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228377_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228377_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228377_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228377_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228377_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228377_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228377_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228377_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228377_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228377_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228377_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228377_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228377_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228377_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228377_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228377_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228377_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228377_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228377_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228377_total_iter /
                (ctx->futhark_mc_segmap_parloop_228377_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228377_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228377_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228377_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_1_parloop_228389   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_1_parloop_228389_runs[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228389_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228389_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228389_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228389_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_1_parloop_228389_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228389_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228389_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228389_iter[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228389_iter[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228389_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228389_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_1_parloop_228389_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228389_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228389_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_1_parloop_228389_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228389_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228389_total_iter),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228389_total_iter,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228389_total_iter /
                (ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_1_parloop_228389_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_3_parloop_228391   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_3_parloop_228391_runs[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228391_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228391_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228391_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228391_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_3_parloop_228391_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228391_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228391_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228391_iter[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228391_iter[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228391_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228391_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_3_parloop_228391_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228391_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228391_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_3_parloop_228391_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228391_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228391_total_iter),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228391_total_iter,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228391_total_iter /
                (ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_3_parloop_228391_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segscan_task_228386           ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segscan_task_228386_runs[i],
                    (long) ctx->futhark_mc_segscan_task_228386_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228386_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228386_runs[i] : 1),
                    (long) ctx->futhark_mc_segscan_task_228386_total_runtime[i],
                    (double) ctx->futhark_mc_segscan_task_228386_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228386_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segscan_task_228386_iter[i]),
                    (long) ctx->futhark_mc_segscan_task_228386_iter[i],
                    (long) ctx->futhark_mc_segscan_task_228386_iter[i] /
                    (ctx->futhark_mc_segscan_task_228386_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228386_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228395         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228395_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228395_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228395_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228395_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228395_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228395_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228395_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228395_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228395_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228395_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228395_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228395_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228395_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228395_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228395_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228395_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228395_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228395_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228395_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228395_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228395_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228395_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228395_total_iter /
                (ctx->futhark_mc_segmap_parloop_228395_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228395_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228395_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228395_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228393            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228393_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228393_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228393_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228393_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228393_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228393_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228393_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228393_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228393_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228393_iter[i] /
                    (ctx->futhark_mc_segmap_task_228393_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228393_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228382         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228382_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228382_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228382_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228382_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228382_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228382_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228382_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228382_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228382_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228382_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228382_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228382_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228382_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228382_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228382_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228382_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228382_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228382_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228382_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228382_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228382_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228382_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228382_total_iter /
                (ctx->futhark_mc_segmap_parloop_228382_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228382_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228382_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228382_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228375            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228375_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228375_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228375_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228375_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228375_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228375_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228375_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228375_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228375_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228375_iter[i] /
                    (ctx->futhark_mc_segmap_task_228375_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228375_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228380     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228380_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228380_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228380_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228380_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228380_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228380_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228380_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228380_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228380_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228380_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228380_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228380_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228399         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228399_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228399_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228399_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228399_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228399_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228399_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228399_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228399_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228399_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228399_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228399_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228399_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228399_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228399_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228399_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228399_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228399_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228399_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228399_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228399_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228399_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228399_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228399_total_iter /
                (ctx->futhark_mc_segmap_parloop_228399_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228399_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228399_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228399_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228408         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228408_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228408_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228408_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228408_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228408_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228408_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228408_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228408_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228408_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228408_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228408_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228408_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228408_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228408_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228408_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228408_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228408_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228408_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228408_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228408_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228408_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228408_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228408_total_iter /
                (ctx->futhark_mc_segmap_parloop_228408_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228408_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228408_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228408_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228417         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228417_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228417_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228417_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228417_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228417_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228417_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228417_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228417_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228417_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228417_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228417_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228417_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228417_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228417_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228417_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228417_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228417_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228417_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228417_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228417_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228417_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228417_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228417_total_iter /
                (ctx->futhark_mc_segmap_parloop_228417_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228417_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228417_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228417_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228415            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228415_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228415_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228415_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228415_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228415_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228415_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228415_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228415_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228415_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228415_iter[i] /
                    (ctx->futhark_mc_segmap_task_228415_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228415_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228412         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228412_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228412_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228412_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228412_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228412_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228412_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228412_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228412_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228412_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228412_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228412_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228412_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228412_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228412_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228412_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228412_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228412_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228412_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228412_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228412_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228412_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228412_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228412_total_iter /
                (ctx->futhark_mc_segmap_parloop_228412_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228412_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228412_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228412_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228406            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228406_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228406_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228406_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228406_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228406_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228406_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228406_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228406_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228406_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228406_iter[i] /
                    (ctx->futhark_mc_segmap_task_228406_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228406_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228410     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228410_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228410_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228410_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228410_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228410_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228410_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228410_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228410_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228410_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228410_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228410_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228410_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228403         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228403_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228403_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228403_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228403_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228403_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228403_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228403_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228403_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228403_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228403_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228403_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228403_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228403_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228403_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228403_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228403_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228403_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228403_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228403_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228403_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228403_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228403_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228403_total_iter /
                (ctx->futhark_mc_segmap_parloop_228403_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228403_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228403_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228403_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228397            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228397_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228397_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228397_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228397_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228397_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228397_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228397_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228397_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228397_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228397_iter[i] /
                    (ctx->futhark_mc_segmap_task_228397_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228397_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228401     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228401_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228401_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228401_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228401_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228401_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228401_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228401_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228401_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228401_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228401_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228401_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228401_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228421         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228421_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228421_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228421_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228421_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228421_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228421_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228421_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228421_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228421_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228421_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228421_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228421_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228421_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228421_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228421_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228421_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228421_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228421_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228421_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228421_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228421_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228421_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228421_total_iter /
                (ctx->futhark_mc_segmap_parloop_228421_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228421_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228421_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228421_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228434         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228434_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228434_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228434_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228434_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228434_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228434_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228434_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228434_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228434_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228434_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228434_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228434_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228434_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228434_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228434_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228434_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228434_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228434_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228434_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228434_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228434_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228434_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228434_total_iter /
                (ctx->futhark_mc_segmap_parloop_228434_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228434_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228434_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228434_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_1_parloop_228446   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_1_parloop_228446_runs[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228446_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228446_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228446_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228446_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_1_parloop_228446_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228446_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228446_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228446_iter[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228446_iter[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228446_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228446_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_1_parloop_228446_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228446_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228446_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_1_parloop_228446_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228446_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228446_total_iter),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228446_total_iter,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228446_total_iter /
                (ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_1_parloop_228446_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_3_parloop_228448   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_3_parloop_228448_runs[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228448_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228448_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228448_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228448_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_3_parloop_228448_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228448_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228448_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228448_iter[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228448_iter[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228448_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228448_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_3_parloop_228448_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228448_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228448_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_3_parloop_228448_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228448_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228448_total_iter),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228448_total_iter,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228448_total_iter /
                (ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_3_parloop_228448_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segscan_task_228443           ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segscan_task_228443_runs[i],
                    (long) ctx->futhark_mc_segscan_task_228443_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228443_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228443_runs[i] : 1),
                    (long) ctx->futhark_mc_segscan_task_228443_total_runtime[i],
                    (double) ctx->futhark_mc_segscan_task_228443_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228443_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segscan_task_228443_iter[i]),
                    (long) ctx->futhark_mc_segscan_task_228443_iter[i],
                    (long) ctx->futhark_mc_segscan_task_228443_iter[i] /
                    (ctx->futhark_mc_segscan_task_228443_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228443_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228452         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228452_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228452_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228452_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228452_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228452_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228452_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228452_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228452_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228452_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228452_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228452_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228452_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228452_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228452_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228452_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228452_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228452_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228452_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228452_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228452_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228452_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228452_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228452_total_iter /
                (ctx->futhark_mc_segmap_parloop_228452_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228452_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228452_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228452_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228450            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228450_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228450_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228450_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228450_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228450_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228450_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228450_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228450_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228450_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228450_iter[i] /
                    (ctx->futhark_mc_segmap_task_228450_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228450_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228439         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228439_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228439_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228439_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228439_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228439_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228439_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228439_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228439_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228439_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228439_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228439_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228439_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228439_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228439_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228439_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228439_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228439_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228439_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228439_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228439_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228439_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228439_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228439_total_iter /
                (ctx->futhark_mc_segmap_parloop_228439_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228439_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228439_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228439_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228432            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228432_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228432_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228432_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228432_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228432_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228432_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228432_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228432_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228432_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228432_iter[i] /
                    (ctx->futhark_mc_segmap_task_228432_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228432_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228437     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228437_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228437_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228437_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228437_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228437_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228437_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228437_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228437_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228437_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228437_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228437_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228437_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228428         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228428_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228428_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228428_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228428_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228428_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228428_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228428_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228428_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228428_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228428_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228428_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228428_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228428_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228428_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228428_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228428_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228428_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228428_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228428_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228428_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228428_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228428_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228428_total_iter /
                (ctx->futhark_mc_segmap_parloop_228428_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228428_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228428_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228428_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228419            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228419_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228419_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228419_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228419_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228419_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228419_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228419_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228419_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228419_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228419_iter[i] /
                    (ctx->futhark_mc_segmap_task_228419_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228419_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228426     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228426_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228426_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228426_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228426_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228426_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228426_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228426_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228426_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228426_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228426_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228426_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228426_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228456         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228456_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228456_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228456_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228456_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228456_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228456_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228456_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228456_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228456_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228456_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228456_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228456_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228456_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228456_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228456_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228456_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228456_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228456_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228456_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228456_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228456_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228456_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228456_total_iter /
                (ctx->futhark_mc_segmap_parloop_228456_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228456_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228456_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228456_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228468         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228468_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228468_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228468_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228468_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228468_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228468_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228468_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228468_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228468_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228468_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228468_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228468_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228468_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228468_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228468_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228468_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228468_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228468_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228468_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228468_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228468_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228468_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228468_total_iter /
                (ctx->futhark_mc_segmap_parloop_228468_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228468_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228468_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228468_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228481         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228481_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228481_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228481_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228481_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228481_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228481_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228481_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228481_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228481_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228481_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228481_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228481_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228481_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228481_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228481_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228481_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228481_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228481_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228481_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228481_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228481_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228481_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228481_total_iter /
                (ctx->futhark_mc_segmap_parloop_228481_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228481_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228481_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228481_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228479            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228479_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228479_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228479_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228479_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228479_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228479_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228479_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228479_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228479_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228479_iter[i] /
                    (ctx->futhark_mc_segmap_task_228479_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228479_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228485         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228485_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228485_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228485_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228485_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228485_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228485_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228485_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228485_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228485_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228485_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228485_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228485_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228485_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228485_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228485_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228485_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228485_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228485_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228485_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228485_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228485_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228485_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228485_total_iter /
                (ctx->futhark_mc_segmap_parloop_228485_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228485_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228485_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228485_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228483            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228483_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228483_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228483_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228483_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228483_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228483_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228483_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228483_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228483_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228483_iter[i] /
                    (ctx->futhark_mc_segmap_task_228483_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228483_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228474         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228474_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228474_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228474_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228474_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228474_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228474_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228474_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228474_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228474_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228474_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228474_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228474_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228474_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228474_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228474_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228474_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228474_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228474_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228474_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228474_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228474_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228474_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228474_total_iter /
                (ctx->futhark_mc_segmap_parloop_228474_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228474_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228474_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228474_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228466            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228466_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228466_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228466_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228466_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228466_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228466_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228466_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228466_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228466_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228466_iter[i] /
                    (ctx->futhark_mc_segmap_task_228466_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228466_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228472     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228472_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228472_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228472_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228472_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228472_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228472_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228472_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228472_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228472_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228472_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228472_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228472_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228462         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228462_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228462_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228462_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228462_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228462_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228462_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228462_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228462_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228462_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228462_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228462_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228462_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228462_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228462_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228462_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228462_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228462_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228462_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228462_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228462_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228462_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228462_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228462_total_iter /
                (ctx->futhark_mc_segmap_parloop_228462_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228462_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228462_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228462_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228454            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228454_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228454_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228454_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228454_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228454_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228454_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228454_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228454_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228454_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228454_iter[i] /
                    (ctx->futhark_mc_segmap_task_228454_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228454_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228460     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228460_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228460_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228460_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228460_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228460_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228460_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228460_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228460_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228460_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228460_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228460_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228460_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228489         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228489_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228489_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228489_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228489_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228489_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228489_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228489_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228489_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228489_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228489_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228489_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228489_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228489_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228489_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228489_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228489_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228489_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228489_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228489_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228489_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228489_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228489_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228489_total_iter /
                (ctx->futhark_mc_segmap_parloop_228489_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228489_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228489_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228489_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228502         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228502_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228502_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228502_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228502_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228502_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228502_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228502_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228502_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228502_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228502_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228502_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228502_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228502_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228502_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228502_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228502_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228502_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228502_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228502_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228502_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228502_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228502_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228502_total_iter /
                (ctx->futhark_mc_segmap_parloop_228502_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228502_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228502_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228502_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228500            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228500_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228500_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228500_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228500_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228500_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228500_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228500_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228500_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228500_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228500_iter[i] /
                    (ctx->futhark_mc_segmap_task_228500_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228500_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228506         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228506_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228506_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228506_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228506_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228506_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228506_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228506_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228506_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228506_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228506_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228506_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228506_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228506_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228506_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228506_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228506_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228506_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228506_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228506_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228506_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228506_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228506_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228506_total_iter /
                (ctx->futhark_mc_segmap_parloop_228506_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228506_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228506_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228506_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228504            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228504_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228504_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228504_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228504_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228504_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228504_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228504_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228504_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228504_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228504_iter[i] /
                    (ctx->futhark_mc_segmap_task_228504_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228504_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228495         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228495_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228495_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228495_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228495_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228495_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228495_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228495_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228495_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228495_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228495_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228495_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228495_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228495_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228495_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228495_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228495_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228495_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228495_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228495_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228495_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228495_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228495_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228495_total_iter /
                (ctx->futhark_mc_segmap_parloop_228495_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228495_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228495_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228495_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228487            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228487_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228487_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228487_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228487_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228487_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228487_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228487_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228487_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228487_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228487_iter[i] /
                    (ctx->futhark_mc_segmap_task_228487_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228487_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228493     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228493_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228493_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228493_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228493_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228493_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228493_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228493_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228493_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228493_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228493_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228493_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228493_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228510         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228510_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228510_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228510_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228510_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228510_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228510_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228510_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228510_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228510_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228510_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228510_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228510_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228510_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228510_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228510_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228510_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228510_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228510_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228510_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228510_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228510_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228510_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228510_total_iter /
                (ctx->futhark_mc_segmap_parloop_228510_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228510_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228510_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228510_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228523         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228523_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228523_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228523_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228523_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228523_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228523_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228523_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228523_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228523_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228523_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228523_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228523_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228523_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228523_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228523_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228523_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228523_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228523_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228523_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228523_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228523_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228523_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228523_total_iter /
                (ctx->futhark_mc_segmap_parloop_228523_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228523_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228523_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228523_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228521            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228521_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228521_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228521_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228521_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228521_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228521_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228521_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228521_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228521_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228521_iter[i] /
                    (ctx->futhark_mc_segmap_task_228521_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228521_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228527         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228527_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228527_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228527_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228527_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228527_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228527_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228527_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228527_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228527_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228527_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228527_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228527_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228527_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228527_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228527_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228527_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228527_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228527_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228527_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228527_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228527_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228527_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228527_total_iter /
                (ctx->futhark_mc_segmap_parloop_228527_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228527_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228527_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228527_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228525            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228525_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228525_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228525_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228525_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228525_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228525_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228525_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228525_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228525_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228525_iter[i] /
                    (ctx->futhark_mc_segmap_task_228525_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228525_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228516         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228516_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228516_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228516_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228516_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228516_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228516_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228516_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228516_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228516_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228516_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228516_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228516_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228516_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228516_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228516_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228516_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228516_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228516_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228516_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228516_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228516_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228516_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228516_total_iter /
                (ctx->futhark_mc_segmap_parloop_228516_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228516_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228516_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228516_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228508            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228508_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228508_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228508_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228508_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228508_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228508_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228508_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228508_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228508_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228508_iter[i] /
                    (ctx->futhark_mc_segmap_task_228508_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228508_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228514     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228514_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228514_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228514_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228514_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228514_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228514_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228514_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228514_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228514_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228514_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228514_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228514_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228531         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228531_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228531_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228531_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228531_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228531_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228531_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228531_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228531_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228531_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228531_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228531_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228531_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228531_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228531_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228531_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228531_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228531_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228531_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228531_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228531_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228531_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228531_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228531_total_iter /
                (ctx->futhark_mc_segmap_parloop_228531_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228531_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228531_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228531_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228540         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228540_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228540_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228540_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228540_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228540_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228540_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228540_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228540_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228540_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228540_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228540_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228540_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228540_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228540_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228540_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228540_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228540_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228540_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228540_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228540_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228540_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228540_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228540_total_iter /
                (ctx->futhark_mc_segmap_parloop_228540_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228540_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228540_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228540_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228538            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228538_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228538_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228538_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228538_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228538_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228538_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228538_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228538_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228538_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228538_iter[i] /
                    (ctx->futhark_mc_segmap_task_228538_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228538_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228535         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228535_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228535_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228535_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228535_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228535_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228535_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228535_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228535_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228535_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228535_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228535_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228535_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228535_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228535_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228535_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228535_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228535_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228535_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228535_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228535_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228535_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228535_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228535_total_iter /
                (ctx->futhark_mc_segmap_parloop_228535_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228535_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228535_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228535_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228529            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228529_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228529_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228529_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228529_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228529_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228529_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228529_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228529_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228529_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228529_iter[i] /
                    (ctx->futhark_mc_segmap_task_228529_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228529_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228533     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228533_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228533_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228533_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228533_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228533_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228533_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228533_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228533_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228533_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228533_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228533_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228533_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228544         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228544_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228544_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228544_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228544_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228544_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228544_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228544_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228544_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228544_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228544_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228544_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228544_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228544_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228544_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228544_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228544_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228544_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228544_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228544_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228544_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228544_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228544_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228544_total_iter /
                (ctx->futhark_mc_segmap_parloop_228544_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228544_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228544_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228544_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228555         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228555_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228555_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228555_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228555_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228555_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228555_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228555_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228555_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228555_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228555_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228555_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228555_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228555_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228555_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228555_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228555_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228555_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228555_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228555_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228555_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228555_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228555_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228555_total_iter /
                (ctx->futhark_mc_segmap_parloop_228555_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228555_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228555_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228555_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228566         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228566_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228566_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228566_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228566_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228566_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228566_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228566_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228566_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228566_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228566_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228566_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228566_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228566_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228566_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228566_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228566_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228566_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228566_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228566_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228566_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228566_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228566_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228566_total_iter /
                (ctx->futhark_mc_segmap_parloop_228566_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228566_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228566_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228566_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228564            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228564_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228564_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228564_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228564_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228564_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228564_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228564_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228564_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228564_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228564_iter[i] /
                    (ctx->futhark_mc_segmap_task_228564_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228564_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228560         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228560_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228560_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228560_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228560_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228560_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228560_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228560_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228560_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228560_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228560_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228560_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228560_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228560_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228560_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228560_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228560_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228560_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228560_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228560_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228560_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228560_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228560_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228560_total_iter /
                (ctx->futhark_mc_segmap_parloop_228560_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228560_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228560_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228560_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228553            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228553_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228553_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228553_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228553_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228553_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228553_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228553_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228553_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228553_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228553_iter[i] /
                    (ctx->futhark_mc_segmap_task_228553_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228553_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228558     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228558_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228558_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228558_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228558_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228558_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228558_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228558_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228558_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228558_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228558_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228558_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228558_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228549         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228549_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228549_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228549_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228549_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228549_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228549_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228549_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228549_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228549_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228549_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228549_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228549_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228549_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228549_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228549_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228549_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228549_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228549_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228549_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228549_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228549_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228549_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228549_total_iter /
                (ctx->futhark_mc_segmap_parloop_228549_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228549_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228549_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228549_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228542            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228542_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228542_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228542_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228542_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228542_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228542_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228542_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228542_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228542_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228542_iter[i] /
                    (ctx->futhark_mc_segmap_task_228542_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228542_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228547     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228547_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228547_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228547_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228547_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228547_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228547_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228547_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228547_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228547_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228547_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228547_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228547_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228570         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228570_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228570_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228570_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228570_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228570_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228570_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228570_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228570_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228570_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228570_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228570_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228570_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228570_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228570_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228570_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228570_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228570_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228570_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228570_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228570_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228570_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228570_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228570_total_iter /
                (ctx->futhark_mc_segmap_parloop_228570_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228570_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228570_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228570_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228579         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228579_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228579_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228579_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228579_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228579_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228579_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228579_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228579_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228579_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228579_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228579_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228579_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228579_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228579_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228579_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228579_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228579_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228579_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228579_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228579_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228579_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228579_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228579_total_iter /
                (ctx->futhark_mc_segmap_parloop_228579_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228579_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228579_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228579_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228588         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228588_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228588_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228588_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228588_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228588_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228588_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228588_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228588_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228588_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228588_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228588_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228588_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228588_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228588_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228588_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228588_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228588_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228588_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228588_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228588_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228588_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228588_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228588_total_iter /
                (ctx->futhark_mc_segmap_parloop_228588_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228588_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228588_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228588_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228596 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228596_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228596_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228596_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228596_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228596_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228596_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228596_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228596_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228596_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228596_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228596_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228596_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228596_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228596_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228596_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228596_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228596_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228596_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228596_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228596_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228596_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228593            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228593_runs[i],
                    (long) ctx->futhark_mc_segred_task_228593_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228593_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228593_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228593_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228593_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228593_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228593_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228593_iter[i],
                    (long) ctx->futhark_mc_segred_task_228593_iter[i] /
                    (ctx->futhark_mc_segred_task_228593_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228593_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228601 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228601_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228601_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228601_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228601_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228601_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228601_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228601_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228601_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228601_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228601_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228601_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228601_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228601_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228601_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228601_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228601_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228601_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228601_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228601_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228601_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228601_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228598            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228598_runs[i],
                    (long) ctx->futhark_mc_segred_task_228598_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228598_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228598_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228598_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228598_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228598_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228598_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228598_iter[i],
                    (long) ctx->futhark_mc_segred_task_228598_iter[i] /
                    (ctx->futhark_mc_segred_task_228598_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228598_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228591         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228591_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228591_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228591_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228591_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228591_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228591_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228591_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228591_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228591_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228591_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228591_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228591_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228591_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228591_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228591_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228591_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228591_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228591_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228591_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228591_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228591_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228591_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228591_total_iter /
                (ctx->futhark_mc_segmap_parloop_228591_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228591_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228591_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228591_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228586            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228586_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228586_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228586_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228586_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228586_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228586_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228586_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228586_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228586_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228586_iter[i] /
                    (ctx->futhark_mc_segmap_task_228586_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228586_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228589     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228589_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228589_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228589_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228589_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228589_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228589_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228589_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228589_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228589_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228589_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228589_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228589_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228583         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228583_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228583_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228583_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228583_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228583_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228583_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228583_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228583_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228583_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228583_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228583_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228583_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228583_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228583_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228583_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228583_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228583_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228583_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228583_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228583_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228583_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228583_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228583_total_iter /
                (ctx->futhark_mc_segmap_parloop_228583_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228583_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228583_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228583_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228577            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228577_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228577_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228577_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228577_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228577_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228577_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228577_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228577_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228577_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228577_iter[i] /
                    (ctx->futhark_mc_segmap_task_228577_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228577_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228581     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228581_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228581_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228581_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228581_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228581_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228581_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228581_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228581_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228581_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228581_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228581_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228581_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228574         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228574_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228574_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228574_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228574_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228574_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228574_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228574_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228574_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228574_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228574_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228574_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228574_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228574_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228574_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228574_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228574_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228574_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228574_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228574_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228574_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228574_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228574_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228574_total_iter /
                (ctx->futhark_mc_segmap_parloop_228574_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228574_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228574_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228574_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228568            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228568_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228568_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228568_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228568_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228568_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228568_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228568_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228568_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228568_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228568_iter[i] /
                    (ctx->futhark_mc_segmap_task_228568_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228568_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228572     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228572_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228572_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228572_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228572_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228572_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228572_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228572_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228572_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228572_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228572_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228572_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228572_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228605         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228605_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228605_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228605_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228605_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228605_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228605_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228605_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228605_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228605_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228605_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228605_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228605_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228605_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228605_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228605_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228605_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228605_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228605_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228605_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228605_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228605_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228605_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228605_total_iter /
                (ctx->futhark_mc_segmap_parloop_228605_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228605_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228605_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228605_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228616         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228616_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228616_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228616_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228616_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228616_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228616_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228616_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228616_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228616_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228616_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228616_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228616_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228616_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228616_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228616_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228616_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228616_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228616_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228616_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228616_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228616_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228616_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228616_total_iter /
                (ctx->futhark_mc_segmap_parloop_228616_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228616_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228616_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228616_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228627         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228627_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228627_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228627_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228627_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228627_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228627_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228627_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228627_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228627_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228627_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228627_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228627_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228627_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228627_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228627_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228627_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228627_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228627_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228627_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228627_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228627_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228627_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228627_total_iter /
                (ctx->futhark_mc_segmap_parloop_228627_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228627_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228627_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228627_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228637 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228637_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228637_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228637_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228637_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228637_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228637_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228637_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228637_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228637_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228637_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228637_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228637_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228637_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228637_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228637_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228637_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228637_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228637_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228637_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228637_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228637_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228632            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228632_runs[i],
                    (long) ctx->futhark_mc_segred_task_228632_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228632_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228632_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228632_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228632_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228632_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228632_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228632_iter[i],
                    (long) ctx->futhark_mc_segred_task_228632_iter[i] /
                    (ctx->futhark_mc_segred_task_228632_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228632_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228643 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228643_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228643_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228643_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228643_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228643_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228643_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228643_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228643_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228643_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228643_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228643_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228643_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228643_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228643_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228643_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228643_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228643_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228643_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228643_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228643_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228643_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228639            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228639_runs[i],
                    (long) ctx->futhark_mc_segred_task_228639_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228639_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228639_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228639_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228639_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228639_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228639_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228639_iter[i],
                    (long) ctx->futhark_mc_segred_task_228639_iter[i] /
                    (ctx->futhark_mc_segred_task_228639_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228639_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228630         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228630_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228630_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228630_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228630_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228630_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228630_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228630_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228630_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228630_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228630_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228630_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228630_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228630_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228630_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228630_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228630_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228630_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228630_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228630_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228630_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228630_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228630_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228630_total_iter /
                (ctx->futhark_mc_segmap_parloop_228630_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228630_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228630_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228630_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228625            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228625_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228625_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228625_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228625_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228625_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228625_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228625_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228625_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228625_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228625_iter[i] /
                    (ctx->futhark_mc_segmap_task_228625_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228625_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228628     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228628_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228628_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228628_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228628_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228628_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228628_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228628_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228628_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228628_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228628_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228628_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228628_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228621         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228621_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228621_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228621_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228621_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228621_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228621_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228621_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228621_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228621_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228621_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228621_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228621_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228621_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228621_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228621_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228621_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228621_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228621_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228621_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228621_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228621_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228621_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228621_total_iter /
                (ctx->futhark_mc_segmap_parloop_228621_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228621_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228621_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228621_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228614            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228614_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228614_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228614_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228614_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228614_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228614_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228614_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228614_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228614_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228614_iter[i] /
                    (ctx->futhark_mc_segmap_task_228614_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228614_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228619     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228619_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228619_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228619_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228619_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228619_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228619_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228619_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228619_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228619_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228619_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228619_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228619_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228610         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228610_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228610_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228610_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228610_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228610_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228610_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228610_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228610_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228610_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228610_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228610_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228610_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228610_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228610_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228610_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228610_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228610_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228610_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228610_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228610_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228610_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228610_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228610_total_iter /
                (ctx->futhark_mc_segmap_parloop_228610_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228610_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228610_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228610_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228603            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228603_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228603_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228603_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228603_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228603_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228603_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228603_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228603_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228603_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228603_iter[i] /
                    (ctx->futhark_mc_segmap_task_228603_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228603_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228608     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228608_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228608_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228608_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228608_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228608_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228608_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228608_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228608_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228608_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228608_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228608_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228608_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228647         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228647_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228647_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228647_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228647_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228647_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228647_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228647_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228647_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228647_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228647_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228647_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228647_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228647_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228647_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228647_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228647_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228647_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228647_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228647_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228647_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228647_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228647_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228647_total_iter /
                (ctx->futhark_mc_segmap_parloop_228647_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228647_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228647_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228647_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228658         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228658_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228658_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228658_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228658_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228658_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228658_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228658_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228658_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228658_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228658_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228658_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228658_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228658_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228658_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228658_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228658_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228658_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228658_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228658_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228658_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228658_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228658_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228658_total_iter /
                (ctx->futhark_mc_segmap_parloop_228658_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228658_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228658_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228658_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228669         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228669_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228669_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228669_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228669_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228669_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228669_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228669_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228669_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228669_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228669_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228669_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228669_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228669_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228669_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228669_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228669_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228669_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228669_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228669_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228669_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228669_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228669_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228669_total_iter /
                (ctx->futhark_mc_segmap_parloop_228669_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228669_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228669_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228669_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228681 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228681_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228681_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228681_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228681_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228681_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228681_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228681_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228681_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228681_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228681_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228681_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228681_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228681_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228681_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228681_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228681_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228681_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228681_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228681_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228681_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228681_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228674            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228674_runs[i],
                    (long) ctx->futhark_mc_segred_task_228674_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228674_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228674_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228674_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228674_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228674_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228674_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228674_iter[i],
                    (long) ctx->futhark_mc_segred_task_228674_iter[i] /
                    (ctx->futhark_mc_segred_task_228674_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228674_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228687 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228687_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228687_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228687_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228687_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228687_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228687_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228687_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228687_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228687_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228687_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228687_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228687_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228687_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228687_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228687_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228687_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228687_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228687_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228687_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228687_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228687_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228683            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228683_runs[i],
                    (long) ctx->futhark_mc_segred_task_228683_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228683_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228683_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228683_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228683_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228683_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228683_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228683_iter[i],
                    (long) ctx->futhark_mc_segred_task_228683_iter[i] /
                    (ctx->futhark_mc_segred_task_228683_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228683_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228672         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228672_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228672_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228672_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228672_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228672_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228672_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228672_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228672_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228672_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228672_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228672_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228672_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228672_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228672_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228672_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228672_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228672_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228672_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228672_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228672_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228672_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228672_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228672_total_iter /
                (ctx->futhark_mc_segmap_parloop_228672_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228672_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228672_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228672_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228667            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228667_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228667_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228667_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228667_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228667_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228667_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228667_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228667_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228667_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228667_iter[i] /
                    (ctx->futhark_mc_segmap_task_228667_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228667_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228670     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228670_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228670_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228670_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228670_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228670_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228670_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228670_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228670_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228670_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228670_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228670_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228670_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228663         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228663_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228663_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228663_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228663_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228663_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228663_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228663_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228663_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228663_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228663_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228663_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228663_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228663_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228663_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228663_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228663_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228663_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228663_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228663_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228663_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228663_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228663_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228663_total_iter /
                (ctx->futhark_mc_segmap_parloop_228663_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228663_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228663_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228663_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228656            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228656_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228656_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228656_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228656_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228656_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228656_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228656_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228656_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228656_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228656_iter[i] /
                    (ctx->futhark_mc_segmap_task_228656_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228656_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228661     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228661_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228661_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228661_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228661_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228661_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228661_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228661_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228661_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228661_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228661_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228661_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228661_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228652         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228652_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228652_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228652_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228652_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228652_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228652_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228652_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228652_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228652_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228652_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228652_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228652_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228652_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228652_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228652_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228652_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228652_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228652_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228652_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228652_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228652_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228652_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228652_total_iter /
                (ctx->futhark_mc_segmap_parloop_228652_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228652_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228652_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228652_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228645            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228645_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228645_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228645_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228645_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228645_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228645_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228645_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228645_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228645_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228645_iter[i] /
                    (ctx->futhark_mc_segmap_task_228645_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228645_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228650     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228650_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228650_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228650_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228650_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228650_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228650_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228650_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228650_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228650_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228650_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228650_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228650_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228691         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228691_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228691_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228691_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228691_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228691_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228691_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228691_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228691_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228691_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228691_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228691_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228691_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228691_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228691_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228691_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228691_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228691_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228691_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228691_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228691_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228691_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228691_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228691_total_iter /
                (ctx->futhark_mc_segmap_parloop_228691_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228691_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228691_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228691_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228701         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228701_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228701_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228701_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228701_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228701_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228701_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228701_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228701_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228701_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228701_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228701_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228701_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228701_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228701_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228701_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228701_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228701_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228701_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228701_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228701_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228701_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228701_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228701_total_iter /
                (ctx->futhark_mc_segmap_parloop_228701_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228701_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228701_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228701_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228711         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228711_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228711_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228711_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228711_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228711_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228711_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228711_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228711_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228711_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228711_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228711_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228711_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228711_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228711_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228711_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228711_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228711_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228711_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228711_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228711_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228711_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228711_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228711_total_iter /
                (ctx->futhark_mc_segmap_parloop_228711_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228711_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228711_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228711_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228721 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228721_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228721_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228721_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228721_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228721_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228721_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228721_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228721_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228721_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228721_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228721_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228721_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228721_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228721_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228721_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228721_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228721_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228721_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228721_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228721_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228721_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228718            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228718_runs[i],
                    (long) ctx->futhark_mc_segred_task_228718_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228718_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228718_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228718_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228718_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228718_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228718_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228718_iter[i],
                    (long) ctx->futhark_mc_segred_task_228718_iter[i] /
                    (ctx->futhark_mc_segred_task_228718_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228718_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228726 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228726_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228726_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228726_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228726_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228726_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228726_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228726_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228726_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228726_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228726_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228726_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228726_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228726_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228726_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228726_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228726_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228726_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228726_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228726_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228726_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228726_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228723            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228723_runs[i],
                    (long) ctx->futhark_mc_segred_task_228723_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228723_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228723_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228723_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228723_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228723_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228723_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228723_iter[i],
                    (long) ctx->futhark_mc_segred_task_228723_iter[i] /
                    (ctx->futhark_mc_segred_task_228723_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228723_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228715         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228715_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228715_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228715_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228715_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228715_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228715_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228715_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228715_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228715_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228715_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228715_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228715_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228715_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228715_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228715_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228715_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228715_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228715_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228715_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228715_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228715_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228715_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228715_total_iter /
                (ctx->futhark_mc_segmap_parloop_228715_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228715_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228715_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228715_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228709            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228709_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228709_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228709_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228709_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228709_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228709_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228709_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228709_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228709_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228709_iter[i] /
                    (ctx->futhark_mc_segmap_task_228709_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228709_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228713     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228713_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228713_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228713_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228713_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228713_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228713_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228713_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228713_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228713_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228713_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228713_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228713_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228706         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228706_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228706_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228706_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228706_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228706_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228706_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228706_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228706_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228706_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228706_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228706_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228706_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228706_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228706_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228706_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228706_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228706_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228706_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228706_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228706_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228706_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228706_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228706_total_iter /
                (ctx->futhark_mc_segmap_parloop_228706_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228706_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228706_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228706_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228699            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228699_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228699_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228699_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228699_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228699_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228699_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228699_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228699_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228699_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228699_iter[i] /
                    (ctx->futhark_mc_segmap_task_228699_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228699_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228704     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228704_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228704_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228704_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228704_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228704_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228704_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228704_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228704_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228704_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228704_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228704_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228704_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228696         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228696_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228696_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228696_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228696_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228696_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228696_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228696_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228696_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228696_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228696_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228696_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228696_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228696_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228696_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228696_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228696_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228696_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228696_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228696_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228696_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228696_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228696_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228696_total_iter /
                (ctx->futhark_mc_segmap_parloop_228696_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228696_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228696_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228696_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228689            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228689_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228689_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228689_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228689_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228689_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228689_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228689_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228689_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228689_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228689_iter[i] /
                    (ctx->futhark_mc_segmap_task_228689_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228689_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228694     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228694_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228694_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228694_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228694_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228694_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228694_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228694_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228694_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228694_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228694_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228694_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228694_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228730         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228730_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228730_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228730_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228730_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228730_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228730_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228730_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228730_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228730_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228730_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228730_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228730_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228730_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228730_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228730_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228730_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228730_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228730_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228730_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228730_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228730_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228730_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228730_total_iter /
                (ctx->futhark_mc_segmap_parloop_228730_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228730_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228730_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228730_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228743         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228743_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228743_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228743_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228743_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228743_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228743_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228743_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228743_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228743_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228743_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228743_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228743_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228743_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228743_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228743_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228743_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228743_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228743_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228743_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228743_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228743_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228743_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228743_total_iter /
                (ctx->futhark_mc_segmap_parloop_228743_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228743_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228743_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228743_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228756         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228756_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228756_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228756_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228756_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228756_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228756_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228756_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228756_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228756_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228756_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228756_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228756_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228756_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228756_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228756_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228756_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228756_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228756_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228756_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228756_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228756_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228756_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228756_total_iter /
                (ctx->futhark_mc_segmap_parloop_228756_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228756_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228756_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228756_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228770 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228770_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228770_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228770_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228770_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228770_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228770_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228770_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228770_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228770_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228770_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228770_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228770_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228770_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228770_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228770_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228770_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228770_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228770_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228770_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228770_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228770_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228765            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228765_runs[i],
                    (long) ctx->futhark_mc_segred_task_228765_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228765_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228765_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228765_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228765_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228765_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228765_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228765_iter[i],
                    (long) ctx->futhark_mc_segred_task_228765_iter[i] /
                    (ctx->futhark_mc_segred_task_228765_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228765_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228776 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228776_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228776_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228776_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228776_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228776_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228776_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228776_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228776_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228776_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228776_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228776_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228776_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228776_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228776_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228776_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228776_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228776_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228776_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228776_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228776_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228776_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228772            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228772_runs[i],
                    (long) ctx->futhark_mc_segred_task_228772_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228772_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228772_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228772_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228772_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228772_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228772_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228772_iter[i],
                    (long) ctx->futhark_mc_segred_task_228772_iter[i] /
                    (ctx->futhark_mc_segred_task_228772_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228772_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228761         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228761_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228761_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228761_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228761_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228761_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228761_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228761_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228761_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228761_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228761_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228761_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228761_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228761_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228761_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228761_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228761_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228761_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228761_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228761_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228761_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228761_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228761_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228761_total_iter /
                (ctx->futhark_mc_segmap_parloop_228761_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228761_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228761_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228761_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228754            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228754_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228754_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228754_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228754_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228754_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228754_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228754_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228754_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228754_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228754_iter[i] /
                    (ctx->futhark_mc_segmap_task_228754_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228754_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228759     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228759_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228759_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228759_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228759_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228759_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228759_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228759_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228759_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228759_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228759_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228759_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228759_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228750         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228750_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228750_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228750_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228750_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228750_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228750_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228750_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228750_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228750_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228750_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228750_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228750_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228750_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228750_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228750_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228750_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228750_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228750_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228750_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228750_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228750_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228750_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228750_total_iter /
                (ctx->futhark_mc_segmap_parloop_228750_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228750_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228750_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228750_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228741            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228741_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228741_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228741_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228741_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228741_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228741_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228741_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228741_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228741_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228741_iter[i] /
                    (ctx->futhark_mc_segmap_task_228741_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228741_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228748     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228748_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228748_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228748_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228748_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228748_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228748_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228748_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228748_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228748_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228748_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228748_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228748_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228737         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228737_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228737_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228737_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228737_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228737_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228737_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228737_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228737_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228737_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228737_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228737_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228737_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228737_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228737_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228737_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228737_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228737_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228737_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228737_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228737_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228737_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228737_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228737_total_iter /
                (ctx->futhark_mc_segmap_parloop_228737_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228737_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228737_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228737_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228728            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228728_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228728_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228728_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228728_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228728_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228728_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228728_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228728_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228728_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228728_iter[i] /
                    (ctx->futhark_mc_segmap_task_228728_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228728_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228735     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228735_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228735_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228735_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228735_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228735_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228735_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228735_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228735_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228735_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228735_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228735_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228735_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228780         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228780_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228780_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228780_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228780_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228780_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228780_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228780_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228780_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228780_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228780_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228780_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228780_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228780_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228780_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228780_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228780_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228780_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228780_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228780_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228780_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228780_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228780_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228780_total_iter /
                (ctx->futhark_mc_segmap_parloop_228780_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228780_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228780_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228780_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228795         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228795_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228795_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228795_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228795_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228795_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228795_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228795_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228795_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228795_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228795_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228795_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228795_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228795_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228795_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228795_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228795_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228795_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228795_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228795_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228795_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228795_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228795_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228795_total_iter /
                (ctx->futhark_mc_segmap_parloop_228795_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228795_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228795_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228795_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228810         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228810_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228810_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228810_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228810_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228810_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228810_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228810_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228810_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228810_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228810_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228810_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228810_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228810_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228810_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228810_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228810_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228810_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228810_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228810_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228810_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228810_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228810_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228810_total_iter /
                (ctx->futhark_mc_segmap_parloop_228810_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228810_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228810_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228810_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228825         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228825_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228825_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228825_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228825_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228825_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228825_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228825_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228825_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228825_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228825_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228825_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228825_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228825_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228825_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228825_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228825_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228825_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228825_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228825_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228825_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228825_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228825_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228825_total_iter /
                (ctx->futhark_mc_segmap_parloop_228825_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228825_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228825_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228825_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228823            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228823_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228823_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228823_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228823_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228823_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228823_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228823_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228823_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228823_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228823_iter[i] /
                    (ctx->futhark_mc_segmap_task_228823_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228823_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228834 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228834_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228834_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228834_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228834_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228834_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228834_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228834_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228834_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228834_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228834_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228834_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228834_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228834_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228834_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228834_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228834_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228834_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228834_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228834_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228834_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228834_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228827            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228827_runs[i],
                    (long) ctx->futhark_mc_segred_task_228827_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228827_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228827_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228827_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228827_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228827_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228827_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228827_iter[i],
                    (long) ctx->futhark_mc_segred_task_228827_iter[i] /
                    (ctx->futhark_mc_segred_task_228827_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228827_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228840 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228840_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228840_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228840_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228840_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228840_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228840_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228840_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228840_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228840_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228840_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228840_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228840_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228840_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228840_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228840_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228840_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228840_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228840_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228840_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228840_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228840_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228836            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228836_runs[i],
                    (long) ctx->futhark_mc_segred_task_228836_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228836_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228836_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228836_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228836_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228836_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228836_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228836_iter[i],
                    (long) ctx->futhark_mc_segred_task_228836_iter[i] /
                    (ctx->futhark_mc_segred_task_228836_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228836_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228817         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228817_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228817_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228817_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228817_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228817_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228817_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228817_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228817_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228817_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228817_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228817_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228817_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228817_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228817_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228817_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228817_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228817_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228817_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228817_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228817_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228817_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228817_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228817_total_iter /
                (ctx->futhark_mc_segmap_parloop_228817_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228817_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228817_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228817_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228808            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228808_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228808_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228808_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228808_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228808_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228808_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228808_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228808_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228808_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228808_iter[i] /
                    (ctx->futhark_mc_segmap_task_228808_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228808_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228815     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228815_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228815_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228815_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228815_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228815_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228815_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228815_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228815_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228815_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228815_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228815_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228815_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228804         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228804_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228804_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228804_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228804_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228804_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228804_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228804_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228804_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228804_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228804_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228804_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228804_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228804_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228804_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228804_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228804_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228804_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228804_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228804_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228804_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228804_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228804_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228804_total_iter /
                (ctx->futhark_mc_segmap_parloop_228804_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228804_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228804_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228804_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228793            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228793_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228793_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228793_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228793_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228793_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228793_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228793_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228793_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228793_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228793_iter[i] /
                    (ctx->futhark_mc_segmap_task_228793_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228793_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228802     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228802_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228802_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228802_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228802_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228802_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228802_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228802_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228802_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228802_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228802_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228802_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228802_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228789         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228789_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228789_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228789_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228789_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228789_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228789_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228789_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228789_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228789_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228789_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228789_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228789_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228789_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228789_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228789_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228789_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228789_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228789_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228789_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228789_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228789_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228789_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228789_total_iter /
                (ctx->futhark_mc_segmap_parloop_228789_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228789_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228789_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228789_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228778            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228778_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228778_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228778_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228778_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228778_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228778_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228778_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228778_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228778_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228778_iter[i] /
                    (ctx->futhark_mc_segmap_task_228778_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228778_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228787     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228787_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228787_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228787_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228787_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228787_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228787_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228787_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228787_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228787_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228787_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228787_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228787_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228844         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228844_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228844_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228844_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228844_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228844_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228844_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228844_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228844_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228844_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228844_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228844_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228844_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228844_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228844_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228844_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228844_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228844_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228844_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228844_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228844_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228844_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228844_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228844_total_iter /
                (ctx->futhark_mc_segmap_parloop_228844_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228844_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228844_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228844_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228853         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228853_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228853_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228853_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228853_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228853_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228853_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228853_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228853_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228853_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228853_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228853_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228853_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228853_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228853_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228853_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228853_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228853_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228853_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228853_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228853_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228853_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228853_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228853_total_iter /
                (ctx->futhark_mc_segmap_parloop_228853_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228853_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228853_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228853_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228862         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228862_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228862_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228862_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228862_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228862_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228862_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228862_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228862_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228862_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228862_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228862_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228862_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228862_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228862_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228862_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228862_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228862_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228862_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228862_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228862_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228862_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228862_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228862_total_iter /
                (ctx->futhark_mc_segmap_parloop_228862_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228862_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228862_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228862_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228860            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228860_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228860_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228860_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228860_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228860_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228860_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228860_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228860_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228860_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228860_iter[i] /
                    (ctx->futhark_mc_segmap_task_228860_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228860_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228857         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228857_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228857_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228857_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228857_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228857_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228857_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228857_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228857_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228857_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228857_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228857_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228857_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228857_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228857_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228857_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228857_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228857_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228857_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228857_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228857_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228857_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228857_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228857_total_iter /
                (ctx->futhark_mc_segmap_parloop_228857_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228857_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228857_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228857_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228851            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228851_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228851_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228851_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228851_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228851_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228851_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228851_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228851_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228851_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228851_iter[i] /
                    (ctx->futhark_mc_segmap_task_228851_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228851_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228855     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228855_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228855_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228855_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228855_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228855_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228855_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228855_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228855_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228855_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228855_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228855_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228855_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228848         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228848_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228848_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228848_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228848_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228848_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228848_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228848_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228848_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228848_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228848_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228848_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228848_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228848_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228848_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228848_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228848_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228848_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228848_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228848_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228848_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228848_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228848_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228848_total_iter /
                (ctx->futhark_mc_segmap_parloop_228848_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228848_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228848_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228848_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228842            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228842_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228842_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228842_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228842_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228842_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228842_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228842_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228842_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228842_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228842_iter[i] /
                    (ctx->futhark_mc_segmap_task_228842_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228842_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228846     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228846_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228846_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228846_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228846_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228846_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228846_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228846_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228846_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228846_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228846_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228846_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228846_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228866         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228866_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228866_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228866_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228866_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228866_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228866_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228866_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228866_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228866_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228866_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228866_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228866_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228866_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228866_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228866_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228866_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228866_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228866_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228866_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228866_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228866_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228866_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228866_total_iter /
                (ctx->futhark_mc_segmap_parloop_228866_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228866_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228866_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228866_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228875         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228875_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228875_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228875_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228875_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228875_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228875_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228875_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228875_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228875_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228875_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228875_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228875_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228875_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228875_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228875_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228875_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228875_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228875_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228875_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228875_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228875_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228875_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228875_total_iter /
                (ctx->futhark_mc_segmap_parloop_228875_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228875_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228875_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228875_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228873            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228873_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228873_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228873_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228873_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228873_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228873_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228873_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228873_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228873_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228873_iter[i] /
                    (ctx->futhark_mc_segmap_task_228873_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228873_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228870         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228870_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228870_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228870_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228870_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228870_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228870_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228870_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228870_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228870_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228870_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228870_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228870_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228870_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228870_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228870_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228870_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228870_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228870_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228870_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228870_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228870_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228870_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228870_total_iter /
                (ctx->futhark_mc_segmap_parloop_228870_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228870_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228870_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228870_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228864            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228864_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228864_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228864_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228864_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228864_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228864_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228864_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228864_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228864_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228864_iter[i] /
                    (ctx->futhark_mc_segmap_task_228864_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228864_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228868     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228868_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228868_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228868_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228868_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228868_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228868_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228868_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228868_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228868_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228868_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228868_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228868_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228879         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228879_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228879_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228879_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228879_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228879_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228879_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228879_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228879_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228879_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228879_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228879_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228879_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228879_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228879_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228879_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228879_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228879_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228879_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228879_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228879_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228879_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228879_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228879_total_iter /
                (ctx->futhark_mc_segmap_parloop_228879_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228879_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228879_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228879_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228887 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228887_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228887_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228887_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228887_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228887_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228887_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228887_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228887_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228887_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228887_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228887_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228887_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228887_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228887_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228887_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228887_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228887_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228887_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228887_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228887_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228887_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228884            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228884_runs[i],
                    (long) ctx->futhark_mc_segred_task_228884_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228884_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228884_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228884_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228884_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228884_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228884_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228884_iter[i],
                    (long) ctx->futhark_mc_segred_task_228884_iter[i] /
                    (ctx->futhark_mc_segred_task_228884_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228884_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228882         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228882_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228882_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228882_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228882_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228882_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228882_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228882_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228882_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228882_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228882_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228882_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228882_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228882_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228882_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228882_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228882_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228882_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228882_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228882_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228882_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228882_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228882_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228882_total_iter /
                (ctx->futhark_mc_segmap_parloop_228882_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228882_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228882_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228882_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228877            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228877_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228877_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228877_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228877_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228877_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228877_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228877_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228877_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228877_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228877_iter[i] /
                    (ctx->futhark_mc_segmap_task_228877_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228877_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228880     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228880_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228880_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228880_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228880_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228880_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228880_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228880_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228880_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228880_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228880_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228880_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228880_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228891         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228891_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228891_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228891_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228891_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228891_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228891_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228891_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228891_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228891_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228891_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228891_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228891_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228891_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228891_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228891_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228891_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228891_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228891_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228891_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228891_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228891_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228891_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228891_total_iter /
                (ctx->futhark_mc_segmap_parloop_228891_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228891_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228891_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228891_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_1_parloop_228901   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_1_parloop_228901_runs[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228901_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228901_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228901_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228901_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_1_parloop_228901_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228901_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228901_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228901_iter[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228901_iter[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228901_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228901_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_1_parloop_228901_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228901_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228901_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_1_parloop_228901_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228901_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228901_total_iter),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228901_total_iter,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228901_total_iter /
                (ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_1_parloop_228901_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_3_parloop_228903   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_3_parloop_228903_runs[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228903_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228903_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228903_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228903_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_3_parloop_228903_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228903_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228903_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228903_iter[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228903_iter[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228903_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228903_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_3_parloop_228903_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228903_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228903_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_3_parloop_228903_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228903_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228903_total_iter),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228903_total_iter,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228903_total_iter /
                (ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_3_parloop_228903_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segscan_task_228898           ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segscan_task_228898_runs[i],
                    (long) ctx->futhark_mc_segscan_task_228898_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228898_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228898_runs[i] : 1),
                    (long) ctx->futhark_mc_segscan_task_228898_total_runtime[i],
                    (double) ctx->futhark_mc_segscan_task_228898_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228898_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segscan_task_228898_iter[i]),
                    (long) ctx->futhark_mc_segscan_task_228898_iter[i],
                    (long) ctx->futhark_mc_segscan_task_228898_iter[i] /
                    (ctx->futhark_mc_segscan_task_228898_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228898_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228895         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228895_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228895_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228895_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228895_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228895_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228895_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228895_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228895_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228895_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228895_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228895_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228895_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228895_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228895_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228895_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228895_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228895_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228895_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228895_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228895_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228895_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228895_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228895_total_iter /
                (ctx->futhark_mc_segmap_parloop_228895_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228895_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228895_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228895_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228889            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228889_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228889_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228889_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228889_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228889_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228889_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228889_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228889_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228889_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228889_iter[i] /
                    (ctx->futhark_mc_segmap_task_228889_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228889_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228893     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228893_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228893_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228893_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228893_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228893_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228893_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228893_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228893_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228893_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228893_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228893_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228893_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228907         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228907_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228907_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228907_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228907_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228907_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228907_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228907_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228907_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228907_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228907_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228907_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228907_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228907_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228907_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228907_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228907_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228907_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228907_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228907_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228907_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228907_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228907_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228907_total_iter /
                (ctx->futhark_mc_segmap_parloop_228907_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228907_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228907_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228907_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228915 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228915_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228915_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228915_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228915_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228915_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228915_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228915_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228915_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228915_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228915_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228915_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228915_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228915_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228915_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228915_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228915_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228915_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228915_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228915_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228915_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228915_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228912            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228912_runs[i],
                    (long) ctx->futhark_mc_segred_task_228912_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228912_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228912_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228912_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228912_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228912_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228912_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228912_iter[i],
                    (long) ctx->futhark_mc_segred_task_228912_iter[i] /
                    (ctx->futhark_mc_segred_task_228912_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228912_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228910         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228910_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228910_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228910_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228910_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228910_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228910_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228910_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228910_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228910_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228910_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228910_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228910_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228910_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228910_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228910_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228910_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228910_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228910_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228910_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228910_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228910_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228910_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228910_total_iter /
                (ctx->futhark_mc_segmap_parloop_228910_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228910_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228910_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228910_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228905            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228905_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228905_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228905_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228905_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228905_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228905_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228905_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228905_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228905_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228905_iter[i] /
                    (ctx->futhark_mc_segmap_task_228905_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228905_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228908     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228908_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228908_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228908_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228908_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228908_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228908_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228908_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228908_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228908_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228908_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228908_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228908_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228919         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228919_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228919_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228919_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228919_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228919_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228919_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228919_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228919_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228919_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228919_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228919_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228919_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228919_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228919_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228919_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228919_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228919_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228919_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228919_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228919_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228919_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228919_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228919_total_iter /
                (ctx->futhark_mc_segmap_parloop_228919_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228919_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228919_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228919_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_1_parloop_228929   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_1_parloop_228929_runs[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228929_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228929_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228929_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228929_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_1_parloop_228929_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228929_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228929_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228929_iter[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228929_iter[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228929_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228929_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_1_parloop_228929_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228929_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228929_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_1_parloop_228929_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228929_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228929_total_iter),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228929_total_iter,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228929_total_iter /
                (ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_1_parloop_228929_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_3_parloop_228931   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_3_parloop_228931_runs[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228931_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228931_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228931_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228931_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_3_parloop_228931_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228931_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228931_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228931_iter[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228931_iter[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228931_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228931_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_3_parloop_228931_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228931_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228931_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_3_parloop_228931_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228931_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228931_total_iter),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228931_total_iter,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228931_total_iter /
                (ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_3_parloop_228931_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segscan_task_228926           ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segscan_task_228926_runs[i],
                    (long) ctx->futhark_mc_segscan_task_228926_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228926_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228926_runs[i] : 1),
                    (long) ctx->futhark_mc_segscan_task_228926_total_runtime[i],
                    (double) ctx->futhark_mc_segscan_task_228926_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228926_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segscan_task_228926_iter[i]),
                    (long) ctx->futhark_mc_segscan_task_228926_iter[i],
                    (long) ctx->futhark_mc_segscan_task_228926_iter[i] /
                    (ctx->futhark_mc_segscan_task_228926_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228926_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228923         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228923_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228923_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228923_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228923_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228923_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228923_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228923_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228923_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228923_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228923_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228923_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228923_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228923_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228923_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228923_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228923_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228923_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228923_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228923_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228923_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228923_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228923_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228923_total_iter /
                (ctx->futhark_mc_segmap_parloop_228923_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228923_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228923_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228923_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228917            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228917_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228917_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228917_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228917_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228917_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228917_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228917_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228917_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228917_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228917_iter[i] /
                    (ctx->futhark_mc_segmap_task_228917_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228917_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228921     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228921_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228921_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228921_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228921_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228921_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228921_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228921_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228921_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228921_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228921_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228921_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228921_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228935         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228935_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228935_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228935_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228935_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228935_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228935_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228935_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228935_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228935_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228935_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228935_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228935_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228935_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228935_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228935_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228935_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228935_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228935_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228935_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228935_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228935_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228935_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228935_total_iter /
                (ctx->futhark_mc_segmap_parloop_228935_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228935_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228935_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228935_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228943 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228943_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228943_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228943_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228943_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228943_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228943_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228943_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228943_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228943_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228943_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228943_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228943_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228943_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228943_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228943_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228943_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228943_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228943_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228943_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228943_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228943_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228940            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228940_runs[i],
                    (long) ctx->futhark_mc_segred_task_228940_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228940_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228940_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228940_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228940_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228940_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228940_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228940_iter[i],
                    (long) ctx->futhark_mc_segred_task_228940_iter[i] /
                    (ctx->futhark_mc_segred_task_228940_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228940_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228938         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228938_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228938_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228938_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228938_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228938_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228938_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228938_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228938_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228938_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228938_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228938_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228938_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228938_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228938_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228938_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228938_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228938_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228938_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228938_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228938_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228938_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228938_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228938_total_iter /
                (ctx->futhark_mc_segmap_parloop_228938_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228938_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228938_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228938_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228933            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228933_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228933_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228933_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228933_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228933_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228933_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228933_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228933_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228933_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228933_iter[i] /
                    (ctx->futhark_mc_segmap_task_228933_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228933_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228936     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228936_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228936_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228936_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228936_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228936_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228936_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228936_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228936_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228936_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228936_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228936_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228936_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228947         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228947_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228947_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228947_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228947_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228947_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228947_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228947_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228947_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228947_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228947_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228947_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228947_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228947_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228947_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228947_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228947_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228947_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228947_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228947_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228947_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228947_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228947_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228947_total_iter /
                (ctx->futhark_mc_segmap_parloop_228947_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228947_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228947_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228947_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_1_parloop_228957   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_1_parloop_228957_runs[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228957_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228957_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228957_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228957_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_1_parloop_228957_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228957_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228957_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228957_iter[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_228957_iter[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_228957_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_228957_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_1_parloop_228957_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228957_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228957_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_1_parloop_228957_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_228957_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_228957_total_iter),
                (long) ctx->futhark_mc_scan_stage_1_parloop_228957_total_iter,
                (long) ctx->futhark_mc_scan_stage_1_parloop_228957_total_iter /
                (ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_1_parloop_228957_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_3_parloop_228959   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_3_parloop_228959_runs[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228959_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228959_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228959_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228959_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_3_parloop_228959_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228959_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228959_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228959_iter[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_228959_iter[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_228959_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_228959_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_3_parloop_228959_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228959_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228959_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_3_parloop_228959_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_228959_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_228959_total_iter),
                (long) ctx->futhark_mc_scan_stage_3_parloop_228959_total_iter,
                (long) ctx->futhark_mc_scan_stage_3_parloop_228959_total_iter /
                (ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_3_parloop_228959_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segscan_task_228954           ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segscan_task_228954_runs[i],
                    (long) ctx->futhark_mc_segscan_task_228954_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228954_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228954_runs[i] : 1),
                    (long) ctx->futhark_mc_segscan_task_228954_total_runtime[i],
                    (double) ctx->futhark_mc_segscan_task_228954_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_228954_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segscan_task_228954_iter[i]),
                    (long) ctx->futhark_mc_segscan_task_228954_iter[i],
                    (long) ctx->futhark_mc_segscan_task_228954_iter[i] /
                    (ctx->futhark_mc_segscan_task_228954_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_228954_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228951         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228951_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228951_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228951_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228951_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228951_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228951_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228951_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228951_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228951_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228951_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228951_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228951_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228951_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228951_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228951_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228951_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228951_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228951_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228951_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228951_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228951_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228951_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228951_total_iter /
                (ctx->futhark_mc_segmap_parloop_228951_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228951_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228951_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228951_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228945            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228945_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228945_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228945_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228945_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228945_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228945_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228945_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228945_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228945_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228945_iter[i] /
                    (ctx->futhark_mc_segmap_task_228945_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228945_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228949     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228949_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228949_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228949_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228949_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228949_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228949_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228949_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228949_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228949_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228949_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228949_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228949_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228963         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228963_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228963_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228963_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228963_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228963_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228963_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228963_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228963_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228963_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228963_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228963_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228963_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228963_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228963_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228963_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228963_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228963_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228963_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228963_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228963_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228963_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228963_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228963_total_iter /
                (ctx->futhark_mc_segmap_parloop_228963_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228963_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228963_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228963_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228972         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228972_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228972_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228972_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228972_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228972_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228972_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228972_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228972_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228972_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228972_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228972_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228972_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228972_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228972_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228972_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228972_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228972_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228972_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228972_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228972_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228972_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228972_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228972_total_iter /
                (ctx->futhark_mc_segmap_parloop_228972_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228972_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228972_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228972_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228980 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228980_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228980_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228980_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228980_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228980_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228980_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228980_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228980_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228980_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228980_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228980_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228980_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228980_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228980_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228980_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228980_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228980_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228980_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228980_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228980_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228980_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228977            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228977_runs[i],
                    (long) ctx->futhark_mc_segred_task_228977_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228977_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228977_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228977_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228977_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228977_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228977_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228977_iter[i],
                    (long) ctx->futhark_mc_segred_task_228977_iter[i] /
                    (ctx->futhark_mc_segred_task_228977_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228977_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_228985 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_228985_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228985_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228985_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228985_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228985_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_228985_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228985_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228985_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228985_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_228985_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_228985_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_228985_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_228985_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228985_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228985_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_228985_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_228985_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_228985_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_228985_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_228985_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_228985_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_228982            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_228982_runs[i],
                    (long) ctx->futhark_mc_segred_task_228982_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228982_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228982_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_228982_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_228982_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_228982_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_228982_iter[i]),
                    (long) ctx->futhark_mc_segred_task_228982_iter[i],
                    (long) ctx->futhark_mc_segred_task_228982_iter[i] /
                    (ctx->futhark_mc_segred_task_228982_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_228982_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228975         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228975_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228975_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228975_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228975_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228975_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228975_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228975_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228975_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228975_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228975_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228975_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228975_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228975_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228975_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228975_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228975_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228975_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228975_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228975_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228975_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228975_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228975_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228975_total_iter /
                (ctx->futhark_mc_segmap_parloop_228975_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228975_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228975_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228975_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228970            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228970_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228970_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228970_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228970_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228970_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228970_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228970_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228970_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228970_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228970_iter[i] /
                    (ctx->futhark_mc_segmap_task_228970_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228970_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228973     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228973_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228973_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228973_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228973_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228973_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228973_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228973_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228973_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228973_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228973_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228973_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228973_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228967         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228967_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228967_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228967_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228967_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228967_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228967_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228967_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228967_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228967_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228967_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228967_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228967_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228967_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228967_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228967_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228967_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228967_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228967_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228967_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228967_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228967_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228967_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228967_total_iter /
                (ctx->futhark_mc_segmap_parloop_228967_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228967_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228967_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228967_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228961            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228961_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228961_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228961_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228961_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228961_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228961_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228961_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228961_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228961_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228961_iter[i] /
                    (ctx->futhark_mc_segmap_task_228961_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228961_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228965     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228965_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228965_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228965_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228965_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228965_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228965_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228965_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228965_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228965_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228965_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228965_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228965_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228989         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228989_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228989_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228989_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228989_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228989_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228989_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228989_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228989_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228989_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228989_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228989_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228989_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228989_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228989_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228989_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228989_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228989_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228989_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228989_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228989_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228989_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228989_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228989_total_iter /
                (ctx->futhark_mc_segmap_parloop_228989_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228989_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228989_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228989_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229000         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229000_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229000_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229000_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229000_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229000_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229000_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229000_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229000_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229000_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229000_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229000_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229000_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229000_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229000_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229000_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229000_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229000_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229000_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229000_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229000_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229000_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229000_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229000_total_iter /
                (ctx->futhark_mc_segmap_parloop_229000_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229000_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229000_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229000_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229010 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229010_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229010_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229010_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229010_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229010_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229010_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229010_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229010_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229010_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229010_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229010_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229010_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229010_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229010_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229010_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229010_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229010_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229010_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229010_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229010_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229010_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229005            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229005_runs[i],
                    (long) ctx->futhark_mc_segred_task_229005_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229005_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229005_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229005_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229005_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229005_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229005_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229005_iter[i],
                    (long) ctx->futhark_mc_segred_task_229005_iter[i] /
                    (ctx->futhark_mc_segred_task_229005_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229005_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229016 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229016_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229016_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229016_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229016_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229016_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229016_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229016_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229016_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229016_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229016_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229016_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229016_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229016_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229016_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229016_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229016_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229016_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229016_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229016_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229016_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229016_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229012            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229012_runs[i],
                    (long) ctx->futhark_mc_segred_task_229012_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229012_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229012_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229012_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229012_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229012_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229012_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229012_iter[i],
                    (long) ctx->futhark_mc_segred_task_229012_iter[i] /
                    (ctx->futhark_mc_segred_task_229012_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229012_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229003         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229003_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229003_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229003_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229003_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229003_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229003_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229003_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229003_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229003_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229003_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229003_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229003_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229003_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229003_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229003_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229003_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229003_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229003_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229003_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229003_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229003_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229003_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229003_total_iter /
                (ctx->futhark_mc_segmap_parloop_229003_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229003_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229003_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229003_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228998            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228998_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228998_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228998_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228998_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228998_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228998_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228998_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228998_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228998_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228998_iter[i] /
                    (ctx->futhark_mc_segmap_task_228998_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228998_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229001     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229001_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229001_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229001_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229001_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229001_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229001_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229001_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229001_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229001_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229001_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229001_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229001_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_228994         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_228994_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_228994_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228994_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228994_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_228994_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_228994_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_228994_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228994_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_228994_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_228994_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_228994_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_228994_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_228994_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_228994_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_228994_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228994_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228994_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_228994_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_228994_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_228994_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_228994_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_228994_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_228994_total_iter /
                (ctx->futhark_mc_segmap_parloop_228994_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_228994_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_228994_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_228994_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_228987            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_228987_runs[i],
                    (long) ctx->futhark_mc_segmap_task_228987_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228987_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228987_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_228987_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_228987_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_228987_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_228987_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_228987_iter[i],
                    (long) ctx->futhark_mc_segmap_task_228987_iter[i] /
                    (ctx->futhark_mc_segmap_task_228987_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_228987_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_228992     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_228992_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228992_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228992_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228992_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_228992_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_228992_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_228992_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_228992_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_228992_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_228992_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_228992_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_228992_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229020         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229020_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229020_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229020_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229020_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229020_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229020_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229020_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229020_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229020_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229020_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229020_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229020_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229020_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229020_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229020_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229020_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229020_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229020_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229020_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229020_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229020_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229020_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229020_total_iter /
                (ctx->futhark_mc_segmap_parloop_229020_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229020_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229020_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229020_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229031         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229031_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229031_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229031_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229031_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229031_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229031_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229031_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229031_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229031_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229031_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229031_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229031_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229031_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229031_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229031_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229031_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229031_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229031_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229031_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229031_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229031_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229031_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229031_total_iter /
                (ctx->futhark_mc_segmap_parloop_229031_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229031_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229031_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229031_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229043 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229043_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229043_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229043_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229043_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229043_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229043_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229043_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229043_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229043_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229043_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229043_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229043_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229043_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229043_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229043_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229043_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229043_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229043_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229043_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229043_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229043_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229036            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229036_runs[i],
                    (long) ctx->futhark_mc_segred_task_229036_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229036_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229036_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229036_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229036_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229036_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229036_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229036_iter[i],
                    (long) ctx->futhark_mc_segred_task_229036_iter[i] /
                    (ctx->futhark_mc_segred_task_229036_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229036_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229049 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229049_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229049_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229049_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229049_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229049_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229049_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229049_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229049_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229049_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229049_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229049_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229049_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229049_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229049_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229049_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229049_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229049_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229049_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229049_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229049_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229049_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229045            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229045_runs[i],
                    (long) ctx->futhark_mc_segred_task_229045_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229045_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229045_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229045_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229045_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229045_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229045_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229045_iter[i],
                    (long) ctx->futhark_mc_segred_task_229045_iter[i] /
                    (ctx->futhark_mc_segred_task_229045_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229045_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229034         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229034_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229034_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229034_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229034_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229034_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229034_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229034_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229034_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229034_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229034_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229034_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229034_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229034_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229034_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229034_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229034_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229034_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229034_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229034_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229034_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229034_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229034_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229034_total_iter /
                (ctx->futhark_mc_segmap_parloop_229034_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229034_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229034_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229034_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229029            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229029_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229029_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229029_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229029_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229029_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229029_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229029_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229029_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229029_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229029_iter[i] /
                    (ctx->futhark_mc_segmap_task_229029_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229029_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229032     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229032_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229032_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229032_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229032_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229032_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229032_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229032_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229032_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229032_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229032_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229032_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229032_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229025         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229025_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229025_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229025_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229025_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229025_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229025_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229025_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229025_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229025_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229025_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229025_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229025_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229025_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229025_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229025_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229025_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229025_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229025_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229025_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229025_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229025_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229025_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229025_total_iter /
                (ctx->futhark_mc_segmap_parloop_229025_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229025_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229025_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229025_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229018            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229018_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229018_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229018_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229018_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229018_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229018_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229018_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229018_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229018_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229018_iter[i] /
                    (ctx->futhark_mc_segmap_task_229018_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229018_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229023     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229023_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229023_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229023_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229023_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229023_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229023_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229023_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229023_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229023_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229023_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229023_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229023_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229053         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229053_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229053_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229053_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229053_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229053_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229053_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229053_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229053_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229053_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229053_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229053_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229053_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229053_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229053_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229053_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229053_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229053_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229053_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229053_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229053_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229053_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229053_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229053_total_iter /
                (ctx->futhark_mc_segmap_parloop_229053_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229053_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229053_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229053_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229063         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229063_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229063_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229063_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229063_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229063_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229063_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229063_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229063_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229063_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229063_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229063_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229063_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229063_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229063_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229063_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229063_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229063_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229063_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229063_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229063_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229063_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229063_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229063_total_iter /
                (ctx->futhark_mc_segmap_parloop_229063_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229063_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229063_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229063_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229073 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229073_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229073_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229073_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229073_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229073_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229073_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229073_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229073_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229073_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229073_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229073_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229073_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229073_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229073_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229073_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229073_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229073_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229073_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229073_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229073_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229073_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229070            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229070_runs[i],
                    (long) ctx->futhark_mc_segred_task_229070_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229070_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229070_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229070_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229070_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229070_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229070_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229070_iter[i],
                    (long) ctx->futhark_mc_segred_task_229070_iter[i] /
                    (ctx->futhark_mc_segred_task_229070_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229070_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229078 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229078_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229078_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229078_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229078_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229078_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229078_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229078_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229078_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229078_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229078_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229078_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229078_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229078_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229078_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229078_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229078_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229078_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229078_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229078_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229078_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229078_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229075            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229075_runs[i],
                    (long) ctx->futhark_mc_segred_task_229075_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229075_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229075_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229075_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229075_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229075_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229075_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229075_iter[i],
                    (long) ctx->futhark_mc_segred_task_229075_iter[i] /
                    (ctx->futhark_mc_segred_task_229075_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229075_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229067         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229067_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229067_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229067_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229067_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229067_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229067_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229067_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229067_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229067_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229067_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229067_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229067_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229067_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229067_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229067_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229067_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229067_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229067_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229067_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229067_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229067_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229067_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229067_total_iter /
                (ctx->futhark_mc_segmap_parloop_229067_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229067_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229067_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229067_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229061            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229061_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229061_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229061_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229061_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229061_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229061_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229061_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229061_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229061_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229061_iter[i] /
                    (ctx->futhark_mc_segmap_task_229061_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229061_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229065     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229065_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229065_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229065_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229065_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229065_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229065_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229065_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229065_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229065_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229065_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229065_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229065_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229058         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229058_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229058_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229058_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229058_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229058_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229058_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229058_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229058_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229058_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229058_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229058_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229058_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229058_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229058_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229058_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229058_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229058_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229058_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229058_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229058_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229058_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229058_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229058_total_iter /
                (ctx->futhark_mc_segmap_parloop_229058_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229058_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229058_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229058_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229051            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229051_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229051_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229051_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229051_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229051_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229051_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229051_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229051_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229051_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229051_iter[i] /
                    (ctx->futhark_mc_segmap_task_229051_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229051_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229056     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229056_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229056_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229056_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229056_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229056_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229056_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229056_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229056_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229056_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229056_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229056_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229056_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229082         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229082_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229082_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229082_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229082_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229082_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229082_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229082_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229082_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229082_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229082_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229082_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229082_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229082_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229082_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229082_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229082_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229082_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229082_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229082_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229082_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229082_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229082_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229082_total_iter /
                (ctx->futhark_mc_segmap_parloop_229082_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229082_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229082_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229082_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229095         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229095_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229095_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229095_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229095_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229095_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229095_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229095_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229095_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229095_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229095_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229095_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229095_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229095_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229095_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229095_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229095_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229095_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229095_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229095_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229095_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229095_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229095_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229095_total_iter /
                (ctx->futhark_mc_segmap_parloop_229095_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229095_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229095_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229095_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229109 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229109_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229109_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229109_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229109_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229109_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229109_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229109_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229109_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229109_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229109_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229109_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229109_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229109_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229109_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229109_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229109_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229109_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229109_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229109_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229109_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229109_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229104            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229104_runs[i],
                    (long) ctx->futhark_mc_segred_task_229104_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229104_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229104_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229104_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229104_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229104_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229104_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229104_iter[i],
                    (long) ctx->futhark_mc_segred_task_229104_iter[i] /
                    (ctx->futhark_mc_segred_task_229104_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229104_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229115 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229115_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229115_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229115_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229115_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229115_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229115_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229115_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229115_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229115_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229115_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229115_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229115_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229115_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229115_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229115_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229115_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229115_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229115_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229115_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229115_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229115_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229111            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229111_runs[i],
                    (long) ctx->futhark_mc_segred_task_229111_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229111_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229111_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229111_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229111_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229111_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229111_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229111_iter[i],
                    (long) ctx->futhark_mc_segred_task_229111_iter[i] /
                    (ctx->futhark_mc_segred_task_229111_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229111_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229100         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229100_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229100_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229100_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229100_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229100_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229100_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229100_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229100_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229100_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229100_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229100_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229100_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229100_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229100_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229100_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229100_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229100_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229100_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229100_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229100_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229100_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229100_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229100_total_iter /
                (ctx->futhark_mc_segmap_parloop_229100_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229100_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229100_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229100_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229093            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229093_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229093_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229093_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229093_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229093_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229093_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229093_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229093_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229093_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229093_iter[i] /
                    (ctx->futhark_mc_segmap_task_229093_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229093_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229098     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229098_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229098_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229098_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229098_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229098_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229098_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229098_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229098_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229098_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229098_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229098_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229098_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229089         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229089_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229089_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229089_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229089_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229089_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229089_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229089_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229089_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229089_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229089_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229089_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229089_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229089_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229089_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229089_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229089_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229089_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229089_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229089_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229089_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229089_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229089_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229089_total_iter /
                (ctx->futhark_mc_segmap_parloop_229089_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229089_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229089_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229089_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229080            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229080_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229080_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229080_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229080_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229080_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229080_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229080_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229080_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229080_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229080_iter[i] /
                    (ctx->futhark_mc_segmap_task_229080_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229080_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229087     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229087_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229087_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229087_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229087_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229087_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229087_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229087_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229087_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229087_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229087_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229087_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229087_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229119         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229119_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229119_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229119_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229119_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229119_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229119_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229119_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229119_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229119_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229119_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229119_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229119_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229119_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229119_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229119_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229119_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229119_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229119_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229119_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229119_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229119_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229119_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229119_total_iter /
                (ctx->futhark_mc_segmap_parloop_229119_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229119_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229119_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229119_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229134         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229134_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229134_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229134_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229134_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229134_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229134_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229134_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229134_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229134_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229134_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229134_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229134_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229134_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229134_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229134_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229134_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229134_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229134_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229134_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229134_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229134_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229134_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229134_total_iter /
                (ctx->futhark_mc_segmap_parloop_229134_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229134_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229134_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229134_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229149         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229149_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229149_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229149_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229149_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229149_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229149_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229149_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229149_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229149_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229149_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229149_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229149_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229149_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229149_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229149_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229149_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229149_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229149_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229149_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229149_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229149_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229149_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229149_total_iter /
                (ctx->futhark_mc_segmap_parloop_229149_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229149_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229149_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229149_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229147            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229147_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229147_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229147_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229147_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229147_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229147_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229147_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229147_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229147_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229147_iter[i] /
                    (ctx->futhark_mc_segmap_task_229147_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229147_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229158 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229158_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229158_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229158_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229158_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229158_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229158_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229158_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229158_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229158_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229158_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229158_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229158_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229158_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229158_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229158_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229158_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229158_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229158_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229158_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229158_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229158_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229151            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229151_runs[i],
                    (long) ctx->futhark_mc_segred_task_229151_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229151_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229151_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229151_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229151_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229151_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229151_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229151_iter[i],
                    (long) ctx->futhark_mc_segred_task_229151_iter[i] /
                    (ctx->futhark_mc_segred_task_229151_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229151_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229164 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229164_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229164_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229164_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229164_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229164_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229164_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229164_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229164_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229164_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229164_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229164_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229164_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229164_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229164_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229164_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229164_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229164_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229164_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229164_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229164_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229164_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229160            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229160_runs[i],
                    (long) ctx->futhark_mc_segred_task_229160_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229160_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229160_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229160_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229160_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229160_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229160_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229160_iter[i],
                    (long) ctx->futhark_mc_segred_task_229160_iter[i] /
                    (ctx->futhark_mc_segred_task_229160_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229160_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229141         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229141_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229141_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229141_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229141_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229141_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229141_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229141_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229141_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229141_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229141_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229141_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229141_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229141_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229141_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229141_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229141_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229141_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229141_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229141_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229141_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229141_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229141_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229141_total_iter /
                (ctx->futhark_mc_segmap_parloop_229141_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229141_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229141_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229141_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229132            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229132_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229132_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229132_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229132_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229132_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229132_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229132_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229132_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229132_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229132_iter[i] /
                    (ctx->futhark_mc_segmap_task_229132_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229132_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229139     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229139_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229139_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229139_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229139_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229139_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229139_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229139_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229139_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229139_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229139_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229139_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229139_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229128         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229128_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229128_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229128_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229128_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229128_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229128_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229128_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229128_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229128_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229128_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229128_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229128_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229128_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229128_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229128_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229128_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229128_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229128_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229128_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229128_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229128_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229128_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229128_total_iter /
                (ctx->futhark_mc_segmap_parloop_229128_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229128_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229128_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229128_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229117            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229117_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229117_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229117_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229117_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229117_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229117_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229117_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229117_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229117_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229117_iter[i] /
                    (ctx->futhark_mc_segmap_task_229117_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229117_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229126     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229126_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229126_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229126_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229126_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229126_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229126_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229126_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229126_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229126_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229126_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229126_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229126_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229168         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229168_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229168_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229168_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229168_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229168_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229168_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229168_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229168_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229168_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229168_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229168_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229168_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229168_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229168_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229168_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229168_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229168_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229168_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229168_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229168_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229168_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229168_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229168_total_iter /
                (ctx->futhark_mc_segmap_parloop_229168_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229168_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229168_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229168_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229177         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229177_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229177_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229177_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229177_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229177_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229177_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229177_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229177_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229177_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229177_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229177_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229177_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229177_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229177_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229177_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229177_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229177_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229177_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229177_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229177_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229177_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229177_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229177_total_iter /
                (ctx->futhark_mc_segmap_parloop_229177_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229177_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229177_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229177_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229175            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229175_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229175_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229175_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229175_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229175_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229175_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229175_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229175_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229175_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229175_iter[i] /
                    (ctx->futhark_mc_segmap_task_229175_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229175_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229172         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229172_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229172_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229172_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229172_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229172_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229172_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229172_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229172_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229172_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229172_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229172_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229172_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229172_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229172_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229172_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229172_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229172_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229172_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229172_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229172_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229172_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229172_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229172_total_iter /
                (ctx->futhark_mc_segmap_parloop_229172_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229172_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229172_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229172_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229166            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229166_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229166_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229166_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229166_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229166_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229166_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229166_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229166_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229166_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229166_iter[i] /
                    (ctx->futhark_mc_segmap_task_229166_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229166_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229170     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229170_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229170_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229170_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229170_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229170_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229170_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229170_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229170_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229170_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229170_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229170_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229170_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229181         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229181_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229181_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229181_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229181_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229181_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229181_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229181_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229181_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229181_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229181_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229181_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229181_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229181_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229181_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229181_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229181_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229181_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229181_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229181_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229181_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229181_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229181_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229181_total_iter /
                (ctx->futhark_mc_segmap_parloop_229181_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229181_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229181_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229181_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229190         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229190_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229190_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229190_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229190_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229190_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229190_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229190_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229190_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229190_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229190_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229190_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229190_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229190_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229190_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229190_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229190_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229190_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229190_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229190_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229190_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229190_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229190_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229190_total_iter /
                (ctx->futhark_mc_segmap_parloop_229190_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229190_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229190_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229190_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229188            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229188_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229188_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229188_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229188_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229188_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229188_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229188_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229188_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229188_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229188_iter[i] /
                    (ctx->futhark_mc_segmap_task_229188_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229188_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229185         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229185_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229185_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229185_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229185_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229185_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229185_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229185_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229185_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229185_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229185_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229185_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229185_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229185_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229185_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229185_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229185_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229185_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229185_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229185_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229185_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229185_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229185_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229185_total_iter /
                (ctx->futhark_mc_segmap_parloop_229185_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229185_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229185_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229185_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229179            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229179_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229179_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229179_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229179_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229179_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229179_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229179_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229179_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229179_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229179_iter[i] /
                    (ctx->futhark_mc_segmap_task_229179_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229179_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229183     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229183_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229183_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229183_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229183_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229183_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229183_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229183_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229183_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229183_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229183_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229183_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229183_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229194         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229194_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229194_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229194_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229194_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229194_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229194_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229194_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229194_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229194_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229194_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229194_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229194_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229194_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229194_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229194_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229194_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229194_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229194_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229194_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229194_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229194_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229194_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229194_total_iter /
                (ctx->futhark_mc_segmap_parloop_229194_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229194_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229194_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229194_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229209         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229209_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229209_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229209_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229209_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229209_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229209_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229209_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229209_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229209_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229209_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229209_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229209_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229209_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229209_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229209_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229209_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229209_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229209_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229209_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229209_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229209_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229209_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229209_total_iter /
                (ctx->futhark_mc_segmap_parloop_229209_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229209_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229209_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229209_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229207            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229207_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229207_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229207_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229207_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229207_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229207_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229207_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229207_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229207_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229207_iter[i] /
                    (ctx->futhark_mc_segmap_task_229207_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229207_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229213         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229213_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229213_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229213_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229213_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229213_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229213_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229213_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229213_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229213_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229213_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229213_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229213_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229213_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229213_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229213_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229213_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229213_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229213_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229213_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229213_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229213_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229213_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229213_total_iter /
                (ctx->futhark_mc_segmap_parloop_229213_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229213_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229213_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229213_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229211            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229211_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229211_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229211_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229211_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229211_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229211_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229211_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229211_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229211_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229211_iter[i] /
                    (ctx->futhark_mc_segmap_task_229211_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229211_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229217         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229217_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229217_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229217_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229217_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229217_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229217_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229217_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229217_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229217_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229217_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229217_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229217_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229217_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229217_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229217_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229217_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229217_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229217_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229217_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229217_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229217_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229217_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229217_total_iter /
                (ctx->futhark_mc_segmap_parloop_229217_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229217_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229217_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229217_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229225 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229225_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229225_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229225_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229225_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229225_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229225_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229225_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229225_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229225_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229225_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229225_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229225_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229225_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229225_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229225_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229225_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229225_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229225_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229225_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229225_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229225_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229222            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229222_runs[i],
                    (long) ctx->futhark_mc_segred_task_229222_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229222_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229222_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229222_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229222_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229222_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229222_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229222_iter[i],
                    (long) ctx->futhark_mc_segred_task_229222_iter[i] /
                    (ctx->futhark_mc_segred_task_229222_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229222_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229230 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229230_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229230_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229230_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229230_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229230_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229230_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229230_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229230_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229230_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229230_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229230_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229230_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229230_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229230_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229230_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229230_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229230_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229230_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229230_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229230_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229230_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229227            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229227_runs[i],
                    (long) ctx->futhark_mc_segred_task_229227_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229227_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229227_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229227_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229227_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229227_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229227_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229227_iter[i],
                    (long) ctx->futhark_mc_segred_task_229227_iter[i] /
                    (ctx->futhark_mc_segred_task_229227_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229227_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229220         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229220_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229220_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229220_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229220_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229220_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229220_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229220_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229220_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229220_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229220_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229220_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229220_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229220_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229220_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229220_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229220_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229220_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229220_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229220_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229220_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229220_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229220_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229220_total_iter /
                (ctx->futhark_mc_segmap_parloop_229220_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229220_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229220_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229220_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229215            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229215_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229215_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229215_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229215_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229215_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229215_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229215_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229215_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229215_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229215_iter[i] /
                    (ctx->futhark_mc_segmap_task_229215_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229215_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229218     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229218_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229218_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229218_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229218_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229218_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229218_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229218_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229218_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229218_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229218_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229218_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229218_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229201         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229201_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229201_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229201_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229201_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229201_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229201_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229201_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229201_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229201_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229201_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229201_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229201_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229201_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229201_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229201_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229201_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229201_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229201_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229201_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229201_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229201_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229201_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229201_total_iter /
                (ctx->futhark_mc_segmap_parloop_229201_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229201_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229201_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229201_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229192            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229192_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229192_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229192_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229192_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229192_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229192_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229192_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229192_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229192_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229192_iter[i] /
                    (ctx->futhark_mc_segmap_task_229192_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229192_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229199     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229199_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229199_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229199_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229199_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229199_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229199_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229199_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229199_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229199_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229199_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229199_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229199_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229234         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229234_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229234_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229234_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229234_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229234_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229234_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229234_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229234_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229234_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229234_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229234_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229234_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229234_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229234_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229234_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229234_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229234_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229234_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229234_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229234_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229234_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229234_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229234_total_iter /
                (ctx->futhark_mc_segmap_parloop_229234_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229234_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229234_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229234_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229251         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229251_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229251_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229251_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229251_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229251_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229251_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229251_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229251_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229251_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229251_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229251_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229251_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229251_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229251_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229251_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229251_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229251_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229251_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229251_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229251_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229251_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229251_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229251_total_iter /
                (ctx->futhark_mc_segmap_parloop_229251_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229251_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229251_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229251_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229249            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229249_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229249_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229249_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229249_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229249_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229249_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229249_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229249_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229249_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229249_iter[i] /
                    (ctx->futhark_mc_segmap_task_229249_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229249_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229255         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229255_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229255_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229255_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229255_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229255_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229255_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229255_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229255_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229255_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229255_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229255_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229255_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229255_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229255_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229255_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229255_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229255_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229255_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229255_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229255_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229255_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229255_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229255_total_iter /
                (ctx->futhark_mc_segmap_parloop_229255_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229255_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229255_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229255_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229253            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229253_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229253_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229253_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229253_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229253_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229253_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229253_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229253_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229253_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229253_iter[i] /
                    (ctx->futhark_mc_segmap_task_229253_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229253_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229259         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229259_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229259_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229259_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229259_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229259_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229259_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229259_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229259_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229259_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229259_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229259_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229259_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229259_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229259_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229259_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229259_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229259_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229259_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229259_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229259_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229259_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229259_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229259_total_iter /
                (ctx->futhark_mc_segmap_parloop_229259_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229259_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229259_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229259_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229269 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229269_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229269_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229269_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229269_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229269_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229269_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229269_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229269_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229269_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229269_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229269_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229269_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229269_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229269_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229269_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229269_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229269_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229269_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229269_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229269_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229269_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229264            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229264_runs[i],
                    (long) ctx->futhark_mc_segred_task_229264_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229264_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229264_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229264_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229264_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229264_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229264_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229264_iter[i],
                    (long) ctx->futhark_mc_segred_task_229264_iter[i] /
                    (ctx->futhark_mc_segred_task_229264_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229264_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229275 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229275_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229275_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229275_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229275_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229275_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229275_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229275_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229275_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229275_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229275_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229275_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229275_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229275_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229275_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229275_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229275_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229275_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229275_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229275_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229275_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229275_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229271            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229271_runs[i],
                    (long) ctx->futhark_mc_segred_task_229271_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229271_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229271_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229271_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229271_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229271_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229271_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229271_iter[i],
                    (long) ctx->futhark_mc_segred_task_229271_iter[i] /
                    (ctx->futhark_mc_segred_task_229271_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229271_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229262         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229262_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229262_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229262_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229262_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229262_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229262_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229262_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229262_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229262_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229262_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229262_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229262_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229262_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229262_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229262_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229262_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229262_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229262_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229262_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229262_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229262_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229262_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229262_total_iter /
                (ctx->futhark_mc_segmap_parloop_229262_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229262_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229262_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229262_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229257            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229257_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229257_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229257_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229257_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229257_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229257_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229257_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229257_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229257_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229257_iter[i] /
                    (ctx->futhark_mc_segmap_task_229257_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229257_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229260     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229260_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229260_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229260_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229260_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229260_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229260_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229260_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229260_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229260_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229260_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229260_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229260_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229242         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229242_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229242_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229242_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229242_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229242_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229242_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229242_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229242_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229242_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229242_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229242_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229242_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229242_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229242_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229242_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229242_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229242_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229242_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229242_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229242_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229242_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229242_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229242_total_iter /
                (ctx->futhark_mc_segmap_parloop_229242_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229242_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229242_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229242_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229232            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229232_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229232_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229232_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229232_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229232_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229232_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229232_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229232_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229232_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229232_iter[i] /
                    (ctx->futhark_mc_segmap_task_229232_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229232_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229240     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229240_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229240_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229240_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229240_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229240_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229240_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229240_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229240_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229240_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229240_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229240_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229240_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229279         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229279_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229279_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229279_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229279_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229279_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229279_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229279_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229279_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229279_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229279_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229279_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229279_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229279_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229279_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229279_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229279_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229279_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229279_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229279_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229279_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229279_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229279_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229279_total_iter /
                (ctx->futhark_mc_segmap_parloop_229279_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229279_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229279_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229279_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229296         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229296_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229296_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229296_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229296_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229296_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229296_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229296_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229296_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229296_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229296_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229296_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229296_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229296_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229296_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229296_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229296_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229296_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229296_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229296_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229296_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229296_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229296_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229296_total_iter /
                (ctx->futhark_mc_segmap_parloop_229296_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229296_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229296_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229296_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229294            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229294_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229294_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229294_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229294_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229294_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229294_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229294_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229294_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229294_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229294_iter[i] /
                    (ctx->futhark_mc_segmap_task_229294_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229294_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229300         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229300_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229300_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229300_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229300_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229300_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229300_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229300_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229300_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229300_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229300_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229300_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229300_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229300_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229300_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229300_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229300_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229300_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229300_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229300_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229300_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229300_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229300_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229300_total_iter /
                (ctx->futhark_mc_segmap_parloop_229300_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229300_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229300_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229300_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229298            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229298_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229298_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229298_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229298_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229298_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229298_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229298_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229298_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229298_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229298_iter[i] /
                    (ctx->futhark_mc_segmap_task_229298_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229298_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229304         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229304_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229304_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229304_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229304_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229304_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229304_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229304_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229304_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229304_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229304_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229304_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229304_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229304_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229304_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229304_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229304_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229304_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229304_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229304_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229304_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229304_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229304_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229304_total_iter /
                (ctx->futhark_mc_segmap_parloop_229304_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229304_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229304_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229304_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229316 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229316_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229316_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229316_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229316_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229316_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229316_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229316_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229316_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229316_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229316_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229316_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229316_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229316_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229316_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229316_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229316_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229316_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229316_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229316_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229316_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229316_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229309            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229309_runs[i],
                    (long) ctx->futhark_mc_segred_task_229309_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229309_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229309_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229309_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229309_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229309_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229309_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229309_iter[i],
                    (long) ctx->futhark_mc_segred_task_229309_iter[i] /
                    (ctx->futhark_mc_segred_task_229309_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229309_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229322 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229322_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229322_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229322_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229322_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229322_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229322_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229322_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229322_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229322_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229322_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229322_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229322_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229322_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229322_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229322_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229322_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229322_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229322_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229322_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229322_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229322_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229318            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229318_runs[i],
                    (long) ctx->futhark_mc_segred_task_229318_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229318_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229318_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229318_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229318_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229318_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229318_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229318_iter[i],
                    (long) ctx->futhark_mc_segred_task_229318_iter[i] /
                    (ctx->futhark_mc_segred_task_229318_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229318_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229307         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229307_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229307_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229307_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229307_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229307_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229307_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229307_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229307_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229307_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229307_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229307_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229307_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229307_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229307_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229307_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229307_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229307_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229307_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229307_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229307_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229307_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229307_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229307_total_iter /
                (ctx->futhark_mc_segmap_parloop_229307_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229307_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229307_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229307_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229302            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229302_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229302_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229302_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229302_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229302_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229302_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229302_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229302_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229302_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229302_iter[i] /
                    (ctx->futhark_mc_segmap_task_229302_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229302_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229305     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229305_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229305_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229305_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229305_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229305_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229305_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229305_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229305_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229305_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229305_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229305_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229305_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229287         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229287_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229287_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229287_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229287_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229287_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229287_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229287_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229287_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229287_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229287_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229287_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229287_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229287_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229287_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229287_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229287_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229287_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229287_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229287_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229287_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229287_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229287_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229287_total_iter /
                (ctx->futhark_mc_segmap_parloop_229287_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229287_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229287_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229287_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229277            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229277_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229277_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229277_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229277_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229277_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229277_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229277_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229277_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229277_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229277_iter[i] /
                    (ctx->futhark_mc_segmap_task_229277_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229277_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229285     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229285_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229285_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229285_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229285_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229285_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229285_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229285_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229285_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229285_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229285_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229285_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229285_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229326         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229326_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229326_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229326_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229326_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229326_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229326_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229326_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229326_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229326_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229326_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229326_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229326_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229326_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229326_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229326_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229326_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229326_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229326_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229326_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229326_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229326_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229326_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229326_total_iter /
                (ctx->futhark_mc_segmap_parloop_229326_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229326_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229326_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229326_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229342         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229342_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229342_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229342_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229342_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229342_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229342_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229342_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229342_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229342_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229342_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229342_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229342_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229342_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229342_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229342_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229342_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229342_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229342_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229342_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229342_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229342_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229342_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229342_total_iter /
                (ctx->futhark_mc_segmap_parloop_229342_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229342_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229342_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229342_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229340            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229340_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229340_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229340_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229340_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229340_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229340_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229340_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229340_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229340_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229340_iter[i] /
                    (ctx->futhark_mc_segmap_task_229340_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229340_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229346         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229346_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229346_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229346_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229346_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229346_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229346_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229346_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229346_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229346_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229346_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229346_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229346_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229346_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229346_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229346_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229346_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229346_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229346_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229346_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229346_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229346_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229346_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229346_total_iter /
                (ctx->futhark_mc_segmap_parloop_229346_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229346_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229346_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229346_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229344            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229344_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229344_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229344_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229344_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229344_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229344_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229344_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229344_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229344_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229344_iter[i] /
                    (ctx->futhark_mc_segmap_task_229344_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229344_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229350         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229350_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229350_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229350_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229350_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229350_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229350_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229350_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229350_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229350_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229350_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229350_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229350_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229350_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229350_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229350_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229350_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229350_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229350_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229350_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229350_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229350_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229350_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229350_total_iter /
                (ctx->futhark_mc_segmap_parloop_229350_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229350_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229350_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229350_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229360 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229360_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229360_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229360_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229360_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229360_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229360_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229360_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229360_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229360_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229360_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229360_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229360_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229360_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229360_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229360_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229360_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229360_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229360_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229360_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229360_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229360_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229357            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229357_runs[i],
                    (long) ctx->futhark_mc_segred_task_229357_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229357_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229357_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229357_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229357_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229357_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229357_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229357_iter[i],
                    (long) ctx->futhark_mc_segred_task_229357_iter[i] /
                    (ctx->futhark_mc_segred_task_229357_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229357_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229365 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229365_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229365_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229365_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229365_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229365_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229365_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229365_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229365_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229365_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229365_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229365_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229365_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229365_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229365_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229365_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229365_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229365_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229365_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229365_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229365_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229365_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229362            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229362_runs[i],
                    (long) ctx->futhark_mc_segred_task_229362_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229362_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229362_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229362_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229362_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229362_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229362_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229362_iter[i],
                    (long) ctx->futhark_mc_segred_task_229362_iter[i] /
                    (ctx->futhark_mc_segred_task_229362_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229362_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229354         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229354_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229354_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229354_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229354_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229354_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229354_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229354_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229354_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229354_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229354_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229354_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229354_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229354_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229354_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229354_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229354_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229354_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229354_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229354_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229354_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229354_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229354_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229354_total_iter /
                (ctx->futhark_mc_segmap_parloop_229354_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229354_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229354_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229354_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229348            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229348_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229348_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229348_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229348_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229348_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229348_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229348_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229348_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229348_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229348_iter[i] /
                    (ctx->futhark_mc_segmap_task_229348_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229348_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229352     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229352_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229352_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229352_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229352_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229352_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229352_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229352_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229352_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229352_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229352_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229352_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229352_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229334         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229334_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229334_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229334_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229334_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229334_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229334_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229334_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229334_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229334_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229334_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229334_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229334_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229334_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229334_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229334_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229334_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229334_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229334_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229334_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229334_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229334_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229334_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229334_total_iter /
                (ctx->futhark_mc_segmap_parloop_229334_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229334_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229334_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229334_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229324            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229324_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229324_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229324_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229324_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229324_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229324_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229324_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229324_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229324_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229324_iter[i] /
                    (ctx->futhark_mc_segmap_task_229324_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229324_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229332     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229332_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229332_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229332_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229332_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229332_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229332_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229332_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229332_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229332_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229332_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229332_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229332_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229369         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229369_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229369_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229369_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229369_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229369_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229369_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229369_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229369_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229369_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229369_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229369_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229369_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229369_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229369_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229369_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229369_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229369_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229369_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229369_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229369_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229369_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229369_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229369_total_iter /
                (ctx->futhark_mc_segmap_parloop_229369_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229369_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229369_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229369_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229388         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229388_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229388_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229388_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229388_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229388_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229388_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229388_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229388_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229388_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229388_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229388_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229388_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229388_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229388_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229388_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229388_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229388_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229388_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229388_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229388_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229388_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229388_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229388_total_iter /
                (ctx->futhark_mc_segmap_parloop_229388_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229388_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229388_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229388_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229386            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229386_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229386_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229386_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229386_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229386_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229386_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229386_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229386_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229386_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229386_iter[i] /
                    (ctx->futhark_mc_segmap_task_229386_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229386_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229392         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229392_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229392_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229392_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229392_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229392_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229392_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229392_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229392_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229392_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229392_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229392_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229392_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229392_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229392_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229392_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229392_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229392_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229392_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229392_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229392_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229392_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229392_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229392_total_iter /
                (ctx->futhark_mc_segmap_parloop_229392_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229392_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229392_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229392_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229390            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229390_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229390_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229390_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229390_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229390_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229390_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229390_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229390_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229390_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229390_iter[i] /
                    (ctx->futhark_mc_segmap_task_229390_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229390_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229396         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229396_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229396_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229396_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229396_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229396_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229396_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229396_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229396_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229396_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229396_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229396_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229396_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229396_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229396_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229396_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229396_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229396_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229396_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229396_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229396_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229396_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229396_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229396_total_iter /
                (ctx->futhark_mc_segmap_parloop_229396_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229396_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229396_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229396_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229410 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229410_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229410_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229410_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229410_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229410_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229410_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229410_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229410_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229410_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229410_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229410_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229410_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229410_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229410_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229410_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229410_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229410_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229410_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229410_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229410_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229410_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229405            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229405_runs[i],
                    (long) ctx->futhark_mc_segred_task_229405_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229405_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229405_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229405_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229405_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229405_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229405_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229405_iter[i],
                    (long) ctx->futhark_mc_segred_task_229405_iter[i] /
                    (ctx->futhark_mc_segred_task_229405_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229405_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229416 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229416_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229416_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229416_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229416_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229416_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229416_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229416_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229416_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229416_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229416_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229416_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229416_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229416_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229416_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229416_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229416_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229416_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229416_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229416_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229416_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229416_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229412            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229412_runs[i],
                    (long) ctx->futhark_mc_segred_task_229412_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229412_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229412_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229412_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229412_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229412_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229412_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229412_iter[i],
                    (long) ctx->futhark_mc_segred_task_229412_iter[i] /
                    (ctx->futhark_mc_segred_task_229412_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229412_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229401         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229401_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229401_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229401_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229401_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229401_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229401_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229401_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229401_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229401_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229401_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229401_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229401_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229401_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229401_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229401_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229401_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229401_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229401_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229401_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229401_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229401_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229401_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229401_total_iter /
                (ctx->futhark_mc_segmap_parloop_229401_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229401_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229401_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229401_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229394            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229394_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229394_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229394_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229394_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229394_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229394_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229394_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229394_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229394_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229394_iter[i] /
                    (ctx->futhark_mc_segmap_task_229394_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229394_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229399     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229399_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229399_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229399_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229399_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229399_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229399_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229399_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229399_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229399_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229399_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229399_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229399_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229379         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229379_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229379_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229379_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229379_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229379_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229379_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229379_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229379_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229379_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229379_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229379_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229379_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229379_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229379_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229379_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229379_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229379_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229379_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229379_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229379_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229379_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229379_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229379_total_iter /
                (ctx->futhark_mc_segmap_parloop_229379_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229379_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229379_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229379_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229367            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229367_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229367_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229367_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229367_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229367_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229367_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229367_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229367_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229367_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229367_iter[i] /
                    (ctx->futhark_mc_segmap_task_229367_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229367_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229377     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229377_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229377_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229377_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229377_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229377_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229377_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229377_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229377_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229377_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229377_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229377_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229377_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229420         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229420_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229420_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229420_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229420_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229420_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229420_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229420_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229420_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229420_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229420_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229420_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229420_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229420_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229420_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229420_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229420_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229420_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229420_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229420_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229420_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229420_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229420_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229420_total_iter /
                (ctx->futhark_mc_segmap_parloop_229420_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229420_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229420_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229420_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229441         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229441_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229441_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229441_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229441_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229441_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229441_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229441_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229441_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229441_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229441_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229441_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229441_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229441_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229441_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229441_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229441_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229441_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229441_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229441_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229441_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229441_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229441_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229441_total_iter /
                (ctx->futhark_mc_segmap_parloop_229441_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229441_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229441_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229441_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229439            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229439_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229439_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229439_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229439_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229439_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229439_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229439_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229439_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229439_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229439_iter[i] /
                    (ctx->futhark_mc_segmap_task_229439_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229439_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229445         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229445_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229445_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229445_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229445_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229445_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229445_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229445_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229445_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229445_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229445_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229445_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229445_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229445_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229445_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229445_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229445_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229445_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229445_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229445_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229445_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229445_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229445_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229445_total_iter /
                (ctx->futhark_mc_segmap_parloop_229445_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229445_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229445_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229445_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229443            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229443_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229443_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229443_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229443_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229443_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229443_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229443_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229443_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229443_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229443_iter[i] /
                    (ctx->futhark_mc_segmap_task_229443_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229443_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229449         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229449_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229449_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229449_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229449_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229449_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229449_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229449_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229449_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229449_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229449_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229449_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229449_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229449_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229449_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229449_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229449_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229449_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229449_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229449_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229449_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229449_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229449_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229449_total_iter /
                (ctx->futhark_mc_segmap_parloop_229449_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229449_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229449_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229449_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229464         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229464_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229464_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229464_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229464_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229464_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229464_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229464_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229464_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229464_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229464_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229464_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229464_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229464_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229464_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229464_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229464_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229464_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229464_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229464_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229464_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229464_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229464_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229464_total_iter /
                (ctx->futhark_mc_segmap_parloop_229464_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229464_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229464_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229464_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229462            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229462_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229462_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229462_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229462_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229462_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229462_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229462_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229462_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229462_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229462_iter[i] /
                    (ctx->futhark_mc_segmap_task_229462_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229462_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229473 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229473_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229473_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229473_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229473_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229473_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229473_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229473_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229473_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229473_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229473_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229473_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229473_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229473_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229473_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229473_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229473_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229473_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229473_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229473_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229473_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229473_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229466            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229466_runs[i],
                    (long) ctx->futhark_mc_segred_task_229466_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229466_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229466_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229466_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229466_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229466_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229466_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229466_iter[i],
                    (long) ctx->futhark_mc_segred_task_229466_iter[i] /
                    (ctx->futhark_mc_segred_task_229466_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229466_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229479 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229479_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229479_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229479_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229479_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229479_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229479_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229479_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229479_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229479_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229479_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229479_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229479_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229479_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229479_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229479_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229479_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229479_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229479_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229479_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229479_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229479_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229475            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229475_runs[i],
                    (long) ctx->futhark_mc_segred_task_229475_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229475_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229475_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229475_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229475_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229475_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229475_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229475_iter[i],
                    (long) ctx->futhark_mc_segred_task_229475_iter[i] /
                    (ctx->futhark_mc_segred_task_229475_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229475_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229456         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229456_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229456_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229456_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229456_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229456_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229456_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229456_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229456_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229456_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229456_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229456_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229456_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229456_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229456_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229456_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229456_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229456_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229456_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229456_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229456_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229456_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229456_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229456_total_iter /
                (ctx->futhark_mc_segmap_parloop_229456_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229456_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229456_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229456_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229447            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229447_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229447_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229447_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229447_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229447_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229447_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229447_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229447_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229447_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229447_iter[i] /
                    (ctx->futhark_mc_segmap_task_229447_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229447_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229454     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229454_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229454_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229454_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229454_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229454_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229454_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229454_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229454_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229454_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229454_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229454_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229454_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229432         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229432_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229432_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229432_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229432_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229432_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229432_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229432_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229432_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229432_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229432_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229432_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229432_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229432_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229432_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229432_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229432_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229432_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229432_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229432_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229432_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229432_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229432_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229432_total_iter /
                (ctx->futhark_mc_segmap_parloop_229432_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229432_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229432_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229432_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229418            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229418_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229418_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229418_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229418_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229418_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229418_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229418_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229418_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229418_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229418_iter[i] /
                    (ctx->futhark_mc_segmap_task_229418_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229418_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229430     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229430_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229430_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229430_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229430_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229430_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229430_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229430_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229430_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229430_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229430_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229430_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229430_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229483         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229483_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229483_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229483_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229483_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229483_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229483_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229483_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229483_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229483_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229483_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229483_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229483_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229483_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229483_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229483_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229483_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229483_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229483_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229483_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229483_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229483_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229483_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229483_total_iter /
                (ctx->futhark_mc_segmap_parloop_229483_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229483_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229483_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229483_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229492         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229492_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229492_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229492_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229492_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229492_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229492_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229492_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229492_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229492_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229492_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229492_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229492_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229492_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229492_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229492_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229492_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229492_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229492_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229492_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229492_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229492_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229492_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229492_total_iter /
                (ctx->futhark_mc_segmap_parloop_229492_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229492_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229492_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229492_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229490            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229490_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229490_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229490_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229490_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229490_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229490_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229490_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229490_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229490_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229490_iter[i] /
                    (ctx->futhark_mc_segmap_task_229490_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229490_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229487         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229487_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229487_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229487_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229487_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229487_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229487_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229487_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229487_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229487_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229487_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229487_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229487_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229487_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229487_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229487_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229487_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229487_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229487_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229487_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229487_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229487_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229487_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229487_total_iter /
                (ctx->futhark_mc_segmap_parloop_229487_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229487_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229487_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229487_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229481            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229481_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229481_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229481_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229481_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229481_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229481_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229481_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229481_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229481_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229481_iter[i] /
                    (ctx->futhark_mc_segmap_task_229481_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229481_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229485     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229485_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229485_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229485_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229485_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229485_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229485_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229485_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229485_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229485_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229485_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229485_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229485_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229496         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229496_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229496_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229496_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229496_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229496_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229496_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229496_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229496_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229496_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229496_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229496_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229496_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229496_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229496_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229496_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229496_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229496_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229496_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229496_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229496_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229496_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229496_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229496_total_iter /
                (ctx->futhark_mc_segmap_parloop_229496_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229496_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229496_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229496_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229507         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229507_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229507_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229507_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229507_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229507_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229507_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229507_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229507_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229507_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229507_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229507_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229507_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229507_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229507_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229507_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229507_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229507_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229507_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229507_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229507_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229507_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229507_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229507_total_iter /
                (ctx->futhark_mc_segmap_parloop_229507_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229507_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229507_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229507_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229505            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229505_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229505_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229505_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229505_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229505_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229505_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229505_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229505_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229505_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229505_iter[i] /
                    (ctx->futhark_mc_segmap_task_229505_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229505_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229511         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229511_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229511_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229511_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229511_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229511_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229511_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229511_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229511_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229511_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229511_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229511_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229511_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229511_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229511_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229511_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229511_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229511_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229511_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229511_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229511_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229511_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229511_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229511_total_iter /
                (ctx->futhark_mc_segmap_parloop_229511_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229511_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229511_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229511_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229509            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229509_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229509_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229509_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229509_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229509_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229509_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229509_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229509_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229509_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229509_iter[i] /
                    (ctx->futhark_mc_segmap_task_229509_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229509_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229501         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229501_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229501_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229501_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229501_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229501_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229501_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229501_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229501_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229501_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229501_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229501_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229501_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229501_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229501_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229501_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229501_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229501_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229501_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229501_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229501_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229501_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229501_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229501_total_iter /
                (ctx->futhark_mc_segmap_parloop_229501_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229501_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229501_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229501_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229494            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229494_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229494_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229494_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229494_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229494_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229494_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229494_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229494_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229494_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229494_iter[i] /
                    (ctx->futhark_mc_segmap_task_229494_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229494_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229499     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229499_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229499_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229499_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229499_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229499_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229499_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229499_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229499_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229499_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229499_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229499_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229499_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229515         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229515_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229515_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229515_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229515_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229515_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229515_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229515_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229515_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229515_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229515_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229515_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229515_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229515_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229515_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229515_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229515_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229515_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229515_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229515_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229515_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229515_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229515_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229515_total_iter /
                (ctx->futhark_mc_segmap_parloop_229515_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229515_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229515_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229515_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_1_parloop_229536   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_1_parloop_229536_runs[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_229536_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_229536_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_229536_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_229536_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_1_parloop_229536_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_229536_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_229536_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_1_parloop_229536_iter[i],
                    (long) ctx->futhark_mc_scan_stage_1_parloop_229536_iter[i] /
                    (ctx->futhark_mc_scan_stage_1_parloop_229536_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_1_parloop_229536_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_1_parloop_229536_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs,
                (long) ctx->futhark_mc_scan_stage_1_parloop_229536_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_1_parloop_229536_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_1_parloop_229536_total_total_runtime /
                (ctx->futhark_mc_scan_stage_1_parloop_229536_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_1_parloop_229536_total_iter),
                (long) ctx->futhark_mc_scan_stage_1_parloop_229536_total_iter,
                (long) ctx->futhark_mc_scan_stage_1_parloop_229536_total_iter /
                (ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_1_parloop_229536_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_scan_stage_3_parloop_229538   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_scan_stage_3_parloop_229538_runs[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_229538_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_229538_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_229538_runs[i] : 1),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_229538_total_runtime[i],
                    (double) ctx->futhark_mc_scan_stage_3_parloop_229538_total_runtime[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_229538_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_229538_iter[i]),
                    (long) ctx->futhark_mc_scan_stage_3_parloop_229538_iter[i],
                    (long) ctx->futhark_mc_scan_stage_3_parloop_229538_iter[i] /
                    (ctx->futhark_mc_scan_stage_3_parloop_229538_runs[i] !=
                     0 ? ctx->futhark_mc_scan_stage_3_parloop_229538_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_scan_stage_3_parloop_229538_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs,
                (long) ctx->futhark_mc_scan_stage_3_parloop_229538_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs : 1),
                (long) ctx->futhark_mc_scan_stage_3_parloop_229538_total_total_runtime,
                (double) ctx->futhark_mc_scan_stage_3_parloop_229538_total_total_runtime /
                (ctx->futhark_mc_scan_stage_3_parloop_229538_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_scan_stage_3_parloop_229538_total_iter),
                (long) ctx->futhark_mc_scan_stage_3_parloop_229538_total_iter,
                (long) ctx->futhark_mc_scan_stage_3_parloop_229538_total_iter /
                (ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs !=
                 0 ? ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_scan_stage_3_parloop_229538_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segscan_task_229530           ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segscan_task_229530_runs[i],
                    (long) ctx->futhark_mc_segscan_task_229530_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_229530_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_229530_runs[i] : 1),
                    (long) ctx->futhark_mc_segscan_task_229530_total_runtime[i],
                    (double) ctx->futhark_mc_segscan_task_229530_total_runtime[i] /
                    (ctx->futhark_mc_segscan_task_229530_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segscan_task_229530_iter[i]),
                    (long) ctx->futhark_mc_segscan_task_229530_iter[i],
                    (long) ctx->futhark_mc_segscan_task_229530_iter[i] /
                    (ctx->futhark_mc_segscan_task_229530_runs[i] !=
                     0 ? ctx->futhark_mc_segscan_task_229530_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229542         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229542_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229542_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229542_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229542_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229542_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229542_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229542_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229542_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229542_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229542_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229542_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229542_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229542_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229542_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229542_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229542_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229542_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229542_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229542_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229542_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229542_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229542_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229542_total_iter /
                (ctx->futhark_mc_segmap_parloop_229542_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229542_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229542_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229542_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229540            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229540_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229540_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229540_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229540_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229540_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229540_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229540_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229540_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229540_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229540_iter[i] /
                    (ctx->futhark_mc_segmap_task_229540_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229540_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229523         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229523_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229523_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229523_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229523_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229523_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229523_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229523_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229523_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229523_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229523_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229523_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229523_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229523_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229523_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229523_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229523_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229523_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229523_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229523_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229523_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229523_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229523_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229523_total_iter /
                (ctx->futhark_mc_segmap_parloop_229523_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229523_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229523_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229523_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229513            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229513_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229513_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229513_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229513_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229513_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229513_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229513_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229513_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229513_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229513_iter[i] /
                    (ctx->futhark_mc_segmap_task_229513_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229513_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229521     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229521_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229521_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229521_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229521_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229521_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229521_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229521_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229521_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229521_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229521_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229521_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229521_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229546         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229546_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229546_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229546_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229546_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229546_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229546_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229546_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229546_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229546_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229546_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229546_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229546_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229546_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229546_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229546_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229546_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229546_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229546_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229546_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229546_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229546_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229546_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229546_total_iter /
                (ctx->futhark_mc_segmap_parloop_229546_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229546_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229546_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229546_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_stage_1_parloop_229554 ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_stage_1_parloop_229554_runs[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229554_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229554_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229554_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229554_total_runtime[i],
                    (double) ctx->futhark_mc_segred_stage_1_parloop_229554_total_runtime[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229554_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229554_iter[i]),
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229554_iter[i],
                    (long) ctx->futhark_mc_segred_stage_1_parloop_229554_iter[i] /
                    (ctx->futhark_mc_segred_stage_1_parloop_229554_runs[i] !=
                     0 ? ctx->futhark_mc_segred_stage_1_parloop_229554_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segred_stage_1_parloop_229554_total ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229554_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs : 1),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229554_total_total_runtime,
                (double) ctx->futhark_mc_segred_stage_1_parloop_229554_total_total_runtime /
                (ctx->futhark_mc_segred_stage_1_parloop_229554_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segred_stage_1_parloop_229554_total_iter),
                (long) ctx->futhark_mc_segred_stage_1_parloop_229554_total_iter,
                (long) ctx->futhark_mc_segred_stage_1_parloop_229554_total_iter /
                (ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs !=
                 0 ? ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segred_stage_1_parloop_229554_total_total_runtime;
        ctx->total_runs +=
            ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segred_task_229551            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segred_task_229551_runs[i],
                    (long) ctx->futhark_mc_segred_task_229551_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229551_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229551_runs[i] : 1),
                    (long) ctx->futhark_mc_segred_task_229551_total_runtime[i],
                    (double) ctx->futhark_mc_segred_task_229551_total_runtime[i] /
                    (ctx->futhark_mc_segred_task_229551_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segred_task_229551_iter[i]),
                    (long) ctx->futhark_mc_segred_task_229551_iter[i],
                    (long) ctx->futhark_mc_segred_task_229551_iter[i] /
                    (ctx->futhark_mc_segred_task_229551_runs[i] !=
                     0 ? ctx->futhark_mc_segred_task_229551_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229549         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229549_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229549_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229549_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229549_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229549_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229549_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229549_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229549_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229549_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229549_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229549_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229549_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229549_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229549_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229549_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229549_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229549_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229549_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229549_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229549_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229549_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229549_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229549_total_iter /
                (ctx->futhark_mc_segmap_parloop_229549_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229549_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229549_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229549_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229544            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229544_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229544_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229544_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229544_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229544_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229544_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229544_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229544_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229544_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229544_iter[i] /
                    (ctx->futhark_mc_segmap_task_229544_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229544_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229547     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229547_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229547_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229547_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229547_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229547_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229547_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229547_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229547_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229547_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229547_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229547_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229547_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229558         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229558_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229558_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229558_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229558_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229558_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229558_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229558_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229558_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229558_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229558_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229558_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229558_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229558_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229558_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229558_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229558_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229558_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229558_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229558_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229558_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229558_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229558_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229558_total_iter /
                (ctx->futhark_mc_segmap_parloop_229558_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229558_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229558_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229558_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229567         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229567_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229567_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229567_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229567_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229567_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229567_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229567_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229567_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229567_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229567_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229567_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229567_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229567_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229567_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229567_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229567_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229567_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229567_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229567_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229567_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229567_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229567_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229567_total_iter /
                (ctx->futhark_mc_segmap_parloop_229567_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229567_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229567_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229567_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229565            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229565_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229565_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229565_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229565_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229565_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229565_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229565_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229565_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229565_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229565_iter[i] /
                    (ctx->futhark_mc_segmap_task_229565_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229565_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229562         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229562_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229562_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229562_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229562_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229562_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229562_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229562_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229562_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229562_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229562_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229562_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229562_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229562_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229562_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229562_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229562_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229562_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229562_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229562_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229562_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229562_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229562_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229562_total_iter /
                (ctx->futhark_mc_segmap_parloop_229562_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229562_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229562_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229562_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229556            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229556_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229556_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229556_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229556_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229556_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229556_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229556_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229556_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229556_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229556_iter[i] /
                    (ctx->futhark_mc_segmap_task_229556_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229556_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229560     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229560_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229560_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229560_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229560_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229560_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229560_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229560_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229560_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229560_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229560_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229560_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229560_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229571         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229571_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229571_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229571_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229571_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229571_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229571_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229571_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229571_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229571_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229571_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229571_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229571_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229571_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229571_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229571_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229571_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229571_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229571_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229571_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229571_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229571_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229571_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229571_total_iter /
                (ctx->futhark_mc_segmap_parloop_229571_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229571_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229571_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229571_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229580         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229580_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229580_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229580_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229580_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229580_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229580_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229580_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229580_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229580_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229580_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229580_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229580_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229580_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229580_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229580_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229580_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229580_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229580_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229580_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229580_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229580_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229580_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229580_total_iter /
                (ctx->futhark_mc_segmap_parloop_229580_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229580_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229580_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229580_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229578            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229578_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229578_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229578_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229578_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229578_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229578_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229578_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229578_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229578_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229578_iter[i] /
                    (ctx->futhark_mc_segmap_task_229578_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229578_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_parloop_229575         ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_parloop_229575_runs[i],
                    (long) ctx->futhark_mc_segmap_parloop_229575_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229575_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229575_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_parloop_229575_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_parloop_229575_total_runtime[i] /
                    (ctx->futhark_mc_segmap_parloop_229575_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229575_iter[i]),
                    (long) ctx->futhark_mc_segmap_parloop_229575_iter[i],
                    (long) ctx->futhark_mc_segmap_parloop_229575_iter[i] /
                    (ctx->futhark_mc_segmap_parloop_229575_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_parloop_229575_runs[i] : 1));
        fprintf(ctx->log,
                "         futhark_mc_segmap_parloop_229575_total   ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                ctx->futhark_mc_segmap_parloop_229575_total_runs,
                (long) ctx->futhark_mc_segmap_parloop_229575_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229575_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229575_total_runs : 1),
                (long) ctx->futhark_mc_segmap_parloop_229575_total_total_runtime,
                (double) ctx->futhark_mc_segmap_parloop_229575_total_total_runtime /
                (ctx->futhark_mc_segmap_parloop_229575_total_iter ==
                 0 ? 1 : (double) ctx->futhark_mc_segmap_parloop_229575_total_iter),
                (long) ctx->futhark_mc_segmap_parloop_229575_total_iter,
                (long) ctx->futhark_mc_segmap_parloop_229575_total_iter /
                (ctx->futhark_mc_segmap_parloop_229575_total_runs !=
                 0 ? ctx->futhark_mc_segmap_parloop_229575_total_runs : 1));
        ctx->total_runtime +=
            ctx->futhark_mc_segmap_parloop_229575_total_total_runtime;
        ctx->total_runs += ctx->futhark_mc_segmap_parloop_229575_total_runs;
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_task_229569            ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_task_229569_runs[i],
                    (long) ctx->futhark_mc_segmap_task_229569_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229569_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229569_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_task_229569_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_task_229569_total_runtime[i] /
                    (ctx->futhark_mc_segmap_task_229569_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_task_229569_iter[i]),
                    (long) ctx->futhark_mc_segmap_task_229569_iter[i],
                    (long) ctx->futhark_mc_segmap_task_229569_iter[i] /
                    (ctx->futhark_mc_segmap_task_229569_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_task_229569_runs[i] : 1));
        for (int i = 0; i < ctx->scheduler.num_threads; i++)
            fprintf(ctx->log,
                    "tid %2d - futhark_mc_segmap_nested_task_229573     ran %10d times; avg: %10ldus; total: %10ldus; time pr. iter %9.6f; iters %9ld; avg %ld\n",
                    i, ctx->futhark_mc_segmap_nested_task_229573_runs[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229573_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229573_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229573_runs[i] : 1),
                    (long) ctx->futhark_mc_segmap_nested_task_229573_total_runtime[i],
                    (double) ctx->futhark_mc_segmap_nested_task_229573_total_runtime[i] /
                    (ctx->futhark_mc_segmap_nested_task_229573_iter[i] ==
                     0 ? 1 : (double) ctx->futhark_mc_segmap_nested_task_229573_iter[i]),
                    (long) ctx->futhark_mc_segmap_nested_task_229573_iter[i],
                    (long) ctx->futhark_mc_segmap_nested_task_229573_iter[i] /
                    (ctx->futhark_mc_segmap_nested_task_229573_runs[i] !=
                     0 ? ctx->futhark_mc_segmap_nested_task_229573_runs[i] : 1));
    }
    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);
    worker_local = &ctx->scheduler.workers[0];
    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 *mem_out_p_228344,
                             struct memblock *mem_out_p_228345,
                             struct memblock *mem_out_p_228346,
                             struct memblock Y_mem_210354, int64_t m_196691,
                             int64_t n_196692, int64_t n_p_196694,
                             int64_t q_s_196695, int64_t q_t_196696,
                             int64_t q_l_196697, int64_t d_s_196698,
                             int64_t d_t_196699, int64_t d_l_196700,
                             int64_t jump_s_196701, int64_t jump_t_196702,
                             int64_t jump_l_196703, int64_t n_inner_196704,
                             int64_t n_outer_196705,
                             int64_t jump_threshold_196706,
                             int64_t q_threshold_196707);

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_mc_task_228374 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
};
struct futhark_mc_segmap_parloop_struct_228376 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
};
static int futhark_mc_segmap_parloop_228377(void *args, int64_t start,
                                            int64_t end, int flat_tid_199959,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228376
    *futhark_mc_segmap_parloop_struct_228376 =
    (struct futhark_mc_segmap_parloop_struct_228376 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228376->ctx;
    uint64_t futhark_mc_segmap_parloop_228377_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228377_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228376->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228376->free_n_196692;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228376->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228376->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_228376->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228376->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_228376->free_mem_210397,
                                  .size =0, .references =NULL};
    size_t mem_210363_cached_sizze_228378 = 0;
    unsigned char *mem_210363 = NULL;
    size_t mem_210378_cached_sizze_228379 = 0;
    unsigned char *mem_210378 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214105 = start;
    
    if (mem_210363_cached_sizze_228378 < (size_t) bytes_210356) {
        mem_210363 = realloc(mem_210363, bytes_210356);
        mem_210363_cached_sizze_228378 = bytes_210356;
    }
    if (mem_210378_cached_sizze_228379 < (size_t) bytes_210356) {
        mem_210378 = realloc(mem_210378, bytes_210356);
        mem_210378_cached_sizze_228379 = bytes_210356;
    }
    for (; iter_214105 < end; iter_214105++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214124 = m_196691;
        int64_t gtid_199960 = iter_214105;
        int64_t remnant_214125 = iter_214105 - gtid_199960;
        int64_t discard_209097;
        int64_t scanacc_214107 = (int64_t) 0;
        
        for (int64_t i_214106 = 0; i_214106 < n_196692; i_214106++) {
            float x_214109;
            
            x_214109 = ((float *) Y_mem_210354.mem)[gtid_199960 * n_196692 +
                                                    i_214106];
            
            bool isnan_res_214110;
            
            isnan_res_214110 = futrts_isnan32(x_214109);
            
            bool defunc_0_p_res_214111 = !isnan_res_214110;
            int64_t defunc_0_f_res_214112 =
                    btoi_bool_i64(defunc_0_p_res_214111);
            int64_t defunc_1_op_res_214113 = add64(defunc_0_f_res_214112,
                                                   scanacc_214107);
            
            ((int64_t *) mem_210363)[i_214106] = defunc_1_op_res_214113;
            
            int64_t scanacc_tmp_214126 = defunc_1_op_res_214113;
            
            scanacc_214107 = scanacc_tmp_214126;
        }
        discard_209097 = scanacc_214107;
        
        int64_t last_res_196795;
        
        last_res_196795 = ((int64_t *) mem_210363)[i_196779];
        for (int64_t i_214128 = 0; i_214128 < n_196692; i_214128++) {
            ((int64_t *) mem_210378)[i_214128] = (int64_t) -1;
        }
        for (int64_t write_iter_214115 = 0; write_iter_214115 < n_196692;
             write_iter_214115++) {
            float write_iv_214117;
            
            write_iv_214117 = ((float *) Y_mem_210354.mem)[gtid_199960 *
                                                           n_196692 +
                                                           write_iter_214115];
            
            bool isnan_res_214118;
            
            isnan_res_214118 = futrts_isnan32(write_iv_214117);
            
            bool defunc_0_p_res_214119 = !isnan_res_214118;
            int64_t defunc_1_f_res_214120;
            
            if (defunc_0_p_res_214119) {
                int64_t write_iv_214121;
                
                write_iv_214121 = ((int64_t *) mem_210363)[write_iter_214115];
                
                int64_t defunc_1_f_res_t_res_214122 = sub64(write_iv_214121,
                                                            (int64_t) 1);
                
                defunc_1_f_res_214120 = defunc_1_f_res_t_res_214122;
            } else {
                defunc_1_f_res_214120 = (int64_t) -1;
            }
            if (sle64((int64_t) 0, defunc_1_f_res_214120) &&
                slt64(defunc_1_f_res_214120, n_196692)) {
                ((int64_t *) mem_210378)[defunc_1_f_res_214120] =
                    write_iter_214115;
            }
        }
        if (n_196692 * (int64_t) 8 > 0)
            memmove(mem_210394.mem + gtid_199960 * n_196692 * (int64_t) 8,
                    mem_210378 + (int64_t) 0, n_196692 * (int64_t) 8);
        ((int64_t *) mem_210397.mem)[gtid_199960] = last_res_196795;
    }
    
  cleanup:
    { }
    free(mem_210363);
    free(mem_210378);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228377_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228377_end -
                 futhark_mc_segmap_parloop_228377_start;
        
        ctx->futhark_mc_segmap_parloop_228377_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228377_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228377_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228375(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_199959 = tid;
    int num_tasks_214104 = info.nsubtasks;
    struct futhark_mc_task_228374 *futhark_mc_task_228374 =
                                  (struct futhark_mc_task_228374 *) args;
    struct futhark_context *ctx = futhark_mc_task_228374->ctx;
    uint64_t futhark_mc_segmap_task_228375_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228375_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228374->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228374->free_n_196692;
    int64_t i_196779 = futhark_mc_task_228374->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228374->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210356 = futhark_mc_task_228374->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228374->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_228374->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t iter_214105;
    struct futhark_mc_segmap_parloop_struct_228376
    futhark_mc_segmap_parloop_struct_228376;
    
    futhark_mc_segmap_parloop_struct_228376.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228376.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228376.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228376.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228376.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228376.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_228376.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228376.free_mem_210397 = mem_210397.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228377_task;
    
    futhark_mc_segmap_parloop_228377_task.name =
        "futhark_mc_segmap_parloop_228377";
    futhark_mc_segmap_parloop_228377_task.fn = futhark_mc_segmap_parloop_228377;
    futhark_mc_segmap_parloop_228377_task.args =
        &futhark_mc_segmap_parloop_struct_228376;
    futhark_mc_segmap_parloop_228377_task.iterations = iterations;
    futhark_mc_segmap_parloop_228377_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228377_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228377_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228377_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228377_task);
    
    if (futhark_mc_segmap_parloop_228377_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228377_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228377_total_end -
                 futhark_mc_segmap_parloop_228377_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228377_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228377_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228377_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228375_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228375_end -
                 futhark_mc_segmap_task_228375_start;
        
        ctx->futhark_mc_segmap_task_228375_runs[tid]++;
        ctx->futhark_mc_segmap_task_228375_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228375_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228381 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
};
struct futhark_mc_task_228385 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_199968;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210357;
};
struct futhark_mc_scan_stage_1_parloop_struct_228388 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_199968;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210357;
};
static int futhark_mc_scan_stage_1_parloop_228389(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_214131, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_1_parloop_struct_228388
    *futhark_mc_scan_stage_1_parloop_struct_228388 =
    (struct futhark_mc_scan_stage_1_parloop_struct_228388 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_1_parloop_struct_228388->ctx;
    uint64_t futhark_mc_scan_stage_1_parloop_228389_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228389_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_scan_stage_1_parloop_struct_228388->free_n_196692;
    int64_t gtid_199968 =
            futhark_mc_scan_stage_1_parloop_struct_228388->free_gtid_199968;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_scan_stage_1_parloop_struct_228388->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210357 = {.desc ="mem_210357", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228388->free_mem_210357,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214151 = start;
    int64_t x_214133;
    int64_t x_214134;
    
    x_214133 = (int64_t) 0;
    for (; iter_214151 < end; iter_214151++) {
        int64_t gtid_214132 = iter_214151;
        
        // stage 1 scan body
        {
            float x_214136;
            
            x_214136 = ((float *) Y_mem_210354.mem)[gtid_199968 * n_196692 +
                                                    gtid_214132];
            
            bool isnan_res_214137;
            
            isnan_res_214137 = futrts_isnan32(x_214136);
            
            bool defunc_0_p_res_214138 = !isnan_res_214137;
            int64_t defunc_0_f_res_214139 =
                    btoi_bool_i64(defunc_0_p_res_214138);
            
            // write mapped values results to memory
            { }
            x_214133 = x_214133;
            // Read next values
            {
                x_214134 = defunc_0_f_res_214139;
            }
            
            int64_t defunc_1_op_res_214135 = add64(x_214133, x_214134);
            
            ((int64_t *) mem_210357.mem)[gtid_214132] = defunc_1_op_res_214135;
            x_214133 = defunc_1_op_res_214135;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228389_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228389_end -
                 futhark_mc_scan_stage_1_parloop_228389_start;
        
        ctx->futhark_mc_scan_stage_1_parloop_228389_runs[tid]++;
        ctx->futhark_mc_scan_stage_1_parloop_228389_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_1_parloop_228389_iter[tid] += iterations;
    }
    return err;
}
struct futhark_mc_scan_stage_3_parloop_struct_228390 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_199968;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210357;
};
static int futhark_mc_scan_stage_3_parloop_228391(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_214131, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_3_parloop_struct_228390
    *futhark_mc_scan_stage_3_parloop_struct_228390 =
    (struct futhark_mc_scan_stage_3_parloop_struct_228390 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_3_parloop_struct_228390->ctx;
    uint64_t futhark_mc_scan_stage_3_parloop_228391_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_3_parloop_228391_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_scan_stage_3_parloop_struct_228390->free_n_196692;
    int64_t gtid_199968 =
            futhark_mc_scan_stage_3_parloop_struct_228390->free_gtid_199968;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_scan_stage_3_parloop_struct_228390->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210357 = {.desc ="mem_210357", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228390->free_mem_210357,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214163 = start;
    int64_t x_214160;
    int64_t x_214161;
    
    if (iter_214163 == (int64_t) 0) {
        x_214160 = (int64_t) 0;
    } else {
        x_214160 = ((int64_t *) mem_210357.mem)[iter_214163 - (int64_t) 1];
    }
    for (; iter_214163 < end; iter_214163++) {
        int64_t gtid_214132 = iter_214163;
        
        // stage 3 scan body
        {
            float x_214136;
            
            x_214136 = ((float *) Y_mem_210354.mem)[gtid_199968 * n_196692 +
                                                    gtid_214132];
            
            bool isnan_res_214137;
            
            isnan_res_214137 = futrts_isnan32(x_214136);
            
            bool defunc_0_p_res_214138 = !isnan_res_214137;
            int64_t defunc_0_f_res_214139 =
                    btoi_bool_i64(defunc_0_p_res_214138);
            
            x_214160 = x_214160;
            x_214161 = defunc_0_f_res_214139;
            
            int64_t defunc_1_op_res_214162 = add64(x_214160, x_214161);
            
            ((int64_t *) mem_210357.mem)[gtid_214132] = defunc_1_op_res_214162;
            x_214160 = defunc_1_op_res_214162;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_3_parloop_228391_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_3_parloop_228391_end -
                 futhark_mc_scan_stage_3_parloop_228391_start;
        
        ctx->futhark_mc_scan_stage_3_parloop_228391_runs[tid]++;
        ctx->futhark_mc_scan_stage_3_parloop_228391_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_3_parloop_228391_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segscan_task_228386(void *args, int64_t iterations, int tid,
                                   struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214131 = tid;
    int num_tasks_214150 = info.nsubtasks;
    struct futhark_mc_task_228385 *futhark_mc_task_228385 =
                                  (struct futhark_mc_task_228385 *) args;
    struct futhark_context *ctx = futhark_mc_task_228385->ctx;
    uint64_t futhark_mc_segscan_task_228386_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segscan_task_228386_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228385->free_n_196692;
    int64_t gtid_199968 = futhark_mc_task_228385->free_gtid_199968;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228385->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210357 = {.desc ="mem_210357", .mem =
                                  futhark_mc_task_228385->free_mem_210357,
                                  .size =0, .references =NULL};
    size_t scan_stage_2_accum_mem_214157_cached_sizze_228387 = 0;
    unsigned char *scan_stage_2_accum_mem_214157 = NULL;
    int64_t iter_214151;
    struct futhark_mc_scan_stage_1_parloop_struct_228388
    futhark_mc_scan_stage_1_parloop_struct_228388;
    
    futhark_mc_scan_stage_1_parloop_struct_228388.ctx = ctx;
    futhark_mc_scan_stage_1_parloop_struct_228388.free_n_196692 = n_196692;
    futhark_mc_scan_stage_1_parloop_struct_228388.free_gtid_199968 =
        gtid_199968;
    futhark_mc_scan_stage_1_parloop_struct_228388.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_scan_stage_1_parloop_struct_228388.free_mem_210357 =
        mem_210357.mem;
    
    struct scheduler_parloop futhark_mc_scan_stage_1_parloop_228389_task;
    
    futhark_mc_scan_stage_1_parloop_228389_task.name =
        "futhark_mc_scan_stage_1_parloop_228389";
    futhark_mc_scan_stage_1_parloop_228389_task.fn =
        futhark_mc_scan_stage_1_parloop_228389;
    futhark_mc_scan_stage_1_parloop_228389_task.args =
        &futhark_mc_scan_stage_1_parloop_struct_228388;
    futhark_mc_scan_stage_1_parloop_228389_task.iterations = iterations;
    futhark_mc_scan_stage_1_parloop_228389_task.info = info;
    
    uint64_t futhark_mc_scan_stage_1_parloop_228389_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228389_total_start = get_wall_time();
    
    int futhark_mc_scan_stage_1_parloop_228389_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_scan_stage_1_parloop_228389_task);
    
    if (futhark_mc_scan_stage_1_parloop_228389_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228389_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228389_total_end -
                 futhark_mc_scan_stage_1_parloop_228389_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228389_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228389_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228389_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    if (slt32(1, num_tasks_214150)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmentedScan stage 2");
        
        int64_t x_214152;
        int64_t x_214153;
        int64_t offset_214155 = (int64_t) 0;
        int64_t offset_index_214156 = (int64_t) 0;
        
        if (scan_stage_2_accum_mem_214157_cached_sizze_228387 <
            (size_t) (int64_t) 8) {
            scan_stage_2_accum_mem_214157 =
                realloc(scan_stage_2_accum_mem_214157, (int64_t) 8);
            scan_stage_2_accum_mem_214157_cached_sizze_228387 = (int64_t) 8;
        }
        ((int64_t *) scan_stage_2_accum_mem_214157)[(int64_t) 0] = (int64_t) 0;
        for (int32_t i_214159 = 0; i_214159 < num_tasks_214150 - 1;
             i_214159++) {
            offset_214155 = squot64(n_196692, sext_i32_i64(num_tasks_214150));
            if (slt64(sext_i32_i64(i_214159), srem64(n_196692,
                                                     sext_i32_i64(num_tasks_214150)))) {
                offset_214155 += (int64_t) 1;
            }
            offset_index_214156 += offset_214155;
            
            int64_t gtid_214132 = offset_index_214156;
            float x_214136;
            
            x_214136 = ((float *) Y_mem_210354.mem)[gtid_199968 * n_196692 +
                                                    gtid_214132];
            
            bool isnan_res_214137;
            
            isnan_res_214137 = futrts_isnan32(x_214136);
            
            bool defunc_0_p_res_214138 = !isnan_res_214137;
            int64_t defunc_0_f_res_214139 =
                    btoi_bool_i64(defunc_0_p_res_214138);
            
            // Read carry in
            {
                x_214152 =
                    ((int64_t *) scan_stage_2_accum_mem_214157)[(int64_t) 0];
            }
            // Read next values
            {
                x_214153 = ((int64_t *) mem_210357.mem)[offset_index_214156 -
                                                        (int64_t) 1];
            }
            
            int64_t defunc_1_op_res_214154 = add64(x_214152, x_214153);
            
            ((int64_t *) mem_210357.mem)[offset_index_214156 - (int64_t) 1] =
                defunc_1_op_res_214154;
            ((int64_t *) scan_stage_2_accum_mem_214157)[(int64_t) 0] =
                defunc_1_op_res_214154;
        }
        
        int64_t iter_214163 = (int64_t) 0;
        struct futhark_mc_scan_stage_3_parloop_struct_228390
        futhark_mc_scan_stage_3_parloop_struct_228390;
        
        futhark_mc_scan_stage_3_parloop_struct_228390.ctx = ctx;
        futhark_mc_scan_stage_3_parloop_struct_228390.free_n_196692 = n_196692;
        futhark_mc_scan_stage_3_parloop_struct_228390.free_gtid_199968 =
            gtid_199968;
        futhark_mc_scan_stage_3_parloop_struct_228390.free_Y_mem_210354 =
            Y_mem_210354.mem;
        futhark_mc_scan_stage_3_parloop_struct_228390.free_mem_210357 =
            mem_210357.mem;
        
        struct scheduler_parloop futhark_mc_scan_stage_3_parloop_228391_task;
        
        futhark_mc_scan_stage_3_parloop_228391_task.name =
            "futhark_mc_scan_stage_3_parloop_228391";
        futhark_mc_scan_stage_3_parloop_228391_task.fn =
            futhark_mc_scan_stage_3_parloop_228391;
        futhark_mc_scan_stage_3_parloop_228391_task.args =
            &futhark_mc_scan_stage_3_parloop_struct_228390;
        futhark_mc_scan_stage_3_parloop_228391_task.iterations = iterations;
        futhark_mc_scan_stage_3_parloop_228391_task.info = info;
        
        uint64_t futhark_mc_scan_stage_3_parloop_228391_total_start = 0;
        
        if (ctx->profiling && !ctx->profiling_paused)
            futhark_mc_scan_stage_3_parloop_228391_total_start =
                get_wall_time();
        
        int futhark_mc_scan_stage_3_parloop_228391_err =
            scheduler_execute_task(&ctx->scheduler,
                                   &futhark_mc_scan_stage_3_parloop_228391_task);
        
        if (futhark_mc_scan_stage_3_parloop_228391_err != 0) {
            err = 1;
            goto cleanup;
        }
        if (ctx->profiling && !ctx->profiling_paused) {
            uint64_t futhark_mc_scan_stage_3_parloop_228391_total_end =
                     get_wall_time();
            uint64_t elapsed =
                     futhark_mc_scan_stage_3_parloop_228391_total_end -
                     futhark_mc_scan_stage_3_parloop_228391_total_start;
            
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228391_total_runs,
                               1, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228391_total_total_runtime,
                               elapsed, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228391_total_iter,
                               iterations, __ATOMIC_RELAXED);
        }
    }
    
  cleanup:
    {
        free(scan_stage_2_accum_mem_214157);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segscan_task_228386_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segscan_task_228386_end -
                 futhark_mc_segscan_task_228386_start;
        
        ctx->futhark_mc_segscan_task_228386_runs[tid]++;
        ctx->futhark_mc_segscan_task_228386_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segscan_task_228386_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228392 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_199968;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210357;
    unsigned char *free_mem_210360;
};
struct futhark_mc_segmap_parloop_struct_228394 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_199968;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210357;
    unsigned char *free_mem_210360;
};
static int futhark_mc_segmap_parloop_228395(void *args, int64_t start,
                                            int64_t end, int flat_tid_214140,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228394
    *futhark_mc_segmap_parloop_struct_228394 =
    (struct futhark_mc_segmap_parloop_struct_228394 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228394->ctx;
    uint64_t futhark_mc_segmap_parloop_228395_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228395_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228394->free_n_196692;
    int64_t gtid_199968 =
            futhark_mc_segmap_parloop_struct_228394->free_gtid_199968;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228394->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210357 = {.desc ="mem_210357", .mem =
                                  futhark_mc_segmap_parloop_struct_228394->free_mem_210357,
                                  .size =0, .references =NULL};
    struct memblock mem_210360 = {.desc ="mem_210360", .mem =
                                  futhark_mc_segmap_parloop_struct_228394->free_mem_210360,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214166 = start;
    
    for (; iter_214166 < end; iter_214166++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214169 = n_196692;
        int64_t gtid_214141 = iter_214166;
        int64_t remnant_214170 = iter_214166 - gtid_214141;
        float x_214142;
        
        x_214142 = ((float *) Y_mem_210354.mem)[gtid_199968 * n_196692 +
                                                gtid_214141];
        
        bool isnan_res_214143;
        
        isnan_res_214143 = futrts_isnan32(x_214142);
        
        bool defunc_0_p_res_214144 = !isnan_res_214143;
        int64_t defunc_1_f_res_214145;
        
        if (defunc_0_p_res_214144) {
            int64_t x_214167;
            
            x_214167 = ((int64_t *) mem_210357.mem)[gtid_214141];
            
            int64_t defunc_1_f_res_t_res_214168 = sub64(x_214167, (int64_t) 1);
            
            defunc_1_f_res_214145 = defunc_1_f_res_t_res_214168;
        } else {
            defunc_1_f_res_214145 = (int64_t) -1;
        }
        if (sle64((int64_t) 0, defunc_1_f_res_214145) &&
            slt64(defunc_1_f_res_214145, n_196692)) {
            ((int64_t *) mem_210360.mem)[defunc_1_f_res_214145] = gtid_214141;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228395_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228395_end -
                 futhark_mc_segmap_parloop_228395_start;
        
        ctx->futhark_mc_segmap_parloop_228395_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228395_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228395_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228393(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214140 = tid;
    int num_tasks_214165 = info.nsubtasks;
    struct futhark_mc_task_228392 *futhark_mc_task_228392 =
                                  (struct futhark_mc_task_228392 *) args;
    struct futhark_context *ctx = futhark_mc_task_228392->ctx;
    uint64_t futhark_mc_segmap_task_228393_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228393_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228392->free_n_196692;
    int64_t gtid_199968 = futhark_mc_task_228392->free_gtid_199968;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228392->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210357 = {.desc ="mem_210357", .mem =
                                  futhark_mc_task_228392->free_mem_210357,
                                  .size =0, .references =NULL};
    struct memblock mem_210360 = {.desc ="mem_210360", .mem =
                                  futhark_mc_task_228392->free_mem_210360,
                                  .size =0, .references =NULL};
    int64_t iter_214166;
    struct futhark_mc_segmap_parloop_struct_228394
    futhark_mc_segmap_parloop_struct_228394;
    
    futhark_mc_segmap_parloop_struct_228394.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228394.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228394.free_gtid_199968 = gtid_199968;
    futhark_mc_segmap_parloop_struct_228394.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228394.free_mem_210357 = mem_210357.mem;
    futhark_mc_segmap_parloop_struct_228394.free_mem_210360 = mem_210360.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228395_task;
    
    futhark_mc_segmap_parloop_228395_task.name =
        "futhark_mc_segmap_parloop_228395";
    futhark_mc_segmap_parloop_228395_task.fn = futhark_mc_segmap_parloop_228395;
    futhark_mc_segmap_parloop_228395_task.args =
        &futhark_mc_segmap_parloop_struct_228394;
    futhark_mc_segmap_parloop_228395_task.iterations = iterations;
    futhark_mc_segmap_parloop_228395_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228395_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228395_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228395_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228395_task);
    
    if (futhark_mc_segmap_parloop_228395_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228395_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228395_total_end -
                 futhark_mc_segmap_parloop_228395_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228395_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228395_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228395_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228393_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228393_end -
                 futhark_mc_segmap_task_228393_start;
        
        ctx->futhark_mc_segmap_task_228393_runs[tid]++;
        ctx->futhark_mc_segmap_task_228393_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228393_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228382(void *args, int64_t start,
                                            int64_t end, int flat_tid_199967,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228381
    *futhark_mc_segmap_parloop_struct_228381 =
    (struct futhark_mc_segmap_parloop_struct_228381 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228381->ctx;
    uint64_t futhark_mc_segmap_parloop_228382_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228382_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228381->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228381->free_n_196692;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228381->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228381->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_228381->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228381->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_228381->free_mem_210397,
                                  .size =0, .references =NULL};
    size_t mem_210357_cached_sizze_228383 = 0;
    unsigned char *mem_210357 = NULL;
    size_t mem_210360_cached_sizze_228384 = 0;
    unsigned char *mem_210360 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214130 = start;
    
    if (mem_210357_cached_sizze_228383 < (size_t) bytes_210356) {
        mem_210357 = realloc(mem_210357, bytes_210356);
        mem_210357_cached_sizze_228383 = bytes_210356;
    }
    if (mem_210360_cached_sizze_228384 < (size_t) bytes_210356) {
        mem_210360 = realloc(mem_210360, bytes_210356);
        mem_210360_cached_sizze_228384 = bytes_210356;
    }
    for (; iter_214130 < end; iter_214130++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214148 = m_196691;
        int64_t gtid_199968 = iter_214130;
        int64_t remnant_214149 = iter_214130 - gtid_199968;
        int64_t flat_tid_214131 = (int64_t) 0;
        int32_t num_tasks_214150;
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmented segScan");
        
        struct futhark_mc_task_228385 futhark_mc_task_228385;
        
        futhark_mc_task_228385.ctx = ctx;
        futhark_mc_task_228385.free_n_196692 = n_196692;
        futhark_mc_task_228385.free_gtid_199968 = gtid_199968;
        futhark_mc_task_228385.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_228385.free_mem_210357 = mem_210357;
        
        struct scheduler_segop futhark_mc_task_228385_task;
        
        futhark_mc_task_228385_task.args = &futhark_mc_task_228385;
        futhark_mc_task_228385_task.top_level_fn =
            futhark_mc_segscan_task_228386;
        futhark_mc_task_228385_task.name = "futhark_mc_segscan_task_228386";
        futhark_mc_task_228385_task.iterations = n_196692;
        futhark_mc_task_228385_task.task_time =
            &ctx->futhark_mc_segscan_task_228386_total_time;
        futhark_mc_task_228385_task.task_iter =
            &ctx->futhark_mc_segscan_task_228386_total_iter;
        futhark_mc_task_228385_task.sched = STATIC;
        futhark_mc_task_228385_task.nested_fn = NULL;
        
        int futhark_mc_segscan_task_228386_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228385_task);
        
        if (futhark_mc_segscan_task_228386_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t last_res_199980;
        
        last_res_199980 = ((int64_t *) mem_210357)[i_196779];
        for (int64_t i_214164 = 0; i_214164 < n_196692; i_214164++) {
            ((int64_t *) mem_210360)[i_214164] = (int64_t) -1;
        }
        
        int64_t flat_tid_214140 = (int64_t) 0;
        int32_t num_tasks_214165;
        struct futhark_mc_task_228392 futhark_mc_task_228392;
        
        futhark_mc_task_228392.ctx = ctx;
        futhark_mc_task_228392.free_n_196692 = n_196692;
        futhark_mc_task_228392.free_gtid_199968 = gtid_199968;
        futhark_mc_task_228392.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_228392.free_mem_210357 = mem_210357;
        futhark_mc_task_228392.free_mem_210360 = mem_210360;
        
        struct scheduler_segop futhark_mc_task_228392_task;
        
        futhark_mc_task_228392_task.args = &futhark_mc_task_228392;
        futhark_mc_task_228392_task.top_level_fn =
            futhark_mc_segmap_task_228393;
        futhark_mc_task_228392_task.name = "futhark_mc_segmap_task_228393";
        futhark_mc_task_228392_task.iterations = n_196692;
        futhark_mc_task_228392_task.task_time =
            &ctx->futhark_mc_segmap_task_228393_total_time;
        futhark_mc_task_228392_task.task_iter =
            &ctx->futhark_mc_segmap_task_228393_total_iter;
        futhark_mc_task_228392_task.sched = STATIC;
        futhark_mc_task_228392_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228393_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228392_task);
        
        if (futhark_mc_segmap_task_228393_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 8 > 0)
            memmove(mem_210394.mem + gtid_199968 * n_196692 * (int64_t) 8,
                    mem_210360 + (int64_t) 0, n_196692 * (int64_t) 8);
        ((int64_t *) mem_210397.mem)[gtid_199968] = last_res_199980;
    }
    
  cleanup:
    { }
    free(mem_210357);
    free(mem_210360);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228382_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228382_end -
                 futhark_mc_segmap_parloop_228382_start;
        
        ctx->futhark_mc_segmap_parloop_228382_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228382_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228382_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228380(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_199967 = tid;
    int num_tasks_214104 = info.nsubtasks;
    struct futhark_mc_task_228374 *futhark_mc_task_228374 =
                                  (struct futhark_mc_task_228374 *) args;
    struct futhark_context *ctx = futhark_mc_task_228374->ctx;
    uint64_t futhark_mc_segmap_nested_task_228380_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228380_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228374->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228374->free_n_196692;
    int64_t i_196779 = futhark_mc_task_228374->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228374->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210356 = futhark_mc_task_228374->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228374->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_228374->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t iter_214130;
    struct futhark_mc_segmap_parloop_struct_228381
    futhark_mc_segmap_parloop_struct_228381;
    
    futhark_mc_segmap_parloop_struct_228381.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228381.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228381.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228381.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228381.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228381.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_228381.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228381.free_mem_210397 = mem_210397.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228382_task;
    
    futhark_mc_segmap_parloop_228382_task.name =
        "futhark_mc_segmap_parloop_228382";
    futhark_mc_segmap_parloop_228382_task.fn = futhark_mc_segmap_parloop_228382;
    futhark_mc_segmap_parloop_228382_task.args =
        &futhark_mc_segmap_parloop_struct_228381;
    futhark_mc_segmap_parloop_228382_task.iterations = iterations;
    futhark_mc_segmap_parloop_228382_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228382_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228382_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228382_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228382_task);
    
    if (futhark_mc_segmap_parloop_228382_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228382_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228382_total_end -
                 futhark_mc_segmap_parloop_228382_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228382_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228382_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228382_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228380_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228380_end -
                 futhark_mc_segmap_nested_task_228380_start;
        
        ctx->futhark_mc_segmap_nested_task_228380_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228380_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228380_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228396 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210399;
    int64_t free_bytes_210418;
    unsigned char *free_mem_210468;
};
struct futhark_mc_segmap_parloop_struct_228398 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210418;
    unsigned char *free_mem_210468;
};
static int futhark_mc_segmap_parloop_228399(void *args, int64_t start,
                                            int64_t end, int flat_tid_199992,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228398
    *futhark_mc_segmap_parloop_struct_228398 =
    (struct futhark_mc_segmap_parloop_struct_228398 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228398->ctx;
    uint64_t futhark_mc_segmap_parloop_228399_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228399_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228398->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228398->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228398->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228398->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228398->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228398->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210418 =
            futhark_mc_segmap_parloop_struct_228398->free_bytes_210418;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228398->free_mem_210468,
                                  .size =0, .references =NULL};
    size_t mem_210423_cached_sizze_228400 = 0;
    unsigned char *mem_210423 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214172 = start;
    
    if (mem_210423_cached_sizze_228400 < (size_t) bytes_210418) {
        mem_210423 = realloc(mem_210423, bytes_210418);
        mem_210423_cached_sizze_228400 = bytes_210418;
    }
    for (; iter_214172 < end; iter_214172++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214188 = m_196691;
        int64_t gtid_199993 = iter_214172;
        int64_t remnant_214189 = iter_214172 - gtid_199993;
        
        for (int64_t i_214173 = 0; i_214173 < n_p_196694; i_214173++) {
            for (int64_t i_214176 = 0; i_214176 < defunc_0_f_res_196740;
                 i_214176++) {
                int64_t y_214178 = mul64(n_p_196694, i_214176);
                int64_t new_i_214179 = add64(y_214178, i_214173);
                bool cond_214180 = slt64(i_196779, new_i_214179);
                float defunc_0_f_res_214181;
                
                if (cond_214180) {
                    defunc_0_f_res_214181 = NAN;
                } else {
                    bool x_214182 = sle64((int64_t) 0, new_i_214179);
                    bool y_214183 = slt64(new_i_214179, n_196692);
                    bool bounds_check_214184 = x_214182 && y_214183;
                    bool index_certs_214185;
                    
                    if (!bounds_check_214184) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) new_i_214179,
                                      "] out of bounds for array of shape [",
                                      (long long) n_196692, "].",
                                      "-> #0  stl.fut:124:33-40\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:119:20-125:36\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:117:12-126:20\n   #9  stl.fut:116:5-127:11\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    float defunc_0_f_res_f_res_214186;
                    
                    defunc_0_f_res_f_res_214186 =
                        ((float *) Y_mem_210354.mem)[gtid_199993 * n_196692 +
                                                     new_i_214179];
                    defunc_0_f_res_214181 = defunc_0_f_res_f_res_214186;
                }
                ((float *) mem_210423)[i_214173 * defunc_0_f_res_196740 +
                                       i_214176] = defunc_0_f_res_214181;
            }
        }
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_210468.mem + gtid_199993 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_210423 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210423);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228399_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228399_end -
                 futhark_mc_segmap_parloop_228399_start;
        
        ctx->futhark_mc_segmap_parloop_228399_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228399_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228399_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228397(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_199992 = tid;
    int num_tasks_214171 = info.nsubtasks;
    struct futhark_mc_task_228396 *futhark_mc_task_228396 =
                                  (struct futhark_mc_task_228396 *) args;
    struct futhark_context *ctx = futhark_mc_task_228396->ctx;
    uint64_t futhark_mc_segmap_task_228397_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228397_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228396->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228396->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228396->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228396->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228396->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228396->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 = futhark_mc_task_228396->free_bytes_210399;
    int64_t bytes_210418 = futhark_mc_task_228396->free_bytes_210418;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228396->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t iter_214172;
    struct futhark_mc_segmap_parloop_struct_228398
    futhark_mc_segmap_parloop_struct_228398;
    
    futhark_mc_segmap_parloop_struct_228398.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228398.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228398.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228398.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228398.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228398.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228398.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228398.free_bytes_210418 = bytes_210418;
    futhark_mc_segmap_parloop_struct_228398.free_mem_210468 = mem_210468.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228399_task;
    
    futhark_mc_segmap_parloop_228399_task.name =
        "futhark_mc_segmap_parloop_228399";
    futhark_mc_segmap_parloop_228399_task.fn = futhark_mc_segmap_parloop_228399;
    futhark_mc_segmap_parloop_228399_task.args =
        &futhark_mc_segmap_parloop_struct_228398;
    futhark_mc_segmap_parloop_228399_task.iterations = iterations;
    futhark_mc_segmap_parloop_228399_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228399_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228399_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228399_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228399_task);
    
    if (futhark_mc_segmap_parloop_228399_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228399_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228399_total_end -
                 futhark_mc_segmap_parloop_228399_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228399_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228399_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228399_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228397_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228397_end -
                 futhark_mc_segmap_task_228397_start;
        
        ctx->futhark_mc_segmap_task_228397_runs[tid]++;
        ctx->futhark_mc_segmap_task_228397_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228397_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228402 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210399;
    int64_t free_bytes_210418;
    unsigned char *free_mem_210468;
};
struct futhark_mc_task_228405 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200019;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210399;
    unsigned char *free_mem_210419;
};
struct futhark_mc_segmap_parloop_struct_228407 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200019;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210399;
    unsigned char *free_mem_210419;
};
static int futhark_mc_segmap_parloop_228408(void *args, int64_t start,
                                            int64_t end, int flat_tid_214208,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228407
    *futhark_mc_segmap_parloop_struct_228407 =
    (struct futhark_mc_segmap_parloop_struct_228407 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228407->ctx;
    uint64_t futhark_mc_segmap_parloop_228408_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228408_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228407->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228407->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228407->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228407->free_i_196779;
    int64_t gtid_200019 =
            futhark_mc_segmap_parloop_struct_228407->free_gtid_200019;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228407->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 =
            futhark_mc_segmap_parloop_struct_228407->free_bytes_210399;
    struct memblock mem_210419 = {.desc ="mem_210419", .mem =
                                  futhark_mc_segmap_parloop_struct_228407->free_mem_210419,
                                  .size =0, .references =NULL};
    size_t mem_214210_cached_sizze_228409 = 0;
    unsigned char *mem_214210 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214228 = start;
    
    if (mem_214210_cached_sizze_228409 < (size_t) bytes_210399) {
        mem_214210 = realloc(mem_214210, bytes_210399);
        mem_214210_cached_sizze_228409 = bytes_210399;
    }
    for (; iter_214228 < end; iter_214228++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214241 = n_p_196694;
        int64_t gtid_214209 = iter_214228;
        int64_t remnant_214242 = iter_214228 - gtid_214209;
        
        for (int64_t i_214229 = 0; i_214229 < defunc_0_f_res_196740;
             i_214229++) {
            int64_t y_214231 = mul64(n_p_196694, i_214229);
            int64_t new_i_214232 = add64(gtid_214209, y_214231);
            bool cond_214233 = slt64(i_196779, new_i_214232);
            float defunc_0_f_res_214234;
            
            if (cond_214233) {
                defunc_0_f_res_214234 = NAN;
            } else {
                bool x_214235 = sle64((int64_t) 0, new_i_214232);
                bool y_214236 = slt64(new_i_214232, n_196692);
                bool bounds_check_214237 = x_214235 && y_214236;
                bool index_certs_214238;
                
                if (!bounds_check_214237) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) new_i_214232,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  stl.fut:124:33-40\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:119:20-125:36\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:117:12-126:20\n   #9  stl.fut:116:5-127:11\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_f_res_214239;
                
                defunc_0_f_res_f_res_214239 =
                    ((float *) Y_mem_210354.mem)[gtid_200019 * n_196692 +
                                                 new_i_214232];
                defunc_0_f_res_214234 = defunc_0_f_res_f_res_214239;
            }
            ((float *) mem_214210)[i_214229] = defunc_0_f_res_214234;
        }
        if (defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_210419.mem + gtid_214209 * defunc_0_f_res_196740 *
                    (int64_t) 4, mem_214210 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_214210);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228408_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228408_end -
                 futhark_mc_segmap_parloop_228408_start;
        
        ctx->futhark_mc_segmap_parloop_228408_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228408_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228408_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228406(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214208 = tid;
    int num_tasks_214227 = info.nsubtasks;
    struct futhark_mc_task_228405 *futhark_mc_task_228405 =
                                  (struct futhark_mc_task_228405 *) args;
    struct futhark_context *ctx = futhark_mc_task_228405->ctx;
    uint64_t futhark_mc_segmap_task_228406_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228406_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228405->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228405->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228405->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228405->free_i_196779;
    int64_t gtid_200019 = futhark_mc_task_228405->free_gtid_200019;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228405->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 = futhark_mc_task_228405->free_bytes_210399;
    struct memblock mem_210419 = {.desc ="mem_210419", .mem =
                                  futhark_mc_task_228405->free_mem_210419,
                                  .size =0, .references =NULL};
    int64_t iter_214228;
    struct futhark_mc_segmap_parloop_struct_228407
    futhark_mc_segmap_parloop_struct_228407;
    
    futhark_mc_segmap_parloop_struct_228407.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228407.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228407.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228407.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228407.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228407.free_gtid_200019 = gtid_200019;
    futhark_mc_segmap_parloop_struct_228407.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228407.free_bytes_210399 = bytes_210399;
    futhark_mc_segmap_parloop_struct_228407.free_mem_210419 = mem_210419.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228408_task;
    
    futhark_mc_segmap_parloop_228408_task.name =
        "futhark_mc_segmap_parloop_228408";
    futhark_mc_segmap_parloop_228408_task.fn = futhark_mc_segmap_parloop_228408;
    futhark_mc_segmap_parloop_228408_task.args =
        &futhark_mc_segmap_parloop_struct_228407;
    futhark_mc_segmap_parloop_228408_task.iterations = iterations;
    futhark_mc_segmap_parloop_228408_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228408_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228408_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228408_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228408_task);
    
    if (futhark_mc_segmap_parloop_228408_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228408_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228408_total_end -
                 futhark_mc_segmap_parloop_228408_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228408_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228408_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228408_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228406_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228406_end -
                 futhark_mc_segmap_task_228406_start;
        
        ctx->futhark_mc_segmap_task_228406_runs[tid]++;
        ctx->futhark_mc_segmap_task_228406_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228406_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228411 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200019;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210399;
    unsigned char *free_mem_210419;
};
struct futhark_mc_task_228414 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200019;
    unsigned char *free_Y_mem_210354;
    int64_t free_gtid_214194;
    unsigned char *free_mem_214195;
};
struct futhark_mc_segmap_parloop_struct_228416 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200019;
    unsigned char *free_Y_mem_210354;
    int64_t free_gtid_214194;
    unsigned char *free_mem_214195;
};
static int futhark_mc_segmap_parloop_228417(void *args, int64_t start,
                                            int64_t end, int flat_tid_214245,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228416
    *futhark_mc_segmap_parloop_struct_228416 =
    (struct futhark_mc_segmap_parloop_struct_228416 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228416->ctx;
    uint64_t futhark_mc_segmap_parloop_228417_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228417_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228416->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228416->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228416->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228416->free_i_196779;
    int64_t gtid_200019 =
            futhark_mc_segmap_parloop_struct_228416->free_gtid_200019;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228416->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t gtid_214194 =
            futhark_mc_segmap_parloop_struct_228416->free_gtid_214194;
    struct memblock mem_214195 = {.desc ="mem_214195", .mem =
                                  futhark_mc_segmap_parloop_struct_228416->free_mem_214195,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214259 = start;
    
    for (; iter_214259 < end; iter_214259++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214265 = defunc_0_f_res_196740;
        int64_t gtid_214246 = iter_214259;
        int64_t remnant_214266 = iter_214259 - gtid_214246;
        int64_t y_214247 = mul64(n_p_196694, gtid_214246);
        int64_t new_i_214248 = add64(gtid_214194, y_214247);
        bool cond_214249 = slt64(i_196779, new_i_214248);
        float defunc_0_f_res_214250;
        
        if (cond_214249) {
            defunc_0_f_res_214250 = NAN;
        } else {
            bool x_214260 = sle64((int64_t) 0, new_i_214248);
            bool y_214261 = slt64(new_i_214248, n_196692);
            bool bounds_check_214262 = x_214260 && y_214261;
            bool index_certs_214263;
            
            if (!bounds_check_214262) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) new_i_214248,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  stl.fut:124:33-40\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:119:20-125:36\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:117:12-126:20\n   #9  stl.fut:116:5-127:11\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_f_res_214264;
            
            defunc_0_f_res_f_res_214264 =
                ((float *) Y_mem_210354.mem)[gtid_200019 * n_196692 +
                                             new_i_214248];
            defunc_0_f_res_214250 = defunc_0_f_res_f_res_214264;
        }
        ((float *) mem_214195.mem)[gtid_214246] = defunc_0_f_res_214250;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228417_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228417_end -
                 futhark_mc_segmap_parloop_228417_start;
        
        ctx->futhark_mc_segmap_parloop_228417_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228417_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228417_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228415(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214245 = tid;
    int num_tasks_214258 = info.nsubtasks;
    struct futhark_mc_task_228414 *futhark_mc_task_228414 =
                                  (struct futhark_mc_task_228414 *) args;
    struct futhark_context *ctx = futhark_mc_task_228414->ctx;
    uint64_t futhark_mc_segmap_task_228415_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228415_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228414->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228414->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228414->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228414->free_i_196779;
    int64_t gtid_200019 = futhark_mc_task_228414->free_gtid_200019;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228414->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t gtid_214194 = futhark_mc_task_228414->free_gtid_214194;
    struct memblock mem_214195 = {.desc ="mem_214195", .mem =
                                  futhark_mc_task_228414->free_mem_214195,
                                  .size =0, .references =NULL};
    int64_t iter_214259;
    struct futhark_mc_segmap_parloop_struct_228416
    futhark_mc_segmap_parloop_struct_228416;
    
    futhark_mc_segmap_parloop_struct_228416.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228416.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228416.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228416.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228416.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228416.free_gtid_200019 = gtid_200019;
    futhark_mc_segmap_parloop_struct_228416.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228416.free_gtid_214194 = gtid_214194;
    futhark_mc_segmap_parloop_struct_228416.free_mem_214195 = mem_214195.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228417_task;
    
    futhark_mc_segmap_parloop_228417_task.name =
        "futhark_mc_segmap_parloop_228417";
    futhark_mc_segmap_parloop_228417_task.fn = futhark_mc_segmap_parloop_228417;
    futhark_mc_segmap_parloop_228417_task.args =
        &futhark_mc_segmap_parloop_struct_228416;
    futhark_mc_segmap_parloop_228417_task.iterations = iterations;
    futhark_mc_segmap_parloop_228417_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228417_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228417_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228417_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228417_task);
    
    if (futhark_mc_segmap_parloop_228417_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228417_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228417_total_end -
                 futhark_mc_segmap_parloop_228417_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228417_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228417_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228417_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228415_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228415_end -
                 futhark_mc_segmap_task_228415_start;
        
        ctx->futhark_mc_segmap_task_228415_runs[tid]++;
        ctx->futhark_mc_segmap_task_228415_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228415_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228412(void *args, int64_t start,
                                            int64_t end, int flat_tid_214193,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228411
    *futhark_mc_segmap_parloop_struct_228411 =
    (struct futhark_mc_segmap_parloop_struct_228411 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228411->ctx;
    uint64_t futhark_mc_segmap_parloop_228412_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228412_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228411->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228411->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228411->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228411->free_i_196779;
    int64_t gtid_200019 =
            futhark_mc_segmap_parloop_struct_228411->free_gtid_200019;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228411->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 =
            futhark_mc_segmap_parloop_struct_228411->free_bytes_210399;
    struct memblock mem_210419 = {.desc ="mem_210419", .mem =
                                  futhark_mc_segmap_parloop_struct_228411->free_mem_210419,
                                  .size =0, .references =NULL};
    size_t mem_214195_cached_sizze_228413 = 0;
    unsigned char *mem_214195 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214244 = start;
    
    if (mem_214195_cached_sizze_228413 < (size_t) bytes_210399) {
        mem_214195 = realloc(mem_214195, bytes_210399);
        mem_214195_cached_sizze_228413 = bytes_210399;
    }
    for (; iter_214244 < end; iter_214244++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214256 = n_p_196694;
        int64_t gtid_214194 = iter_214244;
        int64_t remnant_214257 = iter_214244 - gtid_214194;
        int64_t flat_tid_214245 = (int64_t) 0;
        int32_t num_tasks_214258;
        struct futhark_mc_task_228414 futhark_mc_task_228414;
        
        futhark_mc_task_228414.ctx = ctx;
        futhark_mc_task_228414.free_n_196692 = n_196692;
        futhark_mc_task_228414.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228414.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228414.free_i_196779 = i_196779;
        futhark_mc_task_228414.free_gtid_200019 = gtid_200019;
        futhark_mc_task_228414.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_228414.free_gtid_214194 = gtid_214194;
        futhark_mc_task_228414.free_mem_214195 = mem_214195;
        
        struct scheduler_segop futhark_mc_task_228414_task;
        
        futhark_mc_task_228414_task.args = &futhark_mc_task_228414;
        futhark_mc_task_228414_task.top_level_fn =
            futhark_mc_segmap_task_228415;
        futhark_mc_task_228414_task.name = "futhark_mc_segmap_task_228415";
        futhark_mc_task_228414_task.iterations = defunc_0_f_res_196740;
        futhark_mc_task_228414_task.task_time =
            &ctx->futhark_mc_segmap_task_228415_total_time;
        futhark_mc_task_228414_task.task_iter =
            &ctx->futhark_mc_segmap_task_228415_total_iter;
        futhark_mc_task_228414_task.sched = STATIC;
        futhark_mc_task_228414_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228415_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228414_task);
        
        if (futhark_mc_segmap_task_228415_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_210419.mem + gtid_214194 * defunc_0_f_res_196740 *
                    (int64_t) 4, mem_214195 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_214195);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228412_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228412_end -
                 futhark_mc_segmap_parloop_228412_start;
        
        ctx->futhark_mc_segmap_parloop_228412_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228412_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228412_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228410(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214193 = tid;
    int num_tasks_214227 = info.nsubtasks;
    struct futhark_mc_task_228405 *futhark_mc_task_228405 =
                                  (struct futhark_mc_task_228405 *) args;
    struct futhark_context *ctx = futhark_mc_task_228405->ctx;
    uint64_t futhark_mc_segmap_nested_task_228410_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228410_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228405->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228405->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228405->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228405->free_i_196779;
    int64_t gtid_200019 = futhark_mc_task_228405->free_gtid_200019;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228405->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 = futhark_mc_task_228405->free_bytes_210399;
    struct memblock mem_210419 = {.desc ="mem_210419", .mem =
                                  futhark_mc_task_228405->free_mem_210419,
                                  .size =0, .references =NULL};
    int64_t iter_214244;
    struct futhark_mc_segmap_parloop_struct_228411
    futhark_mc_segmap_parloop_struct_228411;
    
    futhark_mc_segmap_parloop_struct_228411.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228411.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228411.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228411.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228411.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228411.free_gtid_200019 = gtid_200019;
    futhark_mc_segmap_parloop_struct_228411.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228411.free_bytes_210399 = bytes_210399;
    futhark_mc_segmap_parloop_struct_228411.free_mem_210419 = mem_210419.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228412_task;
    
    futhark_mc_segmap_parloop_228412_task.name =
        "futhark_mc_segmap_parloop_228412";
    futhark_mc_segmap_parloop_228412_task.fn = futhark_mc_segmap_parloop_228412;
    futhark_mc_segmap_parloop_228412_task.args =
        &futhark_mc_segmap_parloop_struct_228411;
    futhark_mc_segmap_parloop_228412_task.iterations = iterations;
    futhark_mc_segmap_parloop_228412_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228412_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228412_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228412_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228412_task);
    
    if (futhark_mc_segmap_parloop_228412_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228412_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228412_total_end -
                 futhark_mc_segmap_parloop_228412_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228412_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228412_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228412_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228410_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228410_end -
                 futhark_mc_segmap_nested_task_228410_start;
        
        ctx->futhark_mc_segmap_nested_task_228410_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228410_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228410_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228403(void *args, int64_t start,
                                            int64_t end, int flat_tid_200018,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228402
    *futhark_mc_segmap_parloop_struct_228402 =
    (struct futhark_mc_segmap_parloop_struct_228402 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228402->ctx;
    uint64_t futhark_mc_segmap_parloop_228403_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228403_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228402->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228402->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228402->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228402->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228402->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228402->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 =
            futhark_mc_segmap_parloop_struct_228402->free_bytes_210399;
    int64_t bytes_210418 =
            futhark_mc_segmap_parloop_struct_228402->free_bytes_210418;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228402->free_mem_210468,
                                  .size =0, .references =NULL};
    size_t mem_210419_cached_sizze_228404 = 0;
    unsigned char *mem_210419 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214192 = start;
    
    if (mem_210419_cached_sizze_228404 < (size_t) bytes_210418) {
        mem_210419 = realloc(mem_210419, bytes_210418);
        mem_210419_cached_sizze_228404 = bytes_210418;
    }
    for (; iter_214192 < end; iter_214192++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214225 = m_196691;
        int64_t gtid_200019 = iter_214192;
        int64_t remnant_214226 = iter_214192 - gtid_200019;
        int64_t flat_tid_214208 = (int64_t) 0;
        int32_t num_tasks_214227;
        int64_t flat_tid_214193 = (int64_t) 0;
        struct futhark_mc_task_228405 futhark_mc_task_228405;
        
        futhark_mc_task_228405.ctx = ctx;
        futhark_mc_task_228405.free_n_196692 = n_196692;
        futhark_mc_task_228405.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228405.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228405.free_i_196779 = i_196779;
        futhark_mc_task_228405.free_gtid_200019 = gtid_200019;
        futhark_mc_task_228405.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_228405.free_bytes_210399 = bytes_210399;
        futhark_mc_task_228405.free_mem_210419 = mem_210419;
        
        struct scheduler_segop futhark_mc_task_228405_task;
        
        futhark_mc_task_228405_task.args = &futhark_mc_task_228405;
        futhark_mc_task_228405_task.top_level_fn =
            futhark_mc_segmap_task_228406;
        futhark_mc_task_228405_task.name = "futhark_mc_segmap_task_228406";
        futhark_mc_task_228405_task.iterations = n_p_196694;
        futhark_mc_task_228405_task.task_time =
            &ctx->futhark_mc_segmap_task_228406_total_time;
        futhark_mc_task_228405_task.task_iter =
            &ctx->futhark_mc_segmap_task_228406_total_iter;
        futhark_mc_task_228405_task.sched = STATIC;
        futhark_mc_task_228405_task.nested_fn =
            futhark_mc_segmap_nested_task_228410;
        
        int futhark_mc_segmap_task_228406_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228405_task);
        
        if (futhark_mc_segmap_task_228406_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_210468.mem + gtid_200019 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_210419 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210419);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228403_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228403_end -
                 futhark_mc_segmap_parloop_228403_start;
        
        ctx->futhark_mc_segmap_parloop_228403_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228403_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228403_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228401(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200018 = tid;
    int num_tasks_214171 = info.nsubtasks;
    struct futhark_mc_task_228396 *futhark_mc_task_228396 =
                                  (struct futhark_mc_task_228396 *) args;
    struct futhark_context *ctx = futhark_mc_task_228396->ctx;
    uint64_t futhark_mc_segmap_nested_task_228401_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228401_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228396->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228396->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228396->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228396->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228396->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228396->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210399 = futhark_mc_task_228396->free_bytes_210399;
    int64_t bytes_210418 = futhark_mc_task_228396->free_bytes_210418;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228396->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t iter_214192;
    struct futhark_mc_segmap_parloop_struct_228402
    futhark_mc_segmap_parloop_struct_228402;
    
    futhark_mc_segmap_parloop_struct_228402.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228402.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228402.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228402.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228402.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228402.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228402.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228402.free_bytes_210399 = bytes_210399;
    futhark_mc_segmap_parloop_struct_228402.free_bytes_210418 = bytes_210418;
    futhark_mc_segmap_parloop_struct_228402.free_mem_210468 = mem_210468.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228403_task;
    
    futhark_mc_segmap_parloop_228403_task.name =
        "futhark_mc_segmap_parloop_228403";
    futhark_mc_segmap_parloop_228403_task.fn = futhark_mc_segmap_parloop_228403;
    futhark_mc_segmap_parloop_228403_task.args =
        &futhark_mc_segmap_parloop_struct_228402;
    futhark_mc_segmap_parloop_228403_task.iterations = iterations;
    futhark_mc_segmap_parloop_228403_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228403_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228403_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228403_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228403_task);
    
    if (futhark_mc_segmap_parloop_228403_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228403_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228403_total_end -
                 futhark_mc_segmap_parloop_228403_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228403_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228403_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228403_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228401_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228401_end -
                 futhark_mc_segmap_nested_task_228401_start;
        
        ctx->futhark_mc_segmap_nested_task_228401_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228401_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228401_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228418 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196831;
    unsigned char *free_mem_210468;
    int64_t free_bytes_210470;
    int64_t free_bytes_210507;
    int64_t free_bytes_210510;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
};
struct futhark_mc_segmap_parloop_struct_228420 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196831;
    unsigned char *free_mem_210468;
    int64_t free_bytes_210470;
    int64_t free_bytes_210507;
    int64_t free_bytes_210510;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
};
static int futhark_mc_segmap_parloop_228421(void *args, int64_t start,
                                            int64_t end, int flat_tid_200052,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228420
    *futhark_mc_segmap_parloop_struct_228420 =
    (struct futhark_mc_segmap_parloop_struct_228420 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228420->ctx;
    uint64_t futhark_mc_segmap_parloop_228421_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228421_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228420->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228420->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228420->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228420->free_i_196831;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228420->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228420->free_bytes_210470;
    int64_t bytes_210507 =
            futhark_mc_segmap_parloop_struct_228420->free_bytes_210507;
    int64_t bytes_210510 =
            futhark_mc_segmap_parloop_struct_228420->free_bytes_210510;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228420->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228420->free_mem_210594,
                                  .size =0, .references =NULL};
    size_t mem_210515_cached_sizze_228422 = 0;
    unsigned char *mem_210515 = NULL;
    size_t mem_210518_cached_sizze_228423 = 0;
    unsigned char *mem_210518 = NULL;
    size_t mem_210538_cached_sizze_228424 = 0;
    unsigned char *mem_210538 = NULL;
    size_t mem_210553_cached_sizze_228425 = 0;
    unsigned char *mem_210553 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214268 = start;
    
    if (mem_210515_cached_sizze_228422 < (size_t) bytes_210507) {
        mem_210515 = realloc(mem_210515, bytes_210507);
        mem_210515_cached_sizze_228422 = bytes_210507;
    }
    if (mem_210518_cached_sizze_228423 < (size_t) bytes_210510) {
        mem_210518 = realloc(mem_210518, bytes_210510);
        mem_210518_cached_sizze_228423 = bytes_210510;
    }
    if (mem_210538_cached_sizze_228424 < (size_t) bytes_210470) {
        mem_210538 = realloc(mem_210538, bytes_210470);
        mem_210538_cached_sizze_228424 = bytes_210470;
    }
    if (mem_210553_cached_sizze_228425 < (size_t) bytes_210470) {
        mem_210553 = realloc(mem_210553, bytes_210470);
        mem_210553_cached_sizze_228425 = bytes_210470;
    }
    for (; iter_214268 < end; iter_214268++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214297 = m_196691;
        int64_t gtid_200053 = iter_214268;
        int64_t remnant_214298 = iter_214268 - gtid_200053;
        
        for (int64_t i_214299 = 0; i_214299 < defunc_0_f_res_196740;
             i_214299++) {
            ((int64_t *) mem_210553)[i_214299] = (int64_t) -1;
        }
        for (int64_t i_214269 = 0; i_214269 < n_p_196694; i_214269++) {
            int64_t discard_214273;
            int64_t scanacc_214276 = (int64_t) 0;
            
            for (int64_t i_214275 = 0; i_214275 < defunc_0_f_res_196740;
                 i_214275++) {
                float x_214278;
                
                x_214278 = ((float *) mem_210468.mem)[gtid_200053 *
                                                      (defunc_0_f_res_196740 *
                                                       n_p_196694) + i_214269 *
                                                      defunc_0_f_res_196740 +
                                                      i_214275];
                
                bool isnan_res_214279;
                
                isnan_res_214279 = futrts_isnan32(x_214278);
                
                bool defunc_0_p_res_214280 = !isnan_res_214279;
                int64_t defunc_0_f_res_214281 =
                        btoi_bool_i64(defunc_0_p_res_214280);
                int64_t defunc_1_op_res_214282 = add64(defunc_0_f_res_214281,
                                                       scanacc_214276);
                
                ((int64_t *) mem_210538)[i_214275] = defunc_1_op_res_214282;
                
                int64_t scanacc_tmp_214302 = defunc_1_op_res_214282;
                
                scanacc_214276 = scanacc_tmp_214302;
            }
            discard_214273 = scanacc_214276;
            if (defunc_0_f_res_196740 * (int64_t) 8 > 0)
                memmove(mem_210515 + i_214269 * defunc_0_f_res_196740 *
                        (int64_t) 8, mem_210553 + (int64_t) 0,
                        defunc_0_f_res_196740 * (int64_t) 8);
            for (int64_t write_iter_214286 = 0; write_iter_214286 <
                 defunc_0_f_res_196740; write_iter_214286++) {
                float write_iv_214288;
                
                write_iv_214288 = ((float *) mem_210468.mem)[gtid_200053 *
                                                             (defunc_0_f_res_196740 *
                                                              n_p_196694) +
                                                             i_214269 *
                                                             defunc_0_f_res_196740 +
                                                             write_iter_214286];
                
                bool isnan_res_214289;
                
                isnan_res_214289 = futrts_isnan32(write_iv_214288);
                
                bool defunc_0_p_res_214290 = !isnan_res_214289;
                int64_t defunc_1_f_res_214291;
                
                if (defunc_0_p_res_214290) {
                    int64_t write_iv_214292;
                    
                    write_iv_214292 =
                        ((int64_t *) mem_210538)[write_iter_214286];
                    
                    int64_t defunc_1_f_res_t_res_214293 = sub64(write_iv_214292,
                                                                (int64_t) 1);
                    
                    defunc_1_f_res_214291 = defunc_1_f_res_t_res_214293;
                } else {
                    defunc_1_f_res_214291 = (int64_t) -1;
                }
                if ((sle64((int64_t) 0, i_214269) && slt64(i_214269,
                                                           n_p_196694)) &&
                    (sle64((int64_t) 0, defunc_1_f_res_214291) &&
                     slt64(defunc_1_f_res_214291, defunc_0_f_res_196740))) {
                    ((int64_t *) mem_210515)[i_214269 * defunc_0_f_res_196740 +
                                             defunc_1_f_res_214291] =
                        write_iter_214286;
                }
            }
            if ((int64_t) 8 > 0)
                memmove(mem_210518 + i_214269 * (int64_t) 8, mem_210538 +
                        i_196831 * (int64_t) 8, (int64_t) 8);
        }
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 8 > 0)
            memmove(mem_210590.mem + gtid_200053 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 8,
                    mem_210515 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 8);
        if (n_p_196694 * (int64_t) 8 > 0)
            memmove(mem_210594.mem + gtid_200053 * n_p_196694 * (int64_t) 8,
                    mem_210518 + (int64_t) 0, n_p_196694 * (int64_t) 8);
    }
    
  cleanup:
    { }
    free(mem_210515);
    free(mem_210518);
    free(mem_210538);
    free(mem_210553);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228421_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228421_end -
                 futhark_mc_segmap_parloop_228421_start;
        
        ctx->futhark_mc_segmap_parloop_228421_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228421_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228421_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228419(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200052 = tid;
    int num_tasks_214267 = info.nsubtasks;
    struct futhark_mc_task_228418 *futhark_mc_task_228418 =
                                  (struct futhark_mc_task_228418 *) args;
    struct futhark_context *ctx = futhark_mc_task_228418->ctx;
    uint64_t futhark_mc_segmap_task_228419_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228419_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228418->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228418->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228418->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_task_228418->free_i_196831;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228418->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 = futhark_mc_task_228418->free_bytes_210470;
    int64_t bytes_210507 = futhark_mc_task_228418->free_bytes_210507;
    int64_t bytes_210510 = futhark_mc_task_228418->free_bytes_210510;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228418->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228418->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t iter_214268;
    struct futhark_mc_segmap_parloop_struct_228420
    futhark_mc_segmap_parloop_struct_228420;
    
    futhark_mc_segmap_parloop_struct_228420.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228420.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228420.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228420.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228420.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228420.free_mem_210468 = mem_210468.mem;
    futhark_mc_segmap_parloop_struct_228420.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228420.free_bytes_210507 = bytes_210507;
    futhark_mc_segmap_parloop_struct_228420.free_bytes_210510 = bytes_210510;
    futhark_mc_segmap_parloop_struct_228420.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228420.free_mem_210594 = mem_210594.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228421_task;
    
    futhark_mc_segmap_parloop_228421_task.name =
        "futhark_mc_segmap_parloop_228421";
    futhark_mc_segmap_parloop_228421_task.fn = futhark_mc_segmap_parloop_228421;
    futhark_mc_segmap_parloop_228421_task.args =
        &futhark_mc_segmap_parloop_struct_228420;
    futhark_mc_segmap_parloop_228421_task.iterations = iterations;
    futhark_mc_segmap_parloop_228421_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228421_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228421_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228421_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228421_task);
    
    if (futhark_mc_segmap_parloop_228421_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228421_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228421_total_end -
                 futhark_mc_segmap_parloop_228421_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228421_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228421_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228421_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228419_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228419_end -
                 futhark_mc_segmap_task_228419_start;
        
        ctx->futhark_mc_segmap_task_228419_runs[tid]++;
        ctx->futhark_mc_segmap_task_228419_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228419_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228427 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196831;
    unsigned char *free_mem_210468;
    int64_t free_bytes_210470;
    int64_t free_bytes_210507;
    int64_t free_bytes_210510;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
};
struct futhark_mc_task_228431 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196831;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210508;
    unsigned char *free_mem_210511;
};
struct futhark_mc_segmap_parloop_struct_228433 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196831;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210508;
    unsigned char *free_mem_210511;
};
static int futhark_mc_segmap_parloop_228434(void *args, int64_t start,
                                            int64_t end, int flat_tid_214331,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228433
    *futhark_mc_segmap_parloop_struct_228433 =
    (struct futhark_mc_segmap_parloop_struct_228433 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228433->ctx;
    uint64_t futhark_mc_segmap_parloop_228434_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228434_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228433->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228433->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228433->free_i_196831;
    int64_t gtid_200090 =
            futhark_mc_segmap_parloop_struct_228433->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228433->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228433->free_bytes_210470;
    struct memblock mem_210508 = {.desc ="mem_210508", .mem =
                                  futhark_mc_segmap_parloop_struct_228433->free_mem_210508,
                                  .size =0, .references =NULL};
    struct memblock mem_210511 = {.desc ="mem_210511", .mem =
                                  futhark_mc_segmap_parloop_struct_228433->free_mem_210511,
                                  .size =0, .references =NULL};
    size_t mem_214333_cached_sizze_228435 = 0;
    unsigned char *mem_214333 = NULL;
    size_t mem_214347_cached_sizze_228436 = 0;
    unsigned char *mem_214347 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214362 = start;
    
    if (mem_214333_cached_sizze_228435 < (size_t) bytes_210470) {
        mem_214333 = realloc(mem_214333, bytes_210470);
        mem_214333_cached_sizze_228435 = bytes_210470;
    }
    if (mem_214347_cached_sizze_228436 < (size_t) bytes_210470) {
        mem_214347 = realloc(mem_214347, bytes_210470);
        mem_214347_cached_sizze_228436 = bytes_210470;
    }
    for (; iter_214362 < end; iter_214362++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214381 = n_p_196694;
        int64_t gtid_214332 = iter_214362;
        int64_t remnant_214382 = iter_214362 - gtid_214332;
        int64_t discard_214335;
        int64_t scanacc_214364 = (int64_t) 0;
        
        for (int64_t i_214363 = 0; i_214363 < defunc_0_f_res_196740;
             i_214363++) {
            float x_214366;
            
            x_214366 = ((float *) mem_210468.mem)[gtid_200090 *
                                                  (defunc_0_f_res_196740 *
                                                   n_p_196694) + gtid_214332 *
                                                  defunc_0_f_res_196740 +
                                                  i_214363];
            
            bool isnan_res_214367;
            
            isnan_res_214367 = futrts_isnan32(x_214366);
            
            bool defunc_0_p_res_214368 = !isnan_res_214367;
            int64_t defunc_0_f_res_214369 =
                    btoi_bool_i64(defunc_0_p_res_214368);
            int64_t defunc_1_op_res_214370 = add64(defunc_0_f_res_214369,
                                                   scanacc_214364);
            
            ((int64_t *) mem_214333)[i_214363] = defunc_1_op_res_214370;
            
            int64_t scanacc_tmp_214383 = defunc_1_op_res_214370;
            
            scanacc_214364 = scanacc_tmp_214383;
        }
        discard_214335 = scanacc_214364;
        
        int64_t last_res_214346;
        
        last_res_214346 = ((int64_t *) mem_214333)[i_196831];
        for (int64_t i_214385 = 0; i_214385 < defunc_0_f_res_196740;
             i_214385++) {
            ((int64_t *) mem_214347)[i_214385] = (int64_t) -1;
        }
        for (int64_t write_iter_214372 = 0; write_iter_214372 <
             defunc_0_f_res_196740; write_iter_214372++) {
            float write_iv_214374;
            
            write_iv_214374 = ((float *) mem_210468.mem)[gtid_200090 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         gtid_214332 *
                                                         defunc_0_f_res_196740 +
                                                         write_iter_214372];
            
            bool isnan_res_214375;
            
            isnan_res_214375 = futrts_isnan32(write_iv_214374);
            
            bool defunc_0_p_res_214376 = !isnan_res_214375;
            int64_t defunc_1_f_res_214377;
            
            if (defunc_0_p_res_214376) {
                int64_t write_iv_214378;
                
                write_iv_214378 = ((int64_t *) mem_214333)[write_iter_214372];
                
                int64_t defunc_1_f_res_t_res_214379 = sub64(write_iv_214378,
                                                            (int64_t) 1);
                
                defunc_1_f_res_214377 = defunc_1_f_res_t_res_214379;
            } else {
                defunc_1_f_res_214377 = (int64_t) -1;
            }
            if (sle64((int64_t) 0, defunc_1_f_res_214377) &&
                slt64(defunc_1_f_res_214377, defunc_0_f_res_196740)) {
                ((int64_t *) mem_214347)[defunc_1_f_res_214377] =
                    write_iter_214372;
            }
        }
        if (defunc_0_f_res_196740 * (int64_t) 8 > 0)
            memmove(mem_210508.mem + gtid_214332 * defunc_0_f_res_196740 *
                    (int64_t) 8, mem_214347 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 8);
        ((int64_t *) mem_210511.mem)[gtid_214332] = last_res_214346;
    }
    
  cleanup:
    { }
    free(mem_214333);
    free(mem_214347);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228434_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228434_end -
                 futhark_mc_segmap_parloop_228434_start;
        
        ctx->futhark_mc_segmap_parloop_228434_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228434_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228434_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228432(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214331 = tid;
    int num_tasks_214361 = info.nsubtasks;
    struct futhark_mc_task_228431 *futhark_mc_task_228431 =
                                  (struct futhark_mc_task_228431 *) args;
    struct futhark_context *ctx = futhark_mc_task_228431->ctx;
    uint64_t futhark_mc_segmap_task_228432_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228432_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228431->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228431->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_task_228431->free_i_196831;
    int64_t gtid_200090 = futhark_mc_task_228431->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228431->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 = futhark_mc_task_228431->free_bytes_210470;
    struct memblock mem_210508 = {.desc ="mem_210508", .mem =
                                  futhark_mc_task_228431->free_mem_210508,
                                  .size =0, .references =NULL};
    struct memblock mem_210511 = {.desc ="mem_210511", .mem =
                                  futhark_mc_task_228431->free_mem_210511,
                                  .size =0, .references =NULL};
    int64_t iter_214362;
    struct futhark_mc_segmap_parloop_struct_228433
    futhark_mc_segmap_parloop_struct_228433;
    
    futhark_mc_segmap_parloop_struct_228433.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228433.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228433.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228433.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228433.free_gtid_200090 = gtid_200090;
    futhark_mc_segmap_parloop_struct_228433.free_mem_210468 = mem_210468.mem;
    futhark_mc_segmap_parloop_struct_228433.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228433.free_mem_210508 = mem_210508.mem;
    futhark_mc_segmap_parloop_struct_228433.free_mem_210511 = mem_210511.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228434_task;
    
    futhark_mc_segmap_parloop_228434_task.name =
        "futhark_mc_segmap_parloop_228434";
    futhark_mc_segmap_parloop_228434_task.fn = futhark_mc_segmap_parloop_228434;
    futhark_mc_segmap_parloop_228434_task.args =
        &futhark_mc_segmap_parloop_struct_228433;
    futhark_mc_segmap_parloop_228434_task.iterations = iterations;
    futhark_mc_segmap_parloop_228434_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228434_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228434_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228434_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228434_task);
    
    if (futhark_mc_segmap_parloop_228434_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228434_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228434_total_end -
                 futhark_mc_segmap_parloop_228434_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228434_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228434_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228434_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228432_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228432_end -
                 futhark_mc_segmap_task_228432_start;
        
        ctx->futhark_mc_segmap_task_228432_runs[tid]++;
        ctx->futhark_mc_segmap_task_228432_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228432_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228438 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196831;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210508;
    unsigned char *free_mem_210511;
};
struct futhark_mc_task_228442 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_gtid_214307;
    unsigned char *free_mem_214308;
};
struct futhark_mc_scan_stage_1_parloop_struct_228445 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_gtid_214307;
    unsigned char *free_mem_214308;
};
static int futhark_mc_scan_stage_1_parloop_228446(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_214388, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_1_parloop_struct_228445
    *futhark_mc_scan_stage_1_parloop_struct_228445 =
    (struct futhark_mc_scan_stage_1_parloop_struct_228445 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_1_parloop_struct_228445->ctx;
    uint64_t futhark_mc_scan_stage_1_parloop_228446_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228446_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_scan_stage_1_parloop_struct_228445->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_scan_stage_1_parloop_struct_228445->free_defunc_0_f_res_196740;
    int64_t gtid_200090 =
            futhark_mc_scan_stage_1_parloop_struct_228445->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228445->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t gtid_214307 =
            futhark_mc_scan_stage_1_parloop_struct_228445->free_gtid_214307;
    struct memblock mem_214308 = {.desc ="mem_214308", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228445->free_mem_214308,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214408 = start;
    int64_t x_214390;
    int64_t x_214391;
    
    x_214390 = (int64_t) 0;
    for (; iter_214408 < end; iter_214408++) {
        int64_t gtid_214389 = iter_214408;
        
        // stage 1 scan body
        {
            float x_214393;
            
            x_214393 = ((float *) mem_210468.mem)[gtid_200090 *
                                                  (defunc_0_f_res_196740 *
                                                   n_p_196694) + gtid_214307 *
                                                  defunc_0_f_res_196740 +
                                                  gtid_214389];
            
            bool isnan_res_214394;
            
            isnan_res_214394 = futrts_isnan32(x_214393);
            
            bool defunc_0_p_res_214395 = !isnan_res_214394;
            int64_t defunc_0_f_res_214396 =
                    btoi_bool_i64(defunc_0_p_res_214395);
            
            // write mapped values results to memory
            { }
            x_214390 = x_214390;
            // Read next values
            {
                x_214391 = defunc_0_f_res_214396;
            }
            
            int64_t defunc_1_op_res_214392 = add64(x_214390, x_214391);
            
            ((int64_t *) mem_214308.mem)[gtid_214389] = defunc_1_op_res_214392;
            x_214390 = defunc_1_op_res_214392;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228446_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228446_end -
                 futhark_mc_scan_stage_1_parloop_228446_start;
        
        ctx->futhark_mc_scan_stage_1_parloop_228446_runs[tid]++;
        ctx->futhark_mc_scan_stage_1_parloop_228446_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_1_parloop_228446_iter[tid] += iterations;
    }
    return err;
}
struct futhark_mc_scan_stage_3_parloop_struct_228447 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_gtid_214307;
    unsigned char *free_mem_214308;
};
static int futhark_mc_scan_stage_3_parloop_228448(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_214388, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_3_parloop_struct_228447
    *futhark_mc_scan_stage_3_parloop_struct_228447 =
    (struct futhark_mc_scan_stage_3_parloop_struct_228447 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_3_parloop_struct_228447->ctx;
    uint64_t futhark_mc_scan_stage_3_parloop_228448_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_3_parloop_228448_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_scan_stage_3_parloop_struct_228447->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_scan_stage_3_parloop_struct_228447->free_defunc_0_f_res_196740;
    int64_t gtid_200090 =
            futhark_mc_scan_stage_3_parloop_struct_228447->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228447->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t gtid_214307 =
            futhark_mc_scan_stage_3_parloop_struct_228447->free_gtid_214307;
    struct memblock mem_214308 = {.desc ="mem_214308", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228447->free_mem_214308,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214420 = start;
    int64_t x_214417;
    int64_t x_214418;
    
    if (iter_214420 == (int64_t) 0) {
        x_214417 = (int64_t) 0;
    } else {
        x_214417 = ((int64_t *) mem_214308.mem)[iter_214420 - (int64_t) 1];
    }
    for (; iter_214420 < end; iter_214420++) {
        int64_t gtid_214389 = iter_214420;
        
        // stage 3 scan body
        {
            float x_214393;
            
            x_214393 = ((float *) mem_210468.mem)[gtid_200090 *
                                                  (defunc_0_f_res_196740 *
                                                   n_p_196694) + gtid_214307 *
                                                  defunc_0_f_res_196740 +
                                                  gtid_214389];
            
            bool isnan_res_214394;
            
            isnan_res_214394 = futrts_isnan32(x_214393);
            
            bool defunc_0_p_res_214395 = !isnan_res_214394;
            int64_t defunc_0_f_res_214396 =
                    btoi_bool_i64(defunc_0_p_res_214395);
            
            x_214417 = x_214417;
            x_214418 = defunc_0_f_res_214396;
            
            int64_t defunc_1_op_res_214419 = add64(x_214417, x_214418);
            
            ((int64_t *) mem_214308.mem)[gtid_214389] = defunc_1_op_res_214419;
            x_214417 = defunc_1_op_res_214419;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_3_parloop_228448_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_3_parloop_228448_end -
                 futhark_mc_scan_stage_3_parloop_228448_start;
        
        ctx->futhark_mc_scan_stage_3_parloop_228448_runs[tid]++;
        ctx->futhark_mc_scan_stage_3_parloop_228448_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_3_parloop_228448_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segscan_task_228443(void *args, int64_t iterations, int tid,
                                   struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214388 = tid;
    int num_tasks_214407 = info.nsubtasks;
    struct futhark_mc_task_228442 *futhark_mc_task_228442 =
                                  (struct futhark_mc_task_228442 *) args;
    struct futhark_context *ctx = futhark_mc_task_228442->ctx;
    uint64_t futhark_mc_segscan_task_228443_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segscan_task_228443_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228442->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228442->free_defunc_0_f_res_196740;
    int64_t gtid_200090 = futhark_mc_task_228442->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228442->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t gtid_214307 = futhark_mc_task_228442->free_gtid_214307;
    struct memblock mem_214308 = {.desc ="mem_214308", .mem =
                                  futhark_mc_task_228442->free_mem_214308,
                                  .size =0, .references =NULL};
    size_t scan_stage_2_accum_mem_214414_cached_sizze_228444 = 0;
    unsigned char *scan_stage_2_accum_mem_214414 = NULL;
    int64_t iter_214408;
    struct futhark_mc_scan_stage_1_parloop_struct_228445
    futhark_mc_scan_stage_1_parloop_struct_228445;
    
    futhark_mc_scan_stage_1_parloop_struct_228445.ctx = ctx;
    futhark_mc_scan_stage_1_parloop_struct_228445.free_n_p_196694 = n_p_196694;
    futhark_mc_scan_stage_1_parloop_struct_228445.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_scan_stage_1_parloop_struct_228445.free_gtid_200090 =
        gtid_200090;
    futhark_mc_scan_stage_1_parloop_struct_228445.free_mem_210468 =
        mem_210468.mem;
    futhark_mc_scan_stage_1_parloop_struct_228445.free_gtid_214307 =
        gtid_214307;
    futhark_mc_scan_stage_1_parloop_struct_228445.free_mem_214308 =
        mem_214308.mem;
    
    struct scheduler_parloop futhark_mc_scan_stage_1_parloop_228446_task;
    
    futhark_mc_scan_stage_1_parloop_228446_task.name =
        "futhark_mc_scan_stage_1_parloop_228446";
    futhark_mc_scan_stage_1_parloop_228446_task.fn =
        futhark_mc_scan_stage_1_parloop_228446;
    futhark_mc_scan_stage_1_parloop_228446_task.args =
        &futhark_mc_scan_stage_1_parloop_struct_228445;
    futhark_mc_scan_stage_1_parloop_228446_task.iterations = iterations;
    futhark_mc_scan_stage_1_parloop_228446_task.info = info;
    
    uint64_t futhark_mc_scan_stage_1_parloop_228446_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228446_total_start = get_wall_time();
    
    int futhark_mc_scan_stage_1_parloop_228446_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_scan_stage_1_parloop_228446_task);
    
    if (futhark_mc_scan_stage_1_parloop_228446_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228446_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228446_total_end -
                 futhark_mc_scan_stage_1_parloop_228446_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228446_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228446_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228446_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    if (slt32(1, num_tasks_214407)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmentedScan stage 2");
        
        int64_t x_214409;
        int64_t x_214410;
        int64_t offset_214412 = (int64_t) 0;
        int64_t offset_index_214413 = (int64_t) 0;
        
        if (scan_stage_2_accum_mem_214414_cached_sizze_228444 <
            (size_t) (int64_t) 8) {
            scan_stage_2_accum_mem_214414 =
                realloc(scan_stage_2_accum_mem_214414, (int64_t) 8);
            scan_stage_2_accum_mem_214414_cached_sizze_228444 = (int64_t) 8;
        }
        ((int64_t *) scan_stage_2_accum_mem_214414)[(int64_t) 0] = (int64_t) 0;
        for (int32_t i_214416 = 0; i_214416 < num_tasks_214407 - 1;
             i_214416++) {
            offset_214412 = squot64(defunc_0_f_res_196740,
                                    sext_i32_i64(num_tasks_214407));
            if (slt64(sext_i32_i64(i_214416), srem64(defunc_0_f_res_196740,
                                                     sext_i32_i64(num_tasks_214407)))) {
                offset_214412 += (int64_t) 1;
            }
            offset_index_214413 += offset_214412;
            
            int64_t gtid_214389 = offset_index_214413;
            float x_214393;
            
            x_214393 = ((float *) mem_210468.mem)[gtid_200090 *
                                                  (defunc_0_f_res_196740 *
                                                   n_p_196694) + gtid_214307 *
                                                  defunc_0_f_res_196740 +
                                                  gtid_214389];
            
            bool isnan_res_214394;
            
            isnan_res_214394 = futrts_isnan32(x_214393);
            
            bool defunc_0_p_res_214395 = !isnan_res_214394;
            int64_t defunc_0_f_res_214396 =
                    btoi_bool_i64(defunc_0_p_res_214395);
            
            // Read carry in
            {
                x_214409 =
                    ((int64_t *) scan_stage_2_accum_mem_214414)[(int64_t) 0];
            }
            // Read next values
            {
                x_214410 = ((int64_t *) mem_214308.mem)[offset_index_214413 -
                                                        (int64_t) 1];
            }
            
            int64_t defunc_1_op_res_214411 = add64(x_214409, x_214410);
            
            ((int64_t *) mem_214308.mem)[offset_index_214413 - (int64_t) 1] =
                defunc_1_op_res_214411;
            ((int64_t *) scan_stage_2_accum_mem_214414)[(int64_t) 0] =
                defunc_1_op_res_214411;
        }
        
        int64_t iter_214420 = (int64_t) 0;
        struct futhark_mc_scan_stage_3_parloop_struct_228447
        futhark_mc_scan_stage_3_parloop_struct_228447;
        
        futhark_mc_scan_stage_3_parloop_struct_228447.ctx = ctx;
        futhark_mc_scan_stage_3_parloop_struct_228447.free_n_p_196694 =
            n_p_196694;
        futhark_mc_scan_stage_3_parloop_struct_228447.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_scan_stage_3_parloop_struct_228447.free_gtid_200090 =
            gtid_200090;
        futhark_mc_scan_stage_3_parloop_struct_228447.free_mem_210468 =
            mem_210468.mem;
        futhark_mc_scan_stage_3_parloop_struct_228447.free_gtid_214307 =
            gtid_214307;
        futhark_mc_scan_stage_3_parloop_struct_228447.free_mem_214308 =
            mem_214308.mem;
        
        struct scheduler_parloop futhark_mc_scan_stage_3_parloop_228448_task;
        
        futhark_mc_scan_stage_3_parloop_228448_task.name =
            "futhark_mc_scan_stage_3_parloop_228448";
        futhark_mc_scan_stage_3_parloop_228448_task.fn =
            futhark_mc_scan_stage_3_parloop_228448;
        futhark_mc_scan_stage_3_parloop_228448_task.args =
            &futhark_mc_scan_stage_3_parloop_struct_228447;
        futhark_mc_scan_stage_3_parloop_228448_task.iterations = iterations;
        futhark_mc_scan_stage_3_parloop_228448_task.info = info;
        
        uint64_t futhark_mc_scan_stage_3_parloop_228448_total_start = 0;
        
        if (ctx->profiling && !ctx->profiling_paused)
            futhark_mc_scan_stage_3_parloop_228448_total_start =
                get_wall_time();
        
        int futhark_mc_scan_stage_3_parloop_228448_err =
            scheduler_execute_task(&ctx->scheduler,
                                   &futhark_mc_scan_stage_3_parloop_228448_task);
        
        if (futhark_mc_scan_stage_3_parloop_228448_err != 0) {
            err = 1;
            goto cleanup;
        }
        if (ctx->profiling && !ctx->profiling_paused) {
            uint64_t futhark_mc_scan_stage_3_parloop_228448_total_end =
                     get_wall_time();
            uint64_t elapsed =
                     futhark_mc_scan_stage_3_parloop_228448_total_end -
                     futhark_mc_scan_stage_3_parloop_228448_total_start;
            
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228448_total_runs,
                               1, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228448_total_total_runtime,
                               elapsed, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228448_total_iter,
                               iterations, __ATOMIC_RELAXED);
        }
    }
    
  cleanup:
    {
        free(scan_stage_2_accum_mem_214414);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segscan_task_228443_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segscan_task_228443_end -
                 futhark_mc_segscan_task_228443_start;
        
        ctx->futhark_mc_segscan_task_228443_runs[tid]++;
        ctx->futhark_mc_segscan_task_228443_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segscan_task_228443_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228449 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_gtid_214307;
    unsigned char *free_mem_214308;
    unsigned char *free_mem_214320;
};
struct futhark_mc_segmap_parloop_struct_228451 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200090;
    unsigned char *free_mem_210468;
    int64_t free_gtid_214307;
    unsigned char *free_mem_214308;
    unsigned char *free_mem_214320;
};
static int futhark_mc_segmap_parloop_228452(void *args, int64_t start,
                                            int64_t end, int flat_tid_214397,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228451
    *futhark_mc_segmap_parloop_struct_228451 =
    (struct futhark_mc_segmap_parloop_struct_228451 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228451->ctx;
    uint64_t futhark_mc_segmap_parloop_228452_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228452_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228451->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228451->free_defunc_0_f_res_196740;
    int64_t gtid_200090 =
            futhark_mc_segmap_parloop_struct_228451->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228451->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t gtid_214307 =
            futhark_mc_segmap_parloop_struct_228451->free_gtid_214307;
    struct memblock mem_214308 = {.desc ="mem_214308", .mem =
                                  futhark_mc_segmap_parloop_struct_228451->free_mem_214308,
                                  .size =0, .references =NULL};
    struct memblock mem_214320 = {.desc ="mem_214320", .mem =
                                  futhark_mc_segmap_parloop_struct_228451->free_mem_214320,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_214423 = start;
    
    for (; iter_214423 < end; iter_214423++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214426 = defunc_0_f_res_196740;
        int64_t gtid_214398 = iter_214423;
        int64_t remnant_214427 = iter_214423 - gtid_214398;
        float x_214399;
        
        x_214399 = ((float *) mem_210468.mem)[gtid_200090 *
                                              (defunc_0_f_res_196740 *
                                               n_p_196694) + gtid_214307 *
                                              defunc_0_f_res_196740 +
                                              gtid_214398];
        
        bool isnan_res_214400;
        
        isnan_res_214400 = futrts_isnan32(x_214399);
        
        bool defunc_0_p_res_214401 = !isnan_res_214400;
        int64_t defunc_1_f_res_214402;
        
        if (defunc_0_p_res_214401) {
            int64_t x_214424;
            
            x_214424 = ((int64_t *) mem_214308.mem)[gtid_214398];
            
            int64_t defunc_1_f_res_t_res_214425 = sub64(x_214424, (int64_t) 1);
            
            defunc_1_f_res_214402 = defunc_1_f_res_t_res_214425;
        } else {
            defunc_1_f_res_214402 = (int64_t) -1;
        }
        if (sle64((int64_t) 0, defunc_1_f_res_214402) &&
            slt64(defunc_1_f_res_214402, defunc_0_f_res_196740)) {
            ((int64_t *) mem_214320.mem)[defunc_1_f_res_214402] = gtid_214398;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228452_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228452_end -
                 futhark_mc_segmap_parloop_228452_start;
        
        ctx->futhark_mc_segmap_parloop_228452_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228452_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228452_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228450(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214397 = tid;
    int num_tasks_214422 = info.nsubtasks;
    struct futhark_mc_task_228449 *futhark_mc_task_228449 =
                                  (struct futhark_mc_task_228449 *) args;
    struct futhark_context *ctx = futhark_mc_task_228449->ctx;
    uint64_t futhark_mc_segmap_task_228450_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228450_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228449->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228449->free_defunc_0_f_res_196740;
    int64_t gtid_200090 = futhark_mc_task_228449->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228449->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t gtid_214307 = futhark_mc_task_228449->free_gtid_214307;
    struct memblock mem_214308 = {.desc ="mem_214308", .mem =
                                  futhark_mc_task_228449->free_mem_214308,
                                  .size =0, .references =NULL};
    struct memblock mem_214320 = {.desc ="mem_214320", .mem =
                                  futhark_mc_task_228449->free_mem_214320,
                                  .size =0, .references =NULL};
    int64_t iter_214423;
    struct futhark_mc_segmap_parloop_struct_228451
    futhark_mc_segmap_parloop_struct_228451;
    
    futhark_mc_segmap_parloop_struct_228451.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228451.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228451.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228451.free_gtid_200090 = gtid_200090;
    futhark_mc_segmap_parloop_struct_228451.free_mem_210468 = mem_210468.mem;
    futhark_mc_segmap_parloop_struct_228451.free_gtid_214307 = gtid_214307;
    futhark_mc_segmap_parloop_struct_228451.free_mem_214308 = mem_214308.mem;
    futhark_mc_segmap_parloop_struct_228451.free_mem_214320 = mem_214320.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228452_task;
    
    futhark_mc_segmap_parloop_228452_task.name =
        "futhark_mc_segmap_parloop_228452";
    futhark_mc_segmap_parloop_228452_task.fn = futhark_mc_segmap_parloop_228452;
    futhark_mc_segmap_parloop_228452_task.args =
        &futhark_mc_segmap_parloop_struct_228451;
    futhark_mc_segmap_parloop_228452_task.iterations = iterations;
    futhark_mc_segmap_parloop_228452_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228452_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228452_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228452_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228452_task);
    
    if (futhark_mc_segmap_parloop_228452_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228452_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228452_total_end -
                 futhark_mc_segmap_parloop_228452_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228452_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228452_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228452_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228450_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228450_end -
                 futhark_mc_segmap_task_228450_start;
        
        ctx->futhark_mc_segmap_task_228450_runs[tid]++;
        ctx->futhark_mc_segmap_task_228450_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228450_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228439(void *args, int64_t start,
                                            int64_t end, int flat_tid_214306,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228438
    *futhark_mc_segmap_parloop_struct_228438 =
    (struct futhark_mc_segmap_parloop_struct_228438 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228438->ctx;
    uint64_t futhark_mc_segmap_parloop_228439_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228439_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228438->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228438->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228438->free_i_196831;
    int64_t gtid_200090 =
            futhark_mc_segmap_parloop_struct_228438->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228438->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228438->free_bytes_210470;
    struct memblock mem_210508 = {.desc ="mem_210508", .mem =
                                  futhark_mc_segmap_parloop_struct_228438->free_mem_210508,
                                  .size =0, .references =NULL};
    struct memblock mem_210511 = {.desc ="mem_210511", .mem =
                                  futhark_mc_segmap_parloop_struct_228438->free_mem_210511,
                                  .size =0, .references =NULL};
    size_t mem_214308_cached_sizze_228440 = 0;
    unsigned char *mem_214308 = NULL;
    size_t mem_214320_cached_sizze_228441 = 0;
    unsigned char *mem_214320 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214387 = start;
    
    if (mem_214308_cached_sizze_228440 < (size_t) bytes_210470) {
        mem_214308 = realloc(mem_214308, bytes_210470);
        mem_214308_cached_sizze_228440 = bytes_210470;
    }
    if (mem_214320_cached_sizze_228441 < (size_t) bytes_210470) {
        mem_214320 = realloc(mem_214320, bytes_210470);
        mem_214320_cached_sizze_228441 = bytes_210470;
    }
    for (; iter_214387 < end; iter_214387++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214405 = n_p_196694;
        int64_t gtid_214307 = iter_214387;
        int64_t remnant_214406 = iter_214387 - gtid_214307;
        int64_t flat_tid_214388 = (int64_t) 0;
        int32_t num_tasks_214407;
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmented segScan");
        
        struct futhark_mc_task_228442 futhark_mc_task_228442;
        
        futhark_mc_task_228442.ctx = ctx;
        futhark_mc_task_228442.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228442.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228442.free_gtid_200090 = gtid_200090;
        futhark_mc_task_228442.free_mem_210468 = mem_210468.mem;
        futhark_mc_task_228442.free_gtid_214307 = gtid_214307;
        futhark_mc_task_228442.free_mem_214308 = mem_214308;
        
        struct scheduler_segop futhark_mc_task_228442_task;
        
        futhark_mc_task_228442_task.args = &futhark_mc_task_228442;
        futhark_mc_task_228442_task.top_level_fn =
            futhark_mc_segscan_task_228443;
        futhark_mc_task_228442_task.name = "futhark_mc_segscan_task_228443";
        futhark_mc_task_228442_task.iterations = defunc_0_f_res_196740;
        futhark_mc_task_228442_task.task_time =
            &ctx->futhark_mc_segscan_task_228443_total_time;
        futhark_mc_task_228442_task.task_iter =
            &ctx->futhark_mc_segscan_task_228443_total_iter;
        futhark_mc_task_228442_task.sched = STATIC;
        futhark_mc_task_228442_task.nested_fn = NULL;
        
        int futhark_mc_segscan_task_228443_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228442_task);
        
        if (futhark_mc_segscan_task_228443_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t last_res_214319;
        
        last_res_214319 = ((int64_t *) mem_214308)[i_196831];
        for (int64_t i_214421 = 0; i_214421 < defunc_0_f_res_196740;
             i_214421++) {
            ((int64_t *) mem_214320)[i_214421] = (int64_t) -1;
        }
        
        int64_t flat_tid_214397 = (int64_t) 0;
        int32_t num_tasks_214422;
        struct futhark_mc_task_228449 futhark_mc_task_228449;
        
        futhark_mc_task_228449.ctx = ctx;
        futhark_mc_task_228449.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228449.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228449.free_gtid_200090 = gtid_200090;
        futhark_mc_task_228449.free_mem_210468 = mem_210468.mem;
        futhark_mc_task_228449.free_gtid_214307 = gtid_214307;
        futhark_mc_task_228449.free_mem_214308 = mem_214308;
        futhark_mc_task_228449.free_mem_214320 = mem_214320;
        
        struct scheduler_segop futhark_mc_task_228449_task;
        
        futhark_mc_task_228449_task.args = &futhark_mc_task_228449;
        futhark_mc_task_228449_task.top_level_fn =
            futhark_mc_segmap_task_228450;
        futhark_mc_task_228449_task.name = "futhark_mc_segmap_task_228450";
        futhark_mc_task_228449_task.iterations = defunc_0_f_res_196740;
        futhark_mc_task_228449_task.task_time =
            &ctx->futhark_mc_segmap_task_228450_total_time;
        futhark_mc_task_228449_task.task_iter =
            &ctx->futhark_mc_segmap_task_228450_total_iter;
        futhark_mc_task_228449_task.sched = STATIC;
        futhark_mc_task_228449_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228450_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228449_task);
        
        if (futhark_mc_segmap_task_228450_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (defunc_0_f_res_196740 * (int64_t) 8 > 0)
            memmove(mem_210508.mem + gtid_214307 * defunc_0_f_res_196740 *
                    (int64_t) 8, mem_214320 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 8);
        ((int64_t *) mem_210511.mem)[gtid_214307] = last_res_214319;
    }
    
  cleanup:
    { }
    free(mem_214308);
    free(mem_214320);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228439_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228439_end -
                 futhark_mc_segmap_parloop_228439_start;
        
        ctx->futhark_mc_segmap_parloop_228439_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228439_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228439_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228437(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214306 = tid;
    int num_tasks_214361 = info.nsubtasks;
    struct futhark_mc_task_228431 *futhark_mc_task_228431 =
                                  (struct futhark_mc_task_228431 *) args;
    struct futhark_context *ctx = futhark_mc_task_228431->ctx;
    uint64_t futhark_mc_segmap_nested_task_228437_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228437_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228431->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228431->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_task_228431->free_i_196831;
    int64_t gtid_200090 = futhark_mc_task_228431->free_gtid_200090;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228431->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 = futhark_mc_task_228431->free_bytes_210470;
    struct memblock mem_210508 = {.desc ="mem_210508", .mem =
                                  futhark_mc_task_228431->free_mem_210508,
                                  .size =0, .references =NULL};
    struct memblock mem_210511 = {.desc ="mem_210511", .mem =
                                  futhark_mc_task_228431->free_mem_210511,
                                  .size =0, .references =NULL};
    int64_t iter_214387;
    struct futhark_mc_segmap_parloop_struct_228438
    futhark_mc_segmap_parloop_struct_228438;
    
    futhark_mc_segmap_parloop_struct_228438.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228438.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228438.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228438.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228438.free_gtid_200090 = gtid_200090;
    futhark_mc_segmap_parloop_struct_228438.free_mem_210468 = mem_210468.mem;
    futhark_mc_segmap_parloop_struct_228438.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228438.free_mem_210508 = mem_210508.mem;
    futhark_mc_segmap_parloop_struct_228438.free_mem_210511 = mem_210511.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228439_task;
    
    futhark_mc_segmap_parloop_228439_task.name =
        "futhark_mc_segmap_parloop_228439";
    futhark_mc_segmap_parloop_228439_task.fn = futhark_mc_segmap_parloop_228439;
    futhark_mc_segmap_parloop_228439_task.args =
        &futhark_mc_segmap_parloop_struct_228438;
    futhark_mc_segmap_parloop_228439_task.iterations = iterations;
    futhark_mc_segmap_parloop_228439_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228439_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228439_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228439_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228439_task);
    
    if (futhark_mc_segmap_parloop_228439_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228439_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228439_total_end -
                 futhark_mc_segmap_parloop_228439_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228439_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228439_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228439_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228437_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228437_end -
                 futhark_mc_segmap_nested_task_228437_start;
        
        ctx->futhark_mc_segmap_nested_task_228437_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228437_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228437_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228428(void *args, int64_t start,
                                            int64_t end, int flat_tid_200089,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228427
    *futhark_mc_segmap_parloop_struct_228427 =
    (struct futhark_mc_segmap_parloop_struct_228427 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228427->ctx;
    uint64_t futhark_mc_segmap_parloop_228428_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228428_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228427->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228427->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228427->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228427->free_i_196831;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_segmap_parloop_struct_228427->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228427->free_bytes_210470;
    int64_t bytes_210507 =
            futhark_mc_segmap_parloop_struct_228427->free_bytes_210507;
    int64_t bytes_210510 =
            futhark_mc_segmap_parloop_struct_228427->free_bytes_210510;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228427->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228427->free_mem_210594,
                                  .size =0, .references =NULL};
    size_t mem_210508_cached_sizze_228429 = 0;
    unsigned char *mem_210508 = NULL;
    size_t mem_210511_cached_sizze_228430 = 0;
    unsigned char *mem_210511 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214305 = start;
    
    if (mem_210508_cached_sizze_228429 < (size_t) bytes_210507) {
        mem_210508 = realloc(mem_210508, bytes_210507);
        mem_210508_cached_sizze_228429 = bytes_210507;
    }
    if (mem_210511_cached_sizze_228430 < (size_t) bytes_210510) {
        mem_210511 = realloc(mem_210511, bytes_210510);
        mem_210511_cached_sizze_228430 = bytes_210510;
    }
    for (; iter_214305 < end; iter_214305++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214359 = m_196691;
        int64_t gtid_200090 = iter_214305;
        int64_t remnant_214360 = iter_214305 - gtid_200090;
        int64_t flat_tid_214331 = (int64_t) 0;
        int32_t num_tasks_214361;
        int64_t flat_tid_214306 = (int64_t) 0;
        struct futhark_mc_task_228431 futhark_mc_task_228431;
        
        futhark_mc_task_228431.ctx = ctx;
        futhark_mc_task_228431.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228431.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228431.free_i_196831 = i_196831;
        futhark_mc_task_228431.free_gtid_200090 = gtid_200090;
        futhark_mc_task_228431.free_mem_210468 = mem_210468.mem;
        futhark_mc_task_228431.free_bytes_210470 = bytes_210470;
        futhark_mc_task_228431.free_mem_210508 = mem_210508;
        futhark_mc_task_228431.free_mem_210511 = mem_210511;
        
        struct scheduler_segop futhark_mc_task_228431_task;
        
        futhark_mc_task_228431_task.args = &futhark_mc_task_228431;
        futhark_mc_task_228431_task.top_level_fn =
            futhark_mc_segmap_task_228432;
        futhark_mc_task_228431_task.name = "futhark_mc_segmap_task_228432";
        futhark_mc_task_228431_task.iterations = n_p_196694;
        futhark_mc_task_228431_task.task_time =
            &ctx->futhark_mc_segmap_task_228432_total_time;
        futhark_mc_task_228431_task.task_iter =
            &ctx->futhark_mc_segmap_task_228432_total_iter;
        futhark_mc_task_228431_task.sched = STATIC;
        futhark_mc_task_228431_task.nested_fn =
            futhark_mc_segmap_nested_task_228437;
        
        int futhark_mc_segmap_task_228432_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228431_task);
        
        if (futhark_mc_segmap_task_228432_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 8 > 0)
            memmove(mem_210590.mem + gtid_200090 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 8,
                    mem_210508 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 8);
        if (n_p_196694 * (int64_t) 8 > 0)
            memmove(mem_210594.mem + gtid_200090 * n_p_196694 * (int64_t) 8,
                    mem_210511 + (int64_t) 0, n_p_196694 * (int64_t) 8);
    }
    
  cleanup:
    { }
    free(mem_210508);
    free(mem_210511);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228428_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228428_end -
                 futhark_mc_segmap_parloop_228428_start;
        
        ctx->futhark_mc_segmap_parloop_228428_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228428_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228428_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228426(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200089 = tid;
    int num_tasks_214267 = info.nsubtasks;
    struct futhark_mc_task_228418 *futhark_mc_task_228418 =
                                  (struct futhark_mc_task_228418 *) args;
    struct futhark_context *ctx = futhark_mc_task_228418->ctx;
    uint64_t futhark_mc_segmap_nested_task_228426_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228426_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228418->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228418->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228418->free_defunc_0_f_res_196740;
    int64_t i_196831 = futhark_mc_task_228418->free_i_196831;
    struct memblock mem_210468 = {.desc ="mem_210468", .mem =
                                  futhark_mc_task_228418->free_mem_210468,
                                  .size =0, .references =NULL};
    int64_t bytes_210470 = futhark_mc_task_228418->free_bytes_210470;
    int64_t bytes_210507 = futhark_mc_task_228418->free_bytes_210507;
    int64_t bytes_210510 = futhark_mc_task_228418->free_bytes_210510;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228418->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228418->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t iter_214305;
    struct futhark_mc_segmap_parloop_struct_228427
    futhark_mc_segmap_parloop_struct_228427;
    
    futhark_mc_segmap_parloop_struct_228427.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228427.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228427.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228427.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228427.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228427.free_mem_210468 = mem_210468.mem;
    futhark_mc_segmap_parloop_struct_228427.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228427.free_bytes_210507 = bytes_210507;
    futhark_mc_segmap_parloop_struct_228427.free_bytes_210510 = bytes_210510;
    futhark_mc_segmap_parloop_struct_228427.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228427.free_mem_210594 = mem_210594.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228428_task;
    
    futhark_mc_segmap_parloop_228428_task.name =
        "futhark_mc_segmap_parloop_228428";
    futhark_mc_segmap_parloop_228428_task.fn = futhark_mc_segmap_parloop_228428;
    futhark_mc_segmap_parloop_228428_task.args =
        &futhark_mc_segmap_parloop_struct_228427;
    futhark_mc_segmap_parloop_228428_task.iterations = iterations;
    futhark_mc_segmap_parloop_228428_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228428_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228428_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228428_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228428_task);
    
    if (futhark_mc_segmap_parloop_228428_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228428_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228428_total_end -
                 futhark_mc_segmap_parloop_228428_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228428_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228428_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228428_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228426_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228426_end -
                 futhark_mc_segmap_nested_task_228426_start;
        
        ctx->futhark_mc_segmap_nested_task_228426_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228426_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228426_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228453 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    float free_i64_res_196868;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210602;
    int64_t free_bytes_210651;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
};
struct futhark_mc_segmap_parloop_struct_228455 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    float free_i64_res_196868;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210651;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
};
static int futhark_mc_segmap_parloop_228456(void *args, int64_t start,
                                            int64_t end, int flat_tid_200140,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228455
    *futhark_mc_segmap_parloop_struct_228455 =
    (struct futhark_mc_segmap_parloop_struct_228455 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228455->ctx;
    uint64_t futhark_mc_segmap_parloop_228456_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228456_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228455->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228455->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228455->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228455->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228455->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228455->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228455->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228455->free_i_196831;
    bool x_196832 = futhark_mc_segmap_parloop_struct_228455->free_x_196832;
    int64_t min_res_196862 =
            futhark_mc_segmap_parloop_struct_228455->free_min_res_196862;
    bool loop_cond_196867 =
         futhark_mc_segmap_parloop_struct_228455->free_loop_cond_196867;
    float i64_res_196868 =
          futhark_mc_segmap_parloop_struct_228455->free_i64_res_196868;
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228455->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228455->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228455->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210651 =
            futhark_mc_segmap_parloop_struct_228455->free_bytes_210651;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228455->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228455->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228455->free_mem_210769,
                                  .size =0, .references =NULL};
    size_t mem_210660_cached_sizze_228457 = 0;
    unsigned char *mem_210660 = NULL;
    size_t mem_210664_cached_sizze_228458 = 0;
    unsigned char *mem_210664 = NULL;
    size_t mem_210687_cached_sizze_228459 = 0;
    unsigned char *mem_210687 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214429 = start;
    
    if (mem_210660_cached_sizze_228457 < (size_t) bytes_210651) {
        mem_210660 = realloc(mem_210660, bytes_210651);
        mem_210660_cached_sizze_228457 = bytes_210651;
    }
    if (mem_210664_cached_sizze_228458 < (size_t) bytes_210655) {
        mem_210664 = realloc(mem_210664, bytes_210655);
        mem_210664_cached_sizze_228458 = bytes_210655;
    }
    if (mem_210687_cached_sizze_228459 < (size_t) bytes_210470) {
        mem_210687 = realloc(mem_210687, bytes_210470);
        mem_210687_cached_sizze_228459 = bytes_210470;
    }
    for (; iter_214429 < end; iter_214429++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214557 = m_196691;
        int64_t gtid_200141 = iter_214429;
        int64_t remnant_214558 = iter_214429 - gtid_200141;
        
        for (int64_t i_214430 = 0; i_214430 < n_p_196694; i_214430++) {
            int64_t x_214433;
            
            x_214433 = ((int64_t *) mem_210594.mem)[gtid_200141 * n_p_196694 +
                                                    i_214430];
            for (int64_t i_214436 = 0; i_214436 < defunc_0_f_res_196740;
                 i_214436++) {
                int64_t x_214438;
                
                x_214438 = ((int64_t *) mem_210590.mem)[gtid_200141 *
                                                        (defunc_0_f_res_196740 *
                                                         n_p_196694) +
                                                        i_214430 *
                                                        defunc_0_f_res_196740 +
                                                        i_214436];
                
                int64_t defunc_0_f_res_214439 = add64((int64_t) 1, x_214438);
                
                ((int64_t *) mem_210687)[i_214436] = defunc_0_f_res_214439;
            }
            
            int64_t min_arg_214441 = sub64(x_214433, (int64_t) 1);
            int64_t min_arg_214442 = sub64(x_214433, min_res_196862);
            int64_t min_res_214443 = smin64(q_s_196695, x_214433);
            float i64_res_214444 = sitofp_i64_f32(x_214433);
            float x_214445 = i64_res_196868 - i64_res_214444;
            float max_arg_214446 = x_214445 / 2.0F;
            float max_res_214447 = fmax32(0.0F, max_arg_214446);
            
            for (int64_t i_214450 = 0; i_214450 < s_n_m_196745; i_214450++) {
                bool cond_214453 = i_214450 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_214454;
                
                if (cond_214453) {
                    defunc_0_m_fun_res_214454 = (int64_t) 0;
                } else {
                    int64_t y_214455 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_214456 = i_214450 == y_214455;
                    int64_t defunc_0_m_fun_res_f_res_214457;
                    
                    if (cond_214456) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_214458 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_214457 =
                            defunc_0_m_fun_res_f_res_t_res_214458;
                    } else {
                        int64_t x_214459 = sub64(i_214450, (int64_t) 1);
                        int64_t x_214460 = mul64(jump_s_196701, x_214459);
                        int64_t min_arg_214461 = add64((int64_t) 1, x_214460);
                        int64_t min_res_214462 = smin64(defunc_0_f_res_196740,
                                                        min_arg_214461);
                        
                        defunc_0_m_fun_res_f_res_214457 = min_res_214462;
                    }
                    defunc_0_m_fun_res_214454 = defunc_0_m_fun_res_f_res_214457;
                }
                
                bool init_idx_214463;
                int64_t init_idx_214464;
                int64_t init_idx_214465;
                bool loop_while_214466;
                int64_t low_214467;
                int64_t high_214468;
                
                loop_while_214466 = x_196832;
                low_214467 = (int64_t) 0;
                high_214468 = i_196831;
                while (loop_while_214466) {
                    int64_t x_214469 = add64(low_214467, high_214468);
                    int64_t mid_214470 = sdiv64(x_214469, (int64_t) 2);
                    bool x_214471 = sle64((int64_t) 0, mid_214470);
                    bool y_214472 = slt64(mid_214470, defunc_0_f_res_196740);
                    bool bounds_check_214473 = x_214471 && y_214472;
                    bool index_certs_214474;
                    
                    if (!bounds_check_214473) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) mid_214470,
                                      "] out of bounds for array of shape [",
                                      (long long) defunc_0_f_res_196740, "].",
                                      "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t mid_id_214475;
                    
                    mid_id_214475 = ((int64_t *) mem_210687)[mid_214470];
                    
                    bool cond_214476 = slt64(mid_id_214475, (int64_t) 0);
                    int64_t mid_idx_214477;
                    
                    if (cond_214476) {
                        mid_idx_214477 = (int64_t) 9223372036854775807;
                    } else {
                        mid_idx_214477 = mid_id_214475;
                    }
                    
                    bool cond_214478 = sle64(defunc_0_m_fun_res_214454,
                                             mid_idx_214477);
                    int64_t loopres_214479;
                    int64_t loopres_214480;
                    
                    if (cond_214478) {
                        int64_t loopres_t_res_214481 = sub64(mid_214470,
                                                             (int64_t) 1);
                        
                        loopres_214479 = low_214467;
                        loopres_214480 = loopres_t_res_214481;
                    } else {
                        int64_t loopres_f_res_214482 = add64((int64_t) 1,
                                                             mid_214470);
                        
                        loopres_214479 = loopres_f_res_214482;
                        loopres_214480 = high_214468;
                    }
                    
                    bool loop_cond_214483 = sle64(loopres_214479,
                                                  loopres_214480);
                    bool loop_while_tmp_214564 = loop_cond_214483;
                    int64_t low_tmp_214565 = loopres_214479;
                    int64_t high_tmp_214566 = loopres_214480;
                    
                    loop_while_214466 = loop_while_tmp_214564;
                    low_214467 = low_tmp_214565;
                    high_214468 = high_tmp_214566;
                }
                init_idx_214463 = loop_while_214466;
                init_idx_214464 = low_214467;
                init_idx_214465 = high_214468;
                
                bool idx_214484;
                int64_t idx_214485;
                int64_t idx_214486;
                int64_t idx_214487;
                bool loop_while_214488;
                int64_t l_idx_214489;
                int64_t r_idx_214490;
                int64_t span_214491;
                
                loop_while_214488 = loop_cond_196867;
                l_idx_214489 = init_idx_214464;
                r_idx_214490 = init_idx_214464;
                span_214491 = (int64_t) 1;
                while (loop_while_214488) {
                    int64_t max_arg_214492 = sub64(l_idx_214489, (int64_t) 1);
                    int64_t max_res_214493 = smax64((int64_t) 0,
                                                    max_arg_214492);
                    int64_t min_arg_214494 = add64((int64_t) 1, r_idx_214490);
                    int64_t min_res_214495 = smin64(min_arg_214441,
                                                    min_arg_214494);
                    bool x_214496 = sle64((int64_t) 0, max_res_214493);
                    bool y_214497 = slt64(max_res_214493,
                                          defunc_0_f_res_196740);
                    bool bounds_check_214498 = x_214496 && y_214497;
                    bool index_certs_214499;
                    
                    if (!bounds_check_214498) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) max_res_214493,
                                      "] out of bounds for array of shape [",
                                      (long long) defunc_0_f_res_196740, "].",
                                      "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t x_214500;
                    
                    x_214500 = ((int64_t *) mem_210687)[max_res_214493];
                    
                    int64_t abs_arg_214501 = sub64(x_214500,
                                                   defunc_0_m_fun_res_214454);
                    int64_t abs_res_214502 = abs64(abs_arg_214501);
                    bool x_214503 = sle64((int64_t) 0, min_res_214495);
                    bool y_214504 = slt64(min_res_214495,
                                          defunc_0_f_res_196740);
                    bool bounds_check_214505 = x_214503 && y_214504;
                    bool index_certs_214506;
                    
                    if (!bounds_check_214505) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) min_res_214495,
                                      "] out of bounds for array of shape [",
                                      (long long) defunc_0_f_res_196740, "].",
                                      "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t x_214507;
                    
                    x_214507 = ((int64_t *) mem_210687)[min_res_214495];
                    
                    int64_t abs_arg_214508 = sub64(x_214507,
                                                   defunc_0_m_fun_res_214454);
                    int64_t abs_res_214509 = abs64(abs_arg_214508);
                    bool cond_214510 = max_res_214493 == l_idx_214489;
                    int64_t loopres_214511;
                    int64_t loopres_214512;
                    int64_t loopres_214513;
                    
                    if (cond_214510) {
                        loopres_214511 = l_idx_214489;
                        loopres_214512 = r_idx_214490;
                        loopres_214513 = min_res_196862;
                    } else {
                        bool cond_214514 = slt64(abs_res_214502,
                                                 abs_res_214509);
                        bool cond_f_res_214515 = min_res_214495 == r_idx_214490;
                        bool x_214516 = !cond_214514;
                        bool y_214517 = cond_f_res_214515 && x_214516;
                        bool cond_214518 = cond_214514 || y_214517;
                        int64_t loopres_f_res_214519;
                        
                        if (cond_214518) {
                            loopres_f_res_214519 = max_res_214493;
                        } else {
                            loopres_f_res_214519 = l_idx_214489;
                        }
                        
                        int64_t loopres_f_res_214520;
                        
                        if (cond_214518) {
                            loopres_f_res_214520 = r_idx_214490;
                        } else {
                            loopres_f_res_214520 = min_res_214495;
                        }
                        
                        int64_t loopres_f_res_214521;
                        
                        if (cond_214518) {
                            int64_t loopres_f_res_t_res_214522 =
                                    add64((int64_t) 1, span_214491);
                            
                            loopres_f_res_214521 = loopres_f_res_t_res_214522;
                        } else {
                            int64_t loopres_f_res_f_res_214523 =
                                    add64((int64_t) 1, span_214491);
                            
                            loopres_f_res_214521 = loopres_f_res_f_res_214523;
                        }
                        loopres_214511 = loopres_f_res_214519;
                        loopres_214512 = loopres_f_res_214520;
                        loopres_214513 = loopres_f_res_214521;
                    }
                    
                    bool loop_cond_214524 = slt64(loopres_214513,
                                                  min_res_196862);
                    bool loop_while_tmp_214567 = loop_cond_214524;
                    int64_t l_idx_tmp_214568 = loopres_214511;
                    int64_t r_idx_tmp_214569 = loopres_214512;
                    int64_t span_tmp_214570 = loopres_214513;
                    
                    loop_while_214488 = loop_while_tmp_214567;
                    l_idx_214489 = l_idx_tmp_214568;
                    r_idx_214490 = r_idx_tmp_214569;
                    span_214491 = span_tmp_214570;
                }
                idx_214484 = loop_while_214488;
                idx_214485 = l_idx_214489;
                idx_214486 = r_idx_214490;
                idx_214487 = span_214491;
                
                int64_t min_res_214525 = smin64(min_arg_214442, idx_214485);
                int64_t max_res_214526 = smax64((int64_t) 0, min_res_214525);
                int64_t defunc_0_m_fun_res_214527;
                
                if (cond_214453) {
                    defunc_0_m_fun_res_214527 = (int64_t) 0;
                } else {
                    int64_t y_214528 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_214529 = i_214450 == y_214528;
                    int64_t defunc_0_m_fun_res_f_res_214530;
                    
                    if (cond_214529) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_214531 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_214530 =
                            defunc_0_m_fun_res_f_res_t_res_214531;
                    } else {
                        int64_t x_214532 = sub64(i_214450, (int64_t) 1);
                        int64_t x_214533 = mul64(jump_s_196701, x_214532);
                        int64_t min_arg_214534 = add64((int64_t) 1, x_214533);
                        int64_t min_res_214535 = smin64(defunc_0_f_res_196740,
                                                        min_arg_214534);
                        
                        defunc_0_m_fun_res_f_res_214530 = min_res_214535;
                    }
                    defunc_0_m_fun_res_214527 = defunc_0_m_fun_res_f_res_214530;
                }
                
                int64_t x_214536 = add64(min_res_214443, max_res_214526);
                int64_t r_214537 = sub64(x_214536, (int64_t) 1);
                bool x_214538 = sle64((int64_t) 0, r_214537);
                bool y_214539 = slt64(r_214537, defunc_0_f_res_196740);
                bool bounds_check_214540 = x_214538 && y_214539;
                bool index_certs_214541;
                
                if (!bounds_check_214540) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) r_214537,
                                  "] out of bounds for array of shape [",
                                  (long long) defunc_0_f_res_196740, "].",
                                  "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:517:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_214542;
                
                x_214542 = ((int64_t *) mem_210687)[r_214537];
                
                int64_t abs_arg_214543 = sub64(x_214542,
                                               defunc_0_m_fun_res_214527);
                int64_t abs_res_214544 = abs64(abs_arg_214543);
                bool x_214545 = sle64((int64_t) 0, max_res_214526);
                bool y_214546 = slt64(max_res_214526, defunc_0_f_res_196740);
                bool bounds_check_214547 = x_214545 && y_214546;
                bool index_certs_214548;
                
                if (!bounds_check_214547) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) max_res_214526,
                                  "] out of bounds for array of shape [",
                                  (long long) defunc_0_f_res_196740, "].",
                                  "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:517:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_214549;
                
                x_214549 = ((int64_t *) mem_210687)[max_res_214526];
                
                int64_t abs_arg_214550 = sub64(x_214549,
                                               defunc_0_m_fun_res_214527);
                int64_t abs_res_214551 = abs64(abs_arg_214550);
                int64_t max_res_214552 = smax64(abs_res_214544, abs_res_214551);
                float defunc_0_f_res_214553 = sitofp_i64_f32(max_res_214552);
                float defunc_1_f_res_214554 = max_res_214447 +
                      defunc_0_f_res_214553;
                
                ((float *) mem_210664)[i_214430 * s_n_m_196745 + i_214450] =
                    defunc_1_f_res_214554;
                ((int64_t *) mem_210660)[i_214430 * s_n_m_196745 + i_214450] =
                    max_res_214526;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 8 > 0)
            memmove(mem_210764.mem + gtid_200141 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 8, mem_210660 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 8);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_210769.mem + gtid_200141 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_210664 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210660);
    free(mem_210664);
    free(mem_210687);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228456_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228456_end -
                 futhark_mc_segmap_parloop_228456_start;
        
        ctx->futhark_mc_segmap_parloop_228456_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228456_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228456_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228454(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200140 = tid;
    int num_tasks_214428 = info.nsubtasks;
    struct futhark_mc_task_228453 *futhark_mc_task_228453 =
                                  (struct futhark_mc_task_228453 *) args;
    struct futhark_context *ctx = futhark_mc_task_228453->ctx;
    uint64_t futhark_mc_segmap_task_228454_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228454_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228453->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228453->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228453->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228453->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228453->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228453->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228453->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_task_228453->free_i_196831;
    bool x_196832 = futhark_mc_task_228453->free_x_196832;
    int64_t min_res_196862 = futhark_mc_task_228453->free_min_res_196862;
    bool loop_cond_196867 = futhark_mc_task_228453->free_loop_cond_196867;
    float i64_res_196868 = futhark_mc_task_228453->free_i64_res_196868;
    int64_t bytes_210470 = futhark_mc_task_228453->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228453->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228453->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228453->free_bytes_210599;
    int64_t bytes_210602 = futhark_mc_task_228453->free_bytes_210602;
    int64_t bytes_210651 = futhark_mc_task_228453->free_bytes_210651;
    int64_t bytes_210655 = futhark_mc_task_228453->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228453->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228453->free_mem_210769,
                                  .size =0, .references =NULL};
    int64_t iter_214429;
    struct futhark_mc_segmap_parloop_struct_228455
    futhark_mc_segmap_parloop_struct_228455;
    
    futhark_mc_segmap_parloop_struct_228455.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228455.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228455.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228455.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228455.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228455.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228455.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228455.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228455.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228455.free_x_196832 = x_196832;
    futhark_mc_segmap_parloop_struct_228455.free_min_res_196862 =
        min_res_196862;
    futhark_mc_segmap_parloop_struct_228455.free_loop_cond_196867 =
        loop_cond_196867;
    futhark_mc_segmap_parloop_struct_228455.free_i64_res_196868 =
        i64_res_196868;
    futhark_mc_segmap_parloop_struct_228455.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228455.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228455.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228455.free_bytes_210651 = bytes_210651;
    futhark_mc_segmap_parloop_struct_228455.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228455.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228455.free_mem_210769 = mem_210769.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228456_task;
    
    futhark_mc_segmap_parloop_228456_task.name =
        "futhark_mc_segmap_parloop_228456";
    futhark_mc_segmap_parloop_228456_task.fn = futhark_mc_segmap_parloop_228456;
    futhark_mc_segmap_parloop_228456_task.args =
        &futhark_mc_segmap_parloop_struct_228455;
    futhark_mc_segmap_parloop_228456_task.iterations = iterations;
    futhark_mc_segmap_parloop_228456_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228456_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228456_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228456_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228456_task);
    
    if (futhark_mc_segmap_parloop_228456_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228456_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228456_total_end -
                 futhark_mc_segmap_parloop_228456_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228456_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228456_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228456_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228454_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228454_end -
                 futhark_mc_segmap_task_228454_start;
        
        ctx->futhark_mc_segmap_task_228454_runs[tid]++;
        ctx->futhark_mc_segmap_task_228454_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228454_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228461 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    float free_i64_res_196868;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210602;
    int64_t free_bytes_210651;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
};
struct futhark_mc_task_228465 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    float free_i64_res_196868;
    int64_t free_gtid_200276;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210602;
    unsigned char *free_mem_210652;
    unsigned char *free_mem_210656;
};
struct futhark_mc_segmap_parloop_struct_228467 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    float free_i64_res_196868;
    int64_t free_gtid_200276;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210602;
    unsigned char *free_mem_210652;
    unsigned char *free_mem_210656;
};
static int futhark_mc_segmap_parloop_228468(void *args, int64_t start,
                                            int64_t end, int flat_tid_214696,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228467
    *futhark_mc_segmap_parloop_struct_228467 =
    (struct futhark_mc_segmap_parloop_struct_228467 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228467->ctx;
    uint64_t futhark_mc_segmap_parloop_228468_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228468_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228467->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228467->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228467->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228467->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228467->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228467->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228467->free_i_196831;
    bool x_196832 = futhark_mc_segmap_parloop_struct_228467->free_x_196832;
    int64_t min_res_196862 =
            futhark_mc_segmap_parloop_struct_228467->free_min_res_196862;
    bool loop_cond_196867 =
         futhark_mc_segmap_parloop_struct_228467->free_loop_cond_196867;
    float i64_res_196868 =
          futhark_mc_segmap_parloop_struct_228467->free_i64_res_196868;
    int64_t gtid_200276 =
            futhark_mc_segmap_parloop_struct_228467->free_gtid_200276;
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228467->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228467->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228467->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228467->free_bytes_210599;
    int64_t bytes_210602 =
            futhark_mc_segmap_parloop_struct_228467->free_bytes_210602;
    struct memblock mem_210652 = {.desc ="mem_210652", .mem =
                                  futhark_mc_segmap_parloop_struct_228467->free_mem_210652,
                                  .size =0, .references =NULL};
    struct memblock mem_210656 = {.desc ="mem_210656", .mem =
                                  futhark_mc_segmap_parloop_struct_228467->free_mem_210656,
                                  .size =0, .references =NULL};
    size_t mem_214699_cached_sizze_228469 = 0;
    unsigned char *mem_214699 = NULL;
    size_t mem_214714_cached_sizze_228470 = 0;
    unsigned char *mem_214714 = NULL;
    size_t mem_214716_cached_sizze_228471 = 0;
    unsigned char *mem_214716 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214830 = start;
    
    if (mem_214699_cached_sizze_228469 < (size_t) bytes_210470) {
        mem_214699 = realloc(mem_214699, bytes_210470);
        mem_214699_cached_sizze_228469 = bytes_210470;
    }
    if (mem_214714_cached_sizze_228470 < (size_t) bytes_210599) {
        mem_214714 = realloc(mem_214714, bytes_210599);
        mem_214714_cached_sizze_228470 = bytes_210599;
    }
    if (mem_214716_cached_sizze_228471 < (size_t) bytes_210602) {
        mem_214716 = realloc(mem_214716, bytes_210602);
        mem_214716_cached_sizze_228471 = bytes_210602;
    }
    for (; iter_214830 < end; iter_214830++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214943 = n_p_196694;
        int64_t gtid_214697 = iter_214830;
        int64_t remnant_214944 = iter_214830 - gtid_214697;
        int64_t x_214698;
        
        x_214698 = ((int64_t *) mem_210594.mem)[gtid_200276 * n_p_196694 +
                                                gtid_214697];
        for (int64_t i_214831 = 0; i_214831 < defunc_0_f_res_196740;
             i_214831++) {
            int64_t x_214833;
            
            x_214833 = ((int64_t *) mem_210590.mem)[gtid_200276 *
                                                    (defunc_0_f_res_196740 *
                                                     n_p_196694) + gtid_214697 *
                                                    defunc_0_f_res_196740 +
                                                    i_214831];
            
            int64_t defunc_0_f_res_214834 = add64((int64_t) 1, x_214833);
            
            ((int64_t *) mem_214699)[i_214831] = defunc_0_f_res_214834;
        }
        
        int64_t min_arg_214707 = sub64(x_214698, (int64_t) 1);
        int64_t min_arg_214708 = sub64(x_214698, min_res_196862);
        int64_t min_res_214709 = smin64(q_s_196695, x_214698);
        float i64_res_214710 = sitofp_i64_f32(x_214698);
        float x_214711 = i64_res_196868 - i64_res_214710;
        float max_arg_214712 = x_214711 / 2.0F;
        float max_res_214713 = fmax32(0.0F, max_arg_214712);
        
        for (int64_t i_214836 = 0; i_214836 < s_n_m_196745; i_214836++) {
            bool cond_214839 = i_214836 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_214840;
            
            if (cond_214839) {
                defunc_0_m_fun_res_214840 = (int64_t) 0;
            } else {
                int64_t y_214841 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_214842 = i_214836 == y_214841;
                int64_t defunc_0_m_fun_res_f_res_214843;
                
                if (cond_214842) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_214844 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_214843 =
                        defunc_0_m_fun_res_f_res_t_res_214844;
                } else {
                    int64_t x_214845 = sub64(i_214836, (int64_t) 1);
                    int64_t x_214846 = mul64(jump_s_196701, x_214845);
                    int64_t min_arg_214847 = add64((int64_t) 1, x_214846);
                    int64_t min_res_214848 = smin64(defunc_0_f_res_196740,
                                                    min_arg_214847);
                    
                    defunc_0_m_fun_res_f_res_214843 = min_res_214848;
                }
                defunc_0_m_fun_res_214840 = defunc_0_m_fun_res_f_res_214843;
            }
            
            bool init_idx_214849;
            int64_t init_idx_214850;
            int64_t init_idx_214851;
            bool loop_while_214852;
            int64_t low_214853;
            int64_t high_214854;
            
            loop_while_214852 = x_196832;
            low_214853 = (int64_t) 0;
            high_214854 = i_196831;
            while (loop_while_214852) {
                int64_t x_214855 = add64(low_214853, high_214854);
                int64_t mid_214856 = sdiv64(x_214855, (int64_t) 2);
                bool x_214857 = sle64((int64_t) 0, mid_214856);
                bool y_214858 = slt64(mid_214856, defunc_0_f_res_196740);
                bool bounds_check_214859 = x_214857 && y_214858;
                bool index_certs_214860;
                
                if (!bounds_check_214859) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) mid_214856,
                                  "] out of bounds for array of shape [",
                                  (long long) defunc_0_f_res_196740, "].",
                                  "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t mid_id_214861;
                
                mid_id_214861 = ((int64_t *) mem_214699)[mid_214856];
                
                bool cond_214862 = slt64(mid_id_214861, (int64_t) 0);
                int64_t mid_idx_214863;
                
                if (cond_214862) {
                    mid_idx_214863 = (int64_t) 9223372036854775807;
                } else {
                    mid_idx_214863 = mid_id_214861;
                }
                
                bool cond_214864 = sle64(defunc_0_m_fun_res_214840,
                                         mid_idx_214863);
                int64_t loopres_214865;
                int64_t loopres_214866;
                
                if (cond_214864) {
                    int64_t loopres_t_res_214867 = sub64(mid_214856,
                                                         (int64_t) 1);
                    
                    loopres_214865 = low_214853;
                    loopres_214866 = loopres_t_res_214867;
                } else {
                    int64_t loopres_f_res_214868 = add64((int64_t) 1,
                                                         mid_214856);
                    
                    loopres_214865 = loopres_f_res_214868;
                    loopres_214866 = high_214854;
                }
                
                bool loop_cond_214869 = sle64(loopres_214865, loopres_214866);
                bool loop_while_tmp_214948 = loop_cond_214869;
                int64_t low_tmp_214949 = loopres_214865;
                int64_t high_tmp_214950 = loopres_214866;
                
                loop_while_214852 = loop_while_tmp_214948;
                low_214853 = low_tmp_214949;
                high_214854 = high_tmp_214950;
            }
            init_idx_214849 = loop_while_214852;
            init_idx_214850 = low_214853;
            init_idx_214851 = high_214854;
            
            bool idx_214870;
            int64_t idx_214871;
            int64_t idx_214872;
            int64_t idx_214873;
            bool loop_while_214874;
            int64_t l_idx_214875;
            int64_t r_idx_214876;
            int64_t span_214877;
            
            loop_while_214874 = loop_cond_196867;
            l_idx_214875 = init_idx_214850;
            r_idx_214876 = init_idx_214850;
            span_214877 = (int64_t) 1;
            while (loop_while_214874) {
                int64_t max_arg_214878 = sub64(l_idx_214875, (int64_t) 1);
                int64_t max_res_214879 = smax64((int64_t) 0, max_arg_214878);
                int64_t min_arg_214880 = add64((int64_t) 1, r_idx_214876);
                int64_t min_res_214881 = smin64(min_arg_214707, min_arg_214880);
                bool x_214882 = sle64((int64_t) 0, max_res_214879);
                bool y_214883 = slt64(max_res_214879, defunc_0_f_res_196740);
                bool bounds_check_214884 = x_214882 && y_214883;
                bool index_certs_214885;
                
                if (!bounds_check_214884) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) max_res_214879,
                                  "] out of bounds for array of shape [",
                                  (long long) defunc_0_f_res_196740, "].",
                                  "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_214886;
                
                x_214886 = ((int64_t *) mem_214699)[max_res_214879];
                
                int64_t abs_arg_214887 = sub64(x_214886,
                                               defunc_0_m_fun_res_214840);
                int64_t abs_res_214888 = abs64(abs_arg_214887);
                bool x_214889 = sle64((int64_t) 0, min_res_214881);
                bool y_214890 = slt64(min_res_214881, defunc_0_f_res_196740);
                bool bounds_check_214891 = x_214889 && y_214890;
                bool index_certs_214892;
                
                if (!bounds_check_214891) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) min_res_214881,
                                  "] out of bounds for array of shape [",
                                  (long long) defunc_0_f_res_196740, "].",
                                  "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_214893;
                
                x_214893 = ((int64_t *) mem_214699)[min_res_214881];
                
                int64_t abs_arg_214894 = sub64(x_214893,
                                               defunc_0_m_fun_res_214840);
                int64_t abs_res_214895 = abs64(abs_arg_214894);
                bool cond_214896 = max_res_214879 == l_idx_214875;
                int64_t loopres_214897;
                int64_t loopres_214898;
                int64_t loopres_214899;
                
                if (cond_214896) {
                    loopres_214897 = l_idx_214875;
                    loopres_214898 = r_idx_214876;
                    loopres_214899 = min_res_196862;
                } else {
                    bool cond_214900 = slt64(abs_res_214888, abs_res_214895);
                    bool cond_f_res_214901 = min_res_214881 == r_idx_214876;
                    bool x_214902 = !cond_214900;
                    bool y_214903 = cond_f_res_214901 && x_214902;
                    bool cond_214904 = cond_214900 || y_214903;
                    int64_t loopres_f_res_214905;
                    
                    if (cond_214904) {
                        loopres_f_res_214905 = max_res_214879;
                    } else {
                        loopres_f_res_214905 = l_idx_214875;
                    }
                    
                    int64_t loopres_f_res_214906;
                    
                    if (cond_214904) {
                        loopres_f_res_214906 = r_idx_214876;
                    } else {
                        loopres_f_res_214906 = min_res_214881;
                    }
                    
                    int64_t loopres_f_res_214907;
                    
                    if (cond_214904) {
                        int64_t loopres_f_res_t_res_214908 = add64((int64_t) 1,
                                                                   span_214877);
                        
                        loopres_f_res_214907 = loopres_f_res_t_res_214908;
                    } else {
                        int64_t loopres_f_res_f_res_214909 = add64((int64_t) 1,
                                                                   span_214877);
                        
                        loopres_f_res_214907 = loopres_f_res_f_res_214909;
                    }
                    loopres_214897 = loopres_f_res_214905;
                    loopres_214898 = loopres_f_res_214906;
                    loopres_214899 = loopres_f_res_214907;
                }
                
                bool loop_cond_214910 = slt64(loopres_214899, min_res_196862);
                bool loop_while_tmp_214951 = loop_cond_214910;
                int64_t l_idx_tmp_214952 = loopres_214897;
                int64_t r_idx_tmp_214953 = loopres_214898;
                int64_t span_tmp_214954 = loopres_214899;
                
                loop_while_214874 = loop_while_tmp_214951;
                l_idx_214875 = l_idx_tmp_214952;
                r_idx_214876 = r_idx_tmp_214953;
                span_214877 = span_tmp_214954;
            }
            idx_214870 = loop_while_214874;
            idx_214871 = l_idx_214875;
            idx_214872 = r_idx_214876;
            idx_214873 = span_214877;
            
            int64_t min_res_214911 = smin64(min_arg_214708, idx_214871);
            int64_t max_res_214912 = smax64((int64_t) 0, min_res_214911);
            int64_t defunc_0_m_fun_res_214913;
            
            if (cond_214839) {
                defunc_0_m_fun_res_214913 = (int64_t) 0;
            } else {
                int64_t y_214914 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_214915 = i_214836 == y_214914;
                int64_t defunc_0_m_fun_res_f_res_214916;
                
                if (cond_214915) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_214917 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_214916 =
                        defunc_0_m_fun_res_f_res_t_res_214917;
                } else {
                    int64_t x_214918 = sub64(i_214836, (int64_t) 1);
                    int64_t x_214919 = mul64(jump_s_196701, x_214918);
                    int64_t min_arg_214920 = add64((int64_t) 1, x_214919);
                    int64_t min_res_214921 = smin64(defunc_0_f_res_196740,
                                                    min_arg_214920);
                    
                    defunc_0_m_fun_res_f_res_214916 = min_res_214921;
                }
                defunc_0_m_fun_res_214913 = defunc_0_m_fun_res_f_res_214916;
            }
            
            int64_t x_214922 = add64(min_res_214709, max_res_214912);
            int64_t r_214923 = sub64(x_214922, (int64_t) 1);
            bool x_214924 = sle64((int64_t) 0, r_214923);
            bool y_214925 = slt64(r_214923, defunc_0_f_res_196740);
            bool bounds_check_214926 = x_214924 && y_214925;
            bool index_certs_214927;
            
            if (!bounds_check_214926) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) r_214923,
                              "] out of bounds for array of shape [",
                              (long long) defunc_0_f_res_196740, "].",
                              "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:517:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_214928;
            
            x_214928 = ((int64_t *) mem_214699)[r_214923];
            
            int64_t abs_arg_214929 = sub64(x_214928, defunc_0_m_fun_res_214913);
            int64_t abs_res_214930 = abs64(abs_arg_214929);
            bool x_214931 = sle64((int64_t) 0, max_res_214912);
            bool y_214932 = slt64(max_res_214912, defunc_0_f_res_196740);
            bool bounds_check_214933 = x_214931 && y_214932;
            bool index_certs_214934;
            
            if (!bounds_check_214933) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) max_res_214912,
                              "] out of bounds for array of shape [",
                              (long long) defunc_0_f_res_196740, "].",
                              "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:517:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_214935;
            
            x_214935 = ((int64_t *) mem_214699)[max_res_214912];
            
            int64_t abs_arg_214936 = sub64(x_214935, defunc_0_m_fun_res_214913);
            int64_t abs_res_214937 = abs64(abs_arg_214936);
            int64_t max_res_214938 = smax64(abs_res_214930, abs_res_214937);
            float defunc_0_f_res_214939 = sitofp_i64_f32(max_res_214938);
            float defunc_1_f_res_214940 = max_res_214713 +
                  defunc_0_f_res_214939;
            
            ((float *) mem_214714)[i_214836] = defunc_1_f_res_214940;
            ((int64_t *) mem_214716)[i_214836] = max_res_214912;
        }
        if (s_n_m_196745 * (int64_t) 8 > 0)
            memmove(mem_210652.mem + gtid_214697 * s_n_m_196745 * (int64_t) 8,
                    mem_214716 + (int64_t) 0, s_n_m_196745 * (int64_t) 8);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_210656.mem + gtid_214697 * s_n_m_196745 * (int64_t) 4,
                    mem_214714 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_214699);
    free(mem_214714);
    free(mem_214716);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228468_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228468_end -
                 futhark_mc_segmap_parloop_228468_start;
        
        ctx->futhark_mc_segmap_parloop_228468_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228468_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228468_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228466(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214696 = tid;
    int num_tasks_214829 = info.nsubtasks;
    struct futhark_mc_task_228465 *futhark_mc_task_228465 =
                                  (struct futhark_mc_task_228465 *) args;
    struct futhark_context *ctx = futhark_mc_task_228465->ctx;
    uint64_t futhark_mc_segmap_task_228466_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228466_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228465->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228465->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228465->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228465->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228465->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228465->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_task_228465->free_i_196831;
    bool x_196832 = futhark_mc_task_228465->free_x_196832;
    int64_t min_res_196862 = futhark_mc_task_228465->free_min_res_196862;
    bool loop_cond_196867 = futhark_mc_task_228465->free_loop_cond_196867;
    float i64_res_196868 = futhark_mc_task_228465->free_i64_res_196868;
    int64_t gtid_200276 = futhark_mc_task_228465->free_gtid_200276;
    int64_t bytes_210470 = futhark_mc_task_228465->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228465->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228465->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228465->free_bytes_210599;
    int64_t bytes_210602 = futhark_mc_task_228465->free_bytes_210602;
    struct memblock mem_210652 = {.desc ="mem_210652", .mem =
                                  futhark_mc_task_228465->free_mem_210652,
                                  .size =0, .references =NULL};
    struct memblock mem_210656 = {.desc ="mem_210656", .mem =
                                  futhark_mc_task_228465->free_mem_210656,
                                  .size =0, .references =NULL};
    int64_t iter_214830;
    struct futhark_mc_segmap_parloop_struct_228467
    futhark_mc_segmap_parloop_struct_228467;
    
    futhark_mc_segmap_parloop_struct_228467.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228467.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228467.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228467.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228467.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228467.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228467.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228467.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228467.free_x_196832 = x_196832;
    futhark_mc_segmap_parloop_struct_228467.free_min_res_196862 =
        min_res_196862;
    futhark_mc_segmap_parloop_struct_228467.free_loop_cond_196867 =
        loop_cond_196867;
    futhark_mc_segmap_parloop_struct_228467.free_i64_res_196868 =
        i64_res_196868;
    futhark_mc_segmap_parloop_struct_228467.free_gtid_200276 = gtid_200276;
    futhark_mc_segmap_parloop_struct_228467.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228467.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228467.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228467.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228467.free_bytes_210602 = bytes_210602;
    futhark_mc_segmap_parloop_struct_228467.free_mem_210652 = mem_210652.mem;
    futhark_mc_segmap_parloop_struct_228467.free_mem_210656 = mem_210656.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228468_task;
    
    futhark_mc_segmap_parloop_228468_task.name =
        "futhark_mc_segmap_parloop_228468";
    futhark_mc_segmap_parloop_228468_task.fn = futhark_mc_segmap_parloop_228468;
    futhark_mc_segmap_parloop_228468_task.args =
        &futhark_mc_segmap_parloop_struct_228467;
    futhark_mc_segmap_parloop_228468_task.iterations = iterations;
    futhark_mc_segmap_parloop_228468_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228468_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228468_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228468_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228468_task);
    
    if (futhark_mc_segmap_parloop_228468_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228468_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228468_total_end -
                 futhark_mc_segmap_parloop_228468_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228468_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228468_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228468_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228466_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228466_end -
                 futhark_mc_segmap_task_228466_start;
        
        ctx->futhark_mc_segmap_task_228466_runs[tid]++;
        ctx->futhark_mc_segmap_task_228466_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228466_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228473 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    float free_i64_res_196868;
    int64_t free_gtid_200276;
    int64_t free_bytes_210470;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210602;
    unsigned char *free_mem_210652;
    unsigned char *free_mem_210656;
};
struct futhark_mc_task_228478 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200276;
    unsigned char *free_mem_210590;
    int64_t free_gtid_214573;
    unsigned char *free_mem_214575;
};
struct futhark_mc_segmap_parloop_struct_228480 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_200276;
    unsigned char *free_mem_210590;
    int64_t free_gtid_214573;
    unsigned char *free_mem_214575;
};
static int futhark_mc_segmap_parloop_228481(void *args, int64_t start,
                                            int64_t end, int flat_tid_214956,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228480
    *futhark_mc_segmap_parloop_struct_228480 =
    (struct futhark_mc_segmap_parloop_struct_228480 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228480->ctx;
    uint64_t futhark_mc_segmap_parloop_228481_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228481_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228480->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228480->free_defunc_0_f_res_196740;
    int64_t gtid_200276 =
            futhark_mc_segmap_parloop_struct_228480->free_gtid_200276;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228480->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t gtid_214573 =
            futhark_mc_segmap_parloop_struct_228480->free_gtid_214573;
    struct memblock mem_214575 = {.desc ="mem_214575", .mem =
                                  futhark_mc_segmap_parloop_struct_228480->free_mem_214575,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215067 = start;
    
    for (; iter_215067 < end; iter_215067++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215068 = defunc_0_f_res_196740;
        int64_t gtid_214957 = iter_215067;
        int64_t remnant_215069 = iter_215067 - gtid_214957;
        int64_t x_214958;
        
        x_214958 = ((int64_t *) mem_210590.mem)[gtid_200276 *
                                                (defunc_0_f_res_196740 *
                                                 n_p_196694) + gtid_214573 *
                                                defunc_0_f_res_196740 +
                                                gtid_214957];
        
        int64_t defunc_0_f_res_214959 = add64((int64_t) 1, x_214958);
        
        ((int64_t *) mem_214575.mem)[gtid_214957] = defunc_0_f_res_214959;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228481_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228481_end -
                 futhark_mc_segmap_parloop_228481_start;
        
        ctx->futhark_mc_segmap_parloop_228481_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228481_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228481_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228479(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214956 = tid;
    int num_tasks_215066 = info.nsubtasks;
    struct futhark_mc_task_228478 *futhark_mc_task_228478 =
                                  (struct futhark_mc_task_228478 *) args;
    struct futhark_context *ctx = futhark_mc_task_228478->ctx;
    uint64_t futhark_mc_segmap_task_228479_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228479_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228478->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228478->free_defunc_0_f_res_196740;
    int64_t gtid_200276 = futhark_mc_task_228478->free_gtid_200276;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228478->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t gtid_214573 = futhark_mc_task_228478->free_gtid_214573;
    struct memblock mem_214575 = {.desc ="mem_214575", .mem =
                                  futhark_mc_task_228478->free_mem_214575,
                                  .size =0, .references =NULL};
    int64_t iter_215067;
    struct futhark_mc_segmap_parloop_struct_228480
    futhark_mc_segmap_parloop_struct_228480;
    
    futhark_mc_segmap_parloop_struct_228480.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228480.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228480.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228480.free_gtid_200276 = gtid_200276;
    futhark_mc_segmap_parloop_struct_228480.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228480.free_gtid_214573 = gtid_214573;
    futhark_mc_segmap_parloop_struct_228480.free_mem_214575 = mem_214575.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228481_task;
    
    futhark_mc_segmap_parloop_228481_task.name =
        "futhark_mc_segmap_parloop_228481";
    futhark_mc_segmap_parloop_228481_task.fn = futhark_mc_segmap_parloop_228481;
    futhark_mc_segmap_parloop_228481_task.args =
        &futhark_mc_segmap_parloop_struct_228480;
    futhark_mc_segmap_parloop_228481_task.iterations = iterations;
    futhark_mc_segmap_parloop_228481_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228481_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228481_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228481_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228481_task);
    
    if (futhark_mc_segmap_parloop_228481_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228481_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228481_total_end -
                 futhark_mc_segmap_parloop_228481_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228481_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228481_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228481_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228479_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228479_end -
                 futhark_mc_segmap_task_228479_start;
        
        ctx->futhark_mc_segmap_task_228479_runs[tid]++;
        ctx->futhark_mc_segmap_task_228479_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228479_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228482 {
    struct futhark_context *ctx;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    unsigned char *free_mem_214575;
    int64_t free_min_arg_214581;
    int64_t free_min_arg_214582;
    int64_t free_min_res_214583;
    float free_max_res_214587;
    unsigned char *free_mem_214588;
    unsigned char *free_mem_214589;
};
struct futhark_mc_segmap_parloop_struct_228484 {
    struct futhark_context *ctx;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_i_196831;
    bool free_x_196832;
    int64_t free_min_res_196862;
    bool free_loop_cond_196867;
    unsigned char *free_mem_214575;
    int64_t free_min_arg_214581;
    int64_t free_min_arg_214582;
    int64_t free_min_res_214583;
    float free_max_res_214587;
    unsigned char *free_mem_214588;
    unsigned char *free_mem_214589;
};
static int futhark_mc_segmap_parloop_228485(void *args, int64_t start,
                                            int64_t end, int flat_tid_214960,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228484
    *futhark_mc_segmap_parloop_struct_228484 =
    (struct futhark_mc_segmap_parloop_struct_228484 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228484->ctx;
    uint64_t futhark_mc_segmap_parloop_228485_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228485_start = get_wall_time();
    
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228484->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228484->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228484->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228484->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228484->free_i_196831;
    bool x_196832 = futhark_mc_segmap_parloop_struct_228484->free_x_196832;
    int64_t min_res_196862 =
            futhark_mc_segmap_parloop_struct_228484->free_min_res_196862;
    bool loop_cond_196867 =
         futhark_mc_segmap_parloop_struct_228484->free_loop_cond_196867;
    struct memblock mem_214575 = {.desc ="mem_214575", .mem =
                                  futhark_mc_segmap_parloop_struct_228484->free_mem_214575,
                                  .size =0, .references =NULL};
    int64_t min_arg_214581 =
            futhark_mc_segmap_parloop_struct_228484->free_min_arg_214581;
    int64_t min_arg_214582 =
            futhark_mc_segmap_parloop_struct_228484->free_min_arg_214582;
    int64_t min_res_214583 =
            futhark_mc_segmap_parloop_struct_228484->free_min_res_214583;
    float max_res_214587 =
          futhark_mc_segmap_parloop_struct_228484->free_max_res_214587;
    struct memblock mem_214588 = {.desc ="mem_214588", .mem =
                                  futhark_mc_segmap_parloop_struct_228484->free_mem_214588,
                                  .size =0, .references =NULL};
    struct memblock mem_214589 = {.desc ="mem_214589", .mem =
                                  futhark_mc_segmap_parloop_struct_228484->free_mem_214589,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215071 = start;
    
    for (; iter_215071 < end; iter_215071++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215143 = s_n_m_196745;
        int64_t gtid_214961 = iter_215071;
        int64_t remnant_215144 = iter_215071 - gtid_214961;
        bool cond_214962 = gtid_214961 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_214963;
        
        if (cond_214962) {
            defunc_0_m_fun_res_214963 = (int64_t) 0;
        } else {
            int64_t y_215072 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_215073 = gtid_214961 == y_215072;
            int64_t defunc_0_m_fun_res_f_res_215074;
            
            if (cond_215073) {
                int64_t defunc_0_m_fun_res_f_res_t_res_215075 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_215074 =
                    defunc_0_m_fun_res_f_res_t_res_215075;
            } else {
                int64_t x_215076 = sub64(gtid_214961, (int64_t) 1);
                int64_t x_215077 = mul64(jump_s_196701, x_215076);
                int64_t min_arg_215078 = add64((int64_t) 1, x_215077);
                int64_t min_res_215079 = smin64(defunc_0_f_res_196740,
                                                min_arg_215078);
                
                defunc_0_m_fun_res_f_res_215074 = min_res_215079;
            }
            defunc_0_m_fun_res_214963 = defunc_0_m_fun_res_f_res_215074;
        }
        
        bool init_idx_214972;
        int64_t init_idx_214973;
        int64_t init_idx_214974;
        bool loop_while_215080;
        int64_t low_215081;
        int64_t high_215082;
        
        loop_while_215080 = x_196832;
        low_215081 = (int64_t) 0;
        high_215082 = i_196831;
        while (loop_while_215080) {
            int64_t x_215083 = add64(low_215081, high_215082);
            int64_t mid_215084 = sdiv64(x_215083, (int64_t) 2);
            bool x_215085 = sle64((int64_t) 0, mid_215084);
            bool y_215086 = slt64(mid_215084, defunc_0_f_res_196740);
            bool bounds_check_215087 = x_215085 && y_215086;
            bool index_certs_215088;
            
            if (!bounds_check_215087) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) mid_215084,
                              "] out of bounds for array of shape [",
                              (long long) defunc_0_f_res_196740, "].",
                              "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t mid_id_215089;
            
            mid_id_215089 = ((int64_t *) mem_214575.mem)[mid_215084];
            
            bool cond_215090 = slt64(mid_id_215089, (int64_t) 0);
            int64_t mid_idx_215091;
            
            if (cond_215090) {
                mid_idx_215091 = (int64_t) 9223372036854775807;
            } else {
                mid_idx_215091 = mid_id_215089;
            }
            
            bool cond_215092 = sle64(defunc_0_m_fun_res_214963, mid_idx_215091);
            int64_t loopres_215093;
            int64_t loopres_215094;
            
            if (cond_215092) {
                int64_t loopres_t_res_215095 = sub64(mid_215084, (int64_t) 1);
                
                loopres_215093 = low_215081;
                loopres_215094 = loopres_t_res_215095;
            } else {
                int64_t loopres_f_res_215096 = add64((int64_t) 1, mid_215084);
                
                loopres_215093 = loopres_f_res_215096;
                loopres_215094 = high_215082;
            }
            
            bool loop_cond_215097 = sle64(loopres_215093, loopres_215094);
            bool loop_while_tmp_215145 = loop_cond_215097;
            int64_t low_tmp_215146 = loopres_215093;
            int64_t high_tmp_215147 = loopres_215094;
            
            loop_while_215080 = loop_while_tmp_215145;
            low_215081 = low_tmp_215146;
            high_215082 = high_tmp_215147;
        }
        init_idx_214972 = loop_while_215080;
        init_idx_214973 = low_215081;
        init_idx_214974 = high_215082;
        
        bool idx_214993;
        int64_t idx_214994;
        int64_t idx_214995;
        int64_t idx_214996;
        bool loop_while_215098;
        int64_t l_idx_215099;
        int64_t r_idx_215100;
        int64_t span_215101;
        
        loop_while_215098 = loop_cond_196867;
        l_idx_215099 = init_idx_214973;
        r_idx_215100 = init_idx_214973;
        span_215101 = (int64_t) 1;
        while (loop_while_215098) {
            int64_t max_arg_215102 = sub64(l_idx_215099, (int64_t) 1);
            int64_t max_res_215103 = smax64((int64_t) 0, max_arg_215102);
            int64_t min_arg_215104 = add64((int64_t) 1, r_idx_215100);
            int64_t min_res_215105 = smin64(min_arg_214581, min_arg_215104);
            bool x_215106 = sle64((int64_t) 0, max_res_215103);
            bool y_215107 = slt64(max_res_215103, defunc_0_f_res_196740);
            bool bounds_check_215108 = x_215106 && y_215107;
            bool index_certs_215109;
            
            if (!bounds_check_215108) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) max_res_215103,
                              "] out of bounds for array of shape [",
                              (long long) defunc_0_f_res_196740, "].",
                              "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215110;
            
            x_215110 = ((int64_t *) mem_214575.mem)[max_res_215103];
            
            int64_t abs_arg_215111 = sub64(x_215110, defunc_0_m_fun_res_214963);
            int64_t abs_res_215112 = abs64(abs_arg_215111);
            bool x_215113 = sle64((int64_t) 0, min_res_215105);
            bool y_215114 = slt64(min_res_215105, defunc_0_f_res_196740);
            bool bounds_check_215115 = x_215113 && y_215114;
            bool index_certs_215116;
            
            if (!bounds_check_215115) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) min_res_215105,
                              "] out of bounds for array of shape [",
                              (long long) defunc_0_f_res_196740, "].",
                              "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:516:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215117;
            
            x_215117 = ((int64_t *) mem_214575.mem)[min_res_215105];
            
            int64_t abs_arg_215118 = sub64(x_215117, defunc_0_m_fun_res_214963);
            int64_t abs_res_215119 = abs64(abs_arg_215118);
            bool cond_215120 = max_res_215103 == l_idx_215099;
            int64_t loopres_215121;
            int64_t loopres_215122;
            int64_t loopres_215123;
            
            if (cond_215120) {
                loopres_215121 = l_idx_215099;
                loopres_215122 = r_idx_215100;
                loopres_215123 = min_res_196862;
            } else {
                bool cond_215124 = slt64(abs_res_215112, abs_res_215119);
                bool cond_f_res_215125 = min_res_215105 == r_idx_215100;
                bool x_215126 = !cond_215124;
                bool y_215127 = cond_f_res_215125 && x_215126;
                bool cond_215128 = cond_215124 || y_215127;
                int64_t loopres_f_res_215129;
                
                if (cond_215128) {
                    loopres_f_res_215129 = max_res_215103;
                } else {
                    loopres_f_res_215129 = l_idx_215099;
                }
                
                int64_t loopres_f_res_215130;
                
                if (cond_215128) {
                    loopres_f_res_215130 = r_idx_215100;
                } else {
                    loopres_f_res_215130 = min_res_215105;
                }
                
                int64_t loopres_f_res_215131;
                
                if (cond_215128) {
                    int64_t loopres_f_res_t_res_215132 = add64((int64_t) 1,
                                                               span_215101);
                    
                    loopres_f_res_215131 = loopres_f_res_t_res_215132;
                } else {
                    int64_t loopres_f_res_f_res_215133 = add64((int64_t) 1,
                                                               span_215101);
                    
                    loopres_f_res_215131 = loopres_f_res_f_res_215133;
                }
                loopres_215121 = loopres_f_res_215129;
                loopres_215122 = loopres_f_res_215130;
                loopres_215123 = loopres_f_res_215131;
            }
            
            bool loop_cond_215134 = slt64(loopres_215123, min_res_196862);
            bool loop_while_tmp_215148 = loop_cond_215134;
            int64_t l_idx_tmp_215149 = loopres_215121;
            int64_t r_idx_tmp_215150 = loopres_215122;
            int64_t span_tmp_215151 = loopres_215123;
            
            loop_while_215098 = loop_while_tmp_215148;
            l_idx_215099 = l_idx_tmp_215149;
            r_idx_215100 = r_idx_tmp_215150;
            span_215101 = span_tmp_215151;
        }
        idx_214993 = loop_while_215098;
        idx_214994 = l_idx_215099;
        idx_214995 = r_idx_215100;
        idx_214996 = span_215101;
        
        int64_t min_res_215034 = smin64(min_arg_214582, idx_214994);
        int64_t max_res_215035 = smax64((int64_t) 0, min_res_215034);
        int64_t defunc_0_m_fun_res_215036;
        
        if (cond_214962) {
            defunc_0_m_fun_res_215036 = (int64_t) 0;
        } else {
            int64_t y_215135 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_215136 = gtid_214961 == y_215135;
            int64_t defunc_0_m_fun_res_f_res_215137;
            
            if (cond_215136) {
                int64_t defunc_0_m_fun_res_f_res_t_res_215138 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_215137 =
                    defunc_0_m_fun_res_f_res_t_res_215138;
            } else {
                int64_t x_215139 = sub64(gtid_214961, (int64_t) 1);
                int64_t x_215140 = mul64(jump_s_196701, x_215139);
                int64_t min_arg_215141 = add64((int64_t) 1, x_215140);
                int64_t min_res_215142 = smin64(defunc_0_f_res_196740,
                                                min_arg_215141);
                
                defunc_0_m_fun_res_f_res_215137 = min_res_215142;
            }
            defunc_0_m_fun_res_215036 = defunc_0_m_fun_res_f_res_215137;
        }
        
        int64_t x_215045 = add64(min_res_214583, max_res_215035);
        int64_t r_215046 = sub64(x_215045, (int64_t) 1);
        bool x_215047 = sle64((int64_t) 0, r_215046);
        bool y_215048 = slt64(r_215046, defunc_0_f_res_196740);
        bool bounds_check_215049 = x_215047 && y_215048;
        bool index_certs_215050;
        
        if (!bounds_check_215049) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) r_215046,
                                   "] out of bounds for array of shape [",
                                   (long long) defunc_0_f_res_196740, "].",
                                   "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:517:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        int64_t x_215051;
        
        x_215051 = ((int64_t *) mem_214575.mem)[r_215046];
        
        int64_t abs_arg_215052 = sub64(x_215051, defunc_0_m_fun_res_215036);
        int64_t abs_res_215053 = abs64(abs_arg_215052);
        bool x_215054 = sle64((int64_t) 0, max_res_215035);
        bool y_215055 = slt64(max_res_215035, defunc_0_f_res_196740);
        bool bounds_check_215056 = x_215054 && y_215055;
        bool index_certs_215057;
        
        if (!bounds_check_215056) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) max_res_215035,
                                   "] out of bounds for array of shape [",
                                   (long long) defunc_0_f_res_196740, "].",
                                   "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:517:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        int64_t x_215058;
        
        x_215058 = ((int64_t *) mem_214575.mem)[max_res_215035];
        
        int64_t abs_arg_215059 = sub64(x_215058, defunc_0_m_fun_res_215036);
        int64_t abs_res_215060 = abs64(abs_arg_215059);
        int64_t max_res_215061 = smax64(abs_res_215053, abs_res_215060);
        float defunc_0_f_res_215062 = sitofp_i64_f32(max_res_215061);
        float defunc_1_f_res_215063 = max_res_214587 + defunc_0_f_res_215062;
        
        ((float *) mem_214588.mem)[gtid_214961] = defunc_1_f_res_215063;
        ((int64_t *) mem_214589.mem)[gtid_214961] = max_res_215035;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228485_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228485_end -
                 futhark_mc_segmap_parloop_228485_start;
        
        ctx->futhark_mc_segmap_parloop_228485_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228485_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228485_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228483(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214960 = tid;
    int num_tasks_215070 = info.nsubtasks;
    struct futhark_mc_task_228482 *futhark_mc_task_228482 =
                                  (struct futhark_mc_task_228482 *) args;
    struct futhark_context *ctx = futhark_mc_task_228482->ctx;
    uint64_t futhark_mc_segmap_task_228483_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228483_start = get_wall_time();
    
    int64_t jump_s_196701 = futhark_mc_task_228482->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228482->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228482->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228482->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_task_228482->free_i_196831;
    bool x_196832 = futhark_mc_task_228482->free_x_196832;
    int64_t min_res_196862 = futhark_mc_task_228482->free_min_res_196862;
    bool loop_cond_196867 = futhark_mc_task_228482->free_loop_cond_196867;
    struct memblock mem_214575 = {.desc ="mem_214575", .mem =
                                  futhark_mc_task_228482->free_mem_214575,
                                  .size =0, .references =NULL};
    int64_t min_arg_214581 = futhark_mc_task_228482->free_min_arg_214581;
    int64_t min_arg_214582 = futhark_mc_task_228482->free_min_arg_214582;
    int64_t min_res_214583 = futhark_mc_task_228482->free_min_res_214583;
    float max_res_214587 = futhark_mc_task_228482->free_max_res_214587;
    struct memblock mem_214588 = {.desc ="mem_214588", .mem =
                                  futhark_mc_task_228482->free_mem_214588,
                                  .size =0, .references =NULL};
    struct memblock mem_214589 = {.desc ="mem_214589", .mem =
                                  futhark_mc_task_228482->free_mem_214589,
                                  .size =0, .references =NULL};
    int64_t iter_215071;
    struct futhark_mc_segmap_parloop_struct_228484
    futhark_mc_segmap_parloop_struct_228484;
    
    futhark_mc_segmap_parloop_struct_228484.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228484.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228484.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228484.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228484.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228484.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228484.free_x_196832 = x_196832;
    futhark_mc_segmap_parloop_struct_228484.free_min_res_196862 =
        min_res_196862;
    futhark_mc_segmap_parloop_struct_228484.free_loop_cond_196867 =
        loop_cond_196867;
    futhark_mc_segmap_parloop_struct_228484.free_mem_214575 = mem_214575.mem;
    futhark_mc_segmap_parloop_struct_228484.free_min_arg_214581 =
        min_arg_214581;
    futhark_mc_segmap_parloop_struct_228484.free_min_arg_214582 =
        min_arg_214582;
    futhark_mc_segmap_parloop_struct_228484.free_min_res_214583 =
        min_res_214583;
    futhark_mc_segmap_parloop_struct_228484.free_max_res_214587 =
        max_res_214587;
    futhark_mc_segmap_parloop_struct_228484.free_mem_214588 = mem_214588.mem;
    futhark_mc_segmap_parloop_struct_228484.free_mem_214589 = mem_214589.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228485_task;
    
    futhark_mc_segmap_parloop_228485_task.name =
        "futhark_mc_segmap_parloop_228485";
    futhark_mc_segmap_parloop_228485_task.fn = futhark_mc_segmap_parloop_228485;
    futhark_mc_segmap_parloop_228485_task.args =
        &futhark_mc_segmap_parloop_struct_228484;
    futhark_mc_segmap_parloop_228485_task.iterations = iterations;
    futhark_mc_segmap_parloop_228485_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228485_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228485_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228485_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228485_task);
    
    if (futhark_mc_segmap_parloop_228485_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228485_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228485_total_end -
                 futhark_mc_segmap_parloop_228485_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228485_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228485_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228485_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228483_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228483_end -
                 futhark_mc_segmap_task_228483_start;
        
        ctx->futhark_mc_segmap_task_228483_runs[tid]++;
        ctx->futhark_mc_segmap_task_228483_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228483_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228474(void *args, int64_t start,
                                            int64_t end, int flat_tid_214572,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228473
    *futhark_mc_segmap_parloop_struct_228473 =
    (struct futhark_mc_segmap_parloop_struct_228473 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228473->ctx;
    uint64_t futhark_mc_segmap_parloop_228474_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228474_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228473->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228473->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228473->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228473->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228473->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228473->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228473->free_i_196831;
    bool x_196832 = futhark_mc_segmap_parloop_struct_228473->free_x_196832;
    int64_t min_res_196862 =
            futhark_mc_segmap_parloop_struct_228473->free_min_res_196862;
    bool loop_cond_196867 =
         futhark_mc_segmap_parloop_struct_228473->free_loop_cond_196867;
    float i64_res_196868 =
          futhark_mc_segmap_parloop_struct_228473->free_i64_res_196868;
    int64_t gtid_200276 =
            futhark_mc_segmap_parloop_struct_228473->free_gtid_200276;
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228473->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228473->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228473->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228473->free_bytes_210599;
    int64_t bytes_210602 =
            futhark_mc_segmap_parloop_struct_228473->free_bytes_210602;
    struct memblock mem_210652 = {.desc ="mem_210652", .mem =
                                  futhark_mc_segmap_parloop_struct_228473->free_mem_210652,
                                  .size =0, .references =NULL};
    struct memblock mem_210656 = {.desc ="mem_210656", .mem =
                                  futhark_mc_segmap_parloop_struct_228473->free_mem_210656,
                                  .size =0, .references =NULL};
    size_t mem_214575_cached_sizze_228475 = 0;
    unsigned char *mem_214575 = NULL;
    size_t mem_214588_cached_sizze_228476 = 0;
    unsigned char *mem_214588 = NULL;
    size_t mem_214589_cached_sizze_228477 = 0;
    unsigned char *mem_214589 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214955 = start;
    
    if (mem_214575_cached_sizze_228475 < (size_t) bytes_210470) {
        mem_214575 = realloc(mem_214575, bytes_210470);
        mem_214575_cached_sizze_228475 = bytes_210470;
    }
    if (mem_214588_cached_sizze_228476 < (size_t) bytes_210599) {
        mem_214588 = realloc(mem_214588, bytes_210599);
        mem_214588_cached_sizze_228476 = bytes_210599;
    }
    if (mem_214589_cached_sizze_228477 < (size_t) bytes_210602) {
        mem_214589 = realloc(mem_214589, bytes_210602);
        mem_214589_cached_sizze_228477 = bytes_210602;
    }
    for (; iter_214955 < end; iter_214955++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215064 = n_p_196694;
        int64_t gtid_214573 = iter_214955;
        int64_t remnant_215065 = iter_214955 - gtid_214573;
        int64_t x_214574;
        
        x_214574 = ((int64_t *) mem_210594.mem)[gtid_200276 * n_p_196694 +
                                                gtid_214573];
        
        int64_t flat_tid_214956 = (int64_t) 0;
        int32_t num_tasks_215066;
        struct futhark_mc_task_228478 futhark_mc_task_228478;
        
        futhark_mc_task_228478.ctx = ctx;
        futhark_mc_task_228478.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228478.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228478.free_gtid_200276 = gtid_200276;
        futhark_mc_task_228478.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228478.free_gtid_214573 = gtid_214573;
        futhark_mc_task_228478.free_mem_214575 = mem_214575;
        
        struct scheduler_segop futhark_mc_task_228478_task;
        
        futhark_mc_task_228478_task.args = &futhark_mc_task_228478;
        futhark_mc_task_228478_task.top_level_fn =
            futhark_mc_segmap_task_228479;
        futhark_mc_task_228478_task.name = "futhark_mc_segmap_task_228479";
        futhark_mc_task_228478_task.iterations = defunc_0_f_res_196740;
        futhark_mc_task_228478_task.task_time =
            &ctx->futhark_mc_segmap_task_228479_total_time;
        futhark_mc_task_228478_task.task_iter =
            &ctx->futhark_mc_segmap_task_228479_total_iter;
        futhark_mc_task_228478_task.sched = STATIC;
        futhark_mc_task_228478_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228479_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228478_task);
        
        if (futhark_mc_segmap_task_228479_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t min_arg_214581 = sub64(x_214574, (int64_t) 1);
        int64_t min_arg_214582 = sub64(x_214574, min_res_196862);
        int64_t min_res_214583 = smin64(q_s_196695, x_214574);
        float i64_res_214584 = sitofp_i64_f32(x_214574);
        float x_214585 = i64_res_196868 - i64_res_214584;
        float max_arg_214586 = x_214585 / 2.0F;
        float max_res_214587 = fmax32(0.0F, max_arg_214586);
        int64_t flat_tid_214960 = (int64_t) 0;
        int32_t num_tasks_215070;
        struct futhark_mc_task_228482 futhark_mc_task_228482;
        
        futhark_mc_task_228482.ctx = ctx;
        futhark_mc_task_228482.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228482.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228482.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228482.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228482.free_i_196831 = i_196831;
        futhark_mc_task_228482.free_x_196832 = x_196832;
        futhark_mc_task_228482.free_min_res_196862 = min_res_196862;
        futhark_mc_task_228482.free_loop_cond_196867 = loop_cond_196867;
        futhark_mc_task_228482.free_mem_214575 = mem_214575;
        futhark_mc_task_228482.free_min_arg_214581 = min_arg_214581;
        futhark_mc_task_228482.free_min_arg_214582 = min_arg_214582;
        futhark_mc_task_228482.free_min_res_214583 = min_res_214583;
        futhark_mc_task_228482.free_max_res_214587 = max_res_214587;
        futhark_mc_task_228482.free_mem_214588 = mem_214588;
        futhark_mc_task_228482.free_mem_214589 = mem_214589;
        
        struct scheduler_segop futhark_mc_task_228482_task;
        
        futhark_mc_task_228482_task.args = &futhark_mc_task_228482;
        futhark_mc_task_228482_task.top_level_fn =
            futhark_mc_segmap_task_228483;
        futhark_mc_task_228482_task.name = "futhark_mc_segmap_task_228483";
        futhark_mc_task_228482_task.iterations = s_n_m_196745;
        futhark_mc_task_228482_task.task_time =
            &ctx->futhark_mc_segmap_task_228483_total_time;
        futhark_mc_task_228482_task.task_iter =
            &ctx->futhark_mc_segmap_task_228483_total_iter;
        futhark_mc_task_228482_task.sched = DYNAMIC;
        futhark_mc_task_228482_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228483_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228482_task);
        
        if (futhark_mc_segmap_task_228483_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 8 > 0)
            memmove(mem_210652.mem + gtid_214573 * s_n_m_196745 * (int64_t) 8,
                    mem_214589 + (int64_t) 0, s_n_m_196745 * (int64_t) 8);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_210656.mem + gtid_214573 * s_n_m_196745 * (int64_t) 4,
                    mem_214588 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_214575);
    free(mem_214588);
    free(mem_214589);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228474_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228474_end -
                 futhark_mc_segmap_parloop_228474_start;
        
        ctx->futhark_mc_segmap_parloop_228474_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228474_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228474_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228472(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_214572 = tid;
    int num_tasks_214829 = info.nsubtasks;
    struct futhark_mc_task_228465 *futhark_mc_task_228465 =
                                  (struct futhark_mc_task_228465 *) args;
    struct futhark_context *ctx = futhark_mc_task_228465->ctx;
    uint64_t futhark_mc_segmap_nested_task_228472_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228472_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228465->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228465->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228465->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228465->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228465->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228465->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_task_228465->free_i_196831;
    bool x_196832 = futhark_mc_task_228465->free_x_196832;
    int64_t min_res_196862 = futhark_mc_task_228465->free_min_res_196862;
    bool loop_cond_196867 = futhark_mc_task_228465->free_loop_cond_196867;
    float i64_res_196868 = futhark_mc_task_228465->free_i64_res_196868;
    int64_t gtid_200276 = futhark_mc_task_228465->free_gtid_200276;
    int64_t bytes_210470 = futhark_mc_task_228465->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228465->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228465->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228465->free_bytes_210599;
    int64_t bytes_210602 = futhark_mc_task_228465->free_bytes_210602;
    struct memblock mem_210652 = {.desc ="mem_210652", .mem =
                                  futhark_mc_task_228465->free_mem_210652,
                                  .size =0, .references =NULL};
    struct memblock mem_210656 = {.desc ="mem_210656", .mem =
                                  futhark_mc_task_228465->free_mem_210656,
                                  .size =0, .references =NULL};
    int64_t iter_214955;
    struct futhark_mc_segmap_parloop_struct_228473
    futhark_mc_segmap_parloop_struct_228473;
    
    futhark_mc_segmap_parloop_struct_228473.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228473.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228473.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228473.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228473.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228473.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228473.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228473.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228473.free_x_196832 = x_196832;
    futhark_mc_segmap_parloop_struct_228473.free_min_res_196862 =
        min_res_196862;
    futhark_mc_segmap_parloop_struct_228473.free_loop_cond_196867 =
        loop_cond_196867;
    futhark_mc_segmap_parloop_struct_228473.free_i64_res_196868 =
        i64_res_196868;
    futhark_mc_segmap_parloop_struct_228473.free_gtid_200276 = gtid_200276;
    futhark_mc_segmap_parloop_struct_228473.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228473.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228473.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228473.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228473.free_bytes_210602 = bytes_210602;
    futhark_mc_segmap_parloop_struct_228473.free_mem_210652 = mem_210652.mem;
    futhark_mc_segmap_parloop_struct_228473.free_mem_210656 = mem_210656.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228474_task;
    
    futhark_mc_segmap_parloop_228474_task.name =
        "futhark_mc_segmap_parloop_228474";
    futhark_mc_segmap_parloop_228474_task.fn = futhark_mc_segmap_parloop_228474;
    futhark_mc_segmap_parloop_228474_task.args =
        &futhark_mc_segmap_parloop_struct_228473;
    futhark_mc_segmap_parloop_228474_task.iterations = iterations;
    futhark_mc_segmap_parloop_228474_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228474_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228474_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228474_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228474_task);
    
    if (futhark_mc_segmap_parloop_228474_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228474_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228474_total_end -
                 futhark_mc_segmap_parloop_228474_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228474_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228474_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228474_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228472_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228472_end -
                 futhark_mc_segmap_nested_task_228472_start;
        
        ctx->futhark_mc_segmap_nested_task_228472_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228472_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228472_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228462(void *args, int64_t start,
                                            int64_t end, int flat_tid_200275,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228461
    *futhark_mc_segmap_parloop_struct_228461 =
    (struct futhark_mc_segmap_parloop_struct_228461 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228461->ctx;
    uint64_t futhark_mc_segmap_parloop_228462_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228462_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228461->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228461->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228461->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228461->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228461->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228461->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228461->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_segmap_parloop_struct_228461->free_i_196831;
    bool x_196832 = futhark_mc_segmap_parloop_struct_228461->free_x_196832;
    int64_t min_res_196862 =
            futhark_mc_segmap_parloop_struct_228461->free_min_res_196862;
    bool loop_cond_196867 =
         futhark_mc_segmap_parloop_struct_228461->free_loop_cond_196867;
    float i64_res_196868 =
          futhark_mc_segmap_parloop_struct_228461->free_i64_res_196868;
    int64_t bytes_210470 =
            futhark_mc_segmap_parloop_struct_228461->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228461->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228461->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228461->free_bytes_210599;
    int64_t bytes_210602 =
            futhark_mc_segmap_parloop_struct_228461->free_bytes_210602;
    int64_t bytes_210651 =
            futhark_mc_segmap_parloop_struct_228461->free_bytes_210651;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228461->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228461->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228461->free_mem_210769,
                                  .size =0, .references =NULL};
    size_t mem_210652_cached_sizze_228463 = 0;
    unsigned char *mem_210652 = NULL;
    size_t mem_210656_cached_sizze_228464 = 0;
    unsigned char *mem_210656 = NULL;
    int64_t iterations = end - start;
    int64_t iter_214571 = start;
    
    if (mem_210652_cached_sizze_228463 < (size_t) bytes_210651) {
        mem_210652 = realloc(mem_210652, bytes_210651);
        mem_210652_cached_sizze_228463 = bytes_210651;
    }
    if (mem_210656_cached_sizze_228464 < (size_t) bytes_210655) {
        mem_210656 = realloc(mem_210656, bytes_210655);
        mem_210656_cached_sizze_228464 = bytes_210655;
    }
    for (; iter_214571 < end; iter_214571++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_214827 = m_196691;
        int64_t gtid_200276 = iter_214571;
        int64_t remnant_214828 = iter_214571 - gtid_200276;
        int64_t flat_tid_214696 = (int64_t) 0;
        int32_t num_tasks_214829;
        int64_t flat_tid_214572 = (int64_t) 0;
        struct futhark_mc_task_228465 futhark_mc_task_228465;
        
        futhark_mc_task_228465.ctx = ctx;
        futhark_mc_task_228465.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228465.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228465.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228465.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228465.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228465.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228465.free_i_196831 = i_196831;
        futhark_mc_task_228465.free_x_196832 = x_196832;
        futhark_mc_task_228465.free_min_res_196862 = min_res_196862;
        futhark_mc_task_228465.free_loop_cond_196867 = loop_cond_196867;
        futhark_mc_task_228465.free_i64_res_196868 = i64_res_196868;
        futhark_mc_task_228465.free_gtid_200276 = gtid_200276;
        futhark_mc_task_228465.free_bytes_210470 = bytes_210470;
        futhark_mc_task_228465.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228465.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228465.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228465.free_bytes_210602 = bytes_210602;
        futhark_mc_task_228465.free_mem_210652 = mem_210652;
        futhark_mc_task_228465.free_mem_210656 = mem_210656;
        
        struct scheduler_segop futhark_mc_task_228465_task;
        
        futhark_mc_task_228465_task.args = &futhark_mc_task_228465;
        futhark_mc_task_228465_task.top_level_fn =
            futhark_mc_segmap_task_228466;
        futhark_mc_task_228465_task.name = "futhark_mc_segmap_task_228466";
        futhark_mc_task_228465_task.iterations = n_p_196694;
        futhark_mc_task_228465_task.task_time =
            &ctx->futhark_mc_segmap_task_228466_total_time;
        futhark_mc_task_228465_task.task_iter =
            &ctx->futhark_mc_segmap_task_228466_total_iter;
        futhark_mc_task_228465_task.sched = DYNAMIC;
        futhark_mc_task_228465_task.nested_fn =
            futhark_mc_segmap_nested_task_228472;
        
        int futhark_mc_segmap_task_228466_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228465_task);
        
        if (futhark_mc_segmap_task_228466_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 8 > 0)
            memmove(mem_210764.mem + gtid_200276 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 8, mem_210652 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 8);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_210769.mem + gtid_200276 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_210656 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210652);
    free(mem_210656);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228462_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228462_end -
                 futhark_mc_segmap_parloop_228462_start;
        
        ctx->futhark_mc_segmap_parloop_228462_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228462_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228462_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228460(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200275 = tid;
    int num_tasks_214428 = info.nsubtasks;
    struct futhark_mc_task_228453 *futhark_mc_task_228453 =
                                  (struct futhark_mc_task_228453 *) args;
    struct futhark_context *ctx = futhark_mc_task_228453->ctx;
    uint64_t futhark_mc_segmap_nested_task_228460_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228460_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228453->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228453->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228453->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228453->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228453->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228453->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228453->free_s_n_m_196745;
    int64_t i_196831 = futhark_mc_task_228453->free_i_196831;
    bool x_196832 = futhark_mc_task_228453->free_x_196832;
    int64_t min_res_196862 = futhark_mc_task_228453->free_min_res_196862;
    bool loop_cond_196867 = futhark_mc_task_228453->free_loop_cond_196867;
    float i64_res_196868 = futhark_mc_task_228453->free_i64_res_196868;
    int64_t bytes_210470 = futhark_mc_task_228453->free_bytes_210470;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228453->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228453->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228453->free_bytes_210599;
    int64_t bytes_210602 = futhark_mc_task_228453->free_bytes_210602;
    int64_t bytes_210651 = futhark_mc_task_228453->free_bytes_210651;
    int64_t bytes_210655 = futhark_mc_task_228453->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228453->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228453->free_mem_210769,
                                  .size =0, .references =NULL};
    int64_t iter_214571;
    struct futhark_mc_segmap_parloop_struct_228461
    futhark_mc_segmap_parloop_struct_228461;
    
    futhark_mc_segmap_parloop_struct_228461.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228461.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228461.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228461.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228461.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228461.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228461.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228461.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228461.free_i_196831 = i_196831;
    futhark_mc_segmap_parloop_struct_228461.free_x_196832 = x_196832;
    futhark_mc_segmap_parloop_struct_228461.free_min_res_196862 =
        min_res_196862;
    futhark_mc_segmap_parloop_struct_228461.free_loop_cond_196867 =
        loop_cond_196867;
    futhark_mc_segmap_parloop_struct_228461.free_i64_res_196868 =
        i64_res_196868;
    futhark_mc_segmap_parloop_struct_228461.free_bytes_210470 = bytes_210470;
    futhark_mc_segmap_parloop_struct_228461.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228461.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228461.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228461.free_bytes_210602 = bytes_210602;
    futhark_mc_segmap_parloop_struct_228461.free_bytes_210651 = bytes_210651;
    futhark_mc_segmap_parloop_struct_228461.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228461.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228461.free_mem_210769 = mem_210769.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228462_task;
    
    futhark_mc_segmap_parloop_228462_task.name =
        "futhark_mc_segmap_parloop_228462";
    futhark_mc_segmap_parloop_228462_task.fn = futhark_mc_segmap_parloop_228462;
    futhark_mc_segmap_parloop_228462_task.args =
        &futhark_mc_segmap_parloop_struct_228461;
    futhark_mc_segmap_parloop_228462_task.iterations = iterations;
    futhark_mc_segmap_parloop_228462_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228462_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228462_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228462_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228462_task);
    
    if (futhark_mc_segmap_parloop_228462_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228462_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228462_total_end -
                 futhark_mc_segmap_parloop_228462_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228462_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228462_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228462_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228460_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228460_end -
                 futhark_mc_segmap_nested_task_228460_start;
        
        ctx->futhark_mc_segmap_nested_task_228460_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228460_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228460_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228486 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_196994;
    bool free_loop_cond_196999;
    float free_i64_res_197000;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210774;
    int64_t free_bytes_210777;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
};
struct futhark_mc_segmap_parloop_struct_228488 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_196994;
    bool free_loop_cond_196999;
    float free_i64_res_197000;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210774;
    int64_t free_bytes_210777;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
};
static int futhark_mc_segmap_parloop_228489(void *args, int64_t start,
                                            int64_t end, int flat_tid_200523,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228488
    *futhark_mc_segmap_parloop_struct_228488 =
    (struct futhark_mc_segmap_parloop_struct_228488 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228488->ctx;
    uint64_t futhark_mc_segmap_parloop_228489_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228489_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228488->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228488->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228488->free_q_l_196697;
    int64_t jump_l_196703 =
            futhark_mc_segmap_parloop_struct_228488->free_jump_l_196703;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228488->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228488->free_i_196779;
    bool x_196780 = futhark_mc_segmap_parloop_struct_228488->free_x_196780;
    int64_t min_res_196994 =
            futhark_mc_segmap_parloop_struct_228488->free_min_res_196994;
    bool loop_cond_196999 =
         futhark_mc_segmap_parloop_struct_228488->free_loop_cond_196999;
    float i64_res_197000 =
          futhark_mc_segmap_parloop_struct_228488->free_i64_res_197000;
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_228488->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228488->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_228488->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_228488->free_bytes_210774;
    int64_t bytes_210777 =
            futhark_mc_segmap_parloop_struct_228488->free_bytes_210777;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228488->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228488->free_mem_210831,
                                  .size =0, .references =NULL};
    size_t mem_210781_cached_sizze_228490 = 0;
    unsigned char *mem_210781 = NULL;
    size_t mem_210796_cached_sizze_228491 = 0;
    unsigned char *mem_210796 = NULL;
    size_t mem_210799_cached_sizze_228492 = 0;
    unsigned char *mem_210799 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215153 = start;
    
    if (mem_210781_cached_sizze_228490 < (size_t) bytes_210356) {
        mem_210781 = realloc(mem_210781, bytes_210356);
        mem_210781_cached_sizze_228490 = bytes_210356;
    }
    if (mem_210796_cached_sizze_228491 < (size_t) bytes_210774) {
        mem_210796 = realloc(mem_210796, bytes_210774);
        mem_210796_cached_sizze_228491 = bytes_210774;
    }
    if (mem_210799_cached_sizze_228492 < (size_t) bytes_210777) {
        mem_210799 = realloc(mem_210799, bytes_210777);
        mem_210799_cached_sizze_228492 = bytes_210777;
    }
    for (; iter_215153 < end; iter_215153++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215250 = m_196691;
        int64_t gtid_200524 = iter_215153;
        int64_t remnant_215251 = iter_215153 - gtid_200524;
        int64_t x_197004;
        
        x_197004 = ((int64_t *) mem_210397.mem)[gtid_200524];
        for (int64_t i_215154 = 0; i_215154 < n_196692; i_215154++) {
            int64_t x_215156;
            
            x_215156 = ((int64_t *) mem_210394.mem)[gtid_200524 * n_196692 +
                                                    i_215154];
            
            int64_t defunc_0_f_res_215157 = add64((int64_t) 1, x_215156);
            
            ((int64_t *) mem_210781)[i_215154] = defunc_0_f_res_215157;
        }
        
        int64_t min_arg_197008 = sub64(x_197004, (int64_t) 1);
        int64_t min_arg_197009 = sub64(x_197004, min_res_196994);
        int64_t min_res_197010 = smin64(q_l_196697, x_197004);
        float i64_res_197011 = sitofp_i64_f32(x_197004);
        float x_197012 = i64_res_197000 - i64_res_197011;
        float max_arg_197013 = x_197012 / 2.0F;
        float max_res_197014 = fmax32(0.0F, max_arg_197013);
        
        for (int64_t i_215159 = 0; i_215159 < l_n_m_196752; i_215159++) {
            int64_t min_arg_215162 = mul64(jump_l_196703, i_215159);
            int64_t min_res_215163 = smin64(i_196779, min_arg_215162);
            int64_t defunc_0_g_res_215164 = add64((int64_t) 1, min_res_215163);
            bool init_idx_215165;
            int64_t init_idx_215166;
            int64_t init_idx_215167;
            bool loop_while_215168;
            int64_t low_215169;
            int64_t high_215170;
            
            loop_while_215168 = x_196780;
            low_215169 = (int64_t) 0;
            high_215170 = i_196779;
            while (loop_while_215168) {
                int64_t x_215171 = add64(low_215169, high_215170);
                int64_t mid_215172 = sdiv64(x_215171, (int64_t) 2);
                bool x_215173 = sle64((int64_t) 0, mid_215172);
                bool y_215174 = slt64(mid_215172, n_196692);
                bool bounds_check_215175 = x_215173 && y_215174;
                bool index_certs_215176;
                
                if (!bounds_check_215175) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) mid_215172,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t mid_id_215177;
                
                mid_id_215177 = ((int64_t *) mem_210781)[mid_215172];
                
                bool cond_215178 = slt64(mid_id_215177, (int64_t) 0);
                int64_t mid_idx_215179;
                
                if (cond_215178) {
                    mid_idx_215179 = (int64_t) 9223372036854775807;
                } else {
                    mid_idx_215179 = mid_id_215177;
                }
                
                bool cond_215180 = sle64(defunc_0_g_res_215164, mid_idx_215179);
                int64_t loopres_215181;
                int64_t loopres_215182;
                
                if (cond_215180) {
                    int64_t loopres_t_res_215183 = sub64(mid_215172,
                                                         (int64_t) 1);
                    
                    loopres_215181 = low_215169;
                    loopres_215182 = loopres_t_res_215183;
                } else {
                    int64_t loopres_f_res_215184 = add64((int64_t) 1,
                                                         mid_215172);
                    
                    loopres_215181 = loopres_f_res_215184;
                    loopres_215182 = high_215170;
                }
                
                bool loop_cond_215185 = sle64(loopres_215181, loopres_215182);
                bool loop_while_tmp_215255 = loop_cond_215185;
                int64_t low_tmp_215256 = loopres_215181;
                int64_t high_tmp_215257 = loopres_215182;
                
                loop_while_215168 = loop_while_tmp_215255;
                low_215169 = low_tmp_215256;
                high_215170 = high_tmp_215257;
            }
            init_idx_215165 = loop_while_215168;
            init_idx_215166 = low_215169;
            init_idx_215167 = high_215170;
            
            bool idx_215186;
            int64_t idx_215187;
            int64_t idx_215188;
            int64_t idx_215189;
            bool loop_while_215190;
            int64_t l_idx_215191;
            int64_t r_idx_215192;
            int64_t span_215193;
            
            loop_while_215190 = loop_cond_196999;
            l_idx_215191 = init_idx_215166;
            r_idx_215192 = init_idx_215166;
            span_215193 = (int64_t) 1;
            while (loop_while_215190) {
                int64_t max_arg_215194 = sub64(l_idx_215191, (int64_t) 1);
                int64_t max_res_215195 = smax64((int64_t) 0, max_arg_215194);
                int64_t min_arg_215196 = add64((int64_t) 1, r_idx_215192);
                int64_t min_res_215197 = smin64(min_arg_197008, min_arg_215196);
                bool x_215198 = sle64((int64_t) 0, max_res_215195);
                bool y_215199 = slt64(max_res_215195, n_196692);
                bool bounds_check_215200 = x_215198 && y_215199;
                bool index_certs_215201;
                
                if (!bounds_check_215200) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) max_res_215195,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_215202;
                
                x_215202 = ((int64_t *) mem_210781)[max_res_215195];
                
                int64_t abs_arg_215203 = sub64(x_215202, defunc_0_g_res_215164);
                int64_t abs_res_215204 = abs64(abs_arg_215203);
                bool x_215205 = sle64((int64_t) 0, min_res_215197);
                bool y_215206 = slt64(min_res_215197, n_196692);
                bool bounds_check_215207 = x_215205 && y_215206;
                bool index_certs_215208;
                
                if (!bounds_check_215207) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) min_res_215197,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_215209;
                
                x_215209 = ((int64_t *) mem_210781)[min_res_215197];
                
                int64_t abs_arg_215210 = sub64(x_215209, defunc_0_g_res_215164);
                int64_t abs_res_215211 = abs64(abs_arg_215210);
                bool cond_215212 = max_res_215195 == l_idx_215191;
                int64_t loopres_215213;
                int64_t loopres_215214;
                int64_t loopres_215215;
                
                if (cond_215212) {
                    loopres_215213 = l_idx_215191;
                    loopres_215214 = r_idx_215192;
                    loopres_215215 = min_res_196994;
                } else {
                    bool cond_215216 = slt64(abs_res_215204, abs_res_215211);
                    bool cond_f_res_215217 = min_res_215197 == r_idx_215192;
                    bool x_215218 = !cond_215216;
                    bool y_215219 = cond_f_res_215217 && x_215218;
                    bool cond_215220 = cond_215216 || y_215219;
                    int64_t loopres_f_res_215221;
                    
                    if (cond_215220) {
                        loopres_f_res_215221 = max_res_215195;
                    } else {
                        loopres_f_res_215221 = l_idx_215191;
                    }
                    
                    int64_t loopres_f_res_215222;
                    
                    if (cond_215220) {
                        loopres_f_res_215222 = r_idx_215192;
                    } else {
                        loopres_f_res_215222 = min_res_215197;
                    }
                    
                    int64_t loopres_f_res_215223;
                    
                    if (cond_215220) {
                        int64_t loopres_f_res_t_res_215224 = add64((int64_t) 1,
                                                                   span_215193);
                        
                        loopres_f_res_215223 = loopres_f_res_t_res_215224;
                    } else {
                        int64_t loopres_f_res_f_res_215225 = add64((int64_t) 1,
                                                                   span_215193);
                        
                        loopres_f_res_215223 = loopres_f_res_f_res_215225;
                    }
                    loopres_215213 = loopres_f_res_215221;
                    loopres_215214 = loopres_f_res_215222;
                    loopres_215215 = loopres_f_res_215223;
                }
                
                bool loop_cond_215226 = slt64(loopres_215215, min_res_196994);
                bool loop_while_tmp_215258 = loop_cond_215226;
                int64_t l_idx_tmp_215259 = loopres_215213;
                int64_t r_idx_tmp_215260 = loopres_215214;
                int64_t span_tmp_215261 = loopres_215215;
                
                loop_while_215190 = loop_while_tmp_215258;
                l_idx_215191 = l_idx_tmp_215259;
                r_idx_215192 = r_idx_tmp_215260;
                span_215193 = span_tmp_215261;
            }
            idx_215186 = loop_while_215190;
            idx_215187 = l_idx_215191;
            idx_215188 = r_idx_215192;
            idx_215189 = span_215193;
            
            int64_t min_res_215227 = smin64(min_arg_197009, idx_215187);
            int64_t max_res_215228 = smax64((int64_t) 0, min_res_215227);
            int64_t x_215229 = add64(min_res_197010, max_res_215228);
            int64_t r_215230 = sub64(x_215229, (int64_t) 1);
            bool x_215231 = sle64((int64_t) 0, r_215230);
            bool y_215232 = slt64(r_215230, n_196692);
            bool bounds_check_215233 = x_215231 && y_215232;
            bool index_certs_215234;
            
            if (!bounds_check_215233) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) r_215230,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215235;
            
            x_215235 = ((int64_t *) mem_210394.mem)[gtid_200524 * n_196692 +
                                                    r_215230];
            
            int64_t abs_arg_215236 = sub64(x_215235, min_res_215163);
            int64_t abs_res_215237 = abs64(abs_arg_215236);
            bool x_215238 = sle64((int64_t) 0, max_res_215228);
            bool y_215239 = slt64(max_res_215228, n_196692);
            bool bounds_check_215240 = x_215238 && y_215239;
            bool index_certs_215241;
            
            if (!bounds_check_215240) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) max_res_215228,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215242;
            
            x_215242 = ((int64_t *) mem_210394.mem)[gtid_200524 * n_196692 +
                                                    max_res_215228];
            
            int64_t abs_arg_215243 = sub64(x_215242, min_res_215163);
            int64_t abs_res_215244 = abs64(abs_arg_215243);
            int64_t max_res_215245 = smax64(abs_res_215237, abs_res_215244);
            float defunc_0_f_res_215246 = sitofp_i64_f32(max_res_215245);
            float defunc_1_f_res_215247 = max_res_197014 +
                  defunc_0_f_res_215246;
            
            ((float *) mem_210796)[i_215159] = defunc_1_f_res_215247;
            ((int64_t *) mem_210799)[i_215159] = max_res_215228;
        }
        if (l_n_m_196752 * (int64_t) 8 > 0)
            memmove(mem_210827.mem + gtid_200524 * l_n_m_196752 * (int64_t) 8,
                    mem_210799 + (int64_t) 0, l_n_m_196752 * (int64_t) 8);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_210831.mem + gtid_200524 * l_n_m_196752 * (int64_t) 4,
                    mem_210796 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210781);
    free(mem_210796);
    free(mem_210799);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228489_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228489_end -
                 futhark_mc_segmap_parloop_228489_start;
        
        ctx->futhark_mc_segmap_parloop_228489_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228489_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228489_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228487(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200523 = tid;
    int num_tasks_215152 = info.nsubtasks;
    struct futhark_mc_task_228486 *futhark_mc_task_228486 =
                                  (struct futhark_mc_task_228486 *) args;
    struct futhark_context *ctx = futhark_mc_task_228486->ctx;
    uint64_t futhark_mc_segmap_task_228487_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228487_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228486->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228486->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228486->free_q_l_196697;
    int64_t jump_l_196703 = futhark_mc_task_228486->free_jump_l_196703;
    int64_t l_n_m_196752 = futhark_mc_task_228486->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228486->free_i_196779;
    bool x_196780 = futhark_mc_task_228486->free_x_196780;
    int64_t min_res_196994 = futhark_mc_task_228486->free_min_res_196994;
    bool loop_cond_196999 = futhark_mc_task_228486->free_loop_cond_196999;
    float i64_res_197000 = futhark_mc_task_228486->free_i64_res_197000;
    int64_t bytes_210356 = futhark_mc_task_228486->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228486->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_228486->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210774 = futhark_mc_task_228486->free_bytes_210774;
    int64_t bytes_210777 = futhark_mc_task_228486->free_bytes_210777;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228486->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228486->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t iter_215153;
    struct futhark_mc_segmap_parloop_struct_228488
    futhark_mc_segmap_parloop_struct_228488;
    
    futhark_mc_segmap_parloop_struct_228488.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228488.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228488.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228488.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228488.free_jump_l_196703 = jump_l_196703;
    futhark_mc_segmap_parloop_struct_228488.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228488.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228488.free_x_196780 = x_196780;
    futhark_mc_segmap_parloop_struct_228488.free_min_res_196994 =
        min_res_196994;
    futhark_mc_segmap_parloop_struct_228488.free_loop_cond_196999 =
        loop_cond_196999;
    futhark_mc_segmap_parloop_struct_228488.free_i64_res_197000 =
        i64_res_197000;
    futhark_mc_segmap_parloop_struct_228488.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_228488.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228488.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_228488.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_228488.free_bytes_210777 = bytes_210777;
    futhark_mc_segmap_parloop_struct_228488.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228488.free_mem_210831 = mem_210831.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228489_task;
    
    futhark_mc_segmap_parloop_228489_task.name =
        "futhark_mc_segmap_parloop_228489";
    futhark_mc_segmap_parloop_228489_task.fn = futhark_mc_segmap_parloop_228489;
    futhark_mc_segmap_parloop_228489_task.args =
        &futhark_mc_segmap_parloop_struct_228488;
    futhark_mc_segmap_parloop_228489_task.iterations = iterations;
    futhark_mc_segmap_parloop_228489_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228489_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228489_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228489_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228489_task);
    
    if (futhark_mc_segmap_parloop_228489_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228489_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228489_total_end -
                 futhark_mc_segmap_parloop_228489_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228489_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228489_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228489_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228487_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228487_end -
                 futhark_mc_segmap_task_228487_start;
        
        ctx->futhark_mc_segmap_task_228487_runs[tid]++;
        ctx->futhark_mc_segmap_task_228487_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228487_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228494 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_196994;
    bool free_loop_cond_196999;
    float free_i64_res_197000;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210774;
    int64_t free_bytes_210777;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
};
struct futhark_mc_task_228499 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_200532;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210772;
};
struct futhark_mc_segmap_parloop_struct_228501 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_200532;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210772;
};
static int futhark_mc_segmap_parloop_228502(void *args, int64_t start,
                                            int64_t end, int flat_tid_215263,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228501
    *futhark_mc_segmap_parloop_struct_228501 =
    (struct futhark_mc_segmap_parloop_struct_228501 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228501->ctx;
    uint64_t futhark_mc_segmap_parloop_228502_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228502_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228501->free_n_196692;
    int64_t gtid_200532 =
            futhark_mc_segmap_parloop_struct_228501->free_gtid_200532;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228501->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210772 = {.desc ="mem_210772", .mem =
                                  futhark_mc_segmap_parloop_struct_228501->free_mem_210772,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215358 = start;
    
    for (; iter_215358 < end; iter_215358++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215359 = n_196692;
        int64_t gtid_215264 = iter_215358;
        int64_t remnant_215360 = iter_215358 - gtid_215264;
        int64_t x_215265;
        
        x_215265 = ((int64_t *) mem_210394.mem)[gtid_200532 * n_196692 +
                                                gtid_215264];
        
        int64_t defunc_0_f_res_215266 = add64((int64_t) 1, x_215265);
        
        ((int64_t *) mem_210772.mem)[gtid_215264] = defunc_0_f_res_215266;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228502_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228502_end -
                 futhark_mc_segmap_parloop_228502_start;
        
        ctx->futhark_mc_segmap_parloop_228502_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228502_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228502_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228500(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215263 = tid;
    int num_tasks_215357 = info.nsubtasks;
    struct futhark_mc_task_228499 *futhark_mc_task_228499 =
                                  (struct futhark_mc_task_228499 *) args;
    struct futhark_context *ctx = futhark_mc_task_228499->ctx;
    uint64_t futhark_mc_segmap_task_228500_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228500_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228499->free_n_196692;
    int64_t gtid_200532 = futhark_mc_task_228499->free_gtid_200532;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228499->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210772 = {.desc ="mem_210772", .mem =
                                  futhark_mc_task_228499->free_mem_210772,
                                  .size =0, .references =NULL};
    int64_t iter_215358;
    struct futhark_mc_segmap_parloop_struct_228501
    futhark_mc_segmap_parloop_struct_228501;
    
    futhark_mc_segmap_parloop_struct_228501.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228501.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228501.free_gtid_200532 = gtid_200532;
    futhark_mc_segmap_parloop_struct_228501.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228501.free_mem_210772 = mem_210772.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228502_task;
    
    futhark_mc_segmap_parloop_228502_task.name =
        "futhark_mc_segmap_parloop_228502";
    futhark_mc_segmap_parloop_228502_task.fn = futhark_mc_segmap_parloop_228502;
    futhark_mc_segmap_parloop_228502_task.args =
        &futhark_mc_segmap_parloop_struct_228501;
    futhark_mc_segmap_parloop_228502_task.iterations = iterations;
    futhark_mc_segmap_parloop_228502_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228502_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228502_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228502_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228502_task);
    
    if (futhark_mc_segmap_parloop_228502_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228502_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228502_total_end -
                 futhark_mc_segmap_parloop_228502_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228502_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228502_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228502_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228500_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228500_end -
                 futhark_mc_segmap_task_228500_start;
        
        ctx->futhark_mc_segmap_task_228500_runs[tid]++;
        ctx->futhark_mc_segmap_task_228500_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228500_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228503 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_196994;
    bool free_loop_cond_196999;
    int64_t free_gtid_200532;
    int64_t free_min_arg_200540;
    int64_t free_min_arg_200541;
    int64_t free_min_res_200542;
    float free_max_res_200546;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210772;
    unsigned char *free_mem_210775;
    unsigned char *free_mem_210778;
};
struct futhark_mc_segmap_parloop_struct_228505 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_196994;
    bool free_loop_cond_196999;
    int64_t free_gtid_200532;
    int64_t free_min_arg_200540;
    int64_t free_min_arg_200541;
    int64_t free_min_res_200542;
    float free_max_res_200546;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210772;
    unsigned char *free_mem_210775;
    unsigned char *free_mem_210778;
};
static int futhark_mc_segmap_parloop_228506(void *args, int64_t start,
                                            int64_t end, int flat_tid_215267,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228505
    *futhark_mc_segmap_parloop_struct_228505 =
    (struct futhark_mc_segmap_parloop_struct_228505 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228505->ctx;
    uint64_t futhark_mc_segmap_parloop_228506_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228506_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228505->free_n_196692;
    int64_t jump_l_196703 =
            futhark_mc_segmap_parloop_struct_228505->free_jump_l_196703;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228505->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228505->free_i_196779;
    bool x_196780 = futhark_mc_segmap_parloop_struct_228505->free_x_196780;
    int64_t min_res_196994 =
            futhark_mc_segmap_parloop_struct_228505->free_min_res_196994;
    bool loop_cond_196999 =
         futhark_mc_segmap_parloop_struct_228505->free_loop_cond_196999;
    int64_t gtid_200532 =
            futhark_mc_segmap_parloop_struct_228505->free_gtid_200532;
    int64_t min_arg_200540 =
            futhark_mc_segmap_parloop_struct_228505->free_min_arg_200540;
    int64_t min_arg_200541 =
            futhark_mc_segmap_parloop_struct_228505->free_min_arg_200541;
    int64_t min_res_200542 =
            futhark_mc_segmap_parloop_struct_228505->free_min_res_200542;
    float max_res_200546 =
          futhark_mc_segmap_parloop_struct_228505->free_max_res_200546;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228505->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210772 = {.desc ="mem_210772", .mem =
                                  futhark_mc_segmap_parloop_struct_228505->free_mem_210772,
                                  .size =0, .references =NULL};
    struct memblock mem_210775 = {.desc ="mem_210775", .mem =
                                  futhark_mc_segmap_parloop_struct_228505->free_mem_210775,
                                  .size =0, .references =NULL};
    struct memblock mem_210778 = {.desc ="mem_210778", .mem =
                                  futhark_mc_segmap_parloop_struct_228505->free_mem_210778,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215362 = start;
    
    for (; iter_215362 < end; iter_215362++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215418 = l_n_m_196752;
        int64_t gtid_215268 = iter_215362;
        int64_t remnant_215419 = iter_215362 - gtid_215268;
        int64_t min_arg_215269 = mul64(jump_l_196703, gtid_215268);
        int64_t min_res_215270 = smin64(i_196779, min_arg_215269);
        int64_t defunc_0_g_res_215271 = add64((int64_t) 1, min_res_215270);
        bool init_idx_215272;
        int64_t init_idx_215273;
        int64_t init_idx_215274;
        bool loop_while_215363;
        int64_t low_215364;
        int64_t high_215365;
        
        loop_while_215363 = x_196780;
        low_215364 = (int64_t) 0;
        high_215365 = i_196779;
        while (loop_while_215363) {
            int64_t x_215366 = add64(low_215364, high_215365);
            int64_t mid_215367 = sdiv64(x_215366, (int64_t) 2);
            bool x_215368 = sle64((int64_t) 0, mid_215367);
            bool y_215369 = slt64(mid_215367, n_196692);
            bool bounds_check_215370 = x_215368 && y_215369;
            bool index_certs_215371;
            
            if (!bounds_check_215370) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) mid_215367,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t mid_id_215372;
            
            mid_id_215372 = ((int64_t *) mem_210772.mem)[mid_215367];
            
            bool cond_215373 = slt64(mid_id_215372, (int64_t) 0);
            int64_t mid_idx_215374;
            
            if (cond_215373) {
                mid_idx_215374 = (int64_t) 9223372036854775807;
            } else {
                mid_idx_215374 = mid_id_215372;
            }
            
            bool cond_215375 = sle64(defunc_0_g_res_215271, mid_idx_215374);
            int64_t loopres_215376;
            int64_t loopres_215377;
            
            if (cond_215375) {
                int64_t loopres_t_res_215378 = sub64(mid_215367, (int64_t) 1);
                
                loopres_215376 = low_215364;
                loopres_215377 = loopres_t_res_215378;
            } else {
                int64_t loopres_f_res_215379 = add64((int64_t) 1, mid_215367);
                
                loopres_215376 = loopres_f_res_215379;
                loopres_215377 = high_215365;
            }
            
            bool loop_cond_215380 = sle64(loopres_215376, loopres_215377);
            bool loop_while_tmp_215420 = loop_cond_215380;
            int64_t low_tmp_215421 = loopres_215376;
            int64_t high_tmp_215422 = loopres_215377;
            
            loop_while_215363 = loop_while_tmp_215420;
            low_215364 = low_tmp_215421;
            high_215365 = high_tmp_215422;
        }
        init_idx_215272 = loop_while_215363;
        init_idx_215273 = low_215364;
        init_idx_215274 = high_215365;
        
        bool idx_215293;
        int64_t idx_215294;
        int64_t idx_215295;
        int64_t idx_215296;
        bool loop_while_215381;
        int64_t l_idx_215382;
        int64_t r_idx_215383;
        int64_t span_215384;
        
        loop_while_215381 = loop_cond_196999;
        l_idx_215382 = init_idx_215273;
        r_idx_215383 = init_idx_215273;
        span_215384 = (int64_t) 1;
        while (loop_while_215381) {
            int64_t max_arg_215385 = sub64(l_idx_215382, (int64_t) 1);
            int64_t max_res_215386 = smax64((int64_t) 0, max_arg_215385);
            int64_t min_arg_215387 = add64((int64_t) 1, r_idx_215383);
            int64_t min_res_215388 = smin64(min_arg_200540, min_arg_215387);
            bool x_215389 = sle64((int64_t) 0, max_res_215386);
            bool y_215390 = slt64(max_res_215386, n_196692);
            bool bounds_check_215391 = x_215389 && y_215390;
            bool index_certs_215392;
            
            if (!bounds_check_215391) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) max_res_215386,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215393;
            
            x_215393 = ((int64_t *) mem_210772.mem)[max_res_215386];
            
            int64_t abs_arg_215394 = sub64(x_215393, defunc_0_g_res_215271);
            int64_t abs_res_215395 = abs64(abs_arg_215394);
            bool x_215396 = sle64((int64_t) 0, min_res_215388);
            bool y_215397 = slt64(min_res_215388, n_196692);
            bool bounds_check_215398 = x_215396 && y_215397;
            bool index_certs_215399;
            
            if (!bounds_check_215398) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) min_res_215388,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215400;
            
            x_215400 = ((int64_t *) mem_210772.mem)[min_res_215388];
            
            int64_t abs_arg_215401 = sub64(x_215400, defunc_0_g_res_215271);
            int64_t abs_res_215402 = abs64(abs_arg_215401);
            bool cond_215403 = max_res_215386 == l_idx_215382;
            int64_t loopres_215404;
            int64_t loopres_215405;
            int64_t loopres_215406;
            
            if (cond_215403) {
                loopres_215404 = l_idx_215382;
                loopres_215405 = r_idx_215383;
                loopres_215406 = min_res_196994;
            } else {
                bool cond_215407 = slt64(abs_res_215395, abs_res_215402);
                bool cond_f_res_215408 = min_res_215388 == r_idx_215383;
                bool x_215409 = !cond_215407;
                bool y_215410 = cond_f_res_215408 && x_215409;
                bool cond_215411 = cond_215407 || y_215410;
                int64_t loopres_f_res_215412;
                
                if (cond_215411) {
                    loopres_f_res_215412 = max_res_215386;
                } else {
                    loopres_f_res_215412 = l_idx_215382;
                }
                
                int64_t loopres_f_res_215413;
                
                if (cond_215411) {
                    loopres_f_res_215413 = r_idx_215383;
                } else {
                    loopres_f_res_215413 = min_res_215388;
                }
                
                int64_t loopres_f_res_215414;
                
                if (cond_215411) {
                    int64_t loopres_f_res_t_res_215415 = add64((int64_t) 1,
                                                               span_215384);
                    
                    loopres_f_res_215414 = loopres_f_res_t_res_215415;
                } else {
                    int64_t loopres_f_res_f_res_215416 = add64((int64_t) 1,
                                                               span_215384);
                    
                    loopres_f_res_215414 = loopres_f_res_f_res_215416;
                }
                loopres_215404 = loopres_f_res_215412;
                loopres_215405 = loopres_f_res_215413;
                loopres_215406 = loopres_f_res_215414;
            }
            
            bool loop_cond_215417 = slt64(loopres_215406, min_res_196994);
            bool loop_while_tmp_215423 = loop_cond_215417;
            int64_t l_idx_tmp_215424 = loopres_215404;
            int64_t r_idx_tmp_215425 = loopres_215405;
            int64_t span_tmp_215426 = loopres_215406;
            
            loop_while_215381 = loop_while_tmp_215423;
            l_idx_215382 = l_idx_tmp_215424;
            r_idx_215383 = r_idx_tmp_215425;
            span_215384 = span_tmp_215426;
        }
        idx_215293 = loop_while_215381;
        idx_215294 = l_idx_215382;
        idx_215295 = r_idx_215383;
        idx_215296 = span_215384;
        
        int64_t min_res_215334 = smin64(min_arg_200541, idx_215294);
        int64_t max_res_215335 = smax64((int64_t) 0, min_res_215334);
        int64_t x_215336 = add64(min_res_200542, max_res_215335);
        int64_t r_215337 = sub64(x_215336, (int64_t) 1);
        bool x_215338 = sle64((int64_t) 0, r_215337);
        bool y_215339 = slt64(r_215337, n_196692);
        bool bounds_check_215340 = x_215338 && y_215339;
        bool index_certs_215341;
        
        if (!bounds_check_215340) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) r_215337,
                                   "] out of bounds for array of shape [",
                                   (long long) n_196692, "].",
                                   "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        int64_t x_215342;
        
        x_215342 = ((int64_t *) mem_210394.mem)[gtid_200532 * n_196692 +
                                                r_215337];
        
        int64_t abs_arg_215343 = sub64(x_215342, min_res_215270);
        int64_t abs_res_215344 = abs64(abs_arg_215343);
        bool x_215345 = sle64((int64_t) 0, max_res_215335);
        bool y_215346 = slt64(max_res_215335, n_196692);
        bool bounds_check_215347 = x_215345 && y_215346;
        bool index_certs_215348;
        
        if (!bounds_check_215347) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) max_res_215335,
                                   "] out of bounds for array of shape [",
                                   (long long) n_196692, "].",
                                   "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        int64_t x_215349;
        
        x_215349 = ((int64_t *) mem_210394.mem)[gtid_200532 * n_196692 +
                                                max_res_215335];
        
        int64_t abs_arg_215350 = sub64(x_215349, min_res_215270);
        int64_t abs_res_215351 = abs64(abs_arg_215350);
        int64_t max_res_215352 = smax64(abs_res_215344, abs_res_215351);
        float defunc_0_f_res_215353 = sitofp_i64_f32(max_res_215352);
        float defunc_1_f_res_215354 = max_res_200546 + defunc_0_f_res_215353;
        
        ((float *) mem_210775.mem)[gtid_215268] = defunc_1_f_res_215354;
        ((int64_t *) mem_210778.mem)[gtid_215268] = max_res_215335;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228506_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228506_end -
                 futhark_mc_segmap_parloop_228506_start;
        
        ctx->futhark_mc_segmap_parloop_228506_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228506_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228506_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228504(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215267 = tid;
    int num_tasks_215361 = info.nsubtasks;
    struct futhark_mc_task_228503 *futhark_mc_task_228503 =
                                  (struct futhark_mc_task_228503 *) args;
    struct futhark_context *ctx = futhark_mc_task_228503->ctx;
    uint64_t futhark_mc_segmap_task_228504_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228504_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228503->free_n_196692;
    int64_t jump_l_196703 = futhark_mc_task_228503->free_jump_l_196703;
    int64_t l_n_m_196752 = futhark_mc_task_228503->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228503->free_i_196779;
    bool x_196780 = futhark_mc_task_228503->free_x_196780;
    int64_t min_res_196994 = futhark_mc_task_228503->free_min_res_196994;
    bool loop_cond_196999 = futhark_mc_task_228503->free_loop_cond_196999;
    int64_t gtid_200532 = futhark_mc_task_228503->free_gtid_200532;
    int64_t min_arg_200540 = futhark_mc_task_228503->free_min_arg_200540;
    int64_t min_arg_200541 = futhark_mc_task_228503->free_min_arg_200541;
    int64_t min_res_200542 = futhark_mc_task_228503->free_min_res_200542;
    float max_res_200546 = futhark_mc_task_228503->free_max_res_200546;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228503->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210772 = {.desc ="mem_210772", .mem =
                                  futhark_mc_task_228503->free_mem_210772,
                                  .size =0, .references =NULL};
    struct memblock mem_210775 = {.desc ="mem_210775", .mem =
                                  futhark_mc_task_228503->free_mem_210775,
                                  .size =0, .references =NULL};
    struct memblock mem_210778 = {.desc ="mem_210778", .mem =
                                  futhark_mc_task_228503->free_mem_210778,
                                  .size =0, .references =NULL};
    int64_t iter_215362;
    struct futhark_mc_segmap_parloop_struct_228505
    futhark_mc_segmap_parloop_struct_228505;
    
    futhark_mc_segmap_parloop_struct_228505.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228505.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228505.free_jump_l_196703 = jump_l_196703;
    futhark_mc_segmap_parloop_struct_228505.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228505.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228505.free_x_196780 = x_196780;
    futhark_mc_segmap_parloop_struct_228505.free_min_res_196994 =
        min_res_196994;
    futhark_mc_segmap_parloop_struct_228505.free_loop_cond_196999 =
        loop_cond_196999;
    futhark_mc_segmap_parloop_struct_228505.free_gtid_200532 = gtid_200532;
    futhark_mc_segmap_parloop_struct_228505.free_min_arg_200540 =
        min_arg_200540;
    futhark_mc_segmap_parloop_struct_228505.free_min_arg_200541 =
        min_arg_200541;
    futhark_mc_segmap_parloop_struct_228505.free_min_res_200542 =
        min_res_200542;
    futhark_mc_segmap_parloop_struct_228505.free_max_res_200546 =
        max_res_200546;
    futhark_mc_segmap_parloop_struct_228505.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228505.free_mem_210772 = mem_210772.mem;
    futhark_mc_segmap_parloop_struct_228505.free_mem_210775 = mem_210775.mem;
    futhark_mc_segmap_parloop_struct_228505.free_mem_210778 = mem_210778.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228506_task;
    
    futhark_mc_segmap_parloop_228506_task.name =
        "futhark_mc_segmap_parloop_228506";
    futhark_mc_segmap_parloop_228506_task.fn = futhark_mc_segmap_parloop_228506;
    futhark_mc_segmap_parloop_228506_task.args =
        &futhark_mc_segmap_parloop_struct_228505;
    futhark_mc_segmap_parloop_228506_task.iterations = iterations;
    futhark_mc_segmap_parloop_228506_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228506_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228506_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228506_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228506_task);
    
    if (futhark_mc_segmap_parloop_228506_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228506_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228506_total_end -
                 futhark_mc_segmap_parloop_228506_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228506_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228506_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228506_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228504_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228504_end -
                 futhark_mc_segmap_task_228504_start;
        
        ctx->futhark_mc_segmap_task_228504_runs[tid]++;
        ctx->futhark_mc_segmap_task_228504_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228504_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228495(void *args, int64_t start,
                                            int64_t end, int flat_tid_200531,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228494
    *futhark_mc_segmap_parloop_struct_228494 =
    (struct futhark_mc_segmap_parloop_struct_228494 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228494->ctx;
    uint64_t futhark_mc_segmap_parloop_228495_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228495_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228494->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228494->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228494->free_q_l_196697;
    int64_t jump_l_196703 =
            futhark_mc_segmap_parloop_struct_228494->free_jump_l_196703;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228494->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228494->free_i_196779;
    bool x_196780 = futhark_mc_segmap_parloop_struct_228494->free_x_196780;
    int64_t min_res_196994 =
            futhark_mc_segmap_parloop_struct_228494->free_min_res_196994;
    bool loop_cond_196999 =
         futhark_mc_segmap_parloop_struct_228494->free_loop_cond_196999;
    float i64_res_197000 =
          futhark_mc_segmap_parloop_struct_228494->free_i64_res_197000;
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_228494->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228494->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_228494->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_228494->free_bytes_210774;
    int64_t bytes_210777 =
            futhark_mc_segmap_parloop_struct_228494->free_bytes_210777;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228494->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228494->free_mem_210831,
                                  .size =0, .references =NULL};
    size_t mem_210772_cached_sizze_228496 = 0;
    unsigned char *mem_210772 = NULL;
    size_t mem_210775_cached_sizze_228497 = 0;
    unsigned char *mem_210775 = NULL;
    size_t mem_210778_cached_sizze_228498 = 0;
    unsigned char *mem_210778 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215262 = start;
    
    if (mem_210772_cached_sizze_228496 < (size_t) bytes_210356) {
        mem_210772 = realloc(mem_210772, bytes_210356);
        mem_210772_cached_sizze_228496 = bytes_210356;
    }
    if (mem_210775_cached_sizze_228497 < (size_t) bytes_210774) {
        mem_210775 = realloc(mem_210775, bytes_210774);
        mem_210775_cached_sizze_228497 = bytes_210774;
    }
    if (mem_210778_cached_sizze_228498 < (size_t) bytes_210777) {
        mem_210778 = realloc(mem_210778, bytes_210777);
        mem_210778_cached_sizze_228498 = bytes_210777;
    }
    for (; iter_215262 < end; iter_215262++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215355 = m_196691;
        int64_t gtid_200532 = iter_215262;
        int64_t remnant_215356 = iter_215262 - gtid_200532;
        int64_t x_200534;
        
        x_200534 = ((int64_t *) mem_210397.mem)[gtid_200532];
        
        int64_t flat_tid_215263 = (int64_t) 0;
        int32_t num_tasks_215357;
        struct futhark_mc_task_228499 futhark_mc_task_228499;
        
        futhark_mc_task_228499.ctx = ctx;
        futhark_mc_task_228499.free_n_196692 = n_196692;
        futhark_mc_task_228499.free_gtid_200532 = gtid_200532;
        futhark_mc_task_228499.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_228499.free_mem_210772 = mem_210772;
        
        struct scheduler_segop futhark_mc_task_228499_task;
        
        futhark_mc_task_228499_task.args = &futhark_mc_task_228499;
        futhark_mc_task_228499_task.top_level_fn =
            futhark_mc_segmap_task_228500;
        futhark_mc_task_228499_task.name = "futhark_mc_segmap_task_228500";
        futhark_mc_task_228499_task.iterations = n_196692;
        futhark_mc_task_228499_task.task_time =
            &ctx->futhark_mc_segmap_task_228500_total_time;
        futhark_mc_task_228499_task.task_iter =
            &ctx->futhark_mc_segmap_task_228500_total_iter;
        futhark_mc_task_228499_task.sched = STATIC;
        futhark_mc_task_228499_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228500_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228499_task);
        
        if (futhark_mc_segmap_task_228500_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t min_arg_200540 = sub64(x_200534, (int64_t) 1);
        int64_t min_arg_200541 = sub64(x_200534, min_res_196994);
        int64_t min_res_200542 = smin64(q_l_196697, x_200534);
        float i64_res_200543 = sitofp_i64_f32(x_200534);
        float x_200544 = i64_res_197000 - i64_res_200543;
        float max_arg_200545 = x_200544 / 2.0F;
        float max_res_200546 = fmax32(0.0F, max_arg_200545);
        int64_t flat_tid_215267 = (int64_t) 0;
        int32_t num_tasks_215361;
        struct futhark_mc_task_228503 futhark_mc_task_228503;
        
        futhark_mc_task_228503.ctx = ctx;
        futhark_mc_task_228503.free_n_196692 = n_196692;
        futhark_mc_task_228503.free_jump_l_196703 = jump_l_196703;
        futhark_mc_task_228503.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_228503.free_i_196779 = i_196779;
        futhark_mc_task_228503.free_x_196780 = x_196780;
        futhark_mc_task_228503.free_min_res_196994 = min_res_196994;
        futhark_mc_task_228503.free_loop_cond_196999 = loop_cond_196999;
        futhark_mc_task_228503.free_gtid_200532 = gtid_200532;
        futhark_mc_task_228503.free_min_arg_200540 = min_arg_200540;
        futhark_mc_task_228503.free_min_arg_200541 = min_arg_200541;
        futhark_mc_task_228503.free_min_res_200542 = min_res_200542;
        futhark_mc_task_228503.free_max_res_200546 = max_res_200546;
        futhark_mc_task_228503.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_228503.free_mem_210772 = mem_210772;
        futhark_mc_task_228503.free_mem_210775 = mem_210775;
        futhark_mc_task_228503.free_mem_210778 = mem_210778;
        
        struct scheduler_segop futhark_mc_task_228503_task;
        
        futhark_mc_task_228503_task.args = &futhark_mc_task_228503;
        futhark_mc_task_228503_task.top_level_fn =
            futhark_mc_segmap_task_228504;
        futhark_mc_task_228503_task.name = "futhark_mc_segmap_task_228504";
        futhark_mc_task_228503_task.iterations = l_n_m_196752;
        futhark_mc_task_228503_task.task_time =
            &ctx->futhark_mc_segmap_task_228504_total_time;
        futhark_mc_task_228503_task.task_iter =
            &ctx->futhark_mc_segmap_task_228504_total_iter;
        futhark_mc_task_228503_task.sched = DYNAMIC;
        futhark_mc_task_228503_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228504_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228503_task);
        
        if (futhark_mc_segmap_task_228504_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 8 > 0)
            memmove(mem_210827.mem + gtid_200532 * l_n_m_196752 * (int64_t) 8,
                    mem_210778 + (int64_t) 0, l_n_m_196752 * (int64_t) 8);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_210831.mem + gtid_200532 * l_n_m_196752 * (int64_t) 4,
                    mem_210775 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210772);
    free(mem_210775);
    free(mem_210778);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228495_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228495_end -
                 futhark_mc_segmap_parloop_228495_start;
        
        ctx->futhark_mc_segmap_parloop_228495_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228495_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228495_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228493(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200531 = tid;
    int num_tasks_215152 = info.nsubtasks;
    struct futhark_mc_task_228486 *futhark_mc_task_228486 =
                                  (struct futhark_mc_task_228486 *) args;
    struct futhark_context *ctx = futhark_mc_task_228486->ctx;
    uint64_t futhark_mc_segmap_nested_task_228493_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228493_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228486->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228486->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228486->free_q_l_196697;
    int64_t jump_l_196703 = futhark_mc_task_228486->free_jump_l_196703;
    int64_t l_n_m_196752 = futhark_mc_task_228486->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228486->free_i_196779;
    bool x_196780 = futhark_mc_task_228486->free_x_196780;
    int64_t min_res_196994 = futhark_mc_task_228486->free_min_res_196994;
    bool loop_cond_196999 = futhark_mc_task_228486->free_loop_cond_196999;
    float i64_res_197000 = futhark_mc_task_228486->free_i64_res_197000;
    int64_t bytes_210356 = futhark_mc_task_228486->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228486->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_228486->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210774 = futhark_mc_task_228486->free_bytes_210774;
    int64_t bytes_210777 = futhark_mc_task_228486->free_bytes_210777;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228486->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228486->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t iter_215262;
    struct futhark_mc_segmap_parloop_struct_228494
    futhark_mc_segmap_parloop_struct_228494;
    
    futhark_mc_segmap_parloop_struct_228494.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228494.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228494.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228494.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228494.free_jump_l_196703 = jump_l_196703;
    futhark_mc_segmap_parloop_struct_228494.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228494.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228494.free_x_196780 = x_196780;
    futhark_mc_segmap_parloop_struct_228494.free_min_res_196994 =
        min_res_196994;
    futhark_mc_segmap_parloop_struct_228494.free_loop_cond_196999 =
        loop_cond_196999;
    futhark_mc_segmap_parloop_struct_228494.free_i64_res_197000 =
        i64_res_197000;
    futhark_mc_segmap_parloop_struct_228494.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_228494.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228494.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_228494.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_228494.free_bytes_210777 = bytes_210777;
    futhark_mc_segmap_parloop_struct_228494.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228494.free_mem_210831 = mem_210831.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228495_task;
    
    futhark_mc_segmap_parloop_228495_task.name =
        "futhark_mc_segmap_parloop_228495";
    futhark_mc_segmap_parloop_228495_task.fn = futhark_mc_segmap_parloop_228495;
    futhark_mc_segmap_parloop_228495_task.args =
        &futhark_mc_segmap_parloop_struct_228494;
    futhark_mc_segmap_parloop_228495_task.iterations = iterations;
    futhark_mc_segmap_parloop_228495_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228495_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228495_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228495_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228495_task);
    
    if (futhark_mc_segmap_parloop_228495_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228495_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228495_total_end -
                 futhark_mc_segmap_parloop_228495_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228495_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228495_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228495_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228493_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228493_end -
                 futhark_mc_segmap_nested_task_228493_start;
        
        ctx->futhark_mc_segmap_nested_task_228493_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228493_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228493_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228507 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_197106;
    bool free_loop_cond_197111;
    float free_i64_res_197112;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    int64_t free_bytes_210839;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
};
struct futhark_mc_segmap_parloop_struct_228509 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_197106;
    bool free_loop_cond_197111;
    float free_i64_res_197112;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    int64_t free_bytes_210839;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
};
static int futhark_mc_segmap_parloop_228510(void *args, int64_t start,
                                            int64_t end, int flat_tid_200638,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228509
    *futhark_mc_segmap_parloop_struct_228509 =
    (struct futhark_mc_segmap_parloop_struct_228509 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228509->ctx;
    uint64_t futhark_mc_segmap_parloop_228510_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228510_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228509->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228509->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_228509->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228509->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_228509->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228509->free_i_196779;
    bool x_196780 = futhark_mc_segmap_parloop_struct_228509->free_x_196780;
    int64_t min_res_197106 =
            futhark_mc_segmap_parloop_struct_228509->free_min_res_197106;
    bool loop_cond_197111 =
         futhark_mc_segmap_parloop_struct_228509->free_loop_cond_197111;
    float i64_res_197112 =
          futhark_mc_segmap_parloop_struct_228509->free_i64_res_197112;
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_228509->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228509->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_228509->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_228509->free_bytes_210836;
    int64_t bytes_210839 =
            futhark_mc_segmap_parloop_struct_228509->free_bytes_210839;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_228509->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_228509->free_mem_210893,
                                  .size =0, .references =NULL};
    size_t mem_210843_cached_sizze_228511 = 0;
    unsigned char *mem_210843 = NULL;
    size_t mem_210858_cached_sizze_228512 = 0;
    unsigned char *mem_210858 = NULL;
    size_t mem_210861_cached_sizze_228513 = 0;
    unsigned char *mem_210861 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215428 = start;
    
    if (mem_210843_cached_sizze_228511 < (size_t) bytes_210356) {
        mem_210843 = realloc(mem_210843, bytes_210356);
        mem_210843_cached_sizze_228511 = bytes_210356;
    }
    if (mem_210858_cached_sizze_228512 < (size_t) bytes_210836) {
        mem_210858 = realloc(mem_210858, bytes_210836);
        mem_210858_cached_sizze_228512 = bytes_210836;
    }
    if (mem_210861_cached_sizze_228513 < (size_t) bytes_210839) {
        mem_210861 = realloc(mem_210861, bytes_210839);
        mem_210861_cached_sizze_228513 = bytes_210839;
    }
    for (; iter_215428 < end; iter_215428++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215525 = m_196691;
        int64_t gtid_200639 = iter_215428;
        int64_t remnant_215526 = iter_215428 - gtid_200639;
        int64_t x_197116;
        
        x_197116 = ((int64_t *) mem_210397.mem)[gtid_200639];
        for (int64_t i_215429 = 0; i_215429 < n_196692; i_215429++) {
            int64_t x_215431;
            
            x_215431 = ((int64_t *) mem_210394.mem)[gtid_200639 * n_196692 +
                                                    i_215429];
            
            int64_t defunc_0_f_res_215432 = add64((int64_t) 1, x_215431);
            
            ((int64_t *) mem_210843)[i_215429] = defunc_0_f_res_215432;
        }
        
        int64_t min_arg_197120 = sub64(x_197116, (int64_t) 1);
        int64_t min_arg_197121 = sub64(x_197116, min_res_197106);
        int64_t min_res_197122 = smin64(q_t_196696, x_197116);
        float i64_res_197123 = sitofp_i64_f32(x_197116);
        float x_197124 = i64_res_197112 - i64_res_197123;
        float max_arg_197125 = x_197124 / 2.0F;
        float max_res_197126 = fmax32(0.0F, max_arg_197125);
        
        for (int64_t i_215434 = 0; i_215434 < t_n_m_196759; i_215434++) {
            int64_t min_arg_215437 = mul64(jump_t_196702, i_215434);
            int64_t min_res_215438 = smin64(i_196779, min_arg_215437);
            int64_t defunc_0_g_res_215439 = add64((int64_t) 1, min_res_215438);
            bool init_idx_215440;
            int64_t init_idx_215441;
            int64_t init_idx_215442;
            bool loop_while_215443;
            int64_t low_215444;
            int64_t high_215445;
            
            loop_while_215443 = x_196780;
            low_215444 = (int64_t) 0;
            high_215445 = i_196779;
            while (loop_while_215443) {
                int64_t x_215446 = add64(low_215444, high_215445);
                int64_t mid_215447 = sdiv64(x_215446, (int64_t) 2);
                bool x_215448 = sle64((int64_t) 0, mid_215447);
                bool y_215449 = slt64(mid_215447, n_196692);
                bool bounds_check_215450 = x_215448 && y_215449;
                bool index_certs_215451;
                
                if (!bounds_check_215450) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) mid_215447,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t mid_id_215452;
                
                mid_id_215452 = ((int64_t *) mem_210843)[mid_215447];
                
                bool cond_215453 = slt64(mid_id_215452, (int64_t) 0);
                int64_t mid_idx_215454;
                
                if (cond_215453) {
                    mid_idx_215454 = (int64_t) 9223372036854775807;
                } else {
                    mid_idx_215454 = mid_id_215452;
                }
                
                bool cond_215455 = sle64(defunc_0_g_res_215439, mid_idx_215454);
                int64_t loopres_215456;
                int64_t loopres_215457;
                
                if (cond_215455) {
                    int64_t loopres_t_res_215458 = sub64(mid_215447,
                                                         (int64_t) 1);
                    
                    loopres_215456 = low_215444;
                    loopres_215457 = loopres_t_res_215458;
                } else {
                    int64_t loopres_f_res_215459 = add64((int64_t) 1,
                                                         mid_215447);
                    
                    loopres_215456 = loopres_f_res_215459;
                    loopres_215457 = high_215445;
                }
                
                bool loop_cond_215460 = sle64(loopres_215456, loopres_215457);
                bool loop_while_tmp_215530 = loop_cond_215460;
                int64_t low_tmp_215531 = loopres_215456;
                int64_t high_tmp_215532 = loopres_215457;
                
                loop_while_215443 = loop_while_tmp_215530;
                low_215444 = low_tmp_215531;
                high_215445 = high_tmp_215532;
            }
            init_idx_215440 = loop_while_215443;
            init_idx_215441 = low_215444;
            init_idx_215442 = high_215445;
            
            bool idx_215461;
            int64_t idx_215462;
            int64_t idx_215463;
            int64_t idx_215464;
            bool loop_while_215465;
            int64_t l_idx_215466;
            int64_t r_idx_215467;
            int64_t span_215468;
            
            loop_while_215465 = loop_cond_197111;
            l_idx_215466 = init_idx_215441;
            r_idx_215467 = init_idx_215441;
            span_215468 = (int64_t) 1;
            while (loop_while_215465) {
                int64_t max_arg_215469 = sub64(l_idx_215466, (int64_t) 1);
                int64_t max_res_215470 = smax64((int64_t) 0, max_arg_215469);
                int64_t min_arg_215471 = add64((int64_t) 1, r_idx_215467);
                int64_t min_res_215472 = smin64(min_arg_197120, min_arg_215471);
                bool x_215473 = sle64((int64_t) 0, max_res_215470);
                bool y_215474 = slt64(max_res_215470, n_196692);
                bool bounds_check_215475 = x_215473 && y_215474;
                bool index_certs_215476;
                
                if (!bounds_check_215475) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) max_res_215470,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_215477;
                
                x_215477 = ((int64_t *) mem_210843)[max_res_215470];
                
                int64_t abs_arg_215478 = sub64(x_215477, defunc_0_g_res_215439);
                int64_t abs_res_215479 = abs64(abs_arg_215478);
                bool x_215480 = sle64((int64_t) 0, min_res_215472);
                bool y_215481 = slt64(min_res_215472, n_196692);
                bool bounds_check_215482 = x_215480 && y_215481;
                bool index_certs_215483;
                
                if (!bounds_check_215482) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) min_res_215472,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_215484;
                
                x_215484 = ((int64_t *) mem_210843)[min_res_215472];
                
                int64_t abs_arg_215485 = sub64(x_215484, defunc_0_g_res_215439);
                int64_t abs_res_215486 = abs64(abs_arg_215485);
                bool cond_215487 = max_res_215470 == l_idx_215466;
                int64_t loopres_215488;
                int64_t loopres_215489;
                int64_t loopres_215490;
                
                if (cond_215487) {
                    loopres_215488 = l_idx_215466;
                    loopres_215489 = r_idx_215467;
                    loopres_215490 = min_res_197106;
                } else {
                    bool cond_215491 = slt64(abs_res_215479, abs_res_215486);
                    bool cond_f_res_215492 = min_res_215472 == r_idx_215467;
                    bool x_215493 = !cond_215491;
                    bool y_215494 = cond_f_res_215492 && x_215493;
                    bool cond_215495 = cond_215491 || y_215494;
                    int64_t loopres_f_res_215496;
                    
                    if (cond_215495) {
                        loopres_f_res_215496 = max_res_215470;
                    } else {
                        loopres_f_res_215496 = l_idx_215466;
                    }
                    
                    int64_t loopres_f_res_215497;
                    
                    if (cond_215495) {
                        loopres_f_res_215497 = r_idx_215467;
                    } else {
                        loopres_f_res_215497 = min_res_215472;
                    }
                    
                    int64_t loopres_f_res_215498;
                    
                    if (cond_215495) {
                        int64_t loopres_f_res_t_res_215499 = add64((int64_t) 1,
                                                                   span_215468);
                        
                        loopres_f_res_215498 = loopres_f_res_t_res_215499;
                    } else {
                        int64_t loopres_f_res_f_res_215500 = add64((int64_t) 1,
                                                                   span_215468);
                        
                        loopres_f_res_215498 = loopres_f_res_f_res_215500;
                    }
                    loopres_215488 = loopres_f_res_215496;
                    loopres_215489 = loopres_f_res_215497;
                    loopres_215490 = loopres_f_res_215498;
                }
                
                bool loop_cond_215501 = slt64(loopres_215490, min_res_197106);
                bool loop_while_tmp_215533 = loop_cond_215501;
                int64_t l_idx_tmp_215534 = loopres_215488;
                int64_t r_idx_tmp_215535 = loopres_215489;
                int64_t span_tmp_215536 = loopres_215490;
                
                loop_while_215465 = loop_while_tmp_215533;
                l_idx_215466 = l_idx_tmp_215534;
                r_idx_215467 = r_idx_tmp_215535;
                span_215468 = span_tmp_215536;
            }
            idx_215461 = loop_while_215465;
            idx_215462 = l_idx_215466;
            idx_215463 = r_idx_215467;
            idx_215464 = span_215468;
            
            int64_t min_res_215502 = smin64(min_arg_197121, idx_215462);
            int64_t max_res_215503 = smax64((int64_t) 0, min_res_215502);
            int64_t x_215504 = add64(min_res_197122, max_res_215503);
            int64_t r_215505 = sub64(x_215504, (int64_t) 1);
            bool x_215506 = sle64((int64_t) 0, r_215505);
            bool y_215507 = slt64(r_215505, n_196692);
            bool bounds_check_215508 = x_215506 && y_215507;
            bool index_certs_215509;
            
            if (!bounds_check_215508) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) r_215505,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215510;
            
            x_215510 = ((int64_t *) mem_210394.mem)[gtid_200639 * n_196692 +
                                                    r_215505];
            
            int64_t abs_arg_215511 = sub64(x_215510, min_res_215438);
            int64_t abs_res_215512 = abs64(abs_arg_215511);
            bool x_215513 = sle64((int64_t) 0, max_res_215503);
            bool y_215514 = slt64(max_res_215503, n_196692);
            bool bounds_check_215515 = x_215513 && y_215514;
            bool index_certs_215516;
            
            if (!bounds_check_215515) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) max_res_215503,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215517;
            
            x_215517 = ((int64_t *) mem_210394.mem)[gtid_200639 * n_196692 +
                                                    max_res_215503];
            
            int64_t abs_arg_215518 = sub64(x_215517, min_res_215438);
            int64_t abs_res_215519 = abs64(abs_arg_215518);
            int64_t max_res_215520 = smax64(abs_res_215512, abs_res_215519);
            float defunc_0_f_res_215521 = sitofp_i64_f32(max_res_215520);
            float defunc_1_f_res_215522 = max_res_197126 +
                  defunc_0_f_res_215521;
            
            ((float *) mem_210858)[i_215434] = defunc_1_f_res_215522;
            ((int64_t *) mem_210861)[i_215434] = max_res_215503;
        }
        if (t_n_m_196759 * (int64_t) 8 > 0)
            memmove(mem_210889.mem + gtid_200639 * t_n_m_196759 * (int64_t) 8,
                    mem_210861 + (int64_t) 0, t_n_m_196759 * (int64_t) 8);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_210893.mem + gtid_200639 * t_n_m_196759 * (int64_t) 4,
                    mem_210858 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210843);
    free(mem_210858);
    free(mem_210861);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228510_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228510_end -
                 futhark_mc_segmap_parloop_228510_start;
        
        ctx->futhark_mc_segmap_parloop_228510_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228510_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228510_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228508(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200638 = tid;
    int num_tasks_215427 = info.nsubtasks;
    struct futhark_mc_task_228507 *futhark_mc_task_228507 =
                                  (struct futhark_mc_task_228507 *) args;
    struct futhark_context *ctx = futhark_mc_task_228507->ctx;
    uint64_t futhark_mc_segmap_task_228508_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228508_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228507->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228507->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_228507->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_228507->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_228507->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_228507->free_i_196779;
    bool x_196780 = futhark_mc_task_228507->free_x_196780;
    int64_t min_res_197106 = futhark_mc_task_228507->free_min_res_197106;
    bool loop_cond_197111 = futhark_mc_task_228507->free_loop_cond_197111;
    float i64_res_197112 = futhark_mc_task_228507->free_i64_res_197112;
    int64_t bytes_210356 = futhark_mc_task_228507->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228507->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_228507->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_228507->free_bytes_210836;
    int64_t bytes_210839 = futhark_mc_task_228507->free_bytes_210839;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_228507->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_228507->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t iter_215428;
    struct futhark_mc_segmap_parloop_struct_228509
    futhark_mc_segmap_parloop_struct_228509;
    
    futhark_mc_segmap_parloop_struct_228509.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228509.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228509.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228509.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_228509.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228509.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_228509.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228509.free_x_196780 = x_196780;
    futhark_mc_segmap_parloop_struct_228509.free_min_res_197106 =
        min_res_197106;
    futhark_mc_segmap_parloop_struct_228509.free_loop_cond_197111 =
        loop_cond_197111;
    futhark_mc_segmap_parloop_struct_228509.free_i64_res_197112 =
        i64_res_197112;
    futhark_mc_segmap_parloop_struct_228509.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_228509.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228509.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_228509.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_228509.free_bytes_210839 = bytes_210839;
    futhark_mc_segmap_parloop_struct_228509.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_228509.free_mem_210893 = mem_210893.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228510_task;
    
    futhark_mc_segmap_parloop_228510_task.name =
        "futhark_mc_segmap_parloop_228510";
    futhark_mc_segmap_parloop_228510_task.fn = futhark_mc_segmap_parloop_228510;
    futhark_mc_segmap_parloop_228510_task.args =
        &futhark_mc_segmap_parloop_struct_228509;
    futhark_mc_segmap_parloop_228510_task.iterations = iterations;
    futhark_mc_segmap_parloop_228510_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228510_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228510_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228510_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228510_task);
    
    if (futhark_mc_segmap_parloop_228510_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228510_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228510_total_end -
                 futhark_mc_segmap_parloop_228510_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228510_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228510_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228510_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228508_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228508_end -
                 futhark_mc_segmap_task_228508_start;
        
        ctx->futhark_mc_segmap_task_228508_runs[tid]++;
        ctx->futhark_mc_segmap_task_228508_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228508_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228515 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_197106;
    bool free_loop_cond_197111;
    float free_i64_res_197112;
    int64_t free_bytes_210356;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    int64_t free_bytes_210839;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
};
struct futhark_mc_task_228520 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_200647;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210834;
};
struct futhark_mc_segmap_parloop_struct_228522 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_200647;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210834;
};
static int futhark_mc_segmap_parloop_228523(void *args, int64_t start,
                                            int64_t end, int flat_tid_215538,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228522
    *futhark_mc_segmap_parloop_struct_228522 =
    (struct futhark_mc_segmap_parloop_struct_228522 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228522->ctx;
    uint64_t futhark_mc_segmap_parloop_228523_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228523_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228522->free_n_196692;
    int64_t gtid_200647 =
            futhark_mc_segmap_parloop_struct_228522->free_gtid_200647;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228522->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210834 = {.desc ="mem_210834", .mem =
                                  futhark_mc_segmap_parloop_struct_228522->free_mem_210834,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215633 = start;
    
    for (; iter_215633 < end; iter_215633++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215634 = n_196692;
        int64_t gtid_215539 = iter_215633;
        int64_t remnant_215635 = iter_215633 - gtid_215539;
        int64_t x_215540;
        
        x_215540 = ((int64_t *) mem_210394.mem)[gtid_200647 * n_196692 +
                                                gtid_215539];
        
        int64_t defunc_0_f_res_215541 = add64((int64_t) 1, x_215540);
        
        ((int64_t *) mem_210834.mem)[gtid_215539] = defunc_0_f_res_215541;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228523_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228523_end -
                 futhark_mc_segmap_parloop_228523_start;
        
        ctx->futhark_mc_segmap_parloop_228523_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228523_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228523_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228521(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215538 = tid;
    int num_tasks_215632 = info.nsubtasks;
    struct futhark_mc_task_228520 *futhark_mc_task_228520 =
                                  (struct futhark_mc_task_228520 *) args;
    struct futhark_context *ctx = futhark_mc_task_228520->ctx;
    uint64_t futhark_mc_segmap_task_228521_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228521_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228520->free_n_196692;
    int64_t gtid_200647 = futhark_mc_task_228520->free_gtid_200647;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228520->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210834 = {.desc ="mem_210834", .mem =
                                  futhark_mc_task_228520->free_mem_210834,
                                  .size =0, .references =NULL};
    int64_t iter_215633;
    struct futhark_mc_segmap_parloop_struct_228522
    futhark_mc_segmap_parloop_struct_228522;
    
    futhark_mc_segmap_parloop_struct_228522.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228522.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228522.free_gtid_200647 = gtid_200647;
    futhark_mc_segmap_parloop_struct_228522.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228522.free_mem_210834 = mem_210834.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228523_task;
    
    futhark_mc_segmap_parloop_228523_task.name =
        "futhark_mc_segmap_parloop_228523";
    futhark_mc_segmap_parloop_228523_task.fn = futhark_mc_segmap_parloop_228523;
    futhark_mc_segmap_parloop_228523_task.args =
        &futhark_mc_segmap_parloop_struct_228522;
    futhark_mc_segmap_parloop_228523_task.iterations = iterations;
    futhark_mc_segmap_parloop_228523_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228523_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228523_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228523_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228523_task);
    
    if (futhark_mc_segmap_parloop_228523_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228523_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228523_total_end -
                 futhark_mc_segmap_parloop_228523_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228523_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228523_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228523_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228521_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228521_end -
                 futhark_mc_segmap_task_228521_start;
        
        ctx->futhark_mc_segmap_task_228521_runs[tid]++;
        ctx->futhark_mc_segmap_task_228521_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228521_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228524 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_197106;
    bool free_loop_cond_197111;
    int64_t free_gtid_200647;
    int64_t free_min_arg_200655;
    int64_t free_min_arg_200656;
    int64_t free_min_res_200657;
    float free_max_res_200661;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210834;
    unsigned char *free_mem_210837;
    unsigned char *free_mem_210840;
};
struct futhark_mc_segmap_parloop_struct_228526 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    bool free_x_196780;
    int64_t free_min_res_197106;
    bool free_loop_cond_197111;
    int64_t free_gtid_200647;
    int64_t free_min_arg_200655;
    int64_t free_min_arg_200656;
    int64_t free_min_res_200657;
    float free_max_res_200661;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210834;
    unsigned char *free_mem_210837;
    unsigned char *free_mem_210840;
};
static int futhark_mc_segmap_parloop_228527(void *args, int64_t start,
                                            int64_t end, int flat_tid_215542,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228526
    *futhark_mc_segmap_parloop_struct_228526 =
    (struct futhark_mc_segmap_parloop_struct_228526 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228526->ctx;
    uint64_t futhark_mc_segmap_parloop_228527_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228527_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228526->free_n_196692;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228526->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_228526->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228526->free_i_196779;
    bool x_196780 = futhark_mc_segmap_parloop_struct_228526->free_x_196780;
    int64_t min_res_197106 =
            futhark_mc_segmap_parloop_struct_228526->free_min_res_197106;
    bool loop_cond_197111 =
         futhark_mc_segmap_parloop_struct_228526->free_loop_cond_197111;
    int64_t gtid_200647 =
            futhark_mc_segmap_parloop_struct_228526->free_gtid_200647;
    int64_t min_arg_200655 =
            futhark_mc_segmap_parloop_struct_228526->free_min_arg_200655;
    int64_t min_arg_200656 =
            futhark_mc_segmap_parloop_struct_228526->free_min_arg_200656;
    int64_t min_res_200657 =
            futhark_mc_segmap_parloop_struct_228526->free_min_res_200657;
    float max_res_200661 =
          futhark_mc_segmap_parloop_struct_228526->free_max_res_200661;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228526->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210834 = {.desc ="mem_210834", .mem =
                                  futhark_mc_segmap_parloop_struct_228526->free_mem_210834,
                                  .size =0, .references =NULL};
    struct memblock mem_210837 = {.desc ="mem_210837", .mem =
                                  futhark_mc_segmap_parloop_struct_228526->free_mem_210837,
                                  .size =0, .references =NULL};
    struct memblock mem_210840 = {.desc ="mem_210840", .mem =
                                  futhark_mc_segmap_parloop_struct_228526->free_mem_210840,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215637 = start;
    
    for (; iter_215637 < end; iter_215637++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215693 = t_n_m_196759;
        int64_t gtid_215543 = iter_215637;
        int64_t remnant_215694 = iter_215637 - gtid_215543;
        int64_t min_arg_215544 = mul64(jump_t_196702, gtid_215543);
        int64_t min_res_215545 = smin64(i_196779, min_arg_215544);
        int64_t defunc_0_g_res_215546 = add64((int64_t) 1, min_res_215545);
        bool init_idx_215547;
        int64_t init_idx_215548;
        int64_t init_idx_215549;
        bool loop_while_215638;
        int64_t low_215639;
        int64_t high_215640;
        
        loop_while_215638 = x_196780;
        low_215639 = (int64_t) 0;
        high_215640 = i_196779;
        while (loop_while_215638) {
            int64_t x_215641 = add64(low_215639, high_215640);
            int64_t mid_215642 = sdiv64(x_215641, (int64_t) 2);
            bool x_215643 = sle64((int64_t) 0, mid_215642);
            bool y_215644 = slt64(mid_215642, n_196692);
            bool bounds_check_215645 = x_215643 && y_215644;
            bool index_certs_215646;
            
            if (!bounds_check_215645) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) mid_215642,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t mid_id_215647;
            
            mid_id_215647 = ((int64_t *) mem_210834.mem)[mid_215642];
            
            bool cond_215648 = slt64(mid_id_215647, (int64_t) 0);
            int64_t mid_idx_215649;
            
            if (cond_215648) {
                mid_idx_215649 = (int64_t) 9223372036854775807;
            } else {
                mid_idx_215649 = mid_id_215647;
            }
            
            bool cond_215650 = sle64(defunc_0_g_res_215546, mid_idx_215649);
            int64_t loopres_215651;
            int64_t loopres_215652;
            
            if (cond_215650) {
                int64_t loopres_t_res_215653 = sub64(mid_215642, (int64_t) 1);
                
                loopres_215651 = low_215639;
                loopres_215652 = loopres_t_res_215653;
            } else {
                int64_t loopres_f_res_215654 = add64((int64_t) 1, mid_215642);
                
                loopres_215651 = loopres_f_res_215654;
                loopres_215652 = high_215640;
            }
            
            bool loop_cond_215655 = sle64(loopres_215651, loopres_215652);
            bool loop_while_tmp_215695 = loop_cond_215655;
            int64_t low_tmp_215696 = loopres_215651;
            int64_t high_tmp_215697 = loopres_215652;
            
            loop_while_215638 = loop_while_tmp_215695;
            low_215639 = low_tmp_215696;
            high_215640 = high_tmp_215697;
        }
        init_idx_215547 = loop_while_215638;
        init_idx_215548 = low_215639;
        init_idx_215549 = high_215640;
        
        bool idx_215568;
        int64_t idx_215569;
        int64_t idx_215570;
        int64_t idx_215571;
        bool loop_while_215656;
        int64_t l_idx_215657;
        int64_t r_idx_215658;
        int64_t span_215659;
        
        loop_while_215656 = loop_cond_197111;
        l_idx_215657 = init_idx_215548;
        r_idx_215658 = init_idx_215548;
        span_215659 = (int64_t) 1;
        while (loop_while_215656) {
            int64_t max_arg_215660 = sub64(l_idx_215657, (int64_t) 1);
            int64_t max_res_215661 = smax64((int64_t) 0, max_arg_215660);
            int64_t min_arg_215662 = add64((int64_t) 1, r_idx_215658);
            int64_t min_res_215663 = smin64(min_arg_200655, min_arg_215662);
            bool x_215664 = sle64((int64_t) 0, max_res_215661);
            bool y_215665 = slt64(max_res_215661, n_196692);
            bool bounds_check_215666 = x_215664 && y_215665;
            bool index_certs_215667;
            
            if (!bounds_check_215666) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) max_res_215661,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215668;
            
            x_215668 = ((int64_t *) mem_210834.mem)[max_res_215661];
            
            int64_t abs_arg_215669 = sub64(x_215668, defunc_0_g_res_215546);
            int64_t abs_res_215670 = abs64(abs_arg_215669);
            bool x_215671 = sle64((int64_t) 0, min_res_215663);
            bool y_215672 = slt64(min_res_215663, n_196692);
            bool bounds_check_215673 = x_215671 && y_215672;
            bool index_certs_215674;
            
            if (!bounds_check_215673) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) min_res_215663,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            int64_t x_215675;
            
            x_215675 = ((int64_t *) mem_210834.mem)[min_res_215663];
            
            int64_t abs_arg_215676 = sub64(x_215675, defunc_0_g_res_215546);
            int64_t abs_res_215677 = abs64(abs_arg_215676);
            bool cond_215678 = max_res_215661 == l_idx_215657;
            int64_t loopres_215679;
            int64_t loopres_215680;
            int64_t loopres_215681;
            
            if (cond_215678) {
                loopres_215679 = l_idx_215657;
                loopres_215680 = r_idx_215658;
                loopres_215681 = min_res_197106;
            } else {
                bool cond_215682 = slt64(abs_res_215670, abs_res_215677);
                bool cond_f_res_215683 = min_res_215663 == r_idx_215658;
                bool x_215684 = !cond_215682;
                bool y_215685 = cond_f_res_215683 && x_215684;
                bool cond_215686 = cond_215682 || y_215685;
                int64_t loopres_f_res_215687;
                
                if (cond_215686) {
                    loopres_f_res_215687 = max_res_215661;
                } else {
                    loopres_f_res_215687 = l_idx_215657;
                }
                
                int64_t loopres_f_res_215688;
                
                if (cond_215686) {
                    loopres_f_res_215688 = r_idx_215658;
                } else {
                    loopres_f_res_215688 = min_res_215663;
                }
                
                int64_t loopres_f_res_215689;
                
                if (cond_215686) {
                    int64_t loopres_f_res_t_res_215690 = add64((int64_t) 1,
                                                               span_215659);
                    
                    loopres_f_res_215689 = loopres_f_res_t_res_215690;
                } else {
                    int64_t loopres_f_res_f_res_215691 = add64((int64_t) 1,
                                                               span_215659);
                    
                    loopres_f_res_215689 = loopres_f_res_f_res_215691;
                }
                loopres_215679 = loopres_f_res_215687;
                loopres_215680 = loopres_f_res_215688;
                loopres_215681 = loopres_f_res_215689;
            }
            
            bool loop_cond_215692 = slt64(loopres_215681, min_res_197106);
            bool loop_while_tmp_215698 = loop_cond_215692;
            int64_t l_idx_tmp_215699 = loopres_215679;
            int64_t r_idx_tmp_215700 = loopres_215680;
            int64_t span_tmp_215701 = loopres_215681;
            
            loop_while_215656 = loop_while_tmp_215698;
            l_idx_215657 = l_idx_tmp_215699;
            r_idx_215658 = r_idx_tmp_215700;
            span_215659 = span_tmp_215701;
        }
        idx_215568 = loop_while_215656;
        idx_215569 = l_idx_215657;
        idx_215570 = r_idx_215658;
        idx_215571 = span_215659;
        
        int64_t min_res_215609 = smin64(min_arg_200656, idx_215569);
        int64_t max_res_215610 = smax64((int64_t) 0, min_res_215609);
        int64_t x_215611 = add64(min_res_200657, max_res_215610);
        int64_t r_215612 = sub64(x_215611, (int64_t) 1);
        bool x_215613 = sle64((int64_t) 0, r_215612);
        bool y_215614 = slt64(r_215612, n_196692);
        bool bounds_check_215615 = x_215613 && y_215614;
        bool index_certs_215616;
        
        if (!bounds_check_215615) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) r_215612,
                                   "] out of bounds for array of shape [",
                                   (long long) n_196692, "].",
                                   "-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        int64_t x_215617;
        
        x_215617 = ((int64_t *) mem_210394.mem)[gtid_200647 * n_196692 +
                                                r_215612];
        
        int64_t abs_arg_215618 = sub64(x_215617, min_res_215545);
        int64_t abs_res_215619 = abs64(abs_arg_215618);
        bool x_215620 = sle64((int64_t) 0, max_res_215610);
        bool y_215621 = slt64(max_res_215610, n_196692);
        bool bounds_check_215622 = x_215620 && y_215621;
        bool index_certs_215623;
        
        if (!bounds_check_215622) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) max_res_215610,
                                   "] out of bounds for array of shape [",
                                   (long long) n_196692, "].",
                                   "-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        int64_t x_215624;
        
        x_215624 = ((int64_t *) mem_210394.mem)[gtid_200647 * n_196692 +
                                                max_res_215610];
        
        int64_t abs_arg_215625 = sub64(x_215624, min_res_215545);
        int64_t abs_res_215626 = abs64(abs_arg_215625);
        int64_t max_res_215627 = smax64(abs_res_215619, abs_res_215626);
        float defunc_0_f_res_215628 = sitofp_i64_f32(max_res_215627);
        float defunc_1_f_res_215629 = max_res_200661 + defunc_0_f_res_215628;
        
        ((float *) mem_210837.mem)[gtid_215543] = defunc_1_f_res_215629;
        ((int64_t *) mem_210840.mem)[gtid_215543] = max_res_215610;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228527_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228527_end -
                 futhark_mc_segmap_parloop_228527_start;
        
        ctx->futhark_mc_segmap_parloop_228527_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228527_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228527_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228525(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215542 = tid;
    int num_tasks_215636 = info.nsubtasks;
    struct futhark_mc_task_228524 *futhark_mc_task_228524 =
                                  (struct futhark_mc_task_228524 *) args;
    struct futhark_context *ctx = futhark_mc_task_228524->ctx;
    uint64_t futhark_mc_segmap_task_228525_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228525_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228524->free_n_196692;
    int64_t jump_t_196702 = futhark_mc_task_228524->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_228524->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_228524->free_i_196779;
    bool x_196780 = futhark_mc_task_228524->free_x_196780;
    int64_t min_res_197106 = futhark_mc_task_228524->free_min_res_197106;
    bool loop_cond_197111 = futhark_mc_task_228524->free_loop_cond_197111;
    int64_t gtid_200647 = futhark_mc_task_228524->free_gtid_200647;
    int64_t min_arg_200655 = futhark_mc_task_228524->free_min_arg_200655;
    int64_t min_arg_200656 = futhark_mc_task_228524->free_min_arg_200656;
    int64_t min_res_200657 = futhark_mc_task_228524->free_min_res_200657;
    float max_res_200661 = futhark_mc_task_228524->free_max_res_200661;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228524->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210834 = {.desc ="mem_210834", .mem =
                                  futhark_mc_task_228524->free_mem_210834,
                                  .size =0, .references =NULL};
    struct memblock mem_210837 = {.desc ="mem_210837", .mem =
                                  futhark_mc_task_228524->free_mem_210837,
                                  .size =0, .references =NULL};
    struct memblock mem_210840 = {.desc ="mem_210840", .mem =
                                  futhark_mc_task_228524->free_mem_210840,
                                  .size =0, .references =NULL};
    int64_t iter_215637;
    struct futhark_mc_segmap_parloop_struct_228526
    futhark_mc_segmap_parloop_struct_228526;
    
    futhark_mc_segmap_parloop_struct_228526.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228526.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228526.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228526.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_228526.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228526.free_x_196780 = x_196780;
    futhark_mc_segmap_parloop_struct_228526.free_min_res_197106 =
        min_res_197106;
    futhark_mc_segmap_parloop_struct_228526.free_loop_cond_197111 =
        loop_cond_197111;
    futhark_mc_segmap_parloop_struct_228526.free_gtid_200647 = gtid_200647;
    futhark_mc_segmap_parloop_struct_228526.free_min_arg_200655 =
        min_arg_200655;
    futhark_mc_segmap_parloop_struct_228526.free_min_arg_200656 =
        min_arg_200656;
    futhark_mc_segmap_parloop_struct_228526.free_min_res_200657 =
        min_res_200657;
    futhark_mc_segmap_parloop_struct_228526.free_max_res_200661 =
        max_res_200661;
    futhark_mc_segmap_parloop_struct_228526.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228526.free_mem_210834 = mem_210834.mem;
    futhark_mc_segmap_parloop_struct_228526.free_mem_210837 = mem_210837.mem;
    futhark_mc_segmap_parloop_struct_228526.free_mem_210840 = mem_210840.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228527_task;
    
    futhark_mc_segmap_parloop_228527_task.name =
        "futhark_mc_segmap_parloop_228527";
    futhark_mc_segmap_parloop_228527_task.fn = futhark_mc_segmap_parloop_228527;
    futhark_mc_segmap_parloop_228527_task.args =
        &futhark_mc_segmap_parloop_struct_228526;
    futhark_mc_segmap_parloop_228527_task.iterations = iterations;
    futhark_mc_segmap_parloop_228527_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228527_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228527_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228527_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228527_task);
    
    if (futhark_mc_segmap_parloop_228527_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228527_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228527_total_end -
                 futhark_mc_segmap_parloop_228527_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228527_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228527_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228527_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228525_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228525_end -
                 futhark_mc_segmap_task_228525_start;
        
        ctx->futhark_mc_segmap_task_228525_runs[tid]++;
        ctx->futhark_mc_segmap_task_228525_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228525_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228516(void *args, int64_t start,
                                            int64_t end, int flat_tid_200646,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228515
    *futhark_mc_segmap_parloop_struct_228515 =
    (struct futhark_mc_segmap_parloop_struct_228515 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228515->ctx;
    uint64_t futhark_mc_segmap_parloop_228516_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228516_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228515->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228515->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_228515->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228515->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_228515->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228515->free_i_196779;
    bool x_196780 = futhark_mc_segmap_parloop_struct_228515->free_x_196780;
    int64_t min_res_197106 =
            futhark_mc_segmap_parloop_struct_228515->free_min_res_197106;
    bool loop_cond_197111 =
         futhark_mc_segmap_parloop_struct_228515->free_loop_cond_197111;
    float i64_res_197112 =
          futhark_mc_segmap_parloop_struct_228515->free_i64_res_197112;
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_228515->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_228515->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_228515->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_228515->free_bytes_210836;
    int64_t bytes_210839 =
            futhark_mc_segmap_parloop_struct_228515->free_bytes_210839;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_228515->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_228515->free_mem_210893,
                                  .size =0, .references =NULL};
    size_t mem_210834_cached_sizze_228517 = 0;
    unsigned char *mem_210834 = NULL;
    size_t mem_210837_cached_sizze_228518 = 0;
    unsigned char *mem_210837 = NULL;
    size_t mem_210840_cached_sizze_228519 = 0;
    unsigned char *mem_210840 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215537 = start;
    
    if (mem_210834_cached_sizze_228517 < (size_t) bytes_210356) {
        mem_210834 = realloc(mem_210834, bytes_210356);
        mem_210834_cached_sizze_228517 = bytes_210356;
    }
    if (mem_210837_cached_sizze_228518 < (size_t) bytes_210836) {
        mem_210837 = realloc(mem_210837, bytes_210836);
        mem_210837_cached_sizze_228518 = bytes_210836;
    }
    if (mem_210840_cached_sizze_228519 < (size_t) bytes_210839) {
        mem_210840 = realloc(mem_210840, bytes_210839);
        mem_210840_cached_sizze_228519 = bytes_210839;
    }
    for (; iter_215537 < end; iter_215537++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215630 = m_196691;
        int64_t gtid_200647 = iter_215537;
        int64_t remnant_215631 = iter_215537 - gtid_200647;
        int64_t x_200649;
        
        x_200649 = ((int64_t *) mem_210397.mem)[gtid_200647];
        
        int64_t flat_tid_215538 = (int64_t) 0;
        int32_t num_tasks_215632;
        struct futhark_mc_task_228520 futhark_mc_task_228520;
        
        futhark_mc_task_228520.ctx = ctx;
        futhark_mc_task_228520.free_n_196692 = n_196692;
        futhark_mc_task_228520.free_gtid_200647 = gtid_200647;
        futhark_mc_task_228520.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_228520.free_mem_210834 = mem_210834;
        
        struct scheduler_segop futhark_mc_task_228520_task;
        
        futhark_mc_task_228520_task.args = &futhark_mc_task_228520;
        futhark_mc_task_228520_task.top_level_fn =
            futhark_mc_segmap_task_228521;
        futhark_mc_task_228520_task.name = "futhark_mc_segmap_task_228521";
        futhark_mc_task_228520_task.iterations = n_196692;
        futhark_mc_task_228520_task.task_time =
            &ctx->futhark_mc_segmap_task_228521_total_time;
        futhark_mc_task_228520_task.task_iter =
            &ctx->futhark_mc_segmap_task_228521_total_iter;
        futhark_mc_task_228520_task.sched = STATIC;
        futhark_mc_task_228520_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228521_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228520_task);
        
        if (futhark_mc_segmap_task_228521_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t min_arg_200655 = sub64(x_200649, (int64_t) 1);
        int64_t min_arg_200656 = sub64(x_200649, min_res_197106);
        int64_t min_res_200657 = smin64(q_t_196696, x_200649);
        float i64_res_200658 = sitofp_i64_f32(x_200649);
        float x_200659 = i64_res_197112 - i64_res_200658;
        float max_arg_200660 = x_200659 / 2.0F;
        float max_res_200661 = fmax32(0.0F, max_arg_200660);
        int64_t flat_tid_215542 = (int64_t) 0;
        int32_t num_tasks_215636;
        struct futhark_mc_task_228524 futhark_mc_task_228524;
        
        futhark_mc_task_228524.ctx = ctx;
        futhark_mc_task_228524.free_n_196692 = n_196692;
        futhark_mc_task_228524.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_228524.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_228524.free_i_196779 = i_196779;
        futhark_mc_task_228524.free_x_196780 = x_196780;
        futhark_mc_task_228524.free_min_res_197106 = min_res_197106;
        futhark_mc_task_228524.free_loop_cond_197111 = loop_cond_197111;
        futhark_mc_task_228524.free_gtid_200647 = gtid_200647;
        futhark_mc_task_228524.free_min_arg_200655 = min_arg_200655;
        futhark_mc_task_228524.free_min_arg_200656 = min_arg_200656;
        futhark_mc_task_228524.free_min_res_200657 = min_res_200657;
        futhark_mc_task_228524.free_max_res_200661 = max_res_200661;
        futhark_mc_task_228524.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_228524.free_mem_210834 = mem_210834;
        futhark_mc_task_228524.free_mem_210837 = mem_210837;
        futhark_mc_task_228524.free_mem_210840 = mem_210840;
        
        struct scheduler_segop futhark_mc_task_228524_task;
        
        futhark_mc_task_228524_task.args = &futhark_mc_task_228524;
        futhark_mc_task_228524_task.top_level_fn =
            futhark_mc_segmap_task_228525;
        futhark_mc_task_228524_task.name = "futhark_mc_segmap_task_228525";
        futhark_mc_task_228524_task.iterations = t_n_m_196759;
        futhark_mc_task_228524_task.task_time =
            &ctx->futhark_mc_segmap_task_228525_total_time;
        futhark_mc_task_228524_task.task_iter =
            &ctx->futhark_mc_segmap_task_228525_total_iter;
        futhark_mc_task_228524_task.sched = DYNAMIC;
        futhark_mc_task_228524_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228525_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228524_task);
        
        if (futhark_mc_segmap_task_228525_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 8 > 0)
            memmove(mem_210889.mem + gtid_200647 * t_n_m_196759 * (int64_t) 8,
                    mem_210840 + (int64_t) 0, t_n_m_196759 * (int64_t) 8);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_210893.mem + gtid_200647 * t_n_m_196759 * (int64_t) 4,
                    mem_210837 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210834);
    free(mem_210837);
    free(mem_210840);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228516_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228516_end -
                 futhark_mc_segmap_parloop_228516_start;
        
        ctx->futhark_mc_segmap_parloop_228516_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228516_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228516_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228514(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200646 = tid;
    int num_tasks_215427 = info.nsubtasks;
    struct futhark_mc_task_228507 *futhark_mc_task_228507 =
                                  (struct futhark_mc_task_228507 *) args;
    struct futhark_context *ctx = futhark_mc_task_228507->ctx;
    uint64_t futhark_mc_segmap_nested_task_228514_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228514_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228507->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228507->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_228507->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_228507->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_228507->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_228507->free_i_196779;
    bool x_196780 = futhark_mc_task_228507->free_x_196780;
    int64_t min_res_197106 = futhark_mc_task_228507->free_min_res_197106;
    bool loop_cond_197111 = futhark_mc_task_228507->free_loop_cond_197111;
    float i64_res_197112 = futhark_mc_task_228507->free_i64_res_197112;
    int64_t bytes_210356 = futhark_mc_task_228507->free_bytes_210356;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_228507->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_228507->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_228507->free_bytes_210836;
    int64_t bytes_210839 = futhark_mc_task_228507->free_bytes_210839;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_228507->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_228507->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t iter_215537;
    struct futhark_mc_segmap_parloop_struct_228515
    futhark_mc_segmap_parloop_struct_228515;
    
    futhark_mc_segmap_parloop_struct_228515.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228515.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228515.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228515.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_228515.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228515.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_228515.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228515.free_x_196780 = x_196780;
    futhark_mc_segmap_parloop_struct_228515.free_min_res_197106 =
        min_res_197106;
    futhark_mc_segmap_parloop_struct_228515.free_loop_cond_197111 =
        loop_cond_197111;
    futhark_mc_segmap_parloop_struct_228515.free_i64_res_197112 =
        i64_res_197112;
    futhark_mc_segmap_parloop_struct_228515.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_228515.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_228515.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_228515.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_228515.free_bytes_210839 = bytes_210839;
    futhark_mc_segmap_parloop_struct_228515.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_228515.free_mem_210893 = mem_210893.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228516_task;
    
    futhark_mc_segmap_parloop_228516_task.name =
        "futhark_mc_segmap_parloop_228516";
    futhark_mc_segmap_parloop_228516_task.fn = futhark_mc_segmap_parloop_228516;
    futhark_mc_segmap_parloop_228516_task.args =
        &futhark_mc_segmap_parloop_struct_228515;
    futhark_mc_segmap_parloop_228516_task.iterations = iterations;
    futhark_mc_segmap_parloop_228516_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228516_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228516_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228516_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228516_task);
    
    if (futhark_mc_segmap_parloop_228516_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228516_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228516_total_end -
                 futhark_mc_segmap_parloop_228516_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228516_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228516_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228516_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228514_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228514_end -
                 futhark_mc_segmap_nested_task_228514_start;
        
        ctx->futhark_mc_segmap_nested_task_228514_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228514_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228514_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228528 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    int64_t free_ctx_param_ext_210943;
    unsigned char *free_mem_param_210947;
    int64_t free_bytes_210949;
    unsigned char *free_mem_210969;
};
struct futhark_mc_segmap_parloop_struct_228530 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    int64_t free_ctx_param_ext_210943;
    unsigned char *free_mem_param_210947;
    int64_t free_bytes_210949;
    unsigned char *free_mem_210969;
};
static int futhark_mc_segmap_parloop_228531(void *args, int64_t start,
                                            int64_t end, int flat_tid_200753,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228530
    *futhark_mc_segmap_parloop_struct_228530 =
    (struct futhark_mc_segmap_parloop_struct_228530 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228530->ctx;
    uint64_t futhark_mc_segmap_parloop_228531_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228531_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228530->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228530->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228530->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t ctx_param_ext_210943 =
            futhark_mc_segmap_parloop_struct_228530->free_ctx_param_ext_210943;
    struct memblock mem_param_210947 = {.desc ="mem_param_210947", .mem =
                                        futhark_mc_segmap_parloop_struct_228530->free_mem_param_210947,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_228530->free_bytes_210949;
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228530->free_mem_210969,
                                  .size =0, .references =NULL};
    size_t mem_210953_cached_sizze_228532 = 0;
    unsigned char *mem_210953 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215728 = start;
    
    if (mem_210953_cached_sizze_228532 < (size_t) bytes_210949) {
        mem_210953 = realloc(mem_210953, bytes_210949);
        mem_210953_cached_sizze_228532 = bytes_210949;
    }
    for (; iter_215728 < end; iter_215728++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215735 = m_196691;
        int64_t gtid_200754 = iter_215728;
        int64_t remnant_215736 = iter_215728 - gtid_200754;
        
        for (int64_t i_215729 = 0; i_215729 < n_196692; i_215729++) {
            float x_215731;
            
            x_215731 = ((float *) Y_mem_210354.mem)[gtid_200754 * n_196692 +
                                                    i_215729];
            
            float x_215732;
            
            x_215732 = ((float *) mem_param_210947.mem)[gtid_200754 *
                                                        ctx_param_ext_210943 +
                                                        i_215729];
            
            float defunc_1_f_res_215733 = x_215731 - x_215732;
            
            ((float *) mem_210953)[i_215729] = defunc_1_f_res_215733;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_210969.mem + gtid_200754 * n_196692 * (int64_t) 4,
                    mem_210953 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210953);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228531_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228531_end -
                 futhark_mc_segmap_parloop_228531_start;
        
        ctx->futhark_mc_segmap_parloop_228531_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228531_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228531_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228529(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200753 = tid;
    int num_tasks_215727 = info.nsubtasks;
    struct futhark_mc_task_228528 *futhark_mc_task_228528 =
                                  (struct futhark_mc_task_228528 *) args;
    struct futhark_context *ctx = futhark_mc_task_228528->ctx;
    uint64_t futhark_mc_segmap_task_228529_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228529_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228528->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228528->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228528->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t ctx_param_ext_210943 =
            futhark_mc_task_228528->free_ctx_param_ext_210943;
    struct memblock mem_param_210947 = {.desc ="mem_param_210947", .mem =
                                        futhark_mc_task_228528->free_mem_param_210947,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_228528->free_bytes_210949;
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228528->free_mem_210969,
                                  .size =0, .references =NULL};
    int64_t iter_215728;
    struct futhark_mc_segmap_parloop_struct_228530
    futhark_mc_segmap_parloop_struct_228530;
    
    futhark_mc_segmap_parloop_struct_228530.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228530.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228530.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228530.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228530.free_ctx_param_ext_210943 =
        ctx_param_ext_210943;
    futhark_mc_segmap_parloop_struct_228530.free_mem_param_210947 =
        mem_param_210947.mem;
    futhark_mc_segmap_parloop_struct_228530.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_228530.free_mem_210969 = mem_210969.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228531_task;
    
    futhark_mc_segmap_parloop_228531_task.name =
        "futhark_mc_segmap_parloop_228531";
    futhark_mc_segmap_parloop_228531_task.fn = futhark_mc_segmap_parloop_228531;
    futhark_mc_segmap_parloop_228531_task.args =
        &futhark_mc_segmap_parloop_struct_228530;
    futhark_mc_segmap_parloop_228531_task.iterations = iterations;
    futhark_mc_segmap_parloop_228531_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228531_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228531_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228531_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228531_task);
    
    if (futhark_mc_segmap_parloop_228531_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228531_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228531_total_end -
                 futhark_mc_segmap_parloop_228531_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228531_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228531_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228531_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228529_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228529_end -
                 futhark_mc_segmap_task_228529_start;
        
        ctx->futhark_mc_segmap_task_228529_runs[tid]++;
        ctx->futhark_mc_segmap_task_228529_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228529_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228534 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    int64_t free_ctx_param_ext_210943;
    unsigned char *free_mem_param_210947;
    int64_t free_bytes_210949;
    unsigned char *free_mem_210969;
};
struct futhark_mc_task_228537 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_200760;
    unsigned char *free_Y_mem_210354;
    int64_t free_ctx_param_ext_210943;
    unsigned char *free_mem_param_210947;
    unsigned char *free_mem_210950;
};
struct futhark_mc_segmap_parloop_struct_228539 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_200760;
    unsigned char *free_Y_mem_210354;
    int64_t free_ctx_param_ext_210943;
    unsigned char *free_mem_param_210947;
    unsigned char *free_mem_210950;
};
static int futhark_mc_segmap_parloop_228540(void *args, int64_t start,
                                            int64_t end, int flat_tid_215739,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228539
    *futhark_mc_segmap_parloop_struct_228539 =
    (struct futhark_mc_segmap_parloop_struct_228539 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228539->ctx;
    uint64_t futhark_mc_segmap_parloop_228540_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228540_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228539->free_n_196692;
    int64_t gtid_200760 =
            futhark_mc_segmap_parloop_struct_228539->free_gtid_200760;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228539->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t ctx_param_ext_210943 =
            futhark_mc_segmap_parloop_struct_228539->free_ctx_param_ext_210943;
    struct memblock mem_param_210947 = {.desc ="mem_param_210947", .mem =
                                        futhark_mc_segmap_parloop_struct_228539->free_mem_param_210947,
                                        .size =0, .references =NULL};
    struct memblock mem_210950 = {.desc ="mem_210950", .mem =
                                  futhark_mc_segmap_parloop_struct_228539->free_mem_210950,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215747 = start;
    
    for (; iter_215747 < end; iter_215747++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215748 = n_196692;
        int64_t gtid_215740 = iter_215747;
        int64_t remnant_215749 = iter_215747 - gtid_215740;
        float x_215741;
        
        x_215741 = ((float *) Y_mem_210354.mem)[gtid_200760 * n_196692 +
                                                gtid_215740];
        
        float x_215742;
        
        x_215742 = ((float *) mem_param_210947.mem)[gtid_200760 *
                                                    ctx_param_ext_210943 +
                                                    gtid_215740];
        
        float defunc_1_f_res_215743 = x_215741 - x_215742;
        
        ((float *) mem_210950.mem)[gtid_215740] = defunc_1_f_res_215743;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228540_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228540_end -
                 futhark_mc_segmap_parloop_228540_start;
        
        ctx->futhark_mc_segmap_parloop_228540_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228540_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228540_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228538(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215739 = tid;
    int num_tasks_215746 = info.nsubtasks;
    struct futhark_mc_task_228537 *futhark_mc_task_228537 =
                                  (struct futhark_mc_task_228537 *) args;
    struct futhark_context *ctx = futhark_mc_task_228537->ctx;
    uint64_t futhark_mc_segmap_task_228538_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228538_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228537->free_n_196692;
    int64_t gtid_200760 = futhark_mc_task_228537->free_gtid_200760;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228537->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t ctx_param_ext_210943 =
            futhark_mc_task_228537->free_ctx_param_ext_210943;
    struct memblock mem_param_210947 = {.desc ="mem_param_210947", .mem =
                                        futhark_mc_task_228537->free_mem_param_210947,
                                        .size =0, .references =NULL};
    struct memblock mem_210950 = {.desc ="mem_210950", .mem =
                                  futhark_mc_task_228537->free_mem_210950,
                                  .size =0, .references =NULL};
    int64_t iter_215747;
    struct futhark_mc_segmap_parloop_struct_228539
    futhark_mc_segmap_parloop_struct_228539;
    
    futhark_mc_segmap_parloop_struct_228539.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228539.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228539.free_gtid_200760 = gtid_200760;
    futhark_mc_segmap_parloop_struct_228539.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228539.free_ctx_param_ext_210943 =
        ctx_param_ext_210943;
    futhark_mc_segmap_parloop_struct_228539.free_mem_param_210947 =
        mem_param_210947.mem;
    futhark_mc_segmap_parloop_struct_228539.free_mem_210950 = mem_210950.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228540_task;
    
    futhark_mc_segmap_parloop_228540_task.name =
        "futhark_mc_segmap_parloop_228540";
    futhark_mc_segmap_parloop_228540_task.fn = futhark_mc_segmap_parloop_228540;
    futhark_mc_segmap_parloop_228540_task.args =
        &futhark_mc_segmap_parloop_struct_228539;
    futhark_mc_segmap_parloop_228540_task.iterations = iterations;
    futhark_mc_segmap_parloop_228540_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228540_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228540_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228540_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228540_task);
    
    if (futhark_mc_segmap_parloop_228540_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228540_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228540_total_end -
                 futhark_mc_segmap_parloop_228540_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228540_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228540_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228540_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228538_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228538_end -
                 futhark_mc_segmap_task_228538_start;
        
        ctx->futhark_mc_segmap_task_228538_runs[tid]++;
        ctx->futhark_mc_segmap_task_228538_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228538_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228535(void *args, int64_t start,
                                            int64_t end, int flat_tid_200759,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228534
    *futhark_mc_segmap_parloop_struct_228534 =
    (struct futhark_mc_segmap_parloop_struct_228534 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228534->ctx;
    uint64_t futhark_mc_segmap_parloop_228535_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228535_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228534->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228534->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_228534->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t ctx_param_ext_210943 =
            futhark_mc_segmap_parloop_struct_228534->free_ctx_param_ext_210943;
    struct memblock mem_param_210947 = {.desc ="mem_param_210947", .mem =
                                        futhark_mc_segmap_parloop_struct_228534->free_mem_param_210947,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_228534->free_bytes_210949;
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228534->free_mem_210969,
                                  .size =0, .references =NULL};
    size_t mem_210950_cached_sizze_228536 = 0;
    unsigned char *mem_210950 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215738 = start;
    
    if (mem_210950_cached_sizze_228536 < (size_t) bytes_210949) {
        mem_210950 = realloc(mem_210950, bytes_210949);
        mem_210950_cached_sizze_228536 = bytes_210949;
    }
    for (; iter_215738 < end; iter_215738++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215744 = m_196691;
        int64_t gtid_200760 = iter_215738;
        int64_t remnant_215745 = iter_215738 - gtid_200760;
        int64_t flat_tid_215739 = (int64_t) 0;
        int32_t num_tasks_215746;
        struct futhark_mc_task_228537 futhark_mc_task_228537;
        
        futhark_mc_task_228537.ctx = ctx;
        futhark_mc_task_228537.free_n_196692 = n_196692;
        futhark_mc_task_228537.free_gtid_200760 = gtid_200760;
        futhark_mc_task_228537.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_228537.free_ctx_param_ext_210943 = ctx_param_ext_210943;
        futhark_mc_task_228537.free_mem_param_210947 = mem_param_210947.mem;
        futhark_mc_task_228537.free_mem_210950 = mem_210950;
        
        struct scheduler_segop futhark_mc_task_228537_task;
        
        futhark_mc_task_228537_task.args = &futhark_mc_task_228537;
        futhark_mc_task_228537_task.top_level_fn =
            futhark_mc_segmap_task_228538;
        futhark_mc_task_228537_task.name = "futhark_mc_segmap_task_228538";
        futhark_mc_task_228537_task.iterations = n_196692;
        futhark_mc_task_228537_task.task_time =
            &ctx->futhark_mc_segmap_task_228538_total_time;
        futhark_mc_task_228537_task.task_iter =
            &ctx->futhark_mc_segmap_task_228538_total_iter;
        futhark_mc_task_228537_task.sched = STATIC;
        futhark_mc_task_228537_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228538_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228537_task);
        
        if (futhark_mc_segmap_task_228538_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_210969.mem + gtid_200760 * n_196692 * (int64_t) 4,
                    mem_210950 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_210950);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228535_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228535_end -
                 futhark_mc_segmap_parloop_228535_start;
        
        ctx->futhark_mc_segmap_parloop_228535_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228535_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228535_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228533(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200759 = tid;
    int num_tasks_215727 = info.nsubtasks;
    struct futhark_mc_task_228528 *futhark_mc_task_228528 =
                                  (struct futhark_mc_task_228528 *) args;
    struct futhark_context *ctx = futhark_mc_task_228528->ctx;
    uint64_t futhark_mc_segmap_nested_task_228533_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228533_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228528->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228528->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_228528->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t ctx_param_ext_210943 =
            futhark_mc_task_228528->free_ctx_param_ext_210943;
    struct memblock mem_param_210947 = {.desc ="mem_param_210947", .mem =
                                        futhark_mc_task_228528->free_mem_param_210947,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_228528->free_bytes_210949;
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228528->free_mem_210969,
                                  .size =0, .references =NULL};
    int64_t iter_215738;
    struct futhark_mc_segmap_parloop_struct_228534
    futhark_mc_segmap_parloop_struct_228534;
    
    futhark_mc_segmap_parloop_struct_228534.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228534.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228534.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228534.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_228534.free_ctx_param_ext_210943 =
        ctx_param_ext_210943;
    futhark_mc_segmap_parloop_struct_228534.free_mem_param_210947 =
        mem_param_210947.mem;
    futhark_mc_segmap_parloop_struct_228534.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_228534.free_mem_210969 = mem_210969.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228535_task;
    
    futhark_mc_segmap_parloop_228535_task.name =
        "futhark_mc_segmap_parloop_228535";
    futhark_mc_segmap_parloop_228535_task.fn = futhark_mc_segmap_parloop_228535;
    futhark_mc_segmap_parloop_228535_task.args =
        &futhark_mc_segmap_parloop_struct_228534;
    futhark_mc_segmap_parloop_228535_task.iterations = iterations;
    futhark_mc_segmap_parloop_228535_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228535_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228535_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228535_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228535_task);
    
    if (futhark_mc_segmap_parloop_228535_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228535_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228535_total_end -
                 futhark_mc_segmap_parloop_228535_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228535_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228535_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228535_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228533_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228533_end -
                 futhark_mc_segmap_nested_task_228533_start;
        
        ctx->futhark_mc_segmap_nested_task_228533_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228533_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228533_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228541 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_bytes_210399;
    int64_t free_bytes_210418;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
};
struct futhark_mc_segmap_parloop_struct_228543 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_bytes_210418;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
};
static int futhark_mc_segmap_parloop_228544(void *args, int64_t start,
                                            int64_t end, int flat_tid_200769,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228543
    *futhark_mc_segmap_parloop_struct_228543 =
    (struct futhark_mc_segmap_parloop_struct_228543 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228543->ctx;
    uint64_t futhark_mc_segmap_parloop_228544_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228544_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228543->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228543->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228543->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228543->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228543->free_i_196779;
    int64_t bytes_210418 =
            futhark_mc_segmap_parloop_struct_228543->free_bytes_210418;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228543->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228543->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228543->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228543->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228543->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228543->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228543->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228543->free_mem_211111,
                                  .size =0, .references =NULL};
    size_t mem_211017_cached_sizze_228545 = 0;
    unsigned char *mem_211017 = NULL;
    size_t mem_211021_cached_sizze_228546 = 0;
    unsigned char *mem_211021 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215751 = start;
    
    if (mem_211017_cached_sizze_228545 < (size_t) bytes_210418) {
        mem_211017 = realloc(mem_211017, bytes_210418);
        mem_211017_cached_sizze_228545 = bytes_210418;
    }
    if (mem_211021_cached_sizze_228546 < (size_t) bytes_210418) {
        mem_211021 = realloc(mem_211021, bytes_210418);
        mem_211021_cached_sizze_228546 = bytes_210418;
    }
    for (; iter_215751 < end; iter_215751++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215778 = m_196691;
        int64_t gtid_200770 = iter_215751;
        int64_t remnant_215779 = iter_215751 - gtid_200770;
        
        for (int64_t i_215752 = 0; i_215752 < n_p_196694; i_215752++) {
            for (int64_t i_215757 = 0; i_215757 < defunc_0_f_res_196740;
                 i_215757++) {
                int64_t x_215760;
                
                x_215760 = ((int64_t *) mem_210590.mem)[gtid_200770 *
                                                        (defunc_0_f_res_196740 *
                                                         n_p_196694) +
                                                        i_215752 *
                                                        defunc_0_f_res_196740 +
                                                        i_215757];
                
                int64_t x_215761 = mul64(n_p_196694, x_215760);
                int64_t idx_215762 = add64(x_215761, i_215752);
                bool cond_215763 = slt64(i_196779, idx_215762);
                bool cond_f_res_215764 = slt64(x_215760, (int64_t) 0);
                bool x_215765 = !cond_215763;
                bool y_215766 = cond_f_res_215764 && x_215765;
                bool cond_215767 = cond_215763 || y_215766;
                float defunc_0_f_res_215768;
                float defunc_0_f_res_215769;
                
                if (cond_215767) {
                    defunc_0_f_res_215768 = 0.0F;
                    defunc_0_f_res_215769 = 0.0F;
                } else {
                    bool x_215770 = sle64((int64_t) 0, idx_215762);
                    bool y_215771 = slt64(idx_215762, n_196692);
                    bool bounds_check_215772 = x_215770 && y_215771;
                    bool index_certs_215773;
                    
                    if (!bounds_check_215772) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) idx_215762,
                                      "] out of bounds for array of shape [",
                                      (long long) n_196692, "].",
                                      "-> #0  stl.fut:193:42-57\n   #1  stl.fut:188:28-194:44\n   #2  /prelude/soacs.fut:67:19-23\n   #3  /prelude/soacs.fut:67:3-37\n   #4  stl.fut:186:21-195:50\n   #5  /prelude/soacs.fut:75:22-28\n   #6  /prelude/soacs.fut:75:3-45\n   #7  stl.fut:184:13-196:57\n   #8  stl.fut:401:3-415:29\n   #9  stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    float defunc_0_f_res_f_res_215774;
                    
                    defunc_0_f_res_f_res_215774 =
                        ((float *) mem_210969.mem)[gtid_200770 * n_196692 +
                                                   idx_215762];
                    
                    float defunc_0_f_res_f_res_215775;
                    
                    defunc_0_f_res_f_res_215775 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_200770 *
                                                          ctx_param_ext_210921 +
                                                          idx_215762 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_215768 = defunc_0_f_res_f_res_215774;
                    defunc_0_f_res_215769 = defunc_0_f_res_f_res_215775;
                }
                ((float *) mem_211017)[i_215752 * defunc_0_f_res_196740 +
                                       i_215757] = defunc_0_f_res_215768;
                ((float *) mem_211021)[i_215752 * defunc_0_f_res_196740 +
                                       i_215757] = defunc_0_f_res_215769;
            }
        }
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211106.mem + gtid_200770 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_211017 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 4);
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211111.mem + gtid_200770 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_211021 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211017);
    free(mem_211021);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228544_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228544_end -
                 futhark_mc_segmap_parloop_228544_start;
        
        ctx->futhark_mc_segmap_parloop_228544_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228544_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228544_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228542(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200769 = tid;
    int num_tasks_215750 = info.nsubtasks;
    struct futhark_mc_task_228541 *futhark_mc_task_228541 =
                                  (struct futhark_mc_task_228541 *) args;
    struct futhark_context *ctx = futhark_mc_task_228541->ctx;
    uint64_t futhark_mc_segmap_task_228542_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228542_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228541->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228541->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228541->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228541->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228541->free_i_196779;
    int64_t bytes_210399 = futhark_mc_task_228541->free_bytes_210399;
    int64_t bytes_210418 = futhark_mc_task_228541->free_bytes_210418;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228541->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228541->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228541->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228541->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228541->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228541->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228541->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228541->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t iter_215751;
    struct futhark_mc_segmap_parloop_struct_228543
    futhark_mc_segmap_parloop_struct_228543;
    
    futhark_mc_segmap_parloop_struct_228543.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228543.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228543.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228543.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228543.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228543.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228543.free_bytes_210418 = bytes_210418;
    futhark_mc_segmap_parloop_struct_228543.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228543.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228543.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228543.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228543.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228543.free_mem_210969 = mem_210969.mem;
    futhark_mc_segmap_parloop_struct_228543.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228543.free_mem_211111 = mem_211111.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228544_task;
    
    futhark_mc_segmap_parloop_228544_task.name =
        "futhark_mc_segmap_parloop_228544";
    futhark_mc_segmap_parloop_228544_task.fn = futhark_mc_segmap_parloop_228544;
    futhark_mc_segmap_parloop_228544_task.args =
        &futhark_mc_segmap_parloop_struct_228543;
    futhark_mc_segmap_parloop_228544_task.iterations = iterations;
    futhark_mc_segmap_parloop_228544_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228544_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228544_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228544_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228544_task);
    
    if (futhark_mc_segmap_parloop_228544_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228544_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228544_total_end -
                 futhark_mc_segmap_parloop_228544_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228544_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228544_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228544_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228542_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228542_end -
                 futhark_mc_segmap_task_228542_start;
        
        ctx->futhark_mc_segmap_task_228542_runs[tid]++;
        ctx->futhark_mc_segmap_task_228542_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228542_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228548 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_bytes_210399;
    int64_t free_bytes_210418;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
};
struct futhark_mc_task_228552 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200804;
    int64_t free_bytes_210399;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    unsigned char *free_mem_211009;
    unsigned char *free_mem_211013;
};
struct futhark_mc_segmap_parloop_struct_228554 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200804;
    int64_t free_bytes_210399;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    unsigned char *free_mem_211009;
    unsigned char *free_mem_211013;
};
static int futhark_mc_segmap_parloop_228555(void *args, int64_t start,
                                            int64_t end, int flat_tid_215809,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228554
    *futhark_mc_segmap_parloop_struct_228554 =
    (struct futhark_mc_segmap_parloop_struct_228554 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228554->ctx;
    uint64_t futhark_mc_segmap_parloop_228555_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228555_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228554->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228554->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228554->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228554->free_i_196779;
    int64_t gtid_200804 =
            futhark_mc_segmap_parloop_struct_228554->free_gtid_200804;
    int64_t bytes_210399 =
            futhark_mc_segmap_parloop_struct_228554->free_bytes_210399;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228554->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228554->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228554->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228554->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228554->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228554->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211009 = {.desc ="mem_211009", .mem =
                                  futhark_mc_segmap_parloop_struct_228554->free_mem_211009,
                                  .size =0, .references =NULL};
    struct memblock mem_211013 = {.desc ="mem_211013", .mem =
                                  futhark_mc_segmap_parloop_struct_228554->free_mem_211013,
                                  .size =0, .references =NULL};
    size_t mem_215811_cached_sizze_228556 = 0;
    unsigned char *mem_215811 = NULL;
    size_t mem_215813_cached_sizze_228557 = 0;
    unsigned char *mem_215813 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215841 = start;
    
    if (mem_215811_cached_sizze_228556 < (size_t) bytes_210399) {
        mem_215811 = realloc(mem_215811, bytes_210399);
        mem_215811_cached_sizze_228556 = bytes_210399;
    }
    if (mem_215813_cached_sizze_228557 < (size_t) bytes_210399) {
        mem_215813 = realloc(mem_215813, bytes_210399);
        mem_215813_cached_sizze_228557 = bytes_210399;
    }
    for (; iter_215841 < end; iter_215841++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215863 = n_p_196694;
        int64_t gtid_215810 = iter_215841;
        int64_t remnant_215864 = iter_215841 - gtid_215810;
        
        for (int64_t i_215842 = 0; i_215842 < defunc_0_f_res_196740;
             i_215842++) {
            int64_t x_215845;
            
            x_215845 = ((int64_t *) mem_210590.mem)[gtid_200804 *
                                                    (defunc_0_f_res_196740 *
                                                     n_p_196694) + gtid_215810 *
                                                    defunc_0_f_res_196740 +
                                                    i_215842];
            
            int64_t x_215846 = mul64(n_p_196694, x_215845);
            int64_t idx_215847 = add64(gtid_215810, x_215846);
            bool cond_215848 = slt64(i_196779, idx_215847);
            bool cond_f_res_215849 = slt64(x_215845, (int64_t) 0);
            bool x_215850 = !cond_215848;
            bool y_215851 = cond_f_res_215849 && x_215850;
            bool cond_215852 = cond_215848 || y_215851;
            float defunc_0_f_res_215853;
            float defunc_0_f_res_215854;
            
            if (cond_215852) {
                defunc_0_f_res_215853 = 0.0F;
                defunc_0_f_res_215854 = 0.0F;
            } else {
                bool x_215855 = sle64((int64_t) 0, idx_215847);
                bool y_215856 = slt64(idx_215847, n_196692);
                bool bounds_check_215857 = x_215855 && y_215856;
                bool index_certs_215858;
                
                if (!bounds_check_215857) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) idx_215847,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  stl.fut:193:42-57\n   #1  stl.fut:188:28-194:44\n   #2  /prelude/soacs.fut:67:19-23\n   #3  /prelude/soacs.fut:67:3-37\n   #4  stl.fut:186:21-195:50\n   #5  /prelude/soacs.fut:75:22-28\n   #6  /prelude/soacs.fut:75:3-45\n   #7  stl.fut:184:13-196:57\n   #8  stl.fut:401:3-415:29\n   #9  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_f_res_215859;
                
                defunc_0_f_res_f_res_215859 =
                    ((float *) mem_210969.mem)[gtid_200804 * n_196692 +
                                               idx_215847];
                
                float defunc_0_f_res_f_res_215860;
                
                defunc_0_f_res_f_res_215860 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_200804 *
                                                      ctx_param_ext_210921 +
                                                      idx_215847 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_215853 = defunc_0_f_res_f_res_215859;
                defunc_0_f_res_215854 = defunc_0_f_res_f_res_215860;
            }
            ((float *) mem_215811)[i_215842] = defunc_0_f_res_215853;
            ((float *) mem_215813)[i_215842] = defunc_0_f_res_215854;
        }
        if (defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211009.mem + gtid_215810 * defunc_0_f_res_196740 *
                    (int64_t) 4, mem_215811 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 4);
        if (defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211013.mem + gtid_215810 * defunc_0_f_res_196740 *
                    (int64_t) 4, mem_215813 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_215811);
    free(mem_215813);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228555_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228555_end -
                 futhark_mc_segmap_parloop_228555_start;
        
        ctx->futhark_mc_segmap_parloop_228555_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228555_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228555_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228553(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215809 = tid;
    int num_tasks_215840 = info.nsubtasks;
    struct futhark_mc_task_228552 *futhark_mc_task_228552 =
                                  (struct futhark_mc_task_228552 *) args;
    struct futhark_context *ctx = futhark_mc_task_228552->ctx;
    uint64_t futhark_mc_segmap_task_228553_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228553_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228552->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228552->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228552->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228552->free_i_196779;
    int64_t gtid_200804 = futhark_mc_task_228552->free_gtid_200804;
    int64_t bytes_210399 = futhark_mc_task_228552->free_bytes_210399;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228552->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228552->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228552->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228552->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228552->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228552->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211009 = {.desc ="mem_211009", .mem =
                                  futhark_mc_task_228552->free_mem_211009,
                                  .size =0, .references =NULL};
    struct memblock mem_211013 = {.desc ="mem_211013", .mem =
                                  futhark_mc_task_228552->free_mem_211013,
                                  .size =0, .references =NULL};
    int64_t iter_215841;
    struct futhark_mc_segmap_parloop_struct_228554
    futhark_mc_segmap_parloop_struct_228554;
    
    futhark_mc_segmap_parloop_struct_228554.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228554.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228554.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228554.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228554.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228554.free_gtid_200804 = gtid_200804;
    futhark_mc_segmap_parloop_struct_228554.free_bytes_210399 = bytes_210399;
    futhark_mc_segmap_parloop_struct_228554.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228554.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228554.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228554.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228554.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228554.free_mem_210969 = mem_210969.mem;
    futhark_mc_segmap_parloop_struct_228554.free_mem_211009 = mem_211009.mem;
    futhark_mc_segmap_parloop_struct_228554.free_mem_211013 = mem_211013.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228555_task;
    
    futhark_mc_segmap_parloop_228555_task.name =
        "futhark_mc_segmap_parloop_228555";
    futhark_mc_segmap_parloop_228555_task.fn = futhark_mc_segmap_parloop_228555;
    futhark_mc_segmap_parloop_228555_task.args =
        &futhark_mc_segmap_parloop_struct_228554;
    futhark_mc_segmap_parloop_228555_task.iterations = iterations;
    futhark_mc_segmap_parloop_228555_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228555_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228555_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228555_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228555_task);
    
    if (futhark_mc_segmap_parloop_228555_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228555_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228555_total_end -
                 futhark_mc_segmap_parloop_228555_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228555_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228555_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228555_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228553_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228553_end -
                 futhark_mc_segmap_task_228553_start;
        
        ctx->futhark_mc_segmap_task_228553_runs[tid]++;
        ctx->futhark_mc_segmap_task_228553_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228553_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228559 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200804;
    int64_t free_bytes_210399;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    unsigned char *free_mem_211009;
    unsigned char *free_mem_211013;
};
struct futhark_mc_task_228563 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200804;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    int64_t free_gtid_215786;
    unsigned char *free_mem_215787;
    unsigned char *free_mem_215788;
};
struct futhark_mc_segmap_parloop_struct_228565 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_i_196779;
    int64_t free_gtid_200804;
    unsigned char *free_mem_210590;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_210969;
    int64_t free_gtid_215786;
    unsigned char *free_mem_215787;
    unsigned char *free_mem_215788;
};
static int futhark_mc_segmap_parloop_228566(void *args, int64_t start,
                                            int64_t end, int flat_tid_215868,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228565
    *futhark_mc_segmap_parloop_struct_228565 =
    (struct futhark_mc_segmap_parloop_struct_228565 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228565->ctx;
    uint64_t futhark_mc_segmap_parloop_228566_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228566_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228565->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228565->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228565->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228565->free_i_196779;
    int64_t gtid_200804 =
            futhark_mc_segmap_parloop_struct_228565->free_gtid_200804;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228565->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228565->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228565->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228565->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228565->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228565->free_mem_210969,
                                  .size =0, .references =NULL};
    int64_t gtid_215786 =
            futhark_mc_segmap_parloop_struct_228565->free_gtid_215786;
    struct memblock mem_215787 = {.desc ="mem_215787", .mem =
                                  futhark_mc_segmap_parloop_struct_228565->free_mem_215787,
                                  .size =0, .references =NULL};
    struct memblock mem_215788 = {.desc ="mem_215788", .mem =
                                  futhark_mc_segmap_parloop_struct_228565->free_mem_215788,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_215889 = start;
    
    for (; iter_215889 < end; iter_215889++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215896 = defunc_0_f_res_196740;
        int64_t gtid_215869 = iter_215889;
        int64_t remnant_215897 = iter_215889 - gtid_215869;
        int64_t x_215870;
        
        x_215870 = ((int64_t *) mem_210590.mem)[gtid_200804 *
                                                (defunc_0_f_res_196740 *
                                                 n_p_196694) + gtid_215786 *
                                                defunc_0_f_res_196740 +
                                                gtid_215869];
        
        int64_t x_215871 = mul64(n_p_196694, x_215870);
        int64_t idx_215872 = add64(gtid_215786, x_215871);
        bool cond_215873 = slt64(i_196779, idx_215872);
        bool cond_f_res_215874 = slt64(x_215870, (int64_t) 0);
        bool x_215875 = !cond_215873;
        bool y_215876 = cond_f_res_215874 && x_215875;
        bool cond_215877 = cond_215873 || y_215876;
        float defunc_0_f_res_215878;
        float defunc_0_f_res_215879;
        
        if (cond_215877) {
            defunc_0_f_res_215878 = 0.0F;
            defunc_0_f_res_215879 = 0.0F;
        } else {
            bool x_215890 = sle64((int64_t) 0, idx_215872);
            bool y_215891 = slt64(idx_215872, n_196692);
            bool bounds_check_215892 = x_215890 && y_215891;
            bool index_certs_215893;
            
            if (!bounds_check_215892) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) idx_215872,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  stl.fut:193:42-57\n   #1  stl.fut:188:28-194:44\n   #2  /prelude/soacs.fut:67:19-23\n   #3  /prelude/soacs.fut:67:3-37\n   #4  stl.fut:186:21-195:50\n   #5  /prelude/soacs.fut:75:22-28\n   #6  /prelude/soacs.fut:75:3-45\n   #7  stl.fut:184:13-196:57\n   #8  stl.fut:401:3-415:29\n   #9  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_f_res_215894;
            
            defunc_0_f_res_f_res_215894 =
                ((float *) mem_210969.mem)[gtid_200804 * n_196692 + idx_215872];
            
            float defunc_0_f_res_f_res_215895;
            
            defunc_0_f_res_f_res_215895 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_200804 *
                                                  ctx_param_ext_210921 +
                                                  idx_215872 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_215878 = defunc_0_f_res_f_res_215894;
            defunc_0_f_res_215879 = defunc_0_f_res_f_res_215895;
        }
        ((float *) mem_215787.mem)[gtid_215869] = defunc_0_f_res_215878;
        ((float *) mem_215788.mem)[gtid_215869] = defunc_0_f_res_215879;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228566_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228566_end -
                 futhark_mc_segmap_parloop_228566_start;
        
        ctx->futhark_mc_segmap_parloop_228566_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228566_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228566_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228564(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215868 = tid;
    int num_tasks_215888 = info.nsubtasks;
    struct futhark_mc_task_228563 *futhark_mc_task_228563 =
                                  (struct futhark_mc_task_228563 *) args;
    struct futhark_context *ctx = futhark_mc_task_228563->ctx;
    uint64_t futhark_mc_segmap_task_228564_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228564_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228563->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228563->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228563->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228563->free_i_196779;
    int64_t gtid_200804 = futhark_mc_task_228563->free_gtid_200804;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228563->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228563->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228563->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228563->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228563->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228563->free_mem_210969,
                                  .size =0, .references =NULL};
    int64_t gtid_215786 = futhark_mc_task_228563->free_gtid_215786;
    struct memblock mem_215787 = {.desc ="mem_215787", .mem =
                                  futhark_mc_task_228563->free_mem_215787,
                                  .size =0, .references =NULL};
    struct memblock mem_215788 = {.desc ="mem_215788", .mem =
                                  futhark_mc_task_228563->free_mem_215788,
                                  .size =0, .references =NULL};
    int64_t iter_215889;
    struct futhark_mc_segmap_parloop_struct_228565
    futhark_mc_segmap_parloop_struct_228565;
    
    futhark_mc_segmap_parloop_struct_228565.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228565.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228565.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228565.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228565.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228565.free_gtid_200804 = gtid_200804;
    futhark_mc_segmap_parloop_struct_228565.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228565.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228565.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228565.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228565.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228565.free_mem_210969 = mem_210969.mem;
    futhark_mc_segmap_parloop_struct_228565.free_gtid_215786 = gtid_215786;
    futhark_mc_segmap_parloop_struct_228565.free_mem_215787 = mem_215787.mem;
    futhark_mc_segmap_parloop_struct_228565.free_mem_215788 = mem_215788.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228566_task;
    
    futhark_mc_segmap_parloop_228566_task.name =
        "futhark_mc_segmap_parloop_228566";
    futhark_mc_segmap_parloop_228566_task.fn = futhark_mc_segmap_parloop_228566;
    futhark_mc_segmap_parloop_228566_task.args =
        &futhark_mc_segmap_parloop_struct_228565;
    futhark_mc_segmap_parloop_228566_task.iterations = iterations;
    futhark_mc_segmap_parloop_228566_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228566_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228566_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228566_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228566_task);
    
    if (futhark_mc_segmap_parloop_228566_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228566_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228566_total_end -
                 futhark_mc_segmap_parloop_228566_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228566_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228566_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228566_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228564_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228564_end -
                 futhark_mc_segmap_task_228564_start;
        
        ctx->futhark_mc_segmap_task_228564_runs[tid]++;
        ctx->futhark_mc_segmap_task_228564_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228564_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228560(void *args, int64_t start,
                                            int64_t end, int flat_tid_215785,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228559
    *futhark_mc_segmap_parloop_struct_228559 =
    (struct futhark_mc_segmap_parloop_struct_228559 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228559->ctx;
    uint64_t futhark_mc_segmap_parloop_228560_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228560_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228559->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228559->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228559->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228559->free_i_196779;
    int64_t gtid_200804 =
            futhark_mc_segmap_parloop_struct_228559->free_gtid_200804;
    int64_t bytes_210399 =
            futhark_mc_segmap_parloop_struct_228559->free_bytes_210399;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228559->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228559->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228559->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228559->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228559->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228559->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211009 = {.desc ="mem_211009", .mem =
                                  futhark_mc_segmap_parloop_struct_228559->free_mem_211009,
                                  .size =0, .references =NULL};
    struct memblock mem_211013 = {.desc ="mem_211013", .mem =
                                  futhark_mc_segmap_parloop_struct_228559->free_mem_211013,
                                  .size =0, .references =NULL};
    size_t mem_215787_cached_sizze_228561 = 0;
    unsigned char *mem_215787 = NULL;
    size_t mem_215788_cached_sizze_228562 = 0;
    unsigned char *mem_215788 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215867 = start;
    
    if (mem_215787_cached_sizze_228561 < (size_t) bytes_210399) {
        mem_215787 = realloc(mem_215787, bytes_210399);
        mem_215787_cached_sizze_228561 = bytes_210399;
    }
    if (mem_215788_cached_sizze_228562 < (size_t) bytes_210399) {
        mem_215788 = realloc(mem_215788, bytes_210399);
        mem_215788_cached_sizze_228562 = bytes_210399;
    }
    for (; iter_215867 < end; iter_215867++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215886 = n_p_196694;
        int64_t gtid_215786 = iter_215867;
        int64_t remnant_215887 = iter_215867 - gtid_215786;
        int64_t flat_tid_215868 = (int64_t) 0;
        int32_t num_tasks_215888;
        struct futhark_mc_task_228563 futhark_mc_task_228563;
        
        futhark_mc_task_228563.ctx = ctx;
        futhark_mc_task_228563.free_n_196692 = n_196692;
        futhark_mc_task_228563.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228563.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228563.free_i_196779 = i_196779;
        futhark_mc_task_228563.free_gtid_200804 = gtid_200804;
        futhark_mc_task_228563.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228563.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_228563.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_228563.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_228563.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_228563.free_mem_210969 = mem_210969.mem;
        futhark_mc_task_228563.free_gtid_215786 = gtid_215786;
        futhark_mc_task_228563.free_mem_215787 = mem_215787;
        futhark_mc_task_228563.free_mem_215788 = mem_215788;
        
        struct scheduler_segop futhark_mc_task_228563_task;
        
        futhark_mc_task_228563_task.args = &futhark_mc_task_228563;
        futhark_mc_task_228563_task.top_level_fn =
            futhark_mc_segmap_task_228564;
        futhark_mc_task_228563_task.name = "futhark_mc_segmap_task_228564";
        futhark_mc_task_228563_task.iterations = defunc_0_f_res_196740;
        futhark_mc_task_228563_task.task_time =
            &ctx->futhark_mc_segmap_task_228564_total_time;
        futhark_mc_task_228563_task.task_iter =
            &ctx->futhark_mc_segmap_task_228564_total_iter;
        futhark_mc_task_228563_task.sched = STATIC;
        futhark_mc_task_228563_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228564_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228563_task);
        
        if (futhark_mc_segmap_task_228564_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211009.mem + gtid_215786 * defunc_0_f_res_196740 *
                    (int64_t) 4, mem_215787 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 4);
        if (defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211013.mem + gtid_215786 * defunc_0_f_res_196740 *
                    (int64_t) 4, mem_215788 + (int64_t) 0,
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_215787);
    free(mem_215788);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228560_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228560_end -
                 futhark_mc_segmap_parloop_228560_start;
        
        ctx->futhark_mc_segmap_parloop_228560_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228560_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228560_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228558(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215785 = tid;
    int num_tasks_215840 = info.nsubtasks;
    struct futhark_mc_task_228552 *futhark_mc_task_228552 =
                                  (struct futhark_mc_task_228552 *) args;
    struct futhark_context *ctx = futhark_mc_task_228552->ctx;
    uint64_t futhark_mc_segmap_nested_task_228558_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228558_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228552->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228552->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228552->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228552->free_i_196779;
    int64_t gtid_200804 = futhark_mc_task_228552->free_gtid_200804;
    int64_t bytes_210399 = futhark_mc_task_228552->free_bytes_210399;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228552->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228552->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228552->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228552->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228552->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228552->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211009 = {.desc ="mem_211009", .mem =
                                  futhark_mc_task_228552->free_mem_211009,
                                  .size =0, .references =NULL};
    struct memblock mem_211013 = {.desc ="mem_211013", .mem =
                                  futhark_mc_task_228552->free_mem_211013,
                                  .size =0, .references =NULL};
    int64_t iter_215867;
    struct futhark_mc_segmap_parloop_struct_228559
    futhark_mc_segmap_parloop_struct_228559;
    
    futhark_mc_segmap_parloop_struct_228559.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228559.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228559.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228559.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228559.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228559.free_gtid_200804 = gtid_200804;
    futhark_mc_segmap_parloop_struct_228559.free_bytes_210399 = bytes_210399;
    futhark_mc_segmap_parloop_struct_228559.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228559.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228559.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228559.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228559.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228559.free_mem_210969 = mem_210969.mem;
    futhark_mc_segmap_parloop_struct_228559.free_mem_211009 = mem_211009.mem;
    futhark_mc_segmap_parloop_struct_228559.free_mem_211013 = mem_211013.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228560_task;
    
    futhark_mc_segmap_parloop_228560_task.name =
        "futhark_mc_segmap_parloop_228560";
    futhark_mc_segmap_parloop_228560_task.fn = futhark_mc_segmap_parloop_228560;
    futhark_mc_segmap_parloop_228560_task.args =
        &futhark_mc_segmap_parloop_struct_228559;
    futhark_mc_segmap_parloop_228560_task.iterations = iterations;
    futhark_mc_segmap_parloop_228560_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228560_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228560_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228560_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228560_task);
    
    if (futhark_mc_segmap_parloop_228560_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228560_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228560_total_end -
                 futhark_mc_segmap_parloop_228560_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228560_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228560_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228560_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228558_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228558_end -
                 futhark_mc_segmap_nested_task_228558_start;
        
        ctx->futhark_mc_segmap_nested_task_228558_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228558_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228558_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228549(void *args, int64_t start,
                                            int64_t end, int flat_tid_200803,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228548
    *futhark_mc_segmap_parloop_struct_228548 =
    (struct futhark_mc_segmap_parloop_struct_228548 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228548->ctx;
    uint64_t futhark_mc_segmap_parloop_228549_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228549_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228548->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228548->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228548->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228548->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228548->free_i_196779;
    int64_t bytes_210399 =
            futhark_mc_segmap_parloop_struct_228548->free_bytes_210399;
    int64_t bytes_210418 =
            futhark_mc_segmap_parloop_struct_228548->free_bytes_210418;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228548->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228548->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228548->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228548->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228548->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_segmap_parloop_struct_228548->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228548->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228548->free_mem_211111,
                                  .size =0, .references =NULL};
    size_t mem_211009_cached_sizze_228550 = 0;
    unsigned char *mem_211009 = NULL;
    size_t mem_211013_cached_sizze_228551 = 0;
    unsigned char *mem_211013 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215784 = start;
    
    if (mem_211009_cached_sizze_228550 < (size_t) bytes_210418) {
        mem_211009 = realloc(mem_211009, bytes_210418);
        mem_211009_cached_sizze_228550 = bytes_210418;
    }
    if (mem_211013_cached_sizze_228551 < (size_t) bytes_210418) {
        mem_211013 = realloc(mem_211013, bytes_210418);
        mem_211013_cached_sizze_228551 = bytes_210418;
    }
    for (; iter_215784 < end; iter_215784++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215838 = m_196691;
        int64_t gtid_200804 = iter_215784;
        int64_t remnant_215839 = iter_215784 - gtid_200804;
        int64_t flat_tid_215809 = (int64_t) 0;
        int32_t num_tasks_215840;
        int64_t flat_tid_215785 = (int64_t) 0;
        struct futhark_mc_task_228552 futhark_mc_task_228552;
        
        futhark_mc_task_228552.ctx = ctx;
        futhark_mc_task_228552.free_n_196692 = n_196692;
        futhark_mc_task_228552.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228552.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228552.free_i_196779 = i_196779;
        futhark_mc_task_228552.free_gtid_200804 = gtid_200804;
        futhark_mc_task_228552.free_bytes_210399 = bytes_210399;
        futhark_mc_task_228552.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228552.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_228552.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_228552.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_228552.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_228552.free_mem_210969 = mem_210969.mem;
        futhark_mc_task_228552.free_mem_211009 = mem_211009;
        futhark_mc_task_228552.free_mem_211013 = mem_211013;
        
        struct scheduler_segop futhark_mc_task_228552_task;
        
        futhark_mc_task_228552_task.args = &futhark_mc_task_228552;
        futhark_mc_task_228552_task.top_level_fn =
            futhark_mc_segmap_task_228553;
        futhark_mc_task_228552_task.name = "futhark_mc_segmap_task_228553";
        futhark_mc_task_228552_task.iterations = n_p_196694;
        futhark_mc_task_228552_task.task_time =
            &ctx->futhark_mc_segmap_task_228553_total_time;
        futhark_mc_task_228552_task.task_iter =
            &ctx->futhark_mc_segmap_task_228553_total_iter;
        futhark_mc_task_228552_task.sched = STATIC;
        futhark_mc_task_228552_task.nested_fn =
            futhark_mc_segmap_nested_task_228558;
        
        int futhark_mc_segmap_task_228553_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228552_task);
        
        if (futhark_mc_segmap_task_228553_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211106.mem + gtid_200804 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_211009 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 4);
        if (n_p_196694 * defunc_0_f_res_196740 * (int64_t) 4 > 0)
            memmove(mem_211111.mem + gtid_200804 * (defunc_0_f_res_196740 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_211013 + (int64_t) 0, n_p_196694 *
                    defunc_0_f_res_196740 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211009);
    free(mem_211013);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228549_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228549_end -
                 futhark_mc_segmap_parloop_228549_start;
        
        ctx->futhark_mc_segmap_parloop_228549_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228549_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228549_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228547(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200803 = tid;
    int num_tasks_215750 = info.nsubtasks;
    struct futhark_mc_task_228541 *futhark_mc_task_228541 =
                                  (struct futhark_mc_task_228541 *) args;
    struct futhark_context *ctx = futhark_mc_task_228541->ctx;
    uint64_t futhark_mc_segmap_nested_task_228547_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228547_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228541->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228541->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_228541->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228541->free_defunc_0_f_res_196740;
    int64_t i_196779 = futhark_mc_task_228541->free_i_196779;
    int64_t bytes_210399 = futhark_mc_task_228541->free_bytes_210399;
    int64_t bytes_210418 = futhark_mc_task_228541->free_bytes_210418;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228541->free_mem_210590,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228541->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228541->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228541->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228541->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_210969 = {.desc ="mem_210969", .mem =
                                  futhark_mc_task_228541->free_mem_210969,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228541->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228541->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t iter_215784;
    struct futhark_mc_segmap_parloop_struct_228548
    futhark_mc_segmap_parloop_struct_228548;
    
    futhark_mc_segmap_parloop_struct_228548.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228548.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228548.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228548.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228548.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228548.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228548.free_bytes_210399 = bytes_210399;
    futhark_mc_segmap_parloop_struct_228548.free_bytes_210418 = bytes_210418;
    futhark_mc_segmap_parloop_struct_228548.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228548.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228548.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228548.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228548.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228548.free_mem_210969 = mem_210969.mem;
    futhark_mc_segmap_parloop_struct_228548.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228548.free_mem_211111 = mem_211111.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228549_task;
    
    futhark_mc_segmap_parloop_228549_task.name =
        "futhark_mc_segmap_parloop_228549";
    futhark_mc_segmap_parloop_228549_task.fn = futhark_mc_segmap_parloop_228549;
    futhark_mc_segmap_parloop_228549_task.args =
        &futhark_mc_segmap_parloop_struct_228548;
    futhark_mc_segmap_parloop_228549_task.iterations = iterations;
    futhark_mc_segmap_parloop_228549_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228549_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228549_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228549_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228549_task);
    
    if (futhark_mc_segmap_parloop_228549_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228549_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228549_total_end -
                 futhark_mc_segmap_parloop_228549_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228549_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228549_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228549_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228547_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228547_end -
                 futhark_mc_segmap_nested_task_228547_start;
        
        ctx->futhark_mc_segmap_nested_task_228547_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228547_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228547_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228567 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211187;
};
struct futhark_mc_segmap_parloop_struct_228569 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211187;
};
static int futhark_mc_segmap_parloop_228570(void *args, int64_t start,
                                            int64_t end, int flat_tid_200856,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228569
    *futhark_mc_segmap_parloop_struct_228569 =
    (struct futhark_mc_segmap_parloop_struct_228569 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228569->ctx;
    uint64_t futhark_mc_segmap_parloop_228570_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228570_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228569->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228569->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228569->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228569->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228569->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228569->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228569->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228569->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211187 = {.desc ="mem_211187", .mem =
                                  futhark_mc_segmap_parloop_struct_228569->free_mem_211187,
                                  .size =0, .references =NULL};
    size_t mem_211142_cached_sizze_228571 = 0;
    unsigned char *mem_211142 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215902 = start;
    
    if (mem_211142_cached_sizze_228571 < (size_t) bytes_210655) {
        mem_211142 = realloc(mem_211142, bytes_210655);
        mem_211142_cached_sizze_228571 = bytes_210655;
    }
    for (; iter_215902 < end; iter_215902++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_215981 = m_196691;
        int64_t gtid_200857 = iter_215902;
        int64_t remnant_215982 = iter_215902 - gtid_200857;
        
        for (int64_t i_215903 = 0; i_215903 < n_p_196694; i_215903++) {
            int64_t x_215905;
            
            x_215905 = ((int64_t *) mem_210594.mem)[gtid_200857 * n_p_196694 +
                                                    i_215903];
            for (int64_t i_215907 = 0; i_215907 < s_n_m_196745; i_215907++) {
                int64_t x_215909;
                
                x_215909 = ((int64_t *) mem_210764.mem)[gtid_200857 *
                                                        (s_n_m_196745 *
                                                         n_p_196694) +
                                                        i_215903 *
                                                        s_n_m_196745 +
                                                        i_215907];
                
                float x_215910;
                
                x_215910 = ((float *) mem_210769.mem)[gtid_200857 *
                                                      (s_n_m_196745 *
                                                       n_p_196694) + i_215903 *
                                                      s_n_m_196745 + i_215907];
                
                bool cond_215911 = i_215907 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_215912;
                
                if (cond_215911) {
                    defunc_0_m_fun_res_215912 = (int64_t) 0;
                } else {
                    int64_t y_215913 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_215914 = i_215907 == y_215913;
                    int64_t defunc_0_m_fun_res_f_res_215915;
                    
                    if (cond_215914) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_215916 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_215915 =
                            defunc_0_m_fun_res_f_res_t_res_215916;
                    } else {
                        int64_t x_215917 = sub64(i_215907, (int64_t) 1);
                        int64_t x_215918 = mul64(jump_s_196701, x_215917);
                        int64_t min_arg_215919 = add64((int64_t) 1, x_215918);
                        int64_t min_res_215920 = smin64(defunc_0_f_res_196740,
                                                        min_arg_215919);
                        
                        defunc_0_m_fun_res_f_res_215915 = min_res_215920;
                    }
                    defunc_0_m_fun_res_215912 = defunc_0_m_fun_res_f_res_215915;
                }
                
                float defunc_2_reduce_res_215921;
                float redout_215923 = 0.0F;
                
                for (int64_t i_215922 = 0; i_215922 < q_s_196695; i_215922++) {
                    bool cond_215924 = sle64(x_215905, i_215922);
                    int64_t defunc_0_f_res_215925;
                    
                    if (cond_215924) {
                        defunc_0_f_res_215925 = (int64_t) 0;
                    } else {
                        int64_t i_215926 = add64(x_215909, i_215922);
                        int64_t defunc_0_add_arg_215927;
                        
                        defunc_0_add_arg_215927 =
                            ((int64_t *) mem_210590.mem)[gtid_200857 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_215903 *
                                                         defunc_0_f_res_196740 +
                                                         i_215926];
                        
                        int64_t defunc_1_add_res_215928 = add64((int64_t) 1,
                                                                defunc_0_add_arg_215927);
                        
                        defunc_0_f_res_215925 = defunc_1_add_res_215928;
                    }
                    
                    float defunc_0_f_res_215929;
                    
                    if (cond_215924) {
                        defunc_0_f_res_215929 = 0.0F;
                    } else {
                        int64_t i_215930 = add64(x_215909, i_215922);
                        float defunc_0_add_arg_215931;
                        
                        defunc_0_add_arg_215931 =
                            ((float *) mem_211111.mem)[gtid_200857 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_215903 *
                                                       defunc_0_f_res_196740 +
                                                       i_215930];
                        defunc_0_f_res_215929 = defunc_0_add_arg_215931;
                    }
                    
                    int64_t binop_p_215932 = sub64(defunc_0_f_res_215925,
                                                   defunc_0_m_fun_res_215912);
                    float defunc_0_f_res_215933 =
                          sitofp_i64_f32(binop_p_215932);
                    float abs_res_215934 = (float) fabs(defunc_0_f_res_215933);
                    float tmp1_215935 = abs_res_215934 / x_215910;
                    float x_215936 = tmp1_215935 * tmp1_215935;
                    float y_215937 = tmp1_215935 * x_215936;
                    float tmp2_215938 = 1.0F - y_215937;
                    float x_215939 = tmp2_215938 * tmp2_215938;
                    float tmp3_215940 = tmp2_215938 * x_215939;
                    float w_j_215941 = defunc_0_f_res_215929 * tmp3_215940;
                    float defunc_1_op_res_215942 = w_j_215941 + redout_215923;
                    float redout_tmp_215985 = defunc_1_op_res_215942;
                    
                    redout_215923 = redout_tmp_215985;
                }
                defunc_2_reduce_res_215921 = redout_215923;
                
                float a0_215943 = 1.0F / defunc_2_reduce_res_215921;
                int64_t defunc_0_m_fun_res_215944;
                
                if (cond_215911) {
                    defunc_0_m_fun_res_215944 = (int64_t) 0;
                } else {
                    int64_t y_215945 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_215946 = i_215907 == y_215945;
                    int64_t defunc_0_m_fun_res_f_res_215947;
                    
                    if (cond_215946) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_215948 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_215947 =
                            defunc_0_m_fun_res_f_res_t_res_215948;
                    } else {
                        int64_t x_215949 = sub64(i_215907, (int64_t) 1);
                        int64_t x_215950 = mul64(jump_s_196701, x_215949);
                        int64_t min_arg_215951 = add64((int64_t) 1, x_215950);
                        int64_t min_res_215952 = smin64(defunc_0_f_res_196740,
                                                        min_arg_215951);
                        
                        defunc_0_m_fun_res_f_res_215947 = min_res_215952;
                    }
                    defunc_0_m_fun_res_215944 = defunc_0_m_fun_res_f_res_215947;
                }
                
                float defunc_2_reduce_res_215953;
                float redout_215955 = 0.0F;
                
                for (int64_t i_215954 = 0; i_215954 < q_s_196695; i_215954++) {
                    bool cond_215956 = sle64(x_215905, i_215954);
                    int64_t defunc_0_f_res_215957;
                    
                    if (cond_215956) {
                        defunc_0_f_res_215957 = (int64_t) 0;
                    } else {
                        int64_t i_215958 = add64(x_215909, i_215954);
                        int64_t defunc_0_add_arg_215959;
                        
                        defunc_0_add_arg_215959 =
                            ((int64_t *) mem_210590.mem)[gtid_200857 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_215903 *
                                                         defunc_0_f_res_196740 +
                                                         i_215958];
                        
                        int64_t defunc_1_add_res_215960 = add64((int64_t) 1,
                                                                defunc_0_add_arg_215959);
                        
                        defunc_0_f_res_215957 = defunc_1_add_res_215960;
                    }
                    
                    float defunc_0_f_res_215961;
                    
                    if (cond_215956) {
                        defunc_0_f_res_215961 = 0.0F;
                    } else {
                        int64_t i_215962 = add64(x_215909, i_215954);
                        float defunc_0_add_arg_215963;
                        
                        defunc_0_add_arg_215963 =
                            ((float *) mem_211111.mem)[gtid_200857 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_215903 *
                                                       defunc_0_f_res_196740 +
                                                       i_215962];
                        defunc_0_f_res_215961 = defunc_0_add_arg_215963;
                    }
                    
                    int64_t binop_p_215964 = sub64(defunc_0_f_res_215957,
                                                   defunc_0_m_fun_res_215944);
                    float defunc_0_f_res_215965 =
                          sitofp_i64_f32(binop_p_215964);
                    float abs_res_215966 = (float) fabs(defunc_0_f_res_215965);
                    float tmp1_215967 = abs_res_215966 / x_215910;
                    float x_215968 = tmp1_215967 * tmp1_215967;
                    float y_215969 = tmp1_215967 * x_215968;
                    float tmp2_215970 = 1.0F - y_215969;
                    float x_215971 = tmp2_215970 * tmp2_215970;
                    float tmp3_215972 = tmp2_215970 * x_215971;
                    float tmp4_215973 = defunc_0_f_res_215961 * tmp3_215972;
                    float defunc_0_f_res_215974;
                    
                    if (cond_215956) {
                        defunc_0_f_res_215974 = 0.0F;
                    } else {
                        int64_t i_215975 = add64(x_215909, i_215954);
                        float defunc_0_add_arg_215976;
                        
                        defunc_0_add_arg_215976 =
                            ((float *) mem_211106.mem)[gtid_200857 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_215903 *
                                                       defunc_0_f_res_196740 +
                                                       i_215975];
                        defunc_0_f_res_215974 = defunc_0_add_arg_215976;
                    }
                    
                    float x_215977 = a0_215943 * tmp4_215973;
                    float defunc_9_fit_fun_res_215978 = defunc_0_f_res_215974 *
                          x_215977;
                    float defunc_1_op_res_215979 = defunc_9_fit_fun_res_215978 +
                          redout_215955;
                    float redout_tmp_215986 = defunc_1_op_res_215979;
                    
                    redout_215955 = redout_tmp_215986;
                }
                defunc_2_reduce_res_215953 = redout_215955;
                ((float *) mem_211142)[i_215903 * s_n_m_196745 + i_215907] =
                    defunc_2_reduce_res_215953;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211187.mem + gtid_200857 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211142 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211142);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228570_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228570_end -
                 futhark_mc_segmap_parloop_228570_start;
        
        ctx->futhark_mc_segmap_parloop_228570_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228570_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228570_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228568(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_200856 = tid;
    int num_tasks_215901 = info.nsubtasks;
    struct futhark_mc_task_228567 *futhark_mc_task_228567 =
                                  (struct futhark_mc_task_228567 *) args;
    struct futhark_context *ctx = futhark_mc_task_228567->ctx;
    uint64_t futhark_mc_segmap_task_228568_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228568_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228567->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228567->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228567->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228567->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228567->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228567->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228567->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228567->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228567->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228567->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228567->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228567->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228567->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228567->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228567->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211187 = {.desc ="mem_211187", .mem =
                                  futhark_mc_task_228567->free_mem_211187,
                                  .size =0, .references =NULL};
    int64_t iter_215902;
    struct futhark_mc_segmap_parloop_struct_228569
    futhark_mc_segmap_parloop_struct_228569;
    
    futhark_mc_segmap_parloop_struct_228569.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228569.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228569.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228569.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228569.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228569.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228569.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228569.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228569.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228569.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228569.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228569.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228569.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228569.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228569.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228569.free_mem_211187 = mem_211187.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228570_task;
    
    futhark_mc_segmap_parloop_228570_task.name =
        "futhark_mc_segmap_parloop_228570";
    futhark_mc_segmap_parloop_228570_task.fn = futhark_mc_segmap_parloop_228570;
    futhark_mc_segmap_parloop_228570_task.args =
        &futhark_mc_segmap_parloop_struct_228569;
    futhark_mc_segmap_parloop_228570_task.iterations = iterations;
    futhark_mc_segmap_parloop_228570_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228570_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228570_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228570_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228570_task);
    
    if (futhark_mc_segmap_parloop_228570_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228570_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228570_total_end -
                 futhark_mc_segmap_parloop_228570_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228570_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228570_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228570_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228568_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228568_end -
                 futhark_mc_segmap_task_228568_start;
        
        ctx->futhark_mc_segmap_task_228568_runs[tid]++;
        ctx->futhark_mc_segmap_task_228568_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228568_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228573 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211187;
};
struct futhark_mc_task_228576 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211138;
};
struct futhark_mc_segmap_parloop_struct_228578 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211138;
};
static int futhark_mc_segmap_parloop_228579(void *args, int64_t start,
                                            int64_t end, int flat_tid_216143,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228578
    *futhark_mc_segmap_parloop_struct_228578 =
    (struct futhark_mc_segmap_parloop_struct_228578 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228578->ctx;
    uint64_t futhark_mc_segmap_parloop_228579_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228579_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228578->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228578->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228578->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228578->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228578->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228578->free_s_n_m_196745;
    int64_t gtid_201118 =
            futhark_mc_segmap_parloop_struct_228578->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228578->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211138 = {.desc ="mem_211138", .mem =
                                  futhark_mc_segmap_parloop_struct_228578->free_mem_211138,
                                  .size =0, .references =NULL};
    size_t mem_216146_cached_sizze_228580 = 0;
    unsigned char *mem_216146 = NULL;
    int64_t iterations = end - start;
    int64_t iter_216226 = start;
    
    if (mem_216146_cached_sizze_228580 < (size_t) bytes_210599) {
        mem_216146 = realloc(mem_216146, bytes_210599);
        mem_216146_cached_sizze_228580 = bytes_210599;
    }
    for (; iter_216226 < end; iter_216226++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_216301 = n_p_196694;
        int64_t gtid_216144 = iter_216226;
        int64_t remnant_216302 = iter_216226 - gtid_216144;
        int64_t x_216145;
        
        x_216145 = ((int64_t *) mem_210594.mem)[gtid_201118 * n_p_196694 +
                                                gtid_216144];
        for (int64_t i_216227 = 0; i_216227 < s_n_m_196745; i_216227++) {
            int64_t x_216229;
            
            x_216229 = ((int64_t *) mem_210764.mem)[gtid_201118 *
                                                    (s_n_m_196745 *
                                                     n_p_196694) + gtid_216144 *
                                                    s_n_m_196745 + i_216227];
            
            float x_216230;
            
            x_216230 = ((float *) mem_210769.mem)[gtid_201118 * (s_n_m_196745 *
                                                                 n_p_196694) +
                                                  gtid_216144 * s_n_m_196745 +
                                                  i_216227];
            
            bool cond_216231 = i_216227 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_216232;
            
            if (cond_216231) {
                defunc_0_m_fun_res_216232 = (int64_t) 0;
            } else {
                int64_t y_216233 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_216234 = i_216227 == y_216233;
                int64_t defunc_0_m_fun_res_f_res_216235;
                
                if (cond_216234) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_216236 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_216235 =
                        defunc_0_m_fun_res_f_res_t_res_216236;
                } else {
                    int64_t x_216237 = sub64(i_216227, (int64_t) 1);
                    int64_t x_216238 = mul64(jump_s_196701, x_216237);
                    int64_t min_arg_216239 = add64((int64_t) 1, x_216238);
                    int64_t min_res_216240 = smin64(defunc_0_f_res_196740,
                                                    min_arg_216239);
                    
                    defunc_0_m_fun_res_f_res_216235 = min_res_216240;
                }
                defunc_0_m_fun_res_216232 = defunc_0_m_fun_res_f_res_216235;
            }
            
            float defunc_2_reduce_res_216241;
            float redout_216243 = 0.0F;
            
            for (int64_t i_216242 = 0; i_216242 < q_s_196695; i_216242++) {
                bool cond_216244 = sle64(x_216145, i_216242);
                int64_t defunc_0_f_res_216245;
                
                if (cond_216244) {
                    defunc_0_f_res_216245 = (int64_t) 0;
                } else {
                    int64_t i_216246 = add64(x_216229, i_216242);
                    int64_t defunc_0_add_arg_216247;
                    
                    defunc_0_add_arg_216247 =
                        ((int64_t *) mem_210590.mem)[gtid_201118 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_216144 *
                                                     defunc_0_f_res_196740 +
                                                     i_216246];
                    
                    int64_t defunc_1_add_res_216248 = add64((int64_t) 1,
                                                            defunc_0_add_arg_216247);
                    
                    defunc_0_f_res_216245 = defunc_1_add_res_216248;
                }
                
                float defunc_0_f_res_216249;
                
                if (cond_216244) {
                    defunc_0_f_res_216249 = 0.0F;
                } else {
                    int64_t i_216250 = add64(x_216229, i_216242);
                    float defunc_0_add_arg_216251;
                    
                    defunc_0_add_arg_216251 =
                        ((float *) mem_211111.mem)[gtid_201118 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_216144 *
                                                   defunc_0_f_res_196740 +
                                                   i_216250];
                    defunc_0_f_res_216249 = defunc_0_add_arg_216251;
                }
                
                int64_t binop_p_216252 = sub64(defunc_0_f_res_216245,
                                               defunc_0_m_fun_res_216232);
                float defunc_0_f_res_216253 = sitofp_i64_f32(binop_p_216252);
                float abs_res_216254 = (float) fabs(defunc_0_f_res_216253);
                float tmp1_216255 = abs_res_216254 / x_216230;
                float x_216256 = tmp1_216255 * tmp1_216255;
                float y_216257 = tmp1_216255 * x_216256;
                float tmp2_216258 = 1.0F - y_216257;
                float x_216259 = tmp2_216258 * tmp2_216258;
                float tmp3_216260 = tmp2_216258 * x_216259;
                float w_j_216261 = defunc_0_f_res_216249 * tmp3_216260;
                float defunc_1_op_res_216262 = w_j_216261 + redout_216243;
                float redout_tmp_216304 = defunc_1_op_res_216262;
                
                redout_216243 = redout_tmp_216304;
            }
            defunc_2_reduce_res_216241 = redout_216243;
            
            float a0_216263 = 1.0F / defunc_2_reduce_res_216241;
            int64_t defunc_0_m_fun_res_216264;
            
            if (cond_216231) {
                defunc_0_m_fun_res_216264 = (int64_t) 0;
            } else {
                int64_t y_216265 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_216266 = i_216227 == y_216265;
                int64_t defunc_0_m_fun_res_f_res_216267;
                
                if (cond_216266) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_216268 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_216267 =
                        defunc_0_m_fun_res_f_res_t_res_216268;
                } else {
                    int64_t x_216269 = sub64(i_216227, (int64_t) 1);
                    int64_t x_216270 = mul64(jump_s_196701, x_216269);
                    int64_t min_arg_216271 = add64((int64_t) 1, x_216270);
                    int64_t min_res_216272 = smin64(defunc_0_f_res_196740,
                                                    min_arg_216271);
                    
                    defunc_0_m_fun_res_f_res_216267 = min_res_216272;
                }
                defunc_0_m_fun_res_216264 = defunc_0_m_fun_res_f_res_216267;
            }
            
            float defunc_2_reduce_res_216273;
            float redout_216275 = 0.0F;
            
            for (int64_t i_216274 = 0; i_216274 < q_s_196695; i_216274++) {
                bool cond_216276 = sle64(x_216145, i_216274);
                int64_t defunc_0_f_res_216277;
                
                if (cond_216276) {
                    defunc_0_f_res_216277 = (int64_t) 0;
                } else {
                    int64_t i_216278 = add64(x_216229, i_216274);
                    int64_t defunc_0_add_arg_216279;
                    
                    defunc_0_add_arg_216279 =
                        ((int64_t *) mem_210590.mem)[gtid_201118 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_216144 *
                                                     defunc_0_f_res_196740 +
                                                     i_216278];
                    
                    int64_t defunc_1_add_res_216280 = add64((int64_t) 1,
                                                            defunc_0_add_arg_216279);
                    
                    defunc_0_f_res_216277 = defunc_1_add_res_216280;
                }
                
                float defunc_0_f_res_216281;
                
                if (cond_216276) {
                    defunc_0_f_res_216281 = 0.0F;
                } else {
                    int64_t i_216282 = add64(x_216229, i_216274);
                    float defunc_0_add_arg_216283;
                    
                    defunc_0_add_arg_216283 =
                        ((float *) mem_211111.mem)[gtid_201118 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_216144 *
                                                   defunc_0_f_res_196740 +
                                                   i_216282];
                    defunc_0_f_res_216281 = defunc_0_add_arg_216283;
                }
                
                int64_t binop_p_216284 = sub64(defunc_0_f_res_216277,
                                               defunc_0_m_fun_res_216264);
                float defunc_0_f_res_216285 = sitofp_i64_f32(binop_p_216284);
                float abs_res_216286 = (float) fabs(defunc_0_f_res_216285);
                float tmp1_216287 = abs_res_216286 / x_216230;
                float x_216288 = tmp1_216287 * tmp1_216287;
                float y_216289 = tmp1_216287 * x_216288;
                float tmp2_216290 = 1.0F - y_216289;
                float x_216291 = tmp2_216290 * tmp2_216290;
                float tmp3_216292 = tmp2_216290 * x_216291;
                float tmp4_216293 = defunc_0_f_res_216281 * tmp3_216292;
                float defunc_0_f_res_216294;
                
                if (cond_216276) {
                    defunc_0_f_res_216294 = 0.0F;
                } else {
                    int64_t i_216295 = add64(x_216229, i_216274);
                    float defunc_0_add_arg_216296;
                    
                    defunc_0_add_arg_216296 =
                        ((float *) mem_211106.mem)[gtid_201118 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_216144 *
                                                   defunc_0_f_res_196740 +
                                                   i_216295];
                    defunc_0_f_res_216294 = defunc_0_add_arg_216296;
                }
                
                float x_216297 = a0_216263 * tmp4_216293;
                float defunc_9_fit_fun_res_216298 = defunc_0_f_res_216294 *
                      x_216297;
                float defunc_1_op_res_216299 = defunc_9_fit_fun_res_216298 +
                      redout_216275;
                float redout_tmp_216305 = defunc_1_op_res_216299;
                
                redout_216275 = redout_tmp_216305;
            }
            defunc_2_reduce_res_216273 = redout_216275;
            ((float *) mem_216146)[i_216227] = defunc_2_reduce_res_216273;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211138.mem + gtid_216144 * s_n_m_196745 * (int64_t) 4,
                    mem_216146 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_216146);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228579_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228579_end -
                 futhark_mc_segmap_parloop_228579_start;
        
        ctx->futhark_mc_segmap_parloop_228579_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228579_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228579_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228577(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216143 = tid;
    int num_tasks_216225 = info.nsubtasks;
    struct futhark_mc_task_228576 *futhark_mc_task_228576 =
                                  (struct futhark_mc_task_228576 *) args;
    struct futhark_context *ctx = futhark_mc_task_228576->ctx;
    uint64_t futhark_mc_segmap_task_228577_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228577_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228576->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228576->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228576->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228576->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228576->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228576->free_s_n_m_196745;
    int64_t gtid_201118 = futhark_mc_task_228576->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228576->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228576->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228576->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228576->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228576->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228576->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228576->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211138 = {.desc ="mem_211138", .mem =
                                  futhark_mc_task_228576->free_mem_211138,
                                  .size =0, .references =NULL};
    int64_t iter_216226;
    struct futhark_mc_segmap_parloop_struct_228578
    futhark_mc_segmap_parloop_struct_228578;
    
    futhark_mc_segmap_parloop_struct_228578.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228578.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228578.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228578.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228578.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228578.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228578.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228578.free_gtid_201118 = gtid_201118;
    futhark_mc_segmap_parloop_struct_228578.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228578.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228578.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228578.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228578.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228578.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228578.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228578.free_mem_211138 = mem_211138.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228579_task;
    
    futhark_mc_segmap_parloop_228579_task.name =
        "futhark_mc_segmap_parloop_228579";
    futhark_mc_segmap_parloop_228579_task.fn = futhark_mc_segmap_parloop_228579;
    futhark_mc_segmap_parloop_228579_task.args =
        &futhark_mc_segmap_parloop_struct_228578;
    futhark_mc_segmap_parloop_228579_task.iterations = iterations;
    futhark_mc_segmap_parloop_228579_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228579_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228579_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228579_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228579_task);
    
    if (futhark_mc_segmap_parloop_228579_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228579_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228579_total_end -
                 futhark_mc_segmap_parloop_228579_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228579_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228579_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228579_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228577_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228577_end -
                 futhark_mc_segmap_task_228577_start;
        
        ctx->futhark_mc_segmap_task_228577_runs[tid]++;
        ctx->futhark_mc_segmap_task_228577_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228577_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228582 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211138;
};
struct futhark_mc_task_228585 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    unsigned char *free_mem_215991;
};
struct futhark_mc_segmap_parloop_struct_228587 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    unsigned char *free_mem_215991;
};
static int futhark_mc_segmap_parloop_228588(void *args, int64_t start,
                                            int64_t end, int flat_tid_216384,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228587
    *futhark_mc_segmap_parloop_struct_228587 =
    (struct futhark_mc_segmap_parloop_struct_228587 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228587->ctx;
    uint64_t futhark_mc_segmap_parloop_228588_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228588_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228587->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228587->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228587->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228587->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228587->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228587->free_s_n_m_196745;
    int64_t gtid_201118 =
            futhark_mc_segmap_parloop_struct_228587->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228587->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228587->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228587->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228587->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228587->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 =
            futhark_mc_segmap_parloop_struct_228587->free_gtid_215989;
    int64_t x_215990 = futhark_mc_segmap_parloop_struct_228587->free_x_215990;
    struct memblock mem_215991 = {.desc ="mem_215991", .mem =
                                  futhark_mc_segmap_parloop_struct_228587->free_mem_215991,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_216460 = start;
    
    for (; iter_216460 < end; iter_216460++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_216524 = s_n_m_196745;
        int64_t gtid_216385 = iter_216460;
        int64_t remnant_216525 = iter_216460 - gtid_216385;
        int64_t x_216386;
        
        x_216386 = ((int64_t *) mem_210764.mem)[gtid_201118 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_215989 * s_n_m_196745 +
                                                gtid_216385];
        
        float x_216387;
        
        x_216387 = ((float *) mem_210769.mem)[gtid_201118 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_215989 * s_n_m_196745 +
                                              gtid_216385];
        
        bool cond_216388 = gtid_216385 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_216389;
        
        if (cond_216388) {
            defunc_0_m_fun_res_216389 = (int64_t) 0;
        } else {
            int64_t y_216461 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_216462 = gtid_216385 == y_216461;
            int64_t defunc_0_m_fun_res_f_res_216463;
            
            if (cond_216462) {
                int64_t defunc_0_m_fun_res_f_res_t_res_216464 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_216463 =
                    defunc_0_m_fun_res_f_res_t_res_216464;
            } else {
                int64_t x_216465 = sub64(gtid_216385, (int64_t) 1);
                int64_t x_216466 = mul64(jump_s_196701, x_216465);
                int64_t min_arg_216467 = add64((int64_t) 1, x_216466);
                int64_t min_res_216468 = smin64(defunc_0_f_res_196740,
                                                min_arg_216467);
                
                defunc_0_m_fun_res_f_res_216463 = min_res_216468;
            }
            defunc_0_m_fun_res_216389 = defunc_0_m_fun_res_f_res_216463;
        }
        
        float defunc_2_reduce_res_216398;
        float redout_216470 = 0.0F;
        
        for (int64_t i_216469 = 0; i_216469 < q_s_196695; i_216469++) {
            bool cond_216471 = sle64(x_215990, i_216469);
            int64_t defunc_0_f_res_216472;
            
            if (cond_216471) {
                defunc_0_f_res_216472 = (int64_t) 0;
            } else {
                int64_t i_216473 = add64(x_216386, i_216469);
                int64_t defunc_0_add_arg_216474;
                
                defunc_0_add_arg_216474 =
                    ((int64_t *) mem_210590.mem)[gtid_201118 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_215989 *
                                                 defunc_0_f_res_196740 +
                                                 i_216473];
                
                int64_t defunc_1_add_res_216475 = add64((int64_t) 1,
                                                        defunc_0_add_arg_216474);
                
                defunc_0_f_res_216472 = defunc_1_add_res_216475;
            }
            
            float defunc_0_f_res_216476;
            
            if (cond_216471) {
                defunc_0_f_res_216476 = 0.0F;
            } else {
                int64_t i_216477 = add64(x_216386, i_216469);
                float defunc_0_add_arg_216478;
                
                defunc_0_add_arg_216478 =
                    ((float *) mem_211111.mem)[gtid_201118 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_215989 *
                                               defunc_0_f_res_196740 +
                                               i_216477];
                defunc_0_f_res_216476 = defunc_0_add_arg_216478;
            }
            
            int64_t binop_p_216479 = sub64(defunc_0_f_res_216472,
                                           defunc_0_m_fun_res_216389);
            float defunc_0_f_res_216480 = sitofp_i64_f32(binop_p_216479);
            float abs_res_216481 = (float) fabs(defunc_0_f_res_216480);
            float tmp1_216482 = abs_res_216481 / x_216387;
            float x_216483 = tmp1_216482 * tmp1_216482;
            float y_216484 = tmp1_216482 * x_216483;
            float tmp2_216485 = 1.0F - y_216484;
            float x_216486 = tmp2_216485 * tmp2_216485;
            float tmp3_216487 = tmp2_216485 * x_216486;
            float w_j_216488 = defunc_0_f_res_216476 * tmp3_216487;
            float defunc_1_op_res_216489 = w_j_216488 + redout_216470;
            float redout_tmp_216526 = defunc_1_op_res_216489;
            
            redout_216470 = redout_tmp_216526;
        }
        defunc_2_reduce_res_216398 = redout_216470;
        
        float a0_216420 = 1.0F / defunc_2_reduce_res_216398;
        int64_t defunc_0_m_fun_res_216421;
        
        if (cond_216388) {
            defunc_0_m_fun_res_216421 = (int64_t) 0;
        } else {
            int64_t y_216490 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_216491 = gtid_216385 == y_216490;
            int64_t defunc_0_m_fun_res_f_res_216492;
            
            if (cond_216491) {
                int64_t defunc_0_m_fun_res_f_res_t_res_216493 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_216492 =
                    defunc_0_m_fun_res_f_res_t_res_216493;
            } else {
                int64_t x_216494 = sub64(gtid_216385, (int64_t) 1);
                int64_t x_216495 = mul64(jump_s_196701, x_216494);
                int64_t min_arg_216496 = add64((int64_t) 1, x_216495);
                int64_t min_res_216497 = smin64(defunc_0_f_res_196740,
                                                min_arg_216496);
                
                defunc_0_m_fun_res_f_res_216492 = min_res_216497;
            }
            defunc_0_m_fun_res_216421 = defunc_0_m_fun_res_f_res_216492;
        }
        
        float defunc_2_reduce_res_216430;
        float redout_216499 = 0.0F;
        
        for (int64_t i_216498 = 0; i_216498 < q_s_196695; i_216498++) {
            bool cond_216500 = sle64(x_215990, i_216498);
            int64_t defunc_0_f_res_216501;
            
            if (cond_216500) {
                defunc_0_f_res_216501 = (int64_t) 0;
            } else {
                int64_t i_216502 = add64(x_216386, i_216498);
                int64_t defunc_0_add_arg_216503;
                
                defunc_0_add_arg_216503 =
                    ((int64_t *) mem_210590.mem)[gtid_201118 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_215989 *
                                                 defunc_0_f_res_196740 +
                                                 i_216502];
                
                int64_t defunc_1_add_res_216504 = add64((int64_t) 1,
                                                        defunc_0_add_arg_216503);
                
                defunc_0_f_res_216501 = defunc_1_add_res_216504;
            }
            
            float defunc_0_f_res_216505;
            
            if (cond_216500) {
                defunc_0_f_res_216505 = 0.0F;
            } else {
                int64_t i_216506 = add64(x_216386, i_216498);
                float defunc_0_add_arg_216507;
                
                defunc_0_add_arg_216507 =
                    ((float *) mem_211111.mem)[gtid_201118 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_215989 *
                                               defunc_0_f_res_196740 +
                                               i_216506];
                defunc_0_f_res_216505 = defunc_0_add_arg_216507;
            }
            
            int64_t binop_p_216508 = sub64(defunc_0_f_res_216501,
                                           defunc_0_m_fun_res_216421);
            float defunc_0_f_res_216509 = sitofp_i64_f32(binop_p_216508);
            float abs_res_216510 = (float) fabs(defunc_0_f_res_216509);
            float tmp1_216511 = abs_res_216510 / x_216387;
            float x_216512 = tmp1_216511 * tmp1_216511;
            float y_216513 = tmp1_216511 * x_216512;
            float tmp2_216514 = 1.0F - y_216513;
            float x_216515 = tmp2_216514 * tmp2_216514;
            float tmp3_216516 = tmp2_216514 * x_216515;
            float tmp4_216517 = defunc_0_f_res_216505 * tmp3_216516;
            float defunc_0_f_res_216518;
            
            if (cond_216500) {
                defunc_0_f_res_216518 = 0.0F;
            } else {
                int64_t i_216519 = add64(x_216386, i_216498);
                float defunc_0_add_arg_216520;
                
                defunc_0_add_arg_216520 =
                    ((float *) mem_211106.mem)[gtid_201118 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_215989 *
                                               defunc_0_f_res_196740 +
                                               i_216519];
                defunc_0_f_res_216518 = defunc_0_add_arg_216520;
            }
            
            float x_216521 = a0_216420 * tmp4_216517;
            float defunc_9_fit_fun_res_216522 = defunc_0_f_res_216518 *
                  x_216521;
            float defunc_1_op_res_216523 = defunc_9_fit_fun_res_216522 +
                  redout_216499;
            float redout_tmp_216527 = defunc_1_op_res_216523;
            
            redout_216499 = redout_tmp_216527;
        }
        defunc_2_reduce_res_216430 = redout_216499;
        ((float *) mem_215991.mem)[gtid_216385] = defunc_2_reduce_res_216430;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228588_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228588_end -
                 futhark_mc_segmap_parloop_228588_start;
        
        ctx->futhark_mc_segmap_parloop_228588_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228588_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228588_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228586(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216384 = tid;
    int num_tasks_216459 = info.nsubtasks;
    struct futhark_mc_task_228585 *futhark_mc_task_228585 =
                                  (struct futhark_mc_task_228585 *) args;
    struct futhark_context *ctx = futhark_mc_task_228585->ctx;
    uint64_t futhark_mc_segmap_task_228586_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228586_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228585->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228585->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228585->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228585->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228585->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228585->free_s_n_m_196745;
    int64_t gtid_201118 = futhark_mc_task_228585->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228585->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228585->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228585->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228585->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228585->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 = futhark_mc_task_228585->free_gtid_215989;
    int64_t x_215990 = futhark_mc_task_228585->free_x_215990;
    struct memblock mem_215991 = {.desc ="mem_215991", .mem =
                                  futhark_mc_task_228585->free_mem_215991,
                                  .size =0, .references =NULL};
    int64_t iter_216460;
    struct futhark_mc_segmap_parloop_struct_228587
    futhark_mc_segmap_parloop_struct_228587;
    
    futhark_mc_segmap_parloop_struct_228587.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228587.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228587.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228587.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228587.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228587.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228587.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228587.free_gtid_201118 = gtid_201118;
    futhark_mc_segmap_parloop_struct_228587.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228587.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228587.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228587.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228587.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228587.free_gtid_215989 = gtid_215989;
    futhark_mc_segmap_parloop_struct_228587.free_x_215990 = x_215990;
    futhark_mc_segmap_parloop_struct_228587.free_mem_215991 = mem_215991.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228588_task;
    
    futhark_mc_segmap_parloop_228588_task.name =
        "futhark_mc_segmap_parloop_228588";
    futhark_mc_segmap_parloop_228588_task.fn = futhark_mc_segmap_parloop_228588;
    futhark_mc_segmap_parloop_228588_task.args =
        &futhark_mc_segmap_parloop_struct_228587;
    futhark_mc_segmap_parloop_228588_task.iterations = iterations;
    futhark_mc_segmap_parloop_228588_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228588_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228588_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228588_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228588_task);
    
    if (futhark_mc_segmap_parloop_228588_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228588_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228588_total_end -
                 futhark_mc_segmap_parloop_228588_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228588_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228588_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228588_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228586_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228586_end -
                 futhark_mc_segmap_task_228586_start;
        
        ctx->futhark_mc_segmap_task_228586_runs[tid]++;
        ctx->futhark_mc_segmap_task_228586_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228586_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228590 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    unsigned char *free_mem_215991;
};
struct futhark_mc_task_228592 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    int64_t free_x_216309;
    float free_x_216310;
    int64_t free_defunc_0_m_fun_res_216312;
    float *retval_defunc_2_reduce_res_216321;
};
struct futhark_mc_segred_stage_1_parloop_struct_228595 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    int64_t free_x_216309;
    float free_x_216310;
    int64_t free_defunc_0_m_fun_res_216312;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_216599;
};
static int futhark_mc_segred_stage_1_parloop_228596(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_216537,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228595
    *futhark_mc_segred_stage_1_parloop_struct_228595 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228595 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228595->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228596_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228596_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_defunc_0_f_res_196740;
    int64_t gtid_201118 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228595->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228595->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_gtid_215989;
    int64_t x_215990 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_x_215990;
    int64_t x_216309 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_x_216309;
    float x_216310 =
          futhark_mc_segred_stage_1_parloop_struct_228595->free_x_216310;
    int64_t defunc_0_m_fun_res_216312 =
            futhark_mc_segred_stage_1_parloop_struct_228595->free_defunc_0_m_fun_res_216312;
    struct memblock reduce_stage_1_tid_res_arr_mem_216599 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_216599",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228595->free_reduce_stage_1_tid_res_arr_mem_216599,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_216601 = start;
    float x_216539;
    float x_216540;
    float local_acc_216602 = 0.0F;
    
    for (; iter_216601 < end; iter_216601++) {
        int64_t gtid_216538 = iter_216601;
        bool cond_216542 = sle64(x_215990, gtid_216538);
        int64_t defunc_0_f_res_216543;
        
        if (cond_216542) {
            defunc_0_f_res_216543 = (int64_t) 0;
        } else {
            int64_t i_216544 = add64(x_216309, gtid_216538);
            int64_t defunc_0_add_arg_216545;
            
            defunc_0_add_arg_216545 = ((int64_t *) mem_210590.mem)[gtid_201118 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_215989 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_216544];
            
            int64_t defunc_1_add_res_216546 = add64((int64_t) 1,
                                                    defunc_0_add_arg_216545);
            
            defunc_0_f_res_216543 = defunc_1_add_res_216546;
        }
        
        float defunc_0_f_res_216547;
        
        if (cond_216542) {
            defunc_0_f_res_216547 = 0.0F;
        } else {
            int64_t i_216548 = add64(x_216309, gtid_216538);
            float defunc_0_add_arg_216549;
            
            defunc_0_add_arg_216549 = ((float *) mem_211111.mem)[gtid_201118 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_215989 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_216548];
            defunc_0_f_res_216547 = defunc_0_add_arg_216549;
        }
        
        int64_t binop_p_216550 = sub64(defunc_0_f_res_216543,
                                       defunc_0_m_fun_res_216312);
        float defunc_0_f_res_216551 = sitofp_i64_f32(binop_p_216550);
        float abs_res_216552 = (float) fabs(defunc_0_f_res_216551);
        float tmp1_216553 = abs_res_216552 / x_216310;
        float x_216554 = tmp1_216553 * tmp1_216553;
        float y_216555 = tmp1_216553 * x_216554;
        float tmp2_216556 = 1.0F - y_216555;
        float x_216557 = tmp2_216556 * tmp2_216556;
        float tmp3_216558 = tmp2_216556 * x_216557;
        float w_j_216559 = defunc_0_f_res_216547 * tmp3_216558;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_216539 = local_acc_216602;
        }
        // Load next params
        {
            x_216540 = w_j_216559;
        }
        // Red body
        {
            float defunc_1_op_res_216541 = x_216539 + x_216540;
            
            local_acc_216602 = defunc_1_op_res_216541;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_216599.mem)[flat_tid_216537] =
        local_acc_216602;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228596_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228596_end -
                 futhark_mc_segred_stage_1_parloop_228596_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228596_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228596_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228596_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228593(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216537 = tid;
    int num_tasks_216598 = info.nsubtasks;
    struct futhark_mc_task_228592 *futhark_mc_task_228592 =
                                  (struct futhark_mc_task_228592 *) args;
    struct futhark_context *ctx = futhark_mc_task_228592->ctx;
    uint64_t futhark_mc_segred_task_228593_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228593_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228592->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228592->free_defunc_0_f_res_196740;
    int64_t gtid_201118 = futhark_mc_task_228592->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228592->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228592->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 = futhark_mc_task_228592->free_gtid_215989;
    int64_t x_215990 = futhark_mc_task_228592->free_x_215990;
    int64_t x_216309 = futhark_mc_task_228592->free_x_216309;
    float x_216310 = futhark_mc_task_228592->free_x_216310;
    int64_t defunc_0_m_fun_res_216312 =
            futhark_mc_task_228592->free_defunc_0_m_fun_res_216312;
    float defunc_2_reduce_res_216321 =
          *futhark_mc_task_228592->retval_defunc_2_reduce_res_216321;
    size_t reduce_stage_1_tid_res_arr_mem_216599_cached_sizze_228594 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_216599 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_216599_cached_sizze_228594 <
        (size_t) ((int64_t) 4 * num_tasks_216598)) {
        reduce_stage_1_tid_res_arr_mem_216599 =
            realloc(reduce_stage_1_tid_res_arr_mem_216599, (int64_t) 4 *
                    num_tasks_216598);
        reduce_stage_1_tid_res_arr_mem_216599_cached_sizze_228594 =
            (int64_t) 4 * num_tasks_216598;
    }
    
    int64_t iter_216601;
    struct futhark_mc_segred_stage_1_parloop_struct_228595
    futhark_mc_segred_stage_1_parloop_struct_228595;
    
    futhark_mc_segred_stage_1_parloop_struct_228595.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_gtid_201118 =
        gtid_201118;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_gtid_215989 =
        gtid_215989;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_x_215990 = x_215990;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_x_216309 = x_216309;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_x_216310 = x_216310;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_defunc_0_m_fun_res_216312 =
        defunc_0_m_fun_res_216312;
    futhark_mc_segred_stage_1_parloop_struct_228595.free_reduce_stage_1_tid_res_arr_mem_216599 =
        reduce_stage_1_tid_res_arr_mem_216599;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228596_task;
    
    futhark_mc_segred_stage_1_parloop_228596_task.name =
        "futhark_mc_segred_stage_1_parloop_228596";
    futhark_mc_segred_stage_1_parloop_228596_task.fn =
        futhark_mc_segred_stage_1_parloop_228596;
    futhark_mc_segred_stage_1_parloop_228596_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228595;
    futhark_mc_segred_stage_1_parloop_228596_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228596_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228596_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228596_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228596_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228596_task);
    
    if (futhark_mc_segred_stage_1_parloop_228596_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228596_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228596_total_end -
                 futhark_mc_segred_stage_1_parloop_228596_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228596_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228596_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228596_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_216321 = 0.0F;
    }
    
    float x_216603;
    float x_216604;
    
    for (int32_t i_216606 = 0; i_216606 < num_tasks_216598; i_216606++) {
        flat_tid_216537 = i_216606;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_216603 = defunc_2_reduce_res_216321;
            }
            // load next params
            {
                x_216604 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_216599)[flat_tid_216537];
            }
            // red body
            {
                float defunc_1_op_res_216605 = x_216603 + x_216604;
                
                defunc_2_reduce_res_216321 = defunc_1_op_res_216605;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_216599);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228593_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228593_end -
                 futhark_mc_segred_task_228593_start;
        
        ctx->futhark_mc_segred_task_228593_runs[tid]++;
        ctx->futhark_mc_segred_task_228593_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228593_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228592->retval_defunc_2_reduce_res_216321 =
            defunc_2_reduce_res_216321;
    }
    return err;
}
struct futhark_mc_task_228597 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    int64_t free_x_216309;
    float free_x_216310;
    float free_a0_216345;
    int64_t free_defunc_0_m_fun_res_216346;
    float *retval_defunc_2_reduce_res_216355;
};
struct futhark_mc_segred_stage_1_parloop_struct_228600 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201118;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_215989;
    int64_t free_x_215990;
    int64_t free_x_216309;
    float free_x_216310;
    float free_a0_216345;
    int64_t free_defunc_0_m_fun_res_216346;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_216608;
};
static int futhark_mc_segred_stage_1_parloop_228601(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_216568,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228600
    *futhark_mc_segred_stage_1_parloop_struct_228600 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228600 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228600->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228601_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228601_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_defunc_0_f_res_196740;
    int64_t gtid_201118 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228600->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228600->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228600->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_gtid_215989;
    int64_t x_215990 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_x_215990;
    int64_t x_216309 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_x_216309;
    float x_216310 =
          futhark_mc_segred_stage_1_parloop_struct_228600->free_x_216310;
    float a0_216345 =
          futhark_mc_segred_stage_1_parloop_struct_228600->free_a0_216345;
    int64_t defunc_0_m_fun_res_216346 =
            futhark_mc_segred_stage_1_parloop_struct_228600->free_defunc_0_m_fun_res_216346;
    struct memblock reduce_stage_1_tid_res_arr_mem_216608 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_216608",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228600->free_reduce_stage_1_tid_res_arr_mem_216608,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_216610 = start;
    float x_216570;
    float x_216571;
    float local_acc_216611 = 0.0F;
    
    for (; iter_216610 < end; iter_216610++) {
        int64_t gtid_216569 = iter_216610;
        bool cond_216573 = sle64(x_215990, gtid_216569);
        int64_t defunc_0_f_res_216574;
        
        if (cond_216573) {
            defunc_0_f_res_216574 = (int64_t) 0;
        } else {
            int64_t i_216575 = add64(x_216309, gtid_216569);
            int64_t defunc_0_add_arg_216576;
            
            defunc_0_add_arg_216576 = ((int64_t *) mem_210590.mem)[gtid_201118 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_215989 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_216575];
            
            int64_t defunc_1_add_res_216577 = add64((int64_t) 1,
                                                    defunc_0_add_arg_216576);
            
            defunc_0_f_res_216574 = defunc_1_add_res_216577;
        }
        
        float defunc_0_f_res_216578;
        
        if (cond_216573) {
            defunc_0_f_res_216578 = 0.0F;
        } else {
            int64_t i_216579 = add64(x_216309, gtid_216569);
            float defunc_0_add_arg_216580;
            
            defunc_0_add_arg_216580 = ((float *) mem_211111.mem)[gtid_201118 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_215989 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_216579];
            defunc_0_f_res_216578 = defunc_0_add_arg_216580;
        }
        
        int64_t binop_p_216581 = sub64(defunc_0_f_res_216574,
                                       defunc_0_m_fun_res_216346);
        float defunc_0_f_res_216582 = sitofp_i64_f32(binop_p_216581);
        float abs_res_216583 = (float) fabs(defunc_0_f_res_216582);
        float tmp1_216584 = abs_res_216583 / x_216310;
        float x_216585 = tmp1_216584 * tmp1_216584;
        float y_216586 = tmp1_216584 * x_216585;
        float tmp2_216587 = 1.0F - y_216586;
        float x_216588 = tmp2_216587 * tmp2_216587;
        float tmp3_216589 = tmp2_216587 * x_216588;
        float tmp4_216590 = defunc_0_f_res_216578 * tmp3_216589;
        float defunc_0_f_res_216591;
        
        if (cond_216573) {
            defunc_0_f_res_216591 = 0.0F;
        } else {
            int64_t i_216592 = add64(x_216309, gtid_216569);
            float defunc_0_add_arg_216593;
            
            defunc_0_add_arg_216593 = ((float *) mem_211106.mem)[gtid_201118 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_215989 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_216592];
            defunc_0_f_res_216591 = defunc_0_add_arg_216593;
        }
        
        float x_216594 = a0_216345 * tmp4_216590;
        float defunc_9_fit_fun_res_216595 = defunc_0_f_res_216591 * x_216594;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_216570 = local_acc_216611;
        }
        // Load next params
        {
            x_216571 = defunc_9_fit_fun_res_216595;
        }
        // Red body
        {
            float defunc_1_op_res_216572 = x_216570 + x_216571;
            
            local_acc_216611 = defunc_1_op_res_216572;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_216608.mem)[flat_tid_216568] =
        local_acc_216611;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228601_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228601_end -
                 futhark_mc_segred_stage_1_parloop_228601_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228601_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228601_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228601_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228598(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216568 = tid;
    int num_tasks_216607 = info.nsubtasks;
    struct futhark_mc_task_228597 *futhark_mc_task_228597 =
                                  (struct futhark_mc_task_228597 *) args;
    struct futhark_context *ctx = futhark_mc_task_228597->ctx;
    uint64_t futhark_mc_segred_task_228598_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228598_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228597->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228597->free_defunc_0_f_res_196740;
    int64_t gtid_201118 = futhark_mc_task_228597->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228597->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228597->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228597->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 = futhark_mc_task_228597->free_gtid_215989;
    int64_t x_215990 = futhark_mc_task_228597->free_x_215990;
    int64_t x_216309 = futhark_mc_task_228597->free_x_216309;
    float x_216310 = futhark_mc_task_228597->free_x_216310;
    float a0_216345 = futhark_mc_task_228597->free_a0_216345;
    int64_t defunc_0_m_fun_res_216346 =
            futhark_mc_task_228597->free_defunc_0_m_fun_res_216346;
    float defunc_2_reduce_res_216355 =
          *futhark_mc_task_228597->retval_defunc_2_reduce_res_216355;
    size_t reduce_stage_1_tid_res_arr_mem_216608_cached_sizze_228599 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_216608 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_216608_cached_sizze_228599 <
        (size_t) ((int64_t) 4 * num_tasks_216607)) {
        reduce_stage_1_tid_res_arr_mem_216608 =
            realloc(reduce_stage_1_tid_res_arr_mem_216608, (int64_t) 4 *
                    num_tasks_216607);
        reduce_stage_1_tid_res_arr_mem_216608_cached_sizze_228599 =
            (int64_t) 4 * num_tasks_216607;
    }
    
    int64_t iter_216610;
    struct futhark_mc_segred_stage_1_parloop_struct_228600
    futhark_mc_segred_stage_1_parloop_struct_228600;
    
    futhark_mc_segred_stage_1_parloop_struct_228600.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_gtid_201118 =
        gtid_201118;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_mem_211106 =
        mem_211106.mem;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_gtid_215989 =
        gtid_215989;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_x_215990 = x_215990;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_x_216309 = x_216309;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_x_216310 = x_216310;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_a0_216345 = a0_216345;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_defunc_0_m_fun_res_216346 =
        defunc_0_m_fun_res_216346;
    futhark_mc_segred_stage_1_parloop_struct_228600.free_reduce_stage_1_tid_res_arr_mem_216608 =
        reduce_stage_1_tid_res_arr_mem_216608;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228601_task;
    
    futhark_mc_segred_stage_1_parloop_228601_task.name =
        "futhark_mc_segred_stage_1_parloop_228601";
    futhark_mc_segred_stage_1_parloop_228601_task.fn =
        futhark_mc_segred_stage_1_parloop_228601;
    futhark_mc_segred_stage_1_parloop_228601_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228600;
    futhark_mc_segred_stage_1_parloop_228601_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228601_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228601_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228601_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228601_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228601_task);
    
    if (futhark_mc_segred_stage_1_parloop_228601_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228601_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228601_total_end -
                 futhark_mc_segred_stage_1_parloop_228601_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228601_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228601_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228601_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_216355 = 0.0F;
    }
    
    float x_216612;
    float x_216613;
    
    for (int32_t i_216615 = 0; i_216615 < num_tasks_216607; i_216615++) {
        flat_tid_216568 = i_216615;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_216612 = defunc_2_reduce_res_216355;
            }
            // load next params
            {
                x_216613 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_216608)[flat_tid_216568];
            }
            // red body
            {
                float defunc_1_op_res_216614 = x_216612 + x_216613;
                
                defunc_2_reduce_res_216355 = defunc_1_op_res_216614;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_216608);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228598_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228598_end -
                 futhark_mc_segred_task_228598_start;
        
        ctx->futhark_mc_segred_task_228598_runs[tid]++;
        ctx->futhark_mc_segred_task_228598_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228598_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228597->retval_defunc_2_reduce_res_216355 =
            defunc_2_reduce_res_216355;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228591(void *args, int64_t start,
                                            int64_t end, int flat_tid_216307,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228590
    *futhark_mc_segmap_parloop_struct_228590 =
    (struct futhark_mc_segmap_parloop_struct_228590 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228590->ctx;
    uint64_t futhark_mc_segmap_parloop_228591_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228591_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228590->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228590->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228590->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228590->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228590->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228590->free_s_n_m_196745;
    int64_t gtid_201118 =
            futhark_mc_segmap_parloop_struct_228590->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228590->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228590->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228590->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228590->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228590->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 =
            futhark_mc_segmap_parloop_struct_228590->free_gtid_215989;
    int64_t x_215990 = futhark_mc_segmap_parloop_struct_228590->free_x_215990;
    struct memblock mem_215991 = {.desc ="mem_215991", .mem =
                                  futhark_mc_segmap_parloop_struct_228590->free_mem_215991,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_216528 = start;
    
    for (; iter_216528 < end; iter_216528++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_216596 = s_n_m_196745;
        int64_t gtid_216308 = iter_216528;
        int64_t remnant_216597 = iter_216528 - gtid_216308;
        int64_t x_216309;
        
        x_216309 = ((int64_t *) mem_210764.mem)[gtid_201118 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_215989 * s_n_m_196745 +
                                                gtid_216308];
        
        float x_216310;
        
        x_216310 = ((float *) mem_210769.mem)[gtid_201118 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_215989 * s_n_m_196745 +
                                              gtid_216308];
        
        bool cond_216311 = gtid_216308 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_216312;
        
        if (cond_216311) {
            defunc_0_m_fun_res_216312 = (int64_t) 0;
        } else {
            int64_t y_216529 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_216530 = gtid_216308 == y_216529;
            int64_t defunc_0_m_fun_res_f_res_216531;
            
            if (cond_216530) {
                int64_t defunc_0_m_fun_res_f_res_t_res_216532 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_216531 =
                    defunc_0_m_fun_res_f_res_t_res_216532;
            } else {
                int64_t x_216533 = sub64(gtid_216308, (int64_t) 1);
                int64_t x_216534 = mul64(jump_s_196701, x_216533);
                int64_t min_arg_216535 = add64((int64_t) 1, x_216534);
                int64_t min_res_216536 = smin64(defunc_0_f_res_196740,
                                                min_arg_216535);
                
                defunc_0_m_fun_res_f_res_216531 = min_res_216536;
            }
            defunc_0_m_fun_res_216312 = defunc_0_m_fun_res_f_res_216531;
        }
        
        float defunc_2_reduce_res_216321;
        int64_t flat_tid_216537 = (int64_t) 0;
        int32_t num_tasks_216598;
        
        defunc_2_reduce_res_216321 = 0.0F;
        
        struct futhark_mc_task_228592 futhark_mc_task_228592;
        
        futhark_mc_task_228592.ctx = ctx;
        futhark_mc_task_228592.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228592.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228592.free_gtid_201118 = gtid_201118;
        futhark_mc_task_228592.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228592.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228592.free_gtid_215989 = gtid_215989;
        futhark_mc_task_228592.free_x_215990 = x_215990;
        futhark_mc_task_228592.free_x_216309 = x_216309;
        futhark_mc_task_228592.free_x_216310 = x_216310;
        futhark_mc_task_228592.free_defunc_0_m_fun_res_216312 =
            defunc_0_m_fun_res_216312;
        futhark_mc_task_228592.retval_defunc_2_reduce_res_216321 =
            &defunc_2_reduce_res_216321;
        
        struct scheduler_segop futhark_mc_task_228592_task;
        
        futhark_mc_task_228592_task.args = &futhark_mc_task_228592;
        futhark_mc_task_228592_task.top_level_fn =
            futhark_mc_segred_task_228593;
        futhark_mc_task_228592_task.name = "futhark_mc_segred_task_228593";
        futhark_mc_task_228592_task.iterations = q_s_196695;
        futhark_mc_task_228592_task.task_time =
            &ctx->futhark_mc_segred_task_228593_total_time;
        futhark_mc_task_228592_task.task_iter =
            &ctx->futhark_mc_segred_task_228593_total_iter;
        futhark_mc_task_228592_task.sched = STATIC;
        futhark_mc_task_228592_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228593_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228592_task);
        
        if (futhark_mc_segred_task_228593_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float a0_216345 = 1.0F / defunc_2_reduce_res_216321;
        int64_t defunc_0_m_fun_res_216346;
        
        if (cond_216311) {
            defunc_0_m_fun_res_216346 = (int64_t) 0;
        } else {
            int64_t y_216560 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_216561 = gtid_216308 == y_216560;
            int64_t defunc_0_m_fun_res_f_res_216562;
            
            if (cond_216561) {
                int64_t defunc_0_m_fun_res_f_res_t_res_216563 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_216562 =
                    defunc_0_m_fun_res_f_res_t_res_216563;
            } else {
                int64_t x_216564 = sub64(gtid_216308, (int64_t) 1);
                int64_t x_216565 = mul64(jump_s_196701, x_216564);
                int64_t min_arg_216566 = add64((int64_t) 1, x_216565);
                int64_t min_res_216567 = smin64(defunc_0_f_res_196740,
                                                min_arg_216566);
                
                defunc_0_m_fun_res_f_res_216562 = min_res_216567;
            }
            defunc_0_m_fun_res_216346 = defunc_0_m_fun_res_f_res_216562;
        }
        
        float defunc_2_reduce_res_216355;
        int64_t flat_tid_216568 = (int64_t) 0;
        int32_t num_tasks_216607;
        
        defunc_2_reduce_res_216355 = 0.0F;
        
        struct futhark_mc_task_228597 futhark_mc_task_228597;
        
        futhark_mc_task_228597.ctx = ctx;
        futhark_mc_task_228597.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228597.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228597.free_gtid_201118 = gtid_201118;
        futhark_mc_task_228597.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228597.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228597.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228597.free_gtid_215989 = gtid_215989;
        futhark_mc_task_228597.free_x_215990 = x_215990;
        futhark_mc_task_228597.free_x_216309 = x_216309;
        futhark_mc_task_228597.free_x_216310 = x_216310;
        futhark_mc_task_228597.free_a0_216345 = a0_216345;
        futhark_mc_task_228597.free_defunc_0_m_fun_res_216346 =
            defunc_0_m_fun_res_216346;
        futhark_mc_task_228597.retval_defunc_2_reduce_res_216355 =
            &defunc_2_reduce_res_216355;
        
        struct scheduler_segop futhark_mc_task_228597_task;
        
        futhark_mc_task_228597_task.args = &futhark_mc_task_228597;
        futhark_mc_task_228597_task.top_level_fn =
            futhark_mc_segred_task_228598;
        futhark_mc_task_228597_task.name = "futhark_mc_segred_task_228598";
        futhark_mc_task_228597_task.iterations = q_s_196695;
        futhark_mc_task_228597_task.task_time =
            &ctx->futhark_mc_segred_task_228598_total_time;
        futhark_mc_task_228597_task.task_iter =
            &ctx->futhark_mc_segred_task_228598_total_iter;
        futhark_mc_task_228597_task.sched = STATIC;
        futhark_mc_task_228597_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228598_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228597_task);
        
        if (futhark_mc_segred_task_228598_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_215991.mem)[gtid_216308] = defunc_2_reduce_res_216355;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228591_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228591_end -
                 futhark_mc_segmap_parloop_228591_start;
        
        ctx->futhark_mc_segmap_parloop_228591_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228591_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228591_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228589(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216307 = tid;
    int num_tasks_216459 = info.nsubtasks;
    struct futhark_mc_task_228585 *futhark_mc_task_228585 =
                                  (struct futhark_mc_task_228585 *) args;
    struct futhark_context *ctx = futhark_mc_task_228585->ctx;
    uint64_t futhark_mc_segmap_nested_task_228589_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228589_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228585->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228585->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228585->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228585->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228585->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228585->free_s_n_m_196745;
    int64_t gtid_201118 = futhark_mc_task_228585->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228585->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228585->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228585->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228585->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228585->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_215989 = futhark_mc_task_228585->free_gtid_215989;
    int64_t x_215990 = futhark_mc_task_228585->free_x_215990;
    struct memblock mem_215991 = {.desc ="mem_215991", .mem =
                                  futhark_mc_task_228585->free_mem_215991,
                                  .size =0, .references =NULL};
    int64_t iter_216528;
    struct futhark_mc_segmap_parloop_struct_228590
    futhark_mc_segmap_parloop_struct_228590;
    
    futhark_mc_segmap_parloop_struct_228590.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228590.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228590.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228590.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228590.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228590.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228590.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228590.free_gtid_201118 = gtid_201118;
    futhark_mc_segmap_parloop_struct_228590.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228590.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228590.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228590.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228590.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228590.free_gtid_215989 = gtid_215989;
    futhark_mc_segmap_parloop_struct_228590.free_x_215990 = x_215990;
    futhark_mc_segmap_parloop_struct_228590.free_mem_215991 = mem_215991.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228591_task;
    
    futhark_mc_segmap_parloop_228591_task.name =
        "futhark_mc_segmap_parloop_228591";
    futhark_mc_segmap_parloop_228591_task.fn = futhark_mc_segmap_parloop_228591;
    futhark_mc_segmap_parloop_228591_task.args =
        &futhark_mc_segmap_parloop_struct_228590;
    futhark_mc_segmap_parloop_228591_task.iterations = iterations;
    futhark_mc_segmap_parloop_228591_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228591_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228591_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228591_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228591_task);
    
    if (futhark_mc_segmap_parloop_228591_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228591_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228591_total_end -
                 futhark_mc_segmap_parloop_228591_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228591_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228591_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228591_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228589_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228589_end -
                 futhark_mc_segmap_nested_task_228589_start;
        
        ctx->futhark_mc_segmap_nested_task_228589_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228589_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228589_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228583(void *args, int64_t start,
                                            int64_t end, int flat_tid_215988,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228582
    *futhark_mc_segmap_parloop_struct_228582 =
    (struct futhark_mc_segmap_parloop_struct_228582 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228582->ctx;
    uint64_t futhark_mc_segmap_parloop_228583_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228583_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228582->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228582->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228582->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228582->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228582->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228582->free_s_n_m_196745;
    int64_t gtid_201118 =
            futhark_mc_segmap_parloop_struct_228582->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228582->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211138 = {.desc ="mem_211138", .mem =
                                  futhark_mc_segmap_parloop_struct_228582->free_mem_211138,
                                  .size =0, .references =NULL};
    size_t mem_215991_cached_sizze_228584 = 0;
    unsigned char *mem_215991 = NULL;
    int64_t iterations = end - start;
    int64_t iter_216306 = start;
    
    if (mem_215991_cached_sizze_228584 < (size_t) bytes_210599) {
        mem_215991 = realloc(mem_215991, bytes_210599);
        mem_215991_cached_sizze_228584 = bytes_210599;
    }
    for (; iter_216306 < end; iter_216306++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_216457 = n_p_196694;
        int64_t gtid_215989 = iter_216306;
        int64_t remnant_216458 = iter_216306 - gtid_215989;
        int64_t x_215990;
        
        x_215990 = ((int64_t *) mem_210594.mem)[gtid_201118 * n_p_196694 +
                                                gtid_215989];
        
        int64_t flat_tid_216384 = (int64_t) 0;
        int32_t num_tasks_216459;
        int64_t flat_tid_216307 = (int64_t) 0;
        struct futhark_mc_task_228585 futhark_mc_task_228585;
        
        futhark_mc_task_228585.ctx = ctx;
        futhark_mc_task_228585.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228585.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228585.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228585.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228585.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228585.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228585.free_gtid_201118 = gtid_201118;
        futhark_mc_task_228585.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228585.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228585.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228585.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228585.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228585.free_gtid_215989 = gtid_215989;
        futhark_mc_task_228585.free_x_215990 = x_215990;
        futhark_mc_task_228585.free_mem_215991 = mem_215991;
        
        struct scheduler_segop futhark_mc_task_228585_task;
        
        futhark_mc_task_228585_task.args = &futhark_mc_task_228585;
        futhark_mc_task_228585_task.top_level_fn =
            futhark_mc_segmap_task_228586;
        futhark_mc_task_228585_task.name = "futhark_mc_segmap_task_228586";
        futhark_mc_task_228585_task.iterations = s_n_m_196745;
        futhark_mc_task_228585_task.task_time =
            &ctx->futhark_mc_segmap_task_228586_total_time;
        futhark_mc_task_228585_task.task_iter =
            &ctx->futhark_mc_segmap_task_228586_total_iter;
        futhark_mc_task_228585_task.sched = STATIC;
        futhark_mc_task_228585_task.nested_fn =
            futhark_mc_segmap_nested_task_228589;
        
        int futhark_mc_segmap_task_228586_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228585_task);
        
        if (futhark_mc_segmap_task_228586_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211138.mem + gtid_215989 * s_n_m_196745 * (int64_t) 4,
                    mem_215991 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_215991);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228583_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228583_end -
                 futhark_mc_segmap_parloop_228583_start;
        
        ctx->futhark_mc_segmap_parloop_228583_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228583_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228583_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228581(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_215988 = tid;
    int num_tasks_216225 = info.nsubtasks;
    struct futhark_mc_task_228576 *futhark_mc_task_228576 =
                                  (struct futhark_mc_task_228576 *) args;
    struct futhark_context *ctx = futhark_mc_task_228576->ctx;
    uint64_t futhark_mc_segmap_nested_task_228581_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228581_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228576->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228576->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228576->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228576->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228576->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228576->free_s_n_m_196745;
    int64_t gtid_201118 = futhark_mc_task_228576->free_gtid_201118;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228576->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228576->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228576->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228576->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228576->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228576->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228576->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211138 = {.desc ="mem_211138", .mem =
                                  futhark_mc_task_228576->free_mem_211138,
                                  .size =0, .references =NULL};
    int64_t iter_216306;
    struct futhark_mc_segmap_parloop_struct_228582
    futhark_mc_segmap_parloop_struct_228582;
    
    futhark_mc_segmap_parloop_struct_228582.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228582.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228582.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228582.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228582.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228582.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228582.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228582.free_gtid_201118 = gtid_201118;
    futhark_mc_segmap_parloop_struct_228582.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228582.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228582.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228582.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228582.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228582.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228582.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228582.free_mem_211138 = mem_211138.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228583_task;
    
    futhark_mc_segmap_parloop_228583_task.name =
        "futhark_mc_segmap_parloop_228583";
    futhark_mc_segmap_parloop_228583_task.fn = futhark_mc_segmap_parloop_228583;
    futhark_mc_segmap_parloop_228583_task.args =
        &futhark_mc_segmap_parloop_struct_228582;
    futhark_mc_segmap_parloop_228583_task.iterations = iterations;
    futhark_mc_segmap_parloop_228583_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228583_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228583_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228583_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228583_task);
    
    if (futhark_mc_segmap_parloop_228583_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228583_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228583_total_end -
                 futhark_mc_segmap_parloop_228583_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228583_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228583_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228583_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228581_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228581_end -
                 futhark_mc_segmap_nested_task_228581_start;
        
        ctx->futhark_mc_segmap_nested_task_228581_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228581_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228581_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228574(void *args, int64_t start,
                                            int64_t end, int flat_tid_201117,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228573
    *futhark_mc_segmap_parloop_struct_228573 =
    (struct futhark_mc_segmap_parloop_struct_228573 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228573->ctx;
    uint64_t futhark_mc_segmap_parloop_228574_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228574_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228573->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228573->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228573->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228573->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228573->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228573->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228573->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228573->free_bytes_210599;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228573->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211187 = {.desc ="mem_211187", .mem =
                                  futhark_mc_segmap_parloop_struct_228573->free_mem_211187,
                                  .size =0, .references =NULL};
    size_t mem_211138_cached_sizze_228575 = 0;
    unsigned char *mem_211138 = NULL;
    int64_t iterations = end - start;
    int64_t iter_215987 = start;
    
    if (mem_211138_cached_sizze_228575 < (size_t) bytes_210655) {
        mem_211138 = realloc(mem_211138, bytes_210655);
        mem_211138_cached_sizze_228575 = bytes_210655;
    }
    for (; iter_215987 < end; iter_215987++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_216223 = m_196691;
        int64_t gtid_201118 = iter_215987;
        int64_t remnant_216224 = iter_215987 - gtid_201118;
        int64_t flat_tid_216143 = (int64_t) 0;
        int32_t num_tasks_216225;
        int64_t flat_tid_215988 = (int64_t) 0;
        struct futhark_mc_task_228576 futhark_mc_task_228576;
        
        futhark_mc_task_228576.ctx = ctx;
        futhark_mc_task_228576.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228576.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228576.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228576.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228576.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228576.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228576.free_gtid_201118 = gtid_201118;
        futhark_mc_task_228576.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228576.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228576.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228576.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228576.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228576.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228576.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228576.free_mem_211138 = mem_211138;
        
        struct scheduler_segop futhark_mc_task_228576_task;
        
        futhark_mc_task_228576_task.args = &futhark_mc_task_228576;
        futhark_mc_task_228576_task.top_level_fn =
            futhark_mc_segmap_task_228577;
        futhark_mc_task_228576_task.name = "futhark_mc_segmap_task_228577";
        futhark_mc_task_228576_task.iterations = n_p_196694;
        futhark_mc_task_228576_task.task_time =
            &ctx->futhark_mc_segmap_task_228577_total_time;
        futhark_mc_task_228576_task.task_iter =
            &ctx->futhark_mc_segmap_task_228577_total_iter;
        futhark_mc_task_228576_task.sched = STATIC;
        futhark_mc_task_228576_task.nested_fn =
            futhark_mc_segmap_nested_task_228581;
        
        int futhark_mc_segmap_task_228577_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228576_task);
        
        if (futhark_mc_segmap_task_228577_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211187.mem + gtid_201118 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211138 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211138);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228574_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228574_end -
                 futhark_mc_segmap_parloop_228574_start;
        
        ctx->futhark_mc_segmap_parloop_228574_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228574_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228574_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228572(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_201117 = tid;
    int num_tasks_215901 = info.nsubtasks;
    struct futhark_mc_task_228567 *futhark_mc_task_228567 =
                                  (struct futhark_mc_task_228567 *) args;
    struct futhark_context *ctx = futhark_mc_task_228567->ctx;
    uint64_t futhark_mc_segmap_nested_task_228572_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228572_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228567->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228567->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228567->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228567->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228567->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228567->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228567->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228567->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228567->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228567->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228567->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228567->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228567->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228567->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228567->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211187 = {.desc ="mem_211187", .mem =
                                  futhark_mc_task_228567->free_mem_211187,
                                  .size =0, .references =NULL};
    int64_t iter_215987;
    struct futhark_mc_segmap_parloop_struct_228573
    futhark_mc_segmap_parloop_struct_228573;
    
    futhark_mc_segmap_parloop_struct_228573.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228573.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228573.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228573.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228573.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228573.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228573.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228573.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228573.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228573.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228573.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228573.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228573.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228573.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228573.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228573.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228573.free_mem_211187 = mem_211187.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228574_task;
    
    futhark_mc_segmap_parloop_228574_task.name =
        "futhark_mc_segmap_parloop_228574";
    futhark_mc_segmap_parloop_228574_task.fn = futhark_mc_segmap_parloop_228574;
    futhark_mc_segmap_parloop_228574_task.args =
        &futhark_mc_segmap_parloop_struct_228573;
    futhark_mc_segmap_parloop_228574_task.iterations = iterations;
    futhark_mc_segmap_parloop_228574_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228574_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228574_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228574_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228574_task);
    
    if (futhark_mc_segmap_parloop_228574_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228574_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228574_total_end -
                 futhark_mc_segmap_parloop_228574_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228574_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228574_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228574_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228572_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228572_end -
                 futhark_mc_segmap_nested_task_228572_start;
        
        ctx->futhark_mc_segmap_nested_task_228572_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228572_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228572_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228602 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211324;
    unsigned char *free_mem_211329;
};
struct futhark_mc_segmap_parloop_struct_228604 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211324;
    unsigned char *free_mem_211329;
};
static int futhark_mc_segmap_parloop_228605(void *args, int64_t start,
                                            int64_t end, int flat_tid_201374,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228604
    *futhark_mc_segmap_parloop_struct_228604 =
    (struct futhark_mc_segmap_parloop_struct_228604 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228604->ctx;
    uint64_t futhark_mc_segmap_parloop_228605_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228605_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228604->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228604->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228604->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228604->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228604->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228604->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228604->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228604->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211324 = {.desc ="mem_211324", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_211324,
                                  .size =0, .references =NULL};
    struct memblock mem_211329 = {.desc ="mem_211329", .mem =
                                  futhark_mc_segmap_parloop_struct_228604->free_mem_211329,
                                  .size =0, .references =NULL};
    size_t mem_211235_cached_sizze_228606 = 0;
    unsigned char *mem_211235 = NULL;
    size_t mem_211239_cached_sizze_228607 = 0;
    unsigned char *mem_211239 = NULL;
    int64_t iterations = end - start;
    int64_t iter_216617 = start;
    
    if (mem_211235_cached_sizze_228606 < (size_t) bytes_210655) {
        mem_211235 = realloc(mem_211235, bytes_210655);
        mem_211235_cached_sizze_228606 = bytes_210655;
    }
    if (mem_211239_cached_sizze_228607 < (size_t) bytes_210655) {
        mem_211239 = realloc(mem_211239, bytes_210655);
        mem_211239_cached_sizze_228607 = bytes_210655;
    }
    for (; iter_216617 < end; iter_216617++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_216725 = m_196691;
        int64_t gtid_201375 = iter_216617;
        int64_t remnant_216726 = iter_216617 - gtid_201375;
        
        for (int64_t i_216618 = 0; i_216618 < n_p_196694; i_216618++) {
            int64_t x_216621;
            
            x_216621 = ((int64_t *) mem_210594.mem)[gtid_201375 * n_p_196694 +
                                                    i_216618];
            for (int64_t i_216624 = 0; i_216624 < s_n_m_196745; i_216624++) {
                int64_t x_216627;
                
                x_216627 = ((int64_t *) mem_210764.mem)[gtid_201375 *
                                                        (s_n_m_196745 *
                                                         n_p_196694) +
                                                        i_216618 *
                                                        s_n_m_196745 +
                                                        i_216624];
                
                float x_216628;
                
                x_216628 = ((float *) mem_210769.mem)[gtid_201375 *
                                                      (s_n_m_196745 *
                                                       n_p_196694) + i_216618 *
                                                      s_n_m_196745 + i_216624];
                
                bool cond_216629 = i_216624 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_216630;
                
                if (cond_216629) {
                    defunc_0_m_fun_res_216630 = (int64_t) 0;
                } else {
                    int64_t y_216631 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_216632 = i_216624 == y_216631;
                    int64_t defunc_0_m_fun_res_f_res_216633;
                    
                    if (cond_216632) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_216634 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_216633 =
                            defunc_0_m_fun_res_f_res_t_res_216634;
                    } else {
                        int64_t x_216635 = sub64(i_216624, (int64_t) 1);
                        int64_t x_216636 = mul64(jump_s_196701, x_216635);
                        int64_t min_arg_216637 = add64((int64_t) 1, x_216636);
                        int64_t min_res_216638 = smin64(defunc_0_f_res_196740,
                                                        min_arg_216637);
                        
                        defunc_0_m_fun_res_f_res_216633 = min_res_216638;
                    }
                    defunc_0_m_fun_res_216630 = defunc_0_m_fun_res_f_res_216633;
                }
                
                float defunc_2_reduce_res_216639;
                float defunc_2_reduce_res_216640;
                float defunc_2_reduce_res_216641;
                float redout_216643;
                float redout_216644;
                float redout_216645;
                
                redout_216643 = 0.0F;
                redout_216644 = 0.0F;
                redout_216645 = 0.0F;
                for (int64_t i_216642 = 0; i_216642 < q_s_196695; i_216642++) {
                    bool cond_216646 = sle64(x_216621, i_216642);
                    int64_t defunc_0_f_res_216647;
                    
                    if (cond_216646) {
                        defunc_0_f_res_216647 = (int64_t) 0;
                    } else {
                        int64_t i_216648 = add64(x_216627, i_216642);
                        int64_t defunc_0_add_arg_216649;
                        
                        defunc_0_add_arg_216649 =
                            ((int64_t *) mem_210590.mem)[gtid_201375 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_216618 *
                                                         defunc_0_f_res_196740 +
                                                         i_216648];
                        
                        int64_t defunc_1_add_res_216650 = add64((int64_t) 1,
                                                                defunc_0_add_arg_216649);
                        
                        defunc_0_f_res_216647 = defunc_1_add_res_216650;
                    }
                    
                    float defunc_0_f_res_216651;
                    
                    if (cond_216646) {
                        defunc_0_f_res_216651 = 0.0F;
                    } else {
                        int64_t i_216652 = add64(x_216627, i_216642);
                        float defunc_0_add_arg_216653;
                        
                        defunc_0_add_arg_216653 =
                            ((float *) mem_211111.mem)[gtid_201375 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_216618 *
                                                       defunc_0_f_res_196740 +
                                                       i_216652];
                        defunc_0_f_res_216651 = defunc_0_add_arg_216653;
                    }
                    
                    int64_t binop_p_216654 = sub64(defunc_0_f_res_216647,
                                                   defunc_0_m_fun_res_216630);
                    float defunc_0_f_res_216655 =
                          sitofp_i64_f32(binop_p_216654);
                    float abs_res_216656 = (float) fabs(defunc_0_f_res_216655);
                    float tmp1_216657 = abs_res_216656 / x_216628;
                    float x_216658 = tmp1_216657 * tmp1_216657;
                    float y_216659 = tmp1_216657 * x_216658;
                    float tmp2_216660 = 1.0F - y_216659;
                    float x_216661 = tmp2_216660 * tmp2_216660;
                    float tmp3_216662 = tmp2_216660 * x_216661;
                    float w_j_216663 = defunc_0_f_res_216651 * tmp3_216662;
                    float xw_j_216664 = defunc_0_f_res_216655 * w_j_216663;
                    float x2w_j_216665 = defunc_0_f_res_216655 * xw_j_216664;
                    float defunc_1_op_res_216666 = w_j_216663 + redout_216643;
                    float defunc_1_op_res_216667 = xw_j_216664 + redout_216644;
                    float defunc_1_op_res_216668 = x2w_j_216665 + redout_216645;
                    float redout_tmp_216731 = defunc_1_op_res_216666;
                    float redout_tmp_216732 = defunc_1_op_res_216667;
                    float redout_tmp_216733 = defunc_1_op_res_216668;
                    
                    redout_216643 = redout_tmp_216731;
                    redout_216644 = redout_tmp_216732;
                    redout_216645 = redout_tmp_216733;
                }
                defunc_2_reduce_res_216639 = redout_216643;
                defunc_2_reduce_res_216640 = redout_216644;
                defunc_2_reduce_res_216641 = redout_216645;
                
                float x_216669 = defunc_2_reduce_res_216639 *
                      defunc_2_reduce_res_216641;
                float y_216670 = defunc_2_reduce_res_216640 *
                      defunc_2_reduce_res_216640;
                float y_216671 = x_216669 - y_216670;
                float det1_216672 = 1.0F / y_216671;
                float a11_216673 = defunc_2_reduce_res_216641 * det1_216672;
                float x_216674 = 0.0F - defunc_2_reduce_res_216640;
                float b11_216675 = det1_216672 * x_216674;
                float c11_216676 = defunc_2_reduce_res_216639 * det1_216672;
                int64_t defunc_0_m_fun_res_216677;
                
                if (cond_216629) {
                    defunc_0_m_fun_res_216677 = (int64_t) 0;
                } else {
                    int64_t y_216678 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_216679 = i_216624 == y_216678;
                    int64_t defunc_0_m_fun_res_f_res_216680;
                    
                    if (cond_216679) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_216681 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_216680 =
                            defunc_0_m_fun_res_f_res_t_res_216681;
                    } else {
                        int64_t x_216682 = sub64(i_216624, (int64_t) 1);
                        int64_t x_216683 = mul64(jump_s_196701, x_216682);
                        int64_t min_arg_216684 = add64((int64_t) 1, x_216683);
                        int64_t min_res_216685 = smin64(defunc_0_f_res_196740,
                                                        min_arg_216684);
                        
                        defunc_0_m_fun_res_f_res_216680 = min_res_216685;
                    }
                    defunc_0_m_fun_res_216677 = defunc_0_m_fun_res_f_res_216680;
                }
                
                float defunc_2_reduce_res_216686;
                float defunc_2_reduce_res_216687;
                float redout_216689;
                float redout_216690;
                
                redout_216689 = 0.0F;
                redout_216690 = 0.0F;
                for (int64_t i_216688 = 0; i_216688 < q_s_196695; i_216688++) {
                    bool cond_216691 = sle64(x_216621, i_216688);
                    int64_t defunc_0_f_res_216692;
                    
                    if (cond_216691) {
                        defunc_0_f_res_216692 = (int64_t) 0;
                    } else {
                        int64_t i_216693 = add64(x_216627, i_216688);
                        int64_t defunc_0_add_arg_216694;
                        
                        defunc_0_add_arg_216694 =
                            ((int64_t *) mem_210590.mem)[gtid_201375 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_216618 *
                                                         defunc_0_f_res_196740 +
                                                         i_216693];
                        
                        int64_t defunc_1_add_res_216695 = add64((int64_t) 1,
                                                                defunc_0_add_arg_216694);
                        
                        defunc_0_f_res_216692 = defunc_1_add_res_216695;
                    }
                    
                    float defunc_0_f_res_216696;
                    
                    if (cond_216691) {
                        defunc_0_f_res_216696 = 0.0F;
                    } else {
                        int64_t i_216697 = add64(x_216627, i_216688);
                        float defunc_0_add_arg_216698;
                        
                        defunc_0_add_arg_216698 =
                            ((float *) mem_211111.mem)[gtid_201375 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_216618 *
                                                       defunc_0_f_res_196740 +
                                                       i_216697];
                        defunc_0_f_res_216696 = defunc_0_add_arg_216698;
                    }
                    
                    int64_t binop_p_216699 = sub64(defunc_0_f_res_216692,
                                                   defunc_0_m_fun_res_216677);
                    float defunc_0_f_res_216700 =
                          sitofp_i64_f32(binop_p_216699);
                    float abs_res_216701 = (float) fabs(defunc_0_f_res_216700);
                    float tmp1_216702 = abs_res_216701 / x_216628;
                    float x_216703 = tmp1_216702 * tmp1_216702;
                    float y_216704 = tmp1_216702 * x_216703;
                    float tmp2_216705 = 1.0F - y_216704;
                    float x_216706 = tmp2_216705 * tmp2_216705;
                    float tmp3_216707 = tmp2_216705 * x_216706;
                    float tmp4_216708 = defunc_0_f_res_216696 * tmp3_216707;
                    float defunc_1_f_res_216709 = defunc_0_f_res_216700 *
                          tmp4_216708;
                    float defunc_0_f_res_216710;
                    
                    if (cond_216691) {
                        defunc_0_f_res_216710 = 0.0F;
                    } else {
                        int64_t i_216711 = add64(x_216627, i_216688);
                        float defunc_0_add_arg_216712;
                        
                        defunc_0_add_arg_216712 =
                            ((float *) mem_211106.mem)[gtid_201375 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_216618 *
                                                       defunc_0_f_res_196740 +
                                                       i_216711];
                        defunc_0_f_res_216710 = defunc_0_add_arg_216712;
                    }
                    
                    float x_216713 = a11_216673 * tmp4_216708;
                    float y_216714 = b11_216675 * defunc_1_f_res_216709;
                    float x_216715 = x_216713 + y_216714;
                    float defunc_9_fit_fun_res_216716 = defunc_0_f_res_216710 *
                          x_216715;
                    float x_216717 = b11_216675 * tmp4_216708;
                    float y_216718 = c11_216676 * defunc_1_f_res_216709;
                    float x_216719 = x_216717 + y_216718;
                    float defunc_9_slope_fun_res_216720 =
                          defunc_0_f_res_216710 * x_216719;
                    float defunc_1_op_res_216721 = defunc_9_fit_fun_res_216716 +
                          redout_216689;
                    float defunc_1_op_res_216722 =
                          defunc_9_slope_fun_res_216720 + redout_216690;
                    float redout_tmp_216734 = defunc_1_op_res_216721;
                    float redout_tmp_216735 = defunc_1_op_res_216722;
                    
                    redout_216689 = redout_tmp_216734;
                    redout_216690 = redout_tmp_216735;
                }
                defunc_2_reduce_res_216686 = redout_216689;
                defunc_2_reduce_res_216687 = redout_216690;
                ((float *) mem_211235)[i_216618 * s_n_m_196745 + i_216624] =
                    defunc_2_reduce_res_216686;
                ((float *) mem_211239)[i_216618 * s_n_m_196745 + i_216624] =
                    defunc_2_reduce_res_216687;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211324.mem + gtid_201375 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211235 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211329.mem + gtid_201375 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211239 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211235);
    free(mem_211239);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228605_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228605_end -
                 futhark_mc_segmap_parloop_228605_start;
        
        ctx->futhark_mc_segmap_parloop_228605_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228605_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228605_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228603(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_201374 = tid;
    int num_tasks_216616 = info.nsubtasks;
    struct futhark_mc_task_228602 *futhark_mc_task_228602 =
                                  (struct futhark_mc_task_228602 *) args;
    struct futhark_context *ctx = futhark_mc_task_228602->ctx;
    uint64_t futhark_mc_segmap_task_228603_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228603_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228602->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228602->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228602->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228602->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228602->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228602->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228602->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228602->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228602->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228602->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228602->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228602->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228602->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228602->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228602->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211324 = {.desc ="mem_211324", .mem =
                                  futhark_mc_task_228602->free_mem_211324,
                                  .size =0, .references =NULL};
    struct memblock mem_211329 = {.desc ="mem_211329", .mem =
                                  futhark_mc_task_228602->free_mem_211329,
                                  .size =0, .references =NULL};
    int64_t iter_216617;
    struct futhark_mc_segmap_parloop_struct_228604
    futhark_mc_segmap_parloop_struct_228604;
    
    futhark_mc_segmap_parloop_struct_228604.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228604.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228604.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228604.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228604.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228604.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228604.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228604.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228604.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228604.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228604.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228604.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228604.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228604.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228604.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228604.free_mem_211324 = mem_211324.mem;
    futhark_mc_segmap_parloop_struct_228604.free_mem_211329 = mem_211329.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228605_task;
    
    futhark_mc_segmap_parloop_228605_task.name =
        "futhark_mc_segmap_parloop_228605";
    futhark_mc_segmap_parloop_228605_task.fn = futhark_mc_segmap_parloop_228605;
    futhark_mc_segmap_parloop_228605_task.args =
        &futhark_mc_segmap_parloop_struct_228604;
    futhark_mc_segmap_parloop_228605_task.iterations = iterations;
    futhark_mc_segmap_parloop_228605_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228605_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228605_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228605_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228605_task);
    
    if (futhark_mc_segmap_parloop_228605_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228605_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228605_total_end -
                 futhark_mc_segmap_parloop_228605_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228605_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228605_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228605_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228603_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228603_end -
                 futhark_mc_segmap_task_228603_start;
        
        ctx->futhark_mc_segmap_task_228603_runs[tid]++;
        ctx->futhark_mc_segmap_task_228603_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228603_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228609 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211324;
    unsigned char *free_mem_211329;
};
struct futhark_mc_task_228613 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211227;
    unsigned char *free_mem_211231;
};
struct futhark_mc_segmap_parloop_struct_228615 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211227;
    unsigned char *free_mem_211231;
};
static int futhark_mc_segmap_parloop_228616(void *args, int64_t start,
                                            int64_t end, int flat_tid_216947,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228615
    *futhark_mc_segmap_parloop_struct_228615 =
    (struct futhark_mc_segmap_parloop_struct_228615 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228615->ctx;
    uint64_t futhark_mc_segmap_parloop_228616_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228616_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228615->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228615->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228615->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228615->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228615->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228615->free_s_n_m_196745;
    int64_t gtid_201721 =
            futhark_mc_segmap_parloop_struct_228615->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228615->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211227 = {.desc ="mem_211227", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_211227,
                                  .size =0, .references =NULL};
    struct memblock mem_211231 = {.desc ="mem_211231", .mem =
                                  futhark_mc_segmap_parloop_struct_228615->free_mem_211231,
                                  .size =0, .references =NULL};
    size_t mem_216950_cached_sizze_228617 = 0;
    unsigned char *mem_216950 = NULL;
    size_t mem_216952_cached_sizze_228618 = 0;
    unsigned char *mem_216952 = NULL;
    int64_t iterations = end - start;
    int64_t iter_217060 = start;
    
    if (mem_216950_cached_sizze_228617 < (size_t) bytes_210599) {
        mem_216950 = realloc(mem_216950, bytes_210599);
        mem_216950_cached_sizze_228617 = bytes_210599;
    }
    if (mem_216952_cached_sizze_228618 < (size_t) bytes_210599) {
        mem_216952 = realloc(mem_216952, bytes_210599);
        mem_216952_cached_sizze_228618 = bytes_210599;
    }
    for (; iter_217060 < end; iter_217060++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_217162 = n_p_196694;
        int64_t gtid_216948 = iter_217060;
        int64_t remnant_217163 = iter_217060 - gtid_216948;
        int64_t x_216949;
        
        x_216949 = ((int64_t *) mem_210594.mem)[gtid_201721 * n_p_196694 +
                                                gtid_216948];
        for (int64_t i_217061 = 0; i_217061 < s_n_m_196745; i_217061++) {
            int64_t x_217064;
            
            x_217064 = ((int64_t *) mem_210764.mem)[gtid_201721 *
                                                    (s_n_m_196745 *
                                                     n_p_196694) + gtid_216948 *
                                                    s_n_m_196745 + i_217061];
            
            float x_217065;
            
            x_217065 = ((float *) mem_210769.mem)[gtid_201721 * (s_n_m_196745 *
                                                                 n_p_196694) +
                                                  gtid_216948 * s_n_m_196745 +
                                                  i_217061];
            
            bool cond_217066 = i_217061 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_217067;
            
            if (cond_217066) {
                defunc_0_m_fun_res_217067 = (int64_t) 0;
            } else {
                int64_t y_217068 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_217069 = i_217061 == y_217068;
                int64_t defunc_0_m_fun_res_f_res_217070;
                
                if (cond_217069) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_217071 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_217070 =
                        defunc_0_m_fun_res_f_res_t_res_217071;
                } else {
                    int64_t x_217072 = sub64(i_217061, (int64_t) 1);
                    int64_t x_217073 = mul64(jump_s_196701, x_217072);
                    int64_t min_arg_217074 = add64((int64_t) 1, x_217073);
                    int64_t min_res_217075 = smin64(defunc_0_f_res_196740,
                                                    min_arg_217074);
                    
                    defunc_0_m_fun_res_f_res_217070 = min_res_217075;
                }
                defunc_0_m_fun_res_217067 = defunc_0_m_fun_res_f_res_217070;
            }
            
            float defunc_2_reduce_res_217076;
            float defunc_2_reduce_res_217077;
            float defunc_2_reduce_res_217078;
            float redout_217080;
            float redout_217081;
            float redout_217082;
            
            redout_217080 = 0.0F;
            redout_217081 = 0.0F;
            redout_217082 = 0.0F;
            for (int64_t i_217079 = 0; i_217079 < q_s_196695; i_217079++) {
                bool cond_217083 = sle64(x_216949, i_217079);
                int64_t defunc_0_f_res_217084;
                
                if (cond_217083) {
                    defunc_0_f_res_217084 = (int64_t) 0;
                } else {
                    int64_t i_217085 = add64(x_217064, i_217079);
                    int64_t defunc_0_add_arg_217086;
                    
                    defunc_0_add_arg_217086 =
                        ((int64_t *) mem_210590.mem)[gtid_201721 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_216948 *
                                                     defunc_0_f_res_196740 +
                                                     i_217085];
                    
                    int64_t defunc_1_add_res_217087 = add64((int64_t) 1,
                                                            defunc_0_add_arg_217086);
                    
                    defunc_0_f_res_217084 = defunc_1_add_res_217087;
                }
                
                float defunc_0_f_res_217088;
                
                if (cond_217083) {
                    defunc_0_f_res_217088 = 0.0F;
                } else {
                    int64_t i_217089 = add64(x_217064, i_217079);
                    float defunc_0_add_arg_217090;
                    
                    defunc_0_add_arg_217090 =
                        ((float *) mem_211111.mem)[gtid_201721 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_216948 *
                                                   defunc_0_f_res_196740 +
                                                   i_217089];
                    defunc_0_f_res_217088 = defunc_0_add_arg_217090;
                }
                
                int64_t binop_p_217091 = sub64(defunc_0_f_res_217084,
                                               defunc_0_m_fun_res_217067);
                float defunc_0_f_res_217092 = sitofp_i64_f32(binop_p_217091);
                float abs_res_217093 = (float) fabs(defunc_0_f_res_217092);
                float tmp1_217094 = abs_res_217093 / x_217065;
                float x_217095 = tmp1_217094 * tmp1_217094;
                float y_217096 = tmp1_217094 * x_217095;
                float tmp2_217097 = 1.0F - y_217096;
                float x_217098 = tmp2_217097 * tmp2_217097;
                float tmp3_217099 = tmp2_217097 * x_217098;
                float w_j_217100 = defunc_0_f_res_217088 * tmp3_217099;
                float xw_j_217101 = defunc_0_f_res_217092 * w_j_217100;
                float x2w_j_217102 = defunc_0_f_res_217092 * xw_j_217101;
                float defunc_1_op_res_217103 = w_j_217100 + redout_217080;
                float defunc_1_op_res_217104 = xw_j_217101 + redout_217081;
                float defunc_1_op_res_217105 = x2w_j_217102 + redout_217082;
                float redout_tmp_217166 = defunc_1_op_res_217103;
                float redout_tmp_217167 = defunc_1_op_res_217104;
                float redout_tmp_217168 = defunc_1_op_res_217105;
                
                redout_217080 = redout_tmp_217166;
                redout_217081 = redout_tmp_217167;
                redout_217082 = redout_tmp_217168;
            }
            defunc_2_reduce_res_217076 = redout_217080;
            defunc_2_reduce_res_217077 = redout_217081;
            defunc_2_reduce_res_217078 = redout_217082;
            
            float x_217106 = defunc_2_reduce_res_217076 *
                  defunc_2_reduce_res_217078;
            float y_217107 = defunc_2_reduce_res_217077 *
                  defunc_2_reduce_res_217077;
            float y_217108 = x_217106 - y_217107;
            float det1_217109 = 1.0F / y_217108;
            float a11_217110 = defunc_2_reduce_res_217078 * det1_217109;
            float x_217111 = 0.0F - defunc_2_reduce_res_217077;
            float b11_217112 = det1_217109 * x_217111;
            float c11_217113 = defunc_2_reduce_res_217076 * det1_217109;
            int64_t defunc_0_m_fun_res_217114;
            
            if (cond_217066) {
                defunc_0_m_fun_res_217114 = (int64_t) 0;
            } else {
                int64_t y_217115 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_217116 = i_217061 == y_217115;
                int64_t defunc_0_m_fun_res_f_res_217117;
                
                if (cond_217116) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_217118 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_217117 =
                        defunc_0_m_fun_res_f_res_t_res_217118;
                } else {
                    int64_t x_217119 = sub64(i_217061, (int64_t) 1);
                    int64_t x_217120 = mul64(jump_s_196701, x_217119);
                    int64_t min_arg_217121 = add64((int64_t) 1, x_217120);
                    int64_t min_res_217122 = smin64(defunc_0_f_res_196740,
                                                    min_arg_217121);
                    
                    defunc_0_m_fun_res_f_res_217117 = min_res_217122;
                }
                defunc_0_m_fun_res_217114 = defunc_0_m_fun_res_f_res_217117;
            }
            
            float defunc_2_reduce_res_217123;
            float defunc_2_reduce_res_217124;
            float redout_217126;
            float redout_217127;
            
            redout_217126 = 0.0F;
            redout_217127 = 0.0F;
            for (int64_t i_217125 = 0; i_217125 < q_s_196695; i_217125++) {
                bool cond_217128 = sle64(x_216949, i_217125);
                int64_t defunc_0_f_res_217129;
                
                if (cond_217128) {
                    defunc_0_f_res_217129 = (int64_t) 0;
                } else {
                    int64_t i_217130 = add64(x_217064, i_217125);
                    int64_t defunc_0_add_arg_217131;
                    
                    defunc_0_add_arg_217131 =
                        ((int64_t *) mem_210590.mem)[gtid_201721 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_216948 *
                                                     defunc_0_f_res_196740 +
                                                     i_217130];
                    
                    int64_t defunc_1_add_res_217132 = add64((int64_t) 1,
                                                            defunc_0_add_arg_217131);
                    
                    defunc_0_f_res_217129 = defunc_1_add_res_217132;
                }
                
                float defunc_0_f_res_217133;
                
                if (cond_217128) {
                    defunc_0_f_res_217133 = 0.0F;
                } else {
                    int64_t i_217134 = add64(x_217064, i_217125);
                    float defunc_0_add_arg_217135;
                    
                    defunc_0_add_arg_217135 =
                        ((float *) mem_211111.mem)[gtid_201721 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_216948 *
                                                   defunc_0_f_res_196740 +
                                                   i_217134];
                    defunc_0_f_res_217133 = defunc_0_add_arg_217135;
                }
                
                int64_t binop_p_217136 = sub64(defunc_0_f_res_217129,
                                               defunc_0_m_fun_res_217114);
                float defunc_0_f_res_217137 = sitofp_i64_f32(binop_p_217136);
                float abs_res_217138 = (float) fabs(defunc_0_f_res_217137);
                float tmp1_217139 = abs_res_217138 / x_217065;
                float x_217140 = tmp1_217139 * tmp1_217139;
                float y_217141 = tmp1_217139 * x_217140;
                float tmp2_217142 = 1.0F - y_217141;
                float x_217143 = tmp2_217142 * tmp2_217142;
                float tmp3_217144 = tmp2_217142 * x_217143;
                float tmp4_217145 = defunc_0_f_res_217133 * tmp3_217144;
                float defunc_1_f_res_217146 = defunc_0_f_res_217137 *
                      tmp4_217145;
                float defunc_0_f_res_217147;
                
                if (cond_217128) {
                    defunc_0_f_res_217147 = 0.0F;
                } else {
                    int64_t i_217148 = add64(x_217064, i_217125);
                    float defunc_0_add_arg_217149;
                    
                    defunc_0_add_arg_217149 =
                        ((float *) mem_211106.mem)[gtid_201721 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_216948 *
                                                   defunc_0_f_res_196740 +
                                                   i_217148];
                    defunc_0_f_res_217147 = defunc_0_add_arg_217149;
                }
                
                float x_217150 = a11_217110 * tmp4_217145;
                float y_217151 = b11_217112 * defunc_1_f_res_217146;
                float x_217152 = x_217150 + y_217151;
                float defunc_9_fit_fun_res_217153 = defunc_0_f_res_217147 *
                      x_217152;
                float x_217154 = b11_217112 * tmp4_217145;
                float y_217155 = c11_217113 * defunc_1_f_res_217146;
                float x_217156 = x_217154 + y_217155;
                float defunc_9_slope_fun_res_217157 = defunc_0_f_res_217147 *
                      x_217156;
                float defunc_1_op_res_217158 = defunc_9_fit_fun_res_217153 +
                      redout_217126;
                float defunc_1_op_res_217159 = defunc_9_slope_fun_res_217157 +
                      redout_217127;
                float redout_tmp_217169 = defunc_1_op_res_217158;
                float redout_tmp_217170 = defunc_1_op_res_217159;
                
                redout_217126 = redout_tmp_217169;
                redout_217127 = redout_tmp_217170;
            }
            defunc_2_reduce_res_217123 = redout_217126;
            defunc_2_reduce_res_217124 = redout_217127;
            ((float *) mem_216950)[i_217061] = defunc_2_reduce_res_217123;
            ((float *) mem_216952)[i_217061] = defunc_2_reduce_res_217124;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211227.mem + gtid_216948 * s_n_m_196745 * (int64_t) 4,
                    mem_216950 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211231.mem + gtid_216948 * s_n_m_196745 * (int64_t) 4,
                    mem_216952 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_216950);
    free(mem_216952);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228616_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228616_end -
                 futhark_mc_segmap_parloop_228616_start;
        
        ctx->futhark_mc_segmap_parloop_228616_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228616_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228616_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228614(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216947 = tid;
    int num_tasks_217059 = info.nsubtasks;
    struct futhark_mc_task_228613 *futhark_mc_task_228613 =
                                  (struct futhark_mc_task_228613 *) args;
    struct futhark_context *ctx = futhark_mc_task_228613->ctx;
    uint64_t futhark_mc_segmap_task_228614_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228614_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228613->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228613->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228613->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228613->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228613->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228613->free_s_n_m_196745;
    int64_t gtid_201721 = futhark_mc_task_228613->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228613->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228613->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228613->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228613->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228613->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228613->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228613->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211227 = {.desc ="mem_211227", .mem =
                                  futhark_mc_task_228613->free_mem_211227,
                                  .size =0, .references =NULL};
    struct memblock mem_211231 = {.desc ="mem_211231", .mem =
                                  futhark_mc_task_228613->free_mem_211231,
                                  .size =0, .references =NULL};
    int64_t iter_217060;
    struct futhark_mc_segmap_parloop_struct_228615
    futhark_mc_segmap_parloop_struct_228615;
    
    futhark_mc_segmap_parloop_struct_228615.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228615.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228615.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228615.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228615.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228615.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228615.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228615.free_gtid_201721 = gtid_201721;
    futhark_mc_segmap_parloop_struct_228615.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228615.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228615.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228615.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228615.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228615.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228615.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228615.free_mem_211227 = mem_211227.mem;
    futhark_mc_segmap_parloop_struct_228615.free_mem_211231 = mem_211231.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228616_task;
    
    futhark_mc_segmap_parloop_228616_task.name =
        "futhark_mc_segmap_parloop_228616";
    futhark_mc_segmap_parloop_228616_task.fn = futhark_mc_segmap_parloop_228616;
    futhark_mc_segmap_parloop_228616_task.args =
        &futhark_mc_segmap_parloop_struct_228615;
    futhark_mc_segmap_parloop_228616_task.iterations = iterations;
    futhark_mc_segmap_parloop_228616_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228616_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228616_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228616_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228616_task);
    
    if (futhark_mc_segmap_parloop_228616_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228616_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228616_total_end -
                 futhark_mc_segmap_parloop_228616_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228616_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228616_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228616_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228614_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228614_end -
                 futhark_mc_segmap_task_228614_start;
        
        ctx->futhark_mc_segmap_task_228614_runs[tid]++;
        ctx->futhark_mc_segmap_task_228614_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228614_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228620 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211227;
    unsigned char *free_mem_211231;
};
struct futhark_mc_task_228624 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    unsigned char *free_mem_216740;
    unsigned char *free_mem_216741;
};
struct futhark_mc_segmap_parloop_struct_228626 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    unsigned char *free_mem_216740;
    unsigned char *free_mem_216741;
};
static int futhark_mc_segmap_parloop_228627(void *args, int64_t start,
                                            int64_t end, int flat_tid_217277,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228626
    *futhark_mc_segmap_parloop_struct_228626 =
    (struct futhark_mc_segmap_parloop_struct_228626 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228626->ctx;
    uint64_t futhark_mc_segmap_parloop_228627_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228627_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228626->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228626->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228626->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228626->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228626->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228626->free_s_n_m_196745;
    int64_t gtid_201721 =
            futhark_mc_segmap_parloop_struct_228626->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 =
            futhark_mc_segmap_parloop_struct_228626->free_gtid_216738;
    int64_t x_216739 = futhark_mc_segmap_parloop_struct_228626->free_x_216739;
    struct memblock mem_216740 = {.desc ="mem_216740", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_216740,
                                  .size =0, .references =NULL};
    struct memblock mem_216741 = {.desc ="mem_216741", .mem =
                                  futhark_mc_segmap_parloop_struct_228626->free_mem_216741,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_217378 = start;
    
    for (; iter_217378 < end; iter_217378++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_217457 = s_n_m_196745;
        int64_t gtid_217278 = iter_217378;
        int64_t remnant_217458 = iter_217378 - gtid_217278;
        int64_t x_217279;
        
        x_217279 = ((int64_t *) mem_210764.mem)[gtid_201721 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_216738 * s_n_m_196745 +
                                                gtid_217278];
        
        float x_217280;
        
        x_217280 = ((float *) mem_210769.mem)[gtid_201721 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_216738 * s_n_m_196745 +
                                              gtid_217278];
        
        bool cond_217281 = gtid_217278 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_217282;
        
        if (cond_217281) {
            defunc_0_m_fun_res_217282 = (int64_t) 0;
        } else {
            int64_t y_217379 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_217380 = gtid_217278 == y_217379;
            int64_t defunc_0_m_fun_res_f_res_217381;
            
            if (cond_217380) {
                int64_t defunc_0_m_fun_res_f_res_t_res_217382 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_217381 =
                    defunc_0_m_fun_res_f_res_t_res_217382;
            } else {
                int64_t x_217383 = sub64(gtid_217278, (int64_t) 1);
                int64_t x_217384 = mul64(jump_s_196701, x_217383);
                int64_t min_arg_217385 = add64((int64_t) 1, x_217384);
                int64_t min_res_217386 = smin64(defunc_0_f_res_196740,
                                                min_arg_217385);
                
                defunc_0_m_fun_res_f_res_217381 = min_res_217386;
            }
            defunc_0_m_fun_res_217282 = defunc_0_m_fun_res_f_res_217381;
        }
        
        float defunc_2_reduce_res_217291;
        float defunc_2_reduce_res_217292;
        float defunc_2_reduce_res_217293;
        float redout_217388;
        float redout_217389;
        float redout_217390;
        
        redout_217388 = 0.0F;
        redout_217389 = 0.0F;
        redout_217390 = 0.0F;
        for (int64_t i_217387 = 0; i_217387 < q_s_196695; i_217387++) {
            bool cond_217391 = sle64(x_216739, i_217387);
            int64_t defunc_0_f_res_217392;
            
            if (cond_217391) {
                defunc_0_f_res_217392 = (int64_t) 0;
            } else {
                int64_t i_217393 = add64(x_217279, i_217387);
                int64_t defunc_0_add_arg_217394;
                
                defunc_0_add_arg_217394 =
                    ((int64_t *) mem_210590.mem)[gtid_201721 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_216738 *
                                                 defunc_0_f_res_196740 +
                                                 i_217393];
                
                int64_t defunc_1_add_res_217395 = add64((int64_t) 1,
                                                        defunc_0_add_arg_217394);
                
                defunc_0_f_res_217392 = defunc_1_add_res_217395;
            }
            
            float defunc_0_f_res_217396;
            
            if (cond_217391) {
                defunc_0_f_res_217396 = 0.0F;
            } else {
                int64_t i_217397 = add64(x_217279, i_217387);
                float defunc_0_add_arg_217398;
                
                defunc_0_add_arg_217398 =
                    ((float *) mem_211111.mem)[gtid_201721 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_216738 *
                                               defunc_0_f_res_196740 +
                                               i_217397];
                defunc_0_f_res_217396 = defunc_0_add_arg_217398;
            }
            
            int64_t binop_p_217399 = sub64(defunc_0_f_res_217392,
                                           defunc_0_m_fun_res_217282);
            float defunc_0_f_res_217400 = sitofp_i64_f32(binop_p_217399);
            float abs_res_217401 = (float) fabs(defunc_0_f_res_217400);
            float tmp1_217402 = abs_res_217401 / x_217280;
            float x_217403 = tmp1_217402 * tmp1_217402;
            float y_217404 = tmp1_217402 * x_217403;
            float tmp2_217405 = 1.0F - y_217404;
            float x_217406 = tmp2_217405 * tmp2_217405;
            float tmp3_217407 = tmp2_217405 * x_217406;
            float w_j_217408 = defunc_0_f_res_217396 * tmp3_217407;
            float xw_j_217409 = defunc_0_f_res_217400 * w_j_217408;
            float x2w_j_217410 = defunc_0_f_res_217400 * xw_j_217409;
            float defunc_1_op_res_217411 = w_j_217408 + redout_217388;
            float defunc_1_op_res_217412 = xw_j_217409 + redout_217389;
            float defunc_1_op_res_217413 = x2w_j_217410 + redout_217390;
            float redout_tmp_217459 = defunc_1_op_res_217411;
            float redout_tmp_217460 = defunc_1_op_res_217412;
            float redout_tmp_217461 = defunc_1_op_res_217413;
            
            redout_217388 = redout_tmp_217459;
            redout_217389 = redout_tmp_217460;
            redout_217390 = redout_tmp_217461;
        }
        defunc_2_reduce_res_217291 = redout_217388;
        defunc_2_reduce_res_217292 = redout_217389;
        defunc_2_reduce_res_217293 = redout_217390;
        
        float x_217321 = defunc_2_reduce_res_217291 *
              defunc_2_reduce_res_217293;
        float y_217322 = defunc_2_reduce_res_217292 *
              defunc_2_reduce_res_217292;
        float y_217323 = x_217321 - y_217322;
        float det1_217324 = 1.0F / y_217323;
        float a11_217325 = defunc_2_reduce_res_217293 * det1_217324;
        float x_217326 = 0.0F - defunc_2_reduce_res_217292;
        float b11_217327 = det1_217324 * x_217326;
        float c11_217328 = defunc_2_reduce_res_217291 * det1_217324;
        int64_t defunc_0_m_fun_res_217329;
        
        if (cond_217281) {
            defunc_0_m_fun_res_217329 = (int64_t) 0;
        } else {
            int64_t y_217414 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_217415 = gtid_217278 == y_217414;
            int64_t defunc_0_m_fun_res_f_res_217416;
            
            if (cond_217415) {
                int64_t defunc_0_m_fun_res_f_res_t_res_217417 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_217416 =
                    defunc_0_m_fun_res_f_res_t_res_217417;
            } else {
                int64_t x_217418 = sub64(gtid_217278, (int64_t) 1);
                int64_t x_217419 = mul64(jump_s_196701, x_217418);
                int64_t min_arg_217420 = add64((int64_t) 1, x_217419);
                int64_t min_res_217421 = smin64(defunc_0_f_res_196740,
                                                min_arg_217420);
                
                defunc_0_m_fun_res_f_res_217416 = min_res_217421;
            }
            defunc_0_m_fun_res_217329 = defunc_0_m_fun_res_f_res_217416;
        }
        
        float defunc_2_reduce_res_217338;
        float defunc_2_reduce_res_217339;
        float redout_217423;
        float redout_217424;
        
        redout_217423 = 0.0F;
        redout_217424 = 0.0F;
        for (int64_t i_217422 = 0; i_217422 < q_s_196695; i_217422++) {
            bool cond_217425 = sle64(x_216739, i_217422);
            int64_t defunc_0_f_res_217426;
            
            if (cond_217425) {
                defunc_0_f_res_217426 = (int64_t) 0;
            } else {
                int64_t i_217427 = add64(x_217279, i_217422);
                int64_t defunc_0_add_arg_217428;
                
                defunc_0_add_arg_217428 =
                    ((int64_t *) mem_210590.mem)[gtid_201721 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_216738 *
                                                 defunc_0_f_res_196740 +
                                                 i_217427];
                
                int64_t defunc_1_add_res_217429 = add64((int64_t) 1,
                                                        defunc_0_add_arg_217428);
                
                defunc_0_f_res_217426 = defunc_1_add_res_217429;
            }
            
            float defunc_0_f_res_217430;
            
            if (cond_217425) {
                defunc_0_f_res_217430 = 0.0F;
            } else {
                int64_t i_217431 = add64(x_217279, i_217422);
                float defunc_0_add_arg_217432;
                
                defunc_0_add_arg_217432 =
                    ((float *) mem_211111.mem)[gtid_201721 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_216738 *
                                               defunc_0_f_res_196740 +
                                               i_217431];
                defunc_0_f_res_217430 = defunc_0_add_arg_217432;
            }
            
            int64_t binop_p_217433 = sub64(defunc_0_f_res_217426,
                                           defunc_0_m_fun_res_217329);
            float defunc_0_f_res_217434 = sitofp_i64_f32(binop_p_217433);
            float abs_res_217435 = (float) fabs(defunc_0_f_res_217434);
            float tmp1_217436 = abs_res_217435 / x_217280;
            float x_217437 = tmp1_217436 * tmp1_217436;
            float y_217438 = tmp1_217436 * x_217437;
            float tmp2_217439 = 1.0F - y_217438;
            float x_217440 = tmp2_217439 * tmp2_217439;
            float tmp3_217441 = tmp2_217439 * x_217440;
            float tmp4_217442 = defunc_0_f_res_217430 * tmp3_217441;
            float defunc_1_f_res_217443 = defunc_0_f_res_217434 * tmp4_217442;
            float defunc_0_f_res_217444;
            
            if (cond_217425) {
                defunc_0_f_res_217444 = 0.0F;
            } else {
                int64_t i_217445 = add64(x_217279, i_217422);
                float defunc_0_add_arg_217446;
                
                defunc_0_add_arg_217446 =
                    ((float *) mem_211106.mem)[gtid_201721 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_216738 *
                                               defunc_0_f_res_196740 +
                                               i_217445];
                defunc_0_f_res_217444 = defunc_0_add_arg_217446;
            }
            
            float x_217447 = a11_217325 * tmp4_217442;
            float y_217448 = b11_217327 * defunc_1_f_res_217443;
            float x_217449 = x_217447 + y_217448;
            float defunc_9_fit_fun_res_217450 = defunc_0_f_res_217444 *
                  x_217449;
            float x_217451 = b11_217327 * tmp4_217442;
            float y_217452 = c11_217328 * defunc_1_f_res_217443;
            float x_217453 = x_217451 + y_217452;
            float defunc_9_slope_fun_res_217454 = defunc_0_f_res_217444 *
                  x_217453;
            float defunc_1_op_res_217455 = defunc_9_fit_fun_res_217450 +
                  redout_217423;
            float defunc_1_op_res_217456 = defunc_9_slope_fun_res_217454 +
                  redout_217424;
            float redout_tmp_217462 = defunc_1_op_res_217455;
            float redout_tmp_217463 = defunc_1_op_res_217456;
            
            redout_217423 = redout_tmp_217462;
            redout_217424 = redout_tmp_217463;
        }
        defunc_2_reduce_res_217338 = redout_217423;
        defunc_2_reduce_res_217339 = redout_217424;
        ((float *) mem_216740.mem)[gtid_217278] = defunc_2_reduce_res_217338;
        ((float *) mem_216741.mem)[gtid_217278] = defunc_2_reduce_res_217339;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228627_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228627_end -
                 futhark_mc_segmap_parloop_228627_start;
        
        ctx->futhark_mc_segmap_parloop_228627_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228627_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228627_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228625(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_217277 = tid;
    int num_tasks_217377 = info.nsubtasks;
    struct futhark_mc_task_228624 *futhark_mc_task_228624 =
                                  (struct futhark_mc_task_228624 *) args;
    struct futhark_context *ctx = futhark_mc_task_228624->ctx;
    uint64_t futhark_mc_segmap_task_228625_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228625_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228624->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228624->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228624->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228624->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228624->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228624->free_s_n_m_196745;
    int64_t gtid_201721 = futhark_mc_task_228624->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228624->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228624->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228624->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228624->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228624->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 = futhark_mc_task_228624->free_gtid_216738;
    int64_t x_216739 = futhark_mc_task_228624->free_x_216739;
    struct memblock mem_216740 = {.desc ="mem_216740", .mem =
                                  futhark_mc_task_228624->free_mem_216740,
                                  .size =0, .references =NULL};
    struct memblock mem_216741 = {.desc ="mem_216741", .mem =
                                  futhark_mc_task_228624->free_mem_216741,
                                  .size =0, .references =NULL};
    int64_t iter_217378;
    struct futhark_mc_segmap_parloop_struct_228626
    futhark_mc_segmap_parloop_struct_228626;
    
    futhark_mc_segmap_parloop_struct_228626.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228626.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228626.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228626.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228626.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228626.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228626.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228626.free_gtid_201721 = gtid_201721;
    futhark_mc_segmap_parloop_struct_228626.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228626.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228626.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228626.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228626.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228626.free_gtid_216738 = gtid_216738;
    futhark_mc_segmap_parloop_struct_228626.free_x_216739 = x_216739;
    futhark_mc_segmap_parloop_struct_228626.free_mem_216740 = mem_216740.mem;
    futhark_mc_segmap_parloop_struct_228626.free_mem_216741 = mem_216741.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228627_task;
    
    futhark_mc_segmap_parloop_228627_task.name =
        "futhark_mc_segmap_parloop_228627";
    futhark_mc_segmap_parloop_228627_task.fn = futhark_mc_segmap_parloop_228627;
    futhark_mc_segmap_parloop_228627_task.args =
        &futhark_mc_segmap_parloop_struct_228626;
    futhark_mc_segmap_parloop_228627_task.iterations = iterations;
    futhark_mc_segmap_parloop_228627_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228627_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228627_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228627_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228627_task);
    
    if (futhark_mc_segmap_parloop_228627_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228627_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228627_total_end -
                 futhark_mc_segmap_parloop_228627_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228627_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228627_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228627_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228625_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228625_end -
                 futhark_mc_segmap_task_228625_start;
        
        ctx->futhark_mc_segmap_task_228625_runs[tid]++;
        ctx->futhark_mc_segmap_task_228625_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228625_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228629 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    unsigned char *free_mem_216740;
    unsigned char *free_mem_216741;
};
struct futhark_mc_task_228631 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    int64_t free_x_217174;
    float free_x_217175;
    int64_t free_defunc_0_m_fun_res_217177;
    float *retval_defunc_2_reduce_res_217186;
    float *retval_defunc_2_reduce_res_217187;
    float *retval_defunc_2_reduce_res_217188;
};
struct futhark_mc_segred_stage_1_parloop_struct_228636 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    int64_t free_x_217174;
    float free_x_217175;
    int64_t free_defunc_0_m_fun_res_217177;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_217553;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_217555;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_217557;
};
static int futhark_mc_segred_stage_1_parloop_228637(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_217473,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228636
    *futhark_mc_segred_stage_1_parloop_struct_228636 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228636 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228636->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228637_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228637_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_defunc_0_f_res_196740;
    int64_t gtid_201721 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228636->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228636->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_gtid_216738;
    int64_t x_216739 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_x_216739;
    int64_t x_217174 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_x_217174;
    float x_217175 =
          futhark_mc_segred_stage_1_parloop_struct_228636->free_x_217175;
    int64_t defunc_0_m_fun_res_217177 =
            futhark_mc_segred_stage_1_parloop_struct_228636->free_defunc_0_m_fun_res_217177;
    struct memblock reduce_stage_1_tid_res_arr_mem_217553 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_217553",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228636->free_reduce_stage_1_tid_res_arr_mem_217553,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_217555 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_217555",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228636->free_reduce_stage_1_tid_res_arr_mem_217555,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_217557 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_217557",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228636->free_reduce_stage_1_tid_res_arr_mem_217557,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_217559 = start;
    float x_217475;
    float x_217476;
    float x_217478;
    float x_217479;
    float x_217481;
    float x_217482;
    float local_acc_217560 = 0.0F;
    float local_acc_217561 = 0.0F;
    float local_acc_217562 = 0.0F;
    
    for (; iter_217559 < end; iter_217559++) {
        int64_t gtid_217474 = iter_217559;
        bool cond_217484 = sle64(x_216739, gtid_217474);
        int64_t defunc_0_f_res_217485;
        
        if (cond_217484) {
            defunc_0_f_res_217485 = (int64_t) 0;
        } else {
            int64_t i_217486 = add64(x_217174, gtid_217474);
            int64_t defunc_0_add_arg_217487;
            
            defunc_0_add_arg_217487 = ((int64_t *) mem_210590.mem)[gtid_201721 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_216738 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_217486];
            
            int64_t defunc_1_add_res_217488 = add64((int64_t) 1,
                                                    defunc_0_add_arg_217487);
            
            defunc_0_f_res_217485 = defunc_1_add_res_217488;
        }
        
        float defunc_0_f_res_217489;
        
        if (cond_217484) {
            defunc_0_f_res_217489 = 0.0F;
        } else {
            int64_t i_217490 = add64(x_217174, gtid_217474);
            float defunc_0_add_arg_217491;
            
            defunc_0_add_arg_217491 = ((float *) mem_211111.mem)[gtid_201721 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_216738 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_217490];
            defunc_0_f_res_217489 = defunc_0_add_arg_217491;
        }
        
        int64_t binop_p_217492 = sub64(defunc_0_f_res_217485,
                                       defunc_0_m_fun_res_217177);
        float defunc_0_f_res_217493 = sitofp_i64_f32(binop_p_217492);
        float abs_res_217494 = (float) fabs(defunc_0_f_res_217493);
        float tmp1_217495 = abs_res_217494 / x_217175;
        float x_217496 = tmp1_217495 * tmp1_217495;
        float y_217497 = tmp1_217495 * x_217496;
        float tmp2_217498 = 1.0F - y_217497;
        float x_217499 = tmp2_217498 * tmp2_217498;
        float tmp3_217500 = tmp2_217498 * x_217499;
        float w_j_217501 = defunc_0_f_res_217489 * tmp3_217500;
        float xw_j_217502 = defunc_0_f_res_217493 * w_j_217501;
        float x2w_j_217503 = defunc_0_f_res_217493 * xw_j_217502;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_217475 = local_acc_217560;
        }
        // Load next params
        {
            x_217476 = w_j_217501;
        }
        // Red body
        {
            float defunc_1_op_res_217477 = x_217475 + x_217476;
            
            local_acc_217560 = defunc_1_op_res_217477;
        }
        // Load accum params
        {
            x_217478 = local_acc_217561;
        }
        // Load next params
        {
            x_217479 = xw_j_217502;
        }
        // Red body
        {
            float defunc_1_op_res_217480 = x_217478 + x_217479;
            
            local_acc_217561 = defunc_1_op_res_217480;
        }
        // Load accum params
        {
            x_217481 = local_acc_217562;
        }
        // Load next params
        {
            x_217482 = x2w_j_217503;
        }
        // Red body
        {
            float defunc_1_op_res_217483 = x_217481 + x_217482;
            
            local_acc_217562 = defunc_1_op_res_217483;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_217553.mem)[flat_tid_217473] =
        local_acc_217560;
    ((float *) reduce_stage_1_tid_res_arr_mem_217555.mem)[flat_tid_217473] =
        local_acc_217561;
    ((float *) reduce_stage_1_tid_res_arr_mem_217557.mem)[flat_tid_217473] =
        local_acc_217562;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228637_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228637_end -
                 futhark_mc_segred_stage_1_parloop_228637_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228637_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228637_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228637_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228632(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_217473 = tid;
    int num_tasks_217552 = info.nsubtasks;
    struct futhark_mc_task_228631 *futhark_mc_task_228631 =
                                  (struct futhark_mc_task_228631 *) args;
    struct futhark_context *ctx = futhark_mc_task_228631->ctx;
    uint64_t futhark_mc_segred_task_228632_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228632_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228631->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228631->free_defunc_0_f_res_196740;
    int64_t gtid_201721 = futhark_mc_task_228631->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228631->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228631->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 = futhark_mc_task_228631->free_gtid_216738;
    int64_t x_216739 = futhark_mc_task_228631->free_x_216739;
    int64_t x_217174 = futhark_mc_task_228631->free_x_217174;
    float x_217175 = futhark_mc_task_228631->free_x_217175;
    int64_t defunc_0_m_fun_res_217177 =
            futhark_mc_task_228631->free_defunc_0_m_fun_res_217177;
    float defunc_2_reduce_res_217186 =
          *futhark_mc_task_228631->retval_defunc_2_reduce_res_217186;
    float defunc_2_reduce_res_217187 =
          *futhark_mc_task_228631->retval_defunc_2_reduce_res_217187;
    float defunc_2_reduce_res_217188 =
          *futhark_mc_task_228631->retval_defunc_2_reduce_res_217188;
    size_t reduce_stage_1_tid_res_arr_mem_217553_cached_sizze_228633 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_217553 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_217555_cached_sizze_228634 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_217555 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_217557_cached_sizze_228635 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_217557 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_217553_cached_sizze_228633 <
        (size_t) ((int64_t) 4 * num_tasks_217552)) {
        reduce_stage_1_tid_res_arr_mem_217553 =
            realloc(reduce_stage_1_tid_res_arr_mem_217553, (int64_t) 4 *
                    num_tasks_217552);
        reduce_stage_1_tid_res_arr_mem_217553_cached_sizze_228633 =
            (int64_t) 4 * num_tasks_217552;
    }
    if (reduce_stage_1_tid_res_arr_mem_217555_cached_sizze_228634 <
        (size_t) ((int64_t) 4 * num_tasks_217552)) {
        reduce_stage_1_tid_res_arr_mem_217555 =
            realloc(reduce_stage_1_tid_res_arr_mem_217555, (int64_t) 4 *
                    num_tasks_217552);
        reduce_stage_1_tid_res_arr_mem_217555_cached_sizze_228634 =
            (int64_t) 4 * num_tasks_217552;
    }
    if (reduce_stage_1_tid_res_arr_mem_217557_cached_sizze_228635 <
        (size_t) ((int64_t) 4 * num_tasks_217552)) {
        reduce_stage_1_tid_res_arr_mem_217557 =
            realloc(reduce_stage_1_tid_res_arr_mem_217557, (int64_t) 4 *
                    num_tasks_217552);
        reduce_stage_1_tid_res_arr_mem_217557_cached_sizze_228635 =
            (int64_t) 4 * num_tasks_217552;
    }
    
    int64_t iter_217559;
    struct futhark_mc_segred_stage_1_parloop_struct_228636
    futhark_mc_segred_stage_1_parloop_struct_228636;
    
    futhark_mc_segred_stage_1_parloop_struct_228636.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_gtid_201721 =
        gtid_201721;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_gtid_216738 =
        gtid_216738;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_x_216739 = x_216739;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_x_217174 = x_217174;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_x_217175 = x_217175;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_defunc_0_m_fun_res_217177 =
        defunc_0_m_fun_res_217177;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_reduce_stage_1_tid_res_arr_mem_217553 =
        reduce_stage_1_tid_res_arr_mem_217553;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_reduce_stage_1_tid_res_arr_mem_217555 =
        reduce_stage_1_tid_res_arr_mem_217555;
    futhark_mc_segred_stage_1_parloop_struct_228636.free_reduce_stage_1_tid_res_arr_mem_217557 =
        reduce_stage_1_tid_res_arr_mem_217557;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228637_task;
    
    futhark_mc_segred_stage_1_parloop_228637_task.name =
        "futhark_mc_segred_stage_1_parloop_228637";
    futhark_mc_segred_stage_1_parloop_228637_task.fn =
        futhark_mc_segred_stage_1_parloop_228637;
    futhark_mc_segred_stage_1_parloop_228637_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228636;
    futhark_mc_segred_stage_1_parloop_228637_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228637_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228637_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228637_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228637_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228637_task);
    
    if (futhark_mc_segred_stage_1_parloop_228637_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228637_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228637_total_end -
                 futhark_mc_segred_stage_1_parloop_228637_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228637_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228637_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228637_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_217186 = 0.0F;
        defunc_2_reduce_res_217187 = 0.0F;
        defunc_2_reduce_res_217188 = 0.0F;
    }
    
    float x_217563;
    float x_217564;
    float x_217566;
    float x_217567;
    float x_217569;
    float x_217570;
    
    for (int32_t i_217572 = 0; i_217572 < num_tasks_217552; i_217572++) {
        flat_tid_217473 = i_217572;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_217563 = defunc_2_reduce_res_217186;
            }
            // load next params
            {
                x_217564 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_217553)[flat_tid_217473];
            }
            // red body
            {
                float defunc_1_op_res_217565 = x_217563 + x_217564;
                
                defunc_2_reduce_res_217186 = defunc_1_op_res_217565;
            }
            // load acc params
            {
                x_217566 = defunc_2_reduce_res_217187;
            }
            // load next params
            {
                x_217567 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_217555)[flat_tid_217473];
            }
            // red body
            {
                float defunc_1_op_res_217568 = x_217566 + x_217567;
                
                defunc_2_reduce_res_217187 = defunc_1_op_res_217568;
            }
            // load acc params
            {
                x_217569 = defunc_2_reduce_res_217188;
            }
            // load next params
            {
                x_217570 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_217557)[flat_tid_217473];
            }
            // red body
            {
                float defunc_1_op_res_217571 = x_217569 + x_217570;
                
                defunc_2_reduce_res_217188 = defunc_1_op_res_217571;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_217553);
        free(reduce_stage_1_tid_res_arr_mem_217555);
        free(reduce_stage_1_tid_res_arr_mem_217557);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228632_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228632_end -
                 futhark_mc_segred_task_228632_start;
        
        ctx->futhark_mc_segred_task_228632_runs[tid]++;
        ctx->futhark_mc_segred_task_228632_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228632_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228631->retval_defunc_2_reduce_res_217186 =
            defunc_2_reduce_res_217186;
        *futhark_mc_task_228631->retval_defunc_2_reduce_res_217187 =
            defunc_2_reduce_res_217187;
        *futhark_mc_task_228631->retval_defunc_2_reduce_res_217188 =
            defunc_2_reduce_res_217188;
    }
    return err;
}
struct futhark_mc_task_228638 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    int64_t free_x_217174;
    float free_x_217175;
    float free_a11_217224;
    float free_b11_217226;
    float free_c11_217227;
    int64_t free_defunc_0_m_fun_res_217228;
    float *retval_defunc_2_reduce_res_217237;
    float *retval_defunc_2_reduce_res_217238;
};
struct futhark_mc_segred_stage_1_parloop_struct_228642 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_201721;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_216738;
    int64_t free_x_216739;
    int64_t free_x_217174;
    float free_x_217175;
    float free_a11_217224;
    float free_b11_217226;
    float free_c11_217227;
    int64_t free_defunc_0_m_fun_res_217228;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_217574;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_217576;
};
static int futhark_mc_segred_stage_1_parloop_228643(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_217512,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228642
    *futhark_mc_segred_stage_1_parloop_struct_228642 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228642 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228642->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228643_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228643_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_defunc_0_f_res_196740;
    int64_t gtid_201721 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228642->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228642->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228642->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_gtid_216738;
    int64_t x_216739 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_x_216739;
    int64_t x_217174 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_x_217174;
    float x_217175 =
          futhark_mc_segred_stage_1_parloop_struct_228642->free_x_217175;
    float a11_217224 =
          futhark_mc_segred_stage_1_parloop_struct_228642->free_a11_217224;
    float b11_217226 =
          futhark_mc_segred_stage_1_parloop_struct_228642->free_b11_217226;
    float c11_217227 =
          futhark_mc_segred_stage_1_parloop_struct_228642->free_c11_217227;
    int64_t defunc_0_m_fun_res_217228 =
            futhark_mc_segred_stage_1_parloop_struct_228642->free_defunc_0_m_fun_res_217228;
    struct memblock reduce_stage_1_tid_res_arr_mem_217574 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_217574",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228642->free_reduce_stage_1_tid_res_arr_mem_217574,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_217576 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_217576",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228642->free_reduce_stage_1_tid_res_arr_mem_217576,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_217578 = start;
    float x_217514;
    float x_217515;
    float x_217517;
    float x_217518;
    float local_acc_217579 = 0.0F;
    float local_acc_217580 = 0.0F;
    
    for (; iter_217578 < end; iter_217578++) {
        int64_t gtid_217513 = iter_217578;
        bool cond_217520 = sle64(x_216739, gtid_217513);
        int64_t defunc_0_f_res_217521;
        
        if (cond_217520) {
            defunc_0_f_res_217521 = (int64_t) 0;
        } else {
            int64_t i_217522 = add64(x_217174, gtid_217513);
            int64_t defunc_0_add_arg_217523;
            
            defunc_0_add_arg_217523 = ((int64_t *) mem_210590.mem)[gtid_201721 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_216738 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_217522];
            
            int64_t defunc_1_add_res_217524 = add64((int64_t) 1,
                                                    defunc_0_add_arg_217523);
            
            defunc_0_f_res_217521 = defunc_1_add_res_217524;
        }
        
        float defunc_0_f_res_217525;
        
        if (cond_217520) {
            defunc_0_f_res_217525 = 0.0F;
        } else {
            int64_t i_217526 = add64(x_217174, gtid_217513);
            float defunc_0_add_arg_217527;
            
            defunc_0_add_arg_217527 = ((float *) mem_211111.mem)[gtid_201721 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_216738 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_217526];
            defunc_0_f_res_217525 = defunc_0_add_arg_217527;
        }
        
        int64_t binop_p_217528 = sub64(defunc_0_f_res_217521,
                                       defunc_0_m_fun_res_217228);
        float defunc_0_f_res_217529 = sitofp_i64_f32(binop_p_217528);
        float abs_res_217530 = (float) fabs(defunc_0_f_res_217529);
        float tmp1_217531 = abs_res_217530 / x_217175;
        float x_217532 = tmp1_217531 * tmp1_217531;
        float y_217533 = tmp1_217531 * x_217532;
        float tmp2_217534 = 1.0F - y_217533;
        float x_217535 = tmp2_217534 * tmp2_217534;
        float tmp3_217536 = tmp2_217534 * x_217535;
        float tmp4_217537 = defunc_0_f_res_217525 * tmp3_217536;
        float defunc_1_f_res_217538 = defunc_0_f_res_217529 * tmp4_217537;
        float defunc_0_f_res_217539;
        
        if (cond_217520) {
            defunc_0_f_res_217539 = 0.0F;
        } else {
            int64_t i_217540 = add64(x_217174, gtid_217513);
            float defunc_0_add_arg_217541;
            
            defunc_0_add_arg_217541 = ((float *) mem_211106.mem)[gtid_201721 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_216738 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_217540];
            defunc_0_f_res_217539 = defunc_0_add_arg_217541;
        }
        
        float x_217542 = a11_217224 * tmp4_217537;
        float y_217543 = b11_217226 * defunc_1_f_res_217538;
        float x_217544 = x_217542 + y_217543;
        float defunc_9_fit_fun_res_217545 = defunc_0_f_res_217539 * x_217544;
        float x_217546 = b11_217226 * tmp4_217537;
        float y_217547 = c11_217227 * defunc_1_f_res_217538;
        float x_217548 = x_217546 + y_217547;
        float defunc_9_slope_fun_res_217549 = defunc_0_f_res_217539 * x_217548;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_217514 = local_acc_217579;
        }
        // Load next params
        {
            x_217515 = defunc_9_fit_fun_res_217545;
        }
        // Red body
        {
            float defunc_1_op_res_217516 = x_217514 + x_217515;
            
            local_acc_217579 = defunc_1_op_res_217516;
        }
        // Load accum params
        {
            x_217517 = local_acc_217580;
        }
        // Load next params
        {
            x_217518 = defunc_9_slope_fun_res_217549;
        }
        // Red body
        {
            float defunc_1_op_res_217519 = x_217517 + x_217518;
            
            local_acc_217580 = defunc_1_op_res_217519;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_217574.mem)[flat_tid_217512] =
        local_acc_217579;
    ((float *) reduce_stage_1_tid_res_arr_mem_217576.mem)[flat_tid_217512] =
        local_acc_217580;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228643_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228643_end -
                 futhark_mc_segred_stage_1_parloop_228643_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228643_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228643_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228643_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228639(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_217512 = tid;
    int num_tasks_217573 = info.nsubtasks;
    struct futhark_mc_task_228638 *futhark_mc_task_228638 =
                                  (struct futhark_mc_task_228638 *) args;
    struct futhark_context *ctx = futhark_mc_task_228638->ctx;
    uint64_t futhark_mc_segred_task_228639_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228639_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228638->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228638->free_defunc_0_f_res_196740;
    int64_t gtid_201721 = futhark_mc_task_228638->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228638->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228638->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228638->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 = futhark_mc_task_228638->free_gtid_216738;
    int64_t x_216739 = futhark_mc_task_228638->free_x_216739;
    int64_t x_217174 = futhark_mc_task_228638->free_x_217174;
    float x_217175 = futhark_mc_task_228638->free_x_217175;
    float a11_217224 = futhark_mc_task_228638->free_a11_217224;
    float b11_217226 = futhark_mc_task_228638->free_b11_217226;
    float c11_217227 = futhark_mc_task_228638->free_c11_217227;
    int64_t defunc_0_m_fun_res_217228 =
            futhark_mc_task_228638->free_defunc_0_m_fun_res_217228;
    float defunc_2_reduce_res_217237 =
          *futhark_mc_task_228638->retval_defunc_2_reduce_res_217237;
    float defunc_2_reduce_res_217238 =
          *futhark_mc_task_228638->retval_defunc_2_reduce_res_217238;
    size_t reduce_stage_1_tid_res_arr_mem_217574_cached_sizze_228640 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_217574 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_217576_cached_sizze_228641 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_217576 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_217574_cached_sizze_228640 <
        (size_t) ((int64_t) 4 * num_tasks_217573)) {
        reduce_stage_1_tid_res_arr_mem_217574 =
            realloc(reduce_stage_1_tid_res_arr_mem_217574, (int64_t) 4 *
                    num_tasks_217573);
        reduce_stage_1_tid_res_arr_mem_217574_cached_sizze_228640 =
            (int64_t) 4 * num_tasks_217573;
    }
    if (reduce_stage_1_tid_res_arr_mem_217576_cached_sizze_228641 <
        (size_t) ((int64_t) 4 * num_tasks_217573)) {
        reduce_stage_1_tid_res_arr_mem_217576 =
            realloc(reduce_stage_1_tid_res_arr_mem_217576, (int64_t) 4 *
                    num_tasks_217573);
        reduce_stage_1_tid_res_arr_mem_217576_cached_sizze_228641 =
            (int64_t) 4 * num_tasks_217573;
    }
    
    int64_t iter_217578;
    struct futhark_mc_segred_stage_1_parloop_struct_228642
    futhark_mc_segred_stage_1_parloop_struct_228642;
    
    futhark_mc_segred_stage_1_parloop_struct_228642.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_gtid_201721 =
        gtid_201721;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_mem_211106 =
        mem_211106.mem;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_gtid_216738 =
        gtid_216738;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_x_216739 = x_216739;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_x_217174 = x_217174;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_x_217175 = x_217175;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_a11_217224 =
        a11_217224;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_b11_217226 =
        b11_217226;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_c11_217227 =
        c11_217227;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_defunc_0_m_fun_res_217228 =
        defunc_0_m_fun_res_217228;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_reduce_stage_1_tid_res_arr_mem_217574 =
        reduce_stage_1_tid_res_arr_mem_217574;
    futhark_mc_segred_stage_1_parloop_struct_228642.free_reduce_stage_1_tid_res_arr_mem_217576 =
        reduce_stage_1_tid_res_arr_mem_217576;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228643_task;
    
    futhark_mc_segred_stage_1_parloop_228643_task.name =
        "futhark_mc_segred_stage_1_parloop_228643";
    futhark_mc_segred_stage_1_parloop_228643_task.fn =
        futhark_mc_segred_stage_1_parloop_228643;
    futhark_mc_segred_stage_1_parloop_228643_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228642;
    futhark_mc_segred_stage_1_parloop_228643_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228643_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228643_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228643_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228643_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228643_task);
    
    if (futhark_mc_segred_stage_1_parloop_228643_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228643_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228643_total_end -
                 futhark_mc_segred_stage_1_parloop_228643_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228643_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228643_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228643_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_217237 = 0.0F;
        defunc_2_reduce_res_217238 = 0.0F;
    }
    
    float x_217581;
    float x_217582;
    float x_217584;
    float x_217585;
    
    for (int32_t i_217587 = 0; i_217587 < num_tasks_217573; i_217587++) {
        flat_tid_217512 = i_217587;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_217581 = defunc_2_reduce_res_217237;
            }
            // load next params
            {
                x_217582 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_217574)[flat_tid_217512];
            }
            // red body
            {
                float defunc_1_op_res_217583 = x_217581 + x_217582;
                
                defunc_2_reduce_res_217237 = defunc_1_op_res_217583;
            }
            // load acc params
            {
                x_217584 = defunc_2_reduce_res_217238;
            }
            // load next params
            {
                x_217585 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_217576)[flat_tid_217512];
            }
            // red body
            {
                float defunc_1_op_res_217586 = x_217584 + x_217585;
                
                defunc_2_reduce_res_217238 = defunc_1_op_res_217586;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_217574);
        free(reduce_stage_1_tid_res_arr_mem_217576);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228639_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228639_end -
                 futhark_mc_segred_task_228639_start;
        
        ctx->futhark_mc_segred_task_228639_runs[tid]++;
        ctx->futhark_mc_segred_task_228639_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228639_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228638->retval_defunc_2_reduce_res_217237 =
            defunc_2_reduce_res_217237;
        *futhark_mc_task_228638->retval_defunc_2_reduce_res_217238 =
            defunc_2_reduce_res_217238;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228630(void *args, int64_t start,
                                            int64_t end, int flat_tid_217172,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228629
    *futhark_mc_segmap_parloop_struct_228629 =
    (struct futhark_mc_segmap_parloop_struct_228629 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228629->ctx;
    uint64_t futhark_mc_segmap_parloop_228630_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228630_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228629->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228629->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228629->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228629->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228629->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228629->free_s_n_m_196745;
    int64_t gtid_201721 =
            futhark_mc_segmap_parloop_struct_228629->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 =
            futhark_mc_segmap_parloop_struct_228629->free_gtid_216738;
    int64_t x_216739 = futhark_mc_segmap_parloop_struct_228629->free_x_216739;
    struct memblock mem_216740 = {.desc ="mem_216740", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_216740,
                                  .size =0, .references =NULL};
    struct memblock mem_216741 = {.desc ="mem_216741", .mem =
                                  futhark_mc_segmap_parloop_struct_228629->free_mem_216741,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_217464 = start;
    
    for (; iter_217464 < end; iter_217464++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_217550 = s_n_m_196745;
        int64_t gtid_217173 = iter_217464;
        int64_t remnant_217551 = iter_217464 - gtid_217173;
        int64_t x_217174;
        
        x_217174 = ((int64_t *) mem_210764.mem)[gtid_201721 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_216738 * s_n_m_196745 +
                                                gtid_217173];
        
        float x_217175;
        
        x_217175 = ((float *) mem_210769.mem)[gtid_201721 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_216738 * s_n_m_196745 +
                                              gtid_217173];
        
        bool cond_217176 = gtid_217173 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_217177;
        
        if (cond_217176) {
            defunc_0_m_fun_res_217177 = (int64_t) 0;
        } else {
            int64_t y_217465 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_217466 = gtid_217173 == y_217465;
            int64_t defunc_0_m_fun_res_f_res_217467;
            
            if (cond_217466) {
                int64_t defunc_0_m_fun_res_f_res_t_res_217468 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_217467 =
                    defunc_0_m_fun_res_f_res_t_res_217468;
            } else {
                int64_t x_217469 = sub64(gtid_217173, (int64_t) 1);
                int64_t x_217470 = mul64(jump_s_196701, x_217469);
                int64_t min_arg_217471 = add64((int64_t) 1, x_217470);
                int64_t min_res_217472 = smin64(defunc_0_f_res_196740,
                                                min_arg_217471);
                
                defunc_0_m_fun_res_f_res_217467 = min_res_217472;
            }
            defunc_0_m_fun_res_217177 = defunc_0_m_fun_res_f_res_217467;
        }
        
        float defunc_2_reduce_res_217186;
        float defunc_2_reduce_res_217187;
        float defunc_2_reduce_res_217188;
        int64_t flat_tid_217473 = (int64_t) 0;
        int32_t num_tasks_217552;
        
        defunc_2_reduce_res_217186 = 0.0F;
        defunc_2_reduce_res_217187 = 0.0F;
        defunc_2_reduce_res_217188 = 0.0F;
        
        struct futhark_mc_task_228631 futhark_mc_task_228631;
        
        futhark_mc_task_228631.ctx = ctx;
        futhark_mc_task_228631.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228631.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228631.free_gtid_201721 = gtid_201721;
        futhark_mc_task_228631.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228631.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228631.free_gtid_216738 = gtid_216738;
        futhark_mc_task_228631.free_x_216739 = x_216739;
        futhark_mc_task_228631.free_x_217174 = x_217174;
        futhark_mc_task_228631.free_x_217175 = x_217175;
        futhark_mc_task_228631.free_defunc_0_m_fun_res_217177 =
            defunc_0_m_fun_res_217177;
        futhark_mc_task_228631.retval_defunc_2_reduce_res_217186 =
            &defunc_2_reduce_res_217186;
        futhark_mc_task_228631.retval_defunc_2_reduce_res_217187 =
            &defunc_2_reduce_res_217187;
        futhark_mc_task_228631.retval_defunc_2_reduce_res_217188 =
            &defunc_2_reduce_res_217188;
        
        struct scheduler_segop futhark_mc_task_228631_task;
        
        futhark_mc_task_228631_task.args = &futhark_mc_task_228631;
        futhark_mc_task_228631_task.top_level_fn =
            futhark_mc_segred_task_228632;
        futhark_mc_task_228631_task.name = "futhark_mc_segred_task_228632";
        futhark_mc_task_228631_task.iterations = q_s_196695;
        futhark_mc_task_228631_task.task_time =
            &ctx->futhark_mc_segred_task_228632_total_time;
        futhark_mc_task_228631_task.task_iter =
            &ctx->futhark_mc_segred_task_228632_total_iter;
        futhark_mc_task_228631_task.sched = STATIC;
        futhark_mc_task_228631_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228632_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228631_task);
        
        if (futhark_mc_segred_task_228632_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_217220 = defunc_2_reduce_res_217186 *
              defunc_2_reduce_res_217188;
        float y_217221 = defunc_2_reduce_res_217187 *
              defunc_2_reduce_res_217187;
        float y_217222 = x_217220 - y_217221;
        float det1_217223 = 1.0F / y_217222;
        float a11_217224 = defunc_2_reduce_res_217188 * det1_217223;
        float x_217225 = 0.0F - defunc_2_reduce_res_217187;
        float b11_217226 = det1_217223 * x_217225;
        float c11_217227 = defunc_2_reduce_res_217186 * det1_217223;
        int64_t defunc_0_m_fun_res_217228;
        
        if (cond_217176) {
            defunc_0_m_fun_res_217228 = (int64_t) 0;
        } else {
            int64_t y_217504 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_217505 = gtid_217173 == y_217504;
            int64_t defunc_0_m_fun_res_f_res_217506;
            
            if (cond_217505) {
                int64_t defunc_0_m_fun_res_f_res_t_res_217507 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_217506 =
                    defunc_0_m_fun_res_f_res_t_res_217507;
            } else {
                int64_t x_217508 = sub64(gtid_217173, (int64_t) 1);
                int64_t x_217509 = mul64(jump_s_196701, x_217508);
                int64_t min_arg_217510 = add64((int64_t) 1, x_217509);
                int64_t min_res_217511 = smin64(defunc_0_f_res_196740,
                                                min_arg_217510);
                
                defunc_0_m_fun_res_f_res_217506 = min_res_217511;
            }
            defunc_0_m_fun_res_217228 = defunc_0_m_fun_res_f_res_217506;
        }
        
        float defunc_2_reduce_res_217237;
        float defunc_2_reduce_res_217238;
        int64_t flat_tid_217512 = (int64_t) 0;
        int32_t num_tasks_217573;
        
        defunc_2_reduce_res_217237 = 0.0F;
        defunc_2_reduce_res_217238 = 0.0F;
        
        struct futhark_mc_task_228638 futhark_mc_task_228638;
        
        futhark_mc_task_228638.ctx = ctx;
        futhark_mc_task_228638.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228638.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228638.free_gtid_201721 = gtid_201721;
        futhark_mc_task_228638.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228638.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228638.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228638.free_gtid_216738 = gtid_216738;
        futhark_mc_task_228638.free_x_216739 = x_216739;
        futhark_mc_task_228638.free_x_217174 = x_217174;
        futhark_mc_task_228638.free_x_217175 = x_217175;
        futhark_mc_task_228638.free_a11_217224 = a11_217224;
        futhark_mc_task_228638.free_b11_217226 = b11_217226;
        futhark_mc_task_228638.free_c11_217227 = c11_217227;
        futhark_mc_task_228638.free_defunc_0_m_fun_res_217228 =
            defunc_0_m_fun_res_217228;
        futhark_mc_task_228638.retval_defunc_2_reduce_res_217237 =
            &defunc_2_reduce_res_217237;
        futhark_mc_task_228638.retval_defunc_2_reduce_res_217238 =
            &defunc_2_reduce_res_217238;
        
        struct scheduler_segop futhark_mc_task_228638_task;
        
        futhark_mc_task_228638_task.args = &futhark_mc_task_228638;
        futhark_mc_task_228638_task.top_level_fn =
            futhark_mc_segred_task_228639;
        futhark_mc_task_228638_task.name = "futhark_mc_segred_task_228639";
        futhark_mc_task_228638_task.iterations = q_s_196695;
        futhark_mc_task_228638_task.task_time =
            &ctx->futhark_mc_segred_task_228639_total_time;
        futhark_mc_task_228638_task.task_iter =
            &ctx->futhark_mc_segred_task_228639_total_iter;
        futhark_mc_task_228638_task.sched = STATIC;
        futhark_mc_task_228638_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228639_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228638_task);
        
        if (futhark_mc_segred_task_228639_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_216740.mem)[gtid_217173] = defunc_2_reduce_res_217237;
        ((float *) mem_216741.mem)[gtid_217173] = defunc_2_reduce_res_217238;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228630_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228630_end -
                 futhark_mc_segmap_parloop_228630_start;
        
        ctx->futhark_mc_segmap_parloop_228630_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228630_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228630_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228628(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_217172 = tid;
    int num_tasks_217377 = info.nsubtasks;
    struct futhark_mc_task_228624 *futhark_mc_task_228624 =
                                  (struct futhark_mc_task_228624 *) args;
    struct futhark_context *ctx = futhark_mc_task_228624->ctx;
    uint64_t futhark_mc_segmap_nested_task_228628_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228628_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228624->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228624->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228624->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228624->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228624->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228624->free_s_n_m_196745;
    int64_t gtid_201721 = futhark_mc_task_228624->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228624->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228624->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228624->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228624->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228624->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_216738 = futhark_mc_task_228624->free_gtid_216738;
    int64_t x_216739 = futhark_mc_task_228624->free_x_216739;
    struct memblock mem_216740 = {.desc ="mem_216740", .mem =
                                  futhark_mc_task_228624->free_mem_216740,
                                  .size =0, .references =NULL};
    struct memblock mem_216741 = {.desc ="mem_216741", .mem =
                                  futhark_mc_task_228624->free_mem_216741,
                                  .size =0, .references =NULL};
    int64_t iter_217464;
    struct futhark_mc_segmap_parloop_struct_228629
    futhark_mc_segmap_parloop_struct_228629;
    
    futhark_mc_segmap_parloop_struct_228629.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228629.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228629.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228629.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228629.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228629.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228629.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228629.free_gtid_201721 = gtid_201721;
    futhark_mc_segmap_parloop_struct_228629.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228629.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228629.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228629.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228629.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228629.free_gtid_216738 = gtid_216738;
    futhark_mc_segmap_parloop_struct_228629.free_x_216739 = x_216739;
    futhark_mc_segmap_parloop_struct_228629.free_mem_216740 = mem_216740.mem;
    futhark_mc_segmap_parloop_struct_228629.free_mem_216741 = mem_216741.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228630_task;
    
    futhark_mc_segmap_parloop_228630_task.name =
        "futhark_mc_segmap_parloop_228630";
    futhark_mc_segmap_parloop_228630_task.fn = futhark_mc_segmap_parloop_228630;
    futhark_mc_segmap_parloop_228630_task.args =
        &futhark_mc_segmap_parloop_struct_228629;
    futhark_mc_segmap_parloop_228630_task.iterations = iterations;
    futhark_mc_segmap_parloop_228630_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228630_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228630_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228630_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228630_task);
    
    if (futhark_mc_segmap_parloop_228630_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228630_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228630_total_end -
                 futhark_mc_segmap_parloop_228630_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228630_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228630_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228630_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228628_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228628_end -
                 futhark_mc_segmap_nested_task_228628_start;
        
        ctx->futhark_mc_segmap_nested_task_228628_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228628_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228628_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228621(void *args, int64_t start,
                                            int64_t end, int flat_tid_216737,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228620
    *futhark_mc_segmap_parloop_struct_228620 =
    (struct futhark_mc_segmap_parloop_struct_228620 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228620->ctx;
    uint64_t futhark_mc_segmap_parloop_228621_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228621_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228620->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228620->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228620->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228620->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228620->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228620->free_s_n_m_196745;
    int64_t gtid_201721 =
            futhark_mc_segmap_parloop_struct_228620->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228620->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211227 = {.desc ="mem_211227", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_211227,
                                  .size =0, .references =NULL};
    struct memblock mem_211231 = {.desc ="mem_211231", .mem =
                                  futhark_mc_segmap_parloop_struct_228620->free_mem_211231,
                                  .size =0, .references =NULL};
    size_t mem_216740_cached_sizze_228622 = 0;
    unsigned char *mem_216740 = NULL;
    size_t mem_216741_cached_sizze_228623 = 0;
    unsigned char *mem_216741 = NULL;
    int64_t iterations = end - start;
    int64_t iter_217171 = start;
    
    if (mem_216740_cached_sizze_228622 < (size_t) bytes_210599) {
        mem_216740 = realloc(mem_216740, bytes_210599);
        mem_216740_cached_sizze_228622 = bytes_210599;
    }
    if (mem_216741_cached_sizze_228623 < (size_t) bytes_210599) {
        mem_216741 = realloc(mem_216741, bytes_210599);
        mem_216741_cached_sizze_228623 = bytes_210599;
    }
    for (; iter_217171 < end; iter_217171++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_217375 = n_p_196694;
        int64_t gtid_216738 = iter_217171;
        int64_t remnant_217376 = iter_217171 - gtid_216738;
        int64_t x_216739;
        
        x_216739 = ((int64_t *) mem_210594.mem)[gtid_201721 * n_p_196694 +
                                                gtid_216738];
        
        int64_t flat_tid_217277 = (int64_t) 0;
        int32_t num_tasks_217377;
        int64_t flat_tid_217172 = (int64_t) 0;
        struct futhark_mc_task_228624 futhark_mc_task_228624;
        
        futhark_mc_task_228624.ctx = ctx;
        futhark_mc_task_228624.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228624.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228624.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228624.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228624.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228624.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228624.free_gtid_201721 = gtid_201721;
        futhark_mc_task_228624.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228624.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228624.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228624.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228624.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228624.free_gtid_216738 = gtid_216738;
        futhark_mc_task_228624.free_x_216739 = x_216739;
        futhark_mc_task_228624.free_mem_216740 = mem_216740;
        futhark_mc_task_228624.free_mem_216741 = mem_216741;
        
        struct scheduler_segop futhark_mc_task_228624_task;
        
        futhark_mc_task_228624_task.args = &futhark_mc_task_228624;
        futhark_mc_task_228624_task.top_level_fn =
            futhark_mc_segmap_task_228625;
        futhark_mc_task_228624_task.name = "futhark_mc_segmap_task_228625";
        futhark_mc_task_228624_task.iterations = s_n_m_196745;
        futhark_mc_task_228624_task.task_time =
            &ctx->futhark_mc_segmap_task_228625_total_time;
        futhark_mc_task_228624_task.task_iter =
            &ctx->futhark_mc_segmap_task_228625_total_iter;
        futhark_mc_task_228624_task.sched = STATIC;
        futhark_mc_task_228624_task.nested_fn =
            futhark_mc_segmap_nested_task_228628;
        
        int futhark_mc_segmap_task_228625_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228624_task);
        
        if (futhark_mc_segmap_task_228625_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211227.mem + gtid_216738 * s_n_m_196745 * (int64_t) 4,
                    mem_216740 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211231.mem + gtid_216738 * s_n_m_196745 * (int64_t) 4,
                    mem_216741 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_216740);
    free(mem_216741);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228621_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228621_end -
                 futhark_mc_segmap_parloop_228621_start;
        
        ctx->futhark_mc_segmap_parloop_228621_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228621_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228621_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228619(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_216737 = tid;
    int num_tasks_217059 = info.nsubtasks;
    struct futhark_mc_task_228613 *futhark_mc_task_228613 =
                                  (struct futhark_mc_task_228613 *) args;
    struct futhark_context *ctx = futhark_mc_task_228613->ctx;
    uint64_t futhark_mc_segmap_nested_task_228619_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228619_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228613->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228613->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228613->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228613->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228613->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228613->free_s_n_m_196745;
    int64_t gtid_201721 = futhark_mc_task_228613->free_gtid_201721;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228613->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228613->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228613->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228613->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228613->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228613->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228613->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211227 = {.desc ="mem_211227", .mem =
                                  futhark_mc_task_228613->free_mem_211227,
                                  .size =0, .references =NULL};
    struct memblock mem_211231 = {.desc ="mem_211231", .mem =
                                  futhark_mc_task_228613->free_mem_211231,
                                  .size =0, .references =NULL};
    int64_t iter_217171;
    struct futhark_mc_segmap_parloop_struct_228620
    futhark_mc_segmap_parloop_struct_228620;
    
    futhark_mc_segmap_parloop_struct_228620.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228620.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228620.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228620.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228620.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228620.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228620.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228620.free_gtid_201721 = gtid_201721;
    futhark_mc_segmap_parloop_struct_228620.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228620.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228620.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228620.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228620.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228620.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228620.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228620.free_mem_211227 = mem_211227.mem;
    futhark_mc_segmap_parloop_struct_228620.free_mem_211231 = mem_211231.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228621_task;
    
    futhark_mc_segmap_parloop_228621_task.name =
        "futhark_mc_segmap_parloop_228621";
    futhark_mc_segmap_parloop_228621_task.fn = futhark_mc_segmap_parloop_228621;
    futhark_mc_segmap_parloop_228621_task.args =
        &futhark_mc_segmap_parloop_struct_228620;
    futhark_mc_segmap_parloop_228621_task.iterations = iterations;
    futhark_mc_segmap_parloop_228621_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228621_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228621_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228621_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228621_task);
    
    if (futhark_mc_segmap_parloop_228621_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228621_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228621_total_end -
                 futhark_mc_segmap_parloop_228621_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228621_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228621_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228621_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228619_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228619_end -
                 futhark_mc_segmap_nested_task_228619_start;
        
        ctx->futhark_mc_segmap_nested_task_228619_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228619_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228619_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228610(void *args, int64_t start,
                                            int64_t end, int flat_tid_201720,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228609
    *futhark_mc_segmap_parloop_struct_228609 =
    (struct futhark_mc_segmap_parloop_struct_228609 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228609->ctx;
    uint64_t futhark_mc_segmap_parloop_228610_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228610_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228609->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228609->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228609->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228609->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228609->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228609->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228609->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228609->free_bytes_210599;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228609->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211324 = {.desc ="mem_211324", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_211324,
                                  .size =0, .references =NULL};
    struct memblock mem_211329 = {.desc ="mem_211329", .mem =
                                  futhark_mc_segmap_parloop_struct_228609->free_mem_211329,
                                  .size =0, .references =NULL};
    size_t mem_211227_cached_sizze_228611 = 0;
    unsigned char *mem_211227 = NULL;
    size_t mem_211231_cached_sizze_228612 = 0;
    unsigned char *mem_211231 = NULL;
    int64_t iterations = end - start;
    int64_t iter_216736 = start;
    
    if (mem_211227_cached_sizze_228611 < (size_t) bytes_210655) {
        mem_211227 = realloc(mem_211227, bytes_210655);
        mem_211227_cached_sizze_228611 = bytes_210655;
    }
    if (mem_211231_cached_sizze_228612 < (size_t) bytes_210655) {
        mem_211231 = realloc(mem_211231, bytes_210655);
        mem_211231_cached_sizze_228612 = bytes_210655;
    }
    for (; iter_216736 < end; iter_216736++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_217057 = m_196691;
        int64_t gtid_201721 = iter_216736;
        int64_t remnant_217058 = iter_216736 - gtid_201721;
        int64_t flat_tid_216947 = (int64_t) 0;
        int32_t num_tasks_217059;
        int64_t flat_tid_216737 = (int64_t) 0;
        struct futhark_mc_task_228613 futhark_mc_task_228613;
        
        futhark_mc_task_228613.ctx = ctx;
        futhark_mc_task_228613.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228613.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228613.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228613.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228613.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228613.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228613.free_gtid_201721 = gtid_201721;
        futhark_mc_task_228613.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228613.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228613.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228613.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228613.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228613.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228613.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228613.free_mem_211227 = mem_211227;
        futhark_mc_task_228613.free_mem_211231 = mem_211231;
        
        struct scheduler_segop futhark_mc_task_228613_task;
        
        futhark_mc_task_228613_task.args = &futhark_mc_task_228613;
        futhark_mc_task_228613_task.top_level_fn =
            futhark_mc_segmap_task_228614;
        futhark_mc_task_228613_task.name = "futhark_mc_segmap_task_228614";
        futhark_mc_task_228613_task.iterations = n_p_196694;
        futhark_mc_task_228613_task.task_time =
            &ctx->futhark_mc_segmap_task_228614_total_time;
        futhark_mc_task_228613_task.task_iter =
            &ctx->futhark_mc_segmap_task_228614_total_iter;
        futhark_mc_task_228613_task.sched = STATIC;
        futhark_mc_task_228613_task.nested_fn =
            futhark_mc_segmap_nested_task_228619;
        
        int futhark_mc_segmap_task_228614_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228613_task);
        
        if (futhark_mc_segmap_task_228614_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211324.mem + gtid_201721 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211227 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211329.mem + gtid_201721 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211231 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211227);
    free(mem_211231);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228610_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228610_end -
                 futhark_mc_segmap_parloop_228610_start;
        
        ctx->futhark_mc_segmap_parloop_228610_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228610_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228610_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228608(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_201720 = tid;
    int num_tasks_216616 = info.nsubtasks;
    struct futhark_mc_task_228602 *futhark_mc_task_228602 =
                                  (struct futhark_mc_task_228602 *) args;
    struct futhark_context *ctx = futhark_mc_task_228602->ctx;
    uint64_t futhark_mc_segmap_nested_task_228608_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228608_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228602->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228602->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228602->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228602->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228602->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228602->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228602->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228602->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228602->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228602->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228602->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228602->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228602->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228602->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228602->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211324 = {.desc ="mem_211324", .mem =
                                  futhark_mc_task_228602->free_mem_211324,
                                  .size =0, .references =NULL};
    struct memblock mem_211329 = {.desc ="mem_211329", .mem =
                                  futhark_mc_task_228602->free_mem_211329,
                                  .size =0, .references =NULL};
    int64_t iter_216736;
    struct futhark_mc_segmap_parloop_struct_228609
    futhark_mc_segmap_parloop_struct_228609;
    
    futhark_mc_segmap_parloop_struct_228609.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228609.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228609.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228609.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228609.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228609.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228609.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228609.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228609.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228609.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228609.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228609.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228609.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228609.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228609.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228609.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228609.free_mem_211324 = mem_211324.mem;
    futhark_mc_segmap_parloop_struct_228609.free_mem_211329 = mem_211329.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228610_task;
    
    futhark_mc_segmap_parloop_228610_task.name =
        "futhark_mc_segmap_parloop_228610";
    futhark_mc_segmap_parloop_228610_task.fn = futhark_mc_segmap_parloop_228610;
    futhark_mc_segmap_parloop_228610_task.args =
        &futhark_mc_segmap_parloop_struct_228609;
    futhark_mc_segmap_parloop_228610_task.iterations = iterations;
    futhark_mc_segmap_parloop_228610_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228610_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228610_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228610_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228610_task);
    
    if (futhark_mc_segmap_parloop_228610_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228610_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228610_total_end -
                 futhark_mc_segmap_parloop_228610_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228610_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228610_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228610_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228608_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228608_end -
                 futhark_mc_segmap_nested_task_228608_start;
        
        ctx->futhark_mc_segmap_nested_task_228608_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228608_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228608_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228644 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211466;
    unsigned char *free_mem_211471;
};
struct futhark_mc_segmap_parloop_struct_228646 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211466;
    unsigned char *free_mem_211471;
};
static int futhark_mc_segmap_parloop_228647(void *args, int64_t start,
                                            int64_t end, int flat_tid_202064,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228646
    *futhark_mc_segmap_parloop_struct_228646 =
    (struct futhark_mc_segmap_parloop_struct_228646 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228646->ctx;
    uint64_t futhark_mc_segmap_parloop_228647_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228647_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228646->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228646->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228646->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228646->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228646->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228646->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228646->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228646->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211466 = {.desc ="mem_211466", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_211466,
                                  .size =0, .references =NULL};
    struct memblock mem_211471 = {.desc ="mem_211471", .mem =
                                  futhark_mc_segmap_parloop_struct_228646->free_mem_211471,
                                  .size =0, .references =NULL};
    size_t mem_211377_cached_sizze_228648 = 0;
    unsigned char *mem_211377 = NULL;
    size_t mem_211381_cached_sizze_228649 = 0;
    unsigned char *mem_211381 = NULL;
    int64_t iterations = end - start;
    int64_t iter_217589 = start;
    
    if (mem_211377_cached_sizze_228648 < (size_t) bytes_210655) {
        mem_211377 = realloc(mem_211377, bytes_210655);
        mem_211377_cached_sizze_228648 = bytes_210655;
    }
    if (mem_211381_cached_sizze_228649 < (size_t) bytes_210655) {
        mem_211381 = realloc(mem_211381, bytes_210655);
        mem_211381_cached_sizze_228649 = bytes_210655;
    }
    for (; iter_217589 < end; iter_217589++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_217727 = m_196691;
        int64_t gtid_202065 = iter_217589;
        int64_t remnant_217728 = iter_217589 - gtid_202065;
        
        for (int64_t i_217590 = 0; i_217590 < n_p_196694; i_217590++) {
            int64_t x_217593;
            
            x_217593 = ((int64_t *) mem_210594.mem)[gtid_202065 * n_p_196694 +
                                                    i_217590];
            for (int64_t i_217596 = 0; i_217596 < s_n_m_196745; i_217596++) {
                int64_t x_217599;
                
                x_217599 = ((int64_t *) mem_210764.mem)[gtid_202065 *
                                                        (s_n_m_196745 *
                                                         n_p_196694) +
                                                        i_217590 *
                                                        s_n_m_196745 +
                                                        i_217596];
                
                float x_217600;
                
                x_217600 = ((float *) mem_210769.mem)[gtid_202065 *
                                                      (s_n_m_196745 *
                                                       n_p_196694) + i_217590 *
                                                      s_n_m_196745 + i_217596];
                
                bool cond_217601 = i_217596 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_217602;
                
                if (cond_217601) {
                    defunc_0_m_fun_res_217602 = (int64_t) 0;
                } else {
                    int64_t y_217603 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_217604 = i_217596 == y_217603;
                    int64_t defunc_0_m_fun_res_f_res_217605;
                    
                    if (cond_217604) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_217606 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_217605 =
                            defunc_0_m_fun_res_f_res_t_res_217606;
                    } else {
                        int64_t x_217607 = sub64(i_217596, (int64_t) 1);
                        int64_t x_217608 = mul64(jump_s_196701, x_217607);
                        int64_t min_arg_217609 = add64((int64_t) 1, x_217608);
                        int64_t min_res_217610 = smin64(defunc_0_f_res_196740,
                                                        min_arg_217609);
                        
                        defunc_0_m_fun_res_f_res_217605 = min_res_217610;
                    }
                    defunc_0_m_fun_res_217602 = defunc_0_m_fun_res_f_res_217605;
                }
                
                float defunc_2_reduce_res_217611;
                float defunc_2_reduce_res_217612;
                float defunc_2_reduce_res_217613;
                float defunc_2_reduce_res_217614;
                float defunc_2_reduce_res_217615;
                float redout_217617;
                float redout_217618;
                float redout_217619;
                float redout_217620;
                float redout_217621;
                
                redout_217617 = 0.0F;
                redout_217618 = 0.0F;
                redout_217619 = 0.0F;
                redout_217620 = 0.0F;
                redout_217621 = 0.0F;
                for (int64_t i_217616 = 0; i_217616 < q_s_196695; i_217616++) {
                    bool cond_217622 = sle64(x_217593, i_217616);
                    int64_t defunc_0_f_res_217623;
                    
                    if (cond_217622) {
                        defunc_0_f_res_217623 = (int64_t) 0;
                    } else {
                        int64_t i_217624 = add64(x_217599, i_217616);
                        int64_t defunc_0_add_arg_217625;
                        
                        defunc_0_add_arg_217625 =
                            ((int64_t *) mem_210590.mem)[gtid_202065 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_217590 *
                                                         defunc_0_f_res_196740 +
                                                         i_217624];
                        
                        int64_t defunc_1_add_res_217626 = add64((int64_t) 1,
                                                                defunc_0_add_arg_217625);
                        
                        defunc_0_f_res_217623 = defunc_1_add_res_217626;
                    }
                    
                    float defunc_0_f_res_217627;
                    
                    if (cond_217622) {
                        defunc_0_f_res_217627 = 0.0F;
                    } else {
                        int64_t i_217628 = add64(x_217599, i_217616);
                        float defunc_0_add_arg_217629;
                        
                        defunc_0_add_arg_217629 =
                            ((float *) mem_211111.mem)[gtid_202065 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_217590 *
                                                       defunc_0_f_res_196740 +
                                                       i_217628];
                        defunc_0_f_res_217627 = defunc_0_add_arg_217629;
                    }
                    
                    int64_t binop_p_217630 = sub64(defunc_0_f_res_217623,
                                                   defunc_0_m_fun_res_217602);
                    float defunc_0_f_res_217631 =
                          sitofp_i64_f32(binop_p_217630);
                    float abs_res_217632 = (float) fabs(defunc_0_f_res_217631);
                    float tmp1_217633 = abs_res_217632 / x_217600;
                    float x_217634 = tmp1_217633 * tmp1_217633;
                    float y_217635 = tmp1_217633 * x_217634;
                    float tmp2_217636 = 1.0F - y_217635;
                    float x_217637 = tmp2_217636 * tmp2_217636;
                    float tmp3_217638 = tmp2_217636 * x_217637;
                    float w_j_217639 = defunc_0_f_res_217627 * tmp3_217638;
                    float xw_j_217640 = defunc_0_f_res_217631 * w_j_217639;
                    float x2w_j_217641 = defunc_0_f_res_217631 * xw_j_217640;
                    float x3w_j_217642 = defunc_0_f_res_217631 * x2w_j_217641;
                    float x4w_j_217643 = defunc_0_f_res_217631 * x3w_j_217642;
                    float defunc_1_op_res_217644 = w_j_217639 + redout_217617;
                    float defunc_1_op_res_217645 = xw_j_217640 + redout_217618;
                    float defunc_1_op_res_217646 = x2w_j_217641 + redout_217619;
                    float defunc_1_op_res_217647 = x3w_j_217642 + redout_217620;
                    float defunc_1_op_res_217648 = x4w_j_217643 + redout_217621;
                    float redout_tmp_217733 = defunc_1_op_res_217644;
                    float redout_tmp_217734 = defunc_1_op_res_217645;
                    float redout_tmp_217735 = defunc_1_op_res_217646;
                    float redout_tmp_217736 = defunc_1_op_res_217647;
                    float redout_tmp_217737 = defunc_1_op_res_217648;
                    
                    redout_217617 = redout_tmp_217733;
                    redout_217618 = redout_tmp_217734;
                    redout_217619 = redout_tmp_217735;
                    redout_217620 = redout_tmp_217736;
                    redout_217621 = redout_tmp_217737;
                }
                defunc_2_reduce_res_217611 = redout_217617;
                defunc_2_reduce_res_217612 = redout_217618;
                defunc_2_reduce_res_217613 = redout_217619;
                defunc_2_reduce_res_217614 = redout_217620;
                defunc_2_reduce_res_217615 = redout_217621;
                
                float x_217649 = defunc_2_reduce_res_217613 *
                      defunc_2_reduce_res_217615;
                float y_217650 = defunc_2_reduce_res_217614 *
                      defunc_2_reduce_res_217614;
                float a12_217651 = x_217649 - y_217650;
                float x_217652 = defunc_2_reduce_res_217613 *
                      defunc_2_reduce_res_217614;
                float y_217653 = defunc_2_reduce_res_217612 *
                      defunc_2_reduce_res_217615;
                float b12_217654 = x_217652 - y_217653;
                float x_217655 = defunc_2_reduce_res_217612 *
                      defunc_2_reduce_res_217614;
                float y_217656 = defunc_2_reduce_res_217613 *
                      defunc_2_reduce_res_217613;
                float c12_217657 = x_217655 - y_217656;
                float x_217658 = defunc_2_reduce_res_217611 *
                      defunc_2_reduce_res_217615;
                float b2_217659 = x_217658 - y_217656;
                float x_217660 = defunc_2_reduce_res_217612 *
                      defunc_2_reduce_res_217613;
                float y_217661 = defunc_2_reduce_res_217611 *
                      defunc_2_reduce_res_217614;
                float c2_217662 = x_217660 - y_217661;
                float x_217663 = defunc_2_reduce_res_217611 * a12_217651;
                float y_217664 = defunc_2_reduce_res_217612 * b12_217654;
                float x_217665 = x_217663 + y_217664;
                float y_217666 = defunc_2_reduce_res_217613 * c12_217657;
                float y_217667 = x_217665 + y_217666;
                float det_217668 = 1.0F / y_217667;
                float a12_217669 = a12_217651 * det_217668;
                float b12_217670 = b12_217654 * det_217668;
                float c12_217671 = c12_217657 * det_217668;
                float b2_217672 = b2_217659 * det_217668;
                float c2_217673 = c2_217662 * det_217668;
                int64_t defunc_0_m_fun_res_217674;
                
                if (cond_217601) {
                    defunc_0_m_fun_res_217674 = (int64_t) 0;
                } else {
                    int64_t y_217675 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_217676 = i_217596 == y_217675;
                    int64_t defunc_0_m_fun_res_f_res_217677;
                    
                    if (cond_217676) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_217678 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_217677 =
                            defunc_0_m_fun_res_f_res_t_res_217678;
                    } else {
                        int64_t x_217679 = sub64(i_217596, (int64_t) 1);
                        int64_t x_217680 = mul64(jump_s_196701, x_217679);
                        int64_t min_arg_217681 = add64((int64_t) 1, x_217680);
                        int64_t min_res_217682 = smin64(defunc_0_f_res_196740,
                                                        min_arg_217681);
                        
                        defunc_0_m_fun_res_f_res_217677 = min_res_217682;
                    }
                    defunc_0_m_fun_res_217674 = defunc_0_m_fun_res_f_res_217677;
                }
                
                float defunc_2_reduce_res_217683;
                float defunc_2_reduce_res_217684;
                float redout_217686;
                float redout_217687;
                
                redout_217686 = 0.0F;
                redout_217687 = 0.0F;
                for (int64_t i_217685 = 0; i_217685 < q_s_196695; i_217685++) {
                    bool cond_217688 = sle64(x_217593, i_217685);
                    int64_t defunc_0_f_res_217689;
                    
                    if (cond_217688) {
                        defunc_0_f_res_217689 = (int64_t) 0;
                    } else {
                        int64_t i_217690 = add64(x_217599, i_217685);
                        int64_t defunc_0_add_arg_217691;
                        
                        defunc_0_add_arg_217691 =
                            ((int64_t *) mem_210590.mem)[gtid_202065 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_217590 *
                                                         defunc_0_f_res_196740 +
                                                         i_217690];
                        
                        int64_t defunc_1_add_res_217692 = add64((int64_t) 1,
                                                                defunc_0_add_arg_217691);
                        
                        defunc_0_f_res_217689 = defunc_1_add_res_217692;
                    }
                    
                    float defunc_0_f_res_217693;
                    
                    if (cond_217688) {
                        defunc_0_f_res_217693 = 0.0F;
                    } else {
                        int64_t i_217694 = add64(x_217599, i_217685);
                        float defunc_0_add_arg_217695;
                        
                        defunc_0_add_arg_217695 =
                            ((float *) mem_211111.mem)[gtid_202065 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_217590 *
                                                       defunc_0_f_res_196740 +
                                                       i_217694];
                        defunc_0_f_res_217693 = defunc_0_add_arg_217695;
                    }
                    
                    int64_t binop_p_217696 = sub64(defunc_0_f_res_217689,
                                                   defunc_0_m_fun_res_217674);
                    float defunc_0_f_res_217697 =
                          sitofp_i64_f32(binop_p_217696);
                    float abs_res_217698 = (float) fabs(defunc_0_f_res_217697);
                    float tmp1_217699 = abs_res_217698 / x_217600;
                    float x_217700 = tmp1_217699 * tmp1_217699;
                    float y_217701 = tmp1_217699 * x_217700;
                    float tmp2_217702 = 1.0F - y_217701;
                    float x_217703 = tmp2_217702 * tmp2_217702;
                    float tmp3_217704 = tmp2_217702 * x_217703;
                    float tmp4_217705 = defunc_0_f_res_217693 * tmp3_217704;
                    float defunc_1_f_res_217706 = defunc_0_f_res_217697 *
                          tmp4_217705;
                    float defunc_1_f_res_217707 = defunc_0_f_res_217697 *
                          defunc_1_f_res_217706;
                    float defunc_0_f_res_217708;
                    
                    if (cond_217688) {
                        defunc_0_f_res_217708 = 0.0F;
                    } else {
                        int64_t i_217709 = add64(x_217599, i_217685);
                        float defunc_0_add_arg_217710;
                        
                        defunc_0_add_arg_217710 =
                            ((float *) mem_211106.mem)[gtid_202065 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_217590 *
                                                       defunc_0_f_res_196740 +
                                                       i_217709];
                        defunc_0_f_res_217708 = defunc_0_add_arg_217710;
                    }
                    
                    float x_217711 = a12_217669 * tmp4_217705;
                    float y_217712 = b12_217670 * defunc_1_f_res_217706;
                    float x_217713 = x_217711 + y_217712;
                    float y_217714 = c12_217671 * defunc_1_f_res_217707;
                    float x_217715 = x_217713 + y_217714;
                    float defunc_9_fit_fun_res_217716 = defunc_0_f_res_217708 *
                          x_217715;
                    float x_217717 = b12_217670 * tmp4_217705;
                    float y_217718 = b2_217672 * defunc_1_f_res_217706;
                    float x_217719 = x_217717 + y_217718;
                    float y_217720 = c2_217673 * defunc_1_f_res_217707;
                    float x_217721 = x_217719 + y_217720;
                    float defunc_9_slope_fun_res_217722 =
                          defunc_0_f_res_217708 * x_217721;
                    float defunc_1_op_res_217723 = defunc_9_fit_fun_res_217716 +
                          redout_217686;
                    float defunc_1_op_res_217724 =
                          defunc_9_slope_fun_res_217722 + redout_217687;
                    float redout_tmp_217738 = defunc_1_op_res_217723;
                    float redout_tmp_217739 = defunc_1_op_res_217724;
                    
                    redout_217686 = redout_tmp_217738;
                    redout_217687 = redout_tmp_217739;
                }
                defunc_2_reduce_res_217683 = redout_217686;
                defunc_2_reduce_res_217684 = redout_217687;
                ((float *) mem_211377)[i_217590 * s_n_m_196745 + i_217596] =
                    defunc_2_reduce_res_217683;
                ((float *) mem_211381)[i_217590 * s_n_m_196745 + i_217596] =
                    defunc_2_reduce_res_217684;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211466.mem + gtid_202065 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211377 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211471.mem + gtid_202065 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211381 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211377);
    free(mem_211381);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228647_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228647_end -
                 futhark_mc_segmap_parloop_228647_start;
        
        ctx->futhark_mc_segmap_parloop_228647_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228647_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228647_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228645(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_202064 = tid;
    int num_tasks_217588 = info.nsubtasks;
    struct futhark_mc_task_228644 *futhark_mc_task_228644 =
                                  (struct futhark_mc_task_228644 *) args;
    struct futhark_context *ctx = futhark_mc_task_228644->ctx;
    uint64_t futhark_mc_segmap_task_228645_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228645_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228644->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228644->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228644->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228644->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228644->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228644->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228644->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228644->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228644->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228644->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228644->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228644->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228644->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228644->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228644->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211466 = {.desc ="mem_211466", .mem =
                                  futhark_mc_task_228644->free_mem_211466,
                                  .size =0, .references =NULL};
    struct memblock mem_211471 = {.desc ="mem_211471", .mem =
                                  futhark_mc_task_228644->free_mem_211471,
                                  .size =0, .references =NULL};
    int64_t iter_217589;
    struct futhark_mc_segmap_parloop_struct_228646
    futhark_mc_segmap_parloop_struct_228646;
    
    futhark_mc_segmap_parloop_struct_228646.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228646.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228646.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228646.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228646.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228646.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228646.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228646.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228646.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228646.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228646.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228646.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228646.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228646.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228646.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228646.free_mem_211466 = mem_211466.mem;
    futhark_mc_segmap_parloop_struct_228646.free_mem_211471 = mem_211471.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228647_task;
    
    futhark_mc_segmap_parloop_228647_task.name =
        "futhark_mc_segmap_parloop_228647";
    futhark_mc_segmap_parloop_228647_task.fn = futhark_mc_segmap_parloop_228647;
    futhark_mc_segmap_parloop_228647_task.args =
        &futhark_mc_segmap_parloop_struct_228646;
    futhark_mc_segmap_parloop_228647_task.iterations = iterations;
    futhark_mc_segmap_parloop_228647_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228647_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228647_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228647_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228647_task);
    
    if (futhark_mc_segmap_parloop_228647_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228647_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228647_total_end -
                 futhark_mc_segmap_parloop_228647_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228647_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228647_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228647_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228645_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228645_end -
                 futhark_mc_segmap_task_228645_start;
        
        ctx->futhark_mc_segmap_task_228645_runs[tid]++;
        ctx->futhark_mc_segmap_task_228645_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228645_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228651 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211466;
    unsigned char *free_mem_211471;
};
struct futhark_mc_task_228655 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211369;
    unsigned char *free_mem_211373;
};
struct futhark_mc_segmap_parloop_struct_228657 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211369;
    unsigned char *free_mem_211373;
};
static int futhark_mc_segmap_parloop_228658(void *args, int64_t start,
                                            int64_t end, int flat_tid_218013,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228657
    *futhark_mc_segmap_parloop_struct_228657 =
    (struct futhark_mc_segmap_parloop_struct_228657 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228657->ctx;
    uint64_t futhark_mc_segmap_parloop_228658_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228658_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228657->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228657->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228657->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228657->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228657->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228657->free_s_n_m_196745;
    int64_t gtid_202507 =
            futhark_mc_segmap_parloop_struct_228657->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228657->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211369 = {.desc ="mem_211369", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_211369,
                                  .size =0, .references =NULL};
    struct memblock mem_211373 = {.desc ="mem_211373", .mem =
                                  futhark_mc_segmap_parloop_struct_228657->free_mem_211373,
                                  .size =0, .references =NULL};
    size_t mem_218016_cached_sizze_228659 = 0;
    unsigned char *mem_218016 = NULL;
    size_t mem_218018_cached_sizze_228660 = 0;
    unsigned char *mem_218018 = NULL;
    int64_t iterations = end - start;
    int64_t iter_218156 = start;
    
    if (mem_218016_cached_sizze_228659 < (size_t) bytes_210599) {
        mem_218016 = realloc(mem_218016, bytes_210599);
        mem_218016_cached_sizze_228659 = bytes_210599;
    }
    if (mem_218018_cached_sizze_228660 < (size_t) bytes_210599) {
        mem_218018 = realloc(mem_218018, bytes_210599);
        mem_218018_cached_sizze_228660 = bytes_210599;
    }
    for (; iter_218156 < end; iter_218156++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_218288 = n_p_196694;
        int64_t gtid_218014 = iter_218156;
        int64_t remnant_218289 = iter_218156 - gtid_218014;
        int64_t x_218015;
        
        x_218015 = ((int64_t *) mem_210594.mem)[gtid_202507 * n_p_196694 +
                                                gtid_218014];
        for (int64_t i_218157 = 0; i_218157 < s_n_m_196745; i_218157++) {
            int64_t x_218160;
            
            x_218160 = ((int64_t *) mem_210764.mem)[gtid_202507 *
                                                    (s_n_m_196745 *
                                                     n_p_196694) + gtid_218014 *
                                                    s_n_m_196745 + i_218157];
            
            float x_218161;
            
            x_218161 = ((float *) mem_210769.mem)[gtid_202507 * (s_n_m_196745 *
                                                                 n_p_196694) +
                                                  gtid_218014 * s_n_m_196745 +
                                                  i_218157];
            
            bool cond_218162 = i_218157 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_218163;
            
            if (cond_218162) {
                defunc_0_m_fun_res_218163 = (int64_t) 0;
            } else {
                int64_t y_218164 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_218165 = i_218157 == y_218164;
                int64_t defunc_0_m_fun_res_f_res_218166;
                
                if (cond_218165) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_218167 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_218166 =
                        defunc_0_m_fun_res_f_res_t_res_218167;
                } else {
                    int64_t x_218168 = sub64(i_218157, (int64_t) 1);
                    int64_t x_218169 = mul64(jump_s_196701, x_218168);
                    int64_t min_arg_218170 = add64((int64_t) 1, x_218169);
                    int64_t min_res_218171 = smin64(defunc_0_f_res_196740,
                                                    min_arg_218170);
                    
                    defunc_0_m_fun_res_f_res_218166 = min_res_218171;
                }
                defunc_0_m_fun_res_218163 = defunc_0_m_fun_res_f_res_218166;
            }
            
            float defunc_2_reduce_res_218172;
            float defunc_2_reduce_res_218173;
            float defunc_2_reduce_res_218174;
            float defunc_2_reduce_res_218175;
            float defunc_2_reduce_res_218176;
            float redout_218178;
            float redout_218179;
            float redout_218180;
            float redout_218181;
            float redout_218182;
            
            redout_218178 = 0.0F;
            redout_218179 = 0.0F;
            redout_218180 = 0.0F;
            redout_218181 = 0.0F;
            redout_218182 = 0.0F;
            for (int64_t i_218177 = 0; i_218177 < q_s_196695; i_218177++) {
                bool cond_218183 = sle64(x_218015, i_218177);
                int64_t defunc_0_f_res_218184;
                
                if (cond_218183) {
                    defunc_0_f_res_218184 = (int64_t) 0;
                } else {
                    int64_t i_218185 = add64(x_218160, i_218177);
                    int64_t defunc_0_add_arg_218186;
                    
                    defunc_0_add_arg_218186 =
                        ((int64_t *) mem_210590.mem)[gtid_202507 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_218014 *
                                                     defunc_0_f_res_196740 +
                                                     i_218185];
                    
                    int64_t defunc_1_add_res_218187 = add64((int64_t) 1,
                                                            defunc_0_add_arg_218186);
                    
                    defunc_0_f_res_218184 = defunc_1_add_res_218187;
                }
                
                float defunc_0_f_res_218188;
                
                if (cond_218183) {
                    defunc_0_f_res_218188 = 0.0F;
                } else {
                    int64_t i_218189 = add64(x_218160, i_218177);
                    float defunc_0_add_arg_218190;
                    
                    defunc_0_add_arg_218190 =
                        ((float *) mem_211111.mem)[gtid_202507 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_218014 *
                                                   defunc_0_f_res_196740 +
                                                   i_218189];
                    defunc_0_f_res_218188 = defunc_0_add_arg_218190;
                }
                
                int64_t binop_p_218191 = sub64(defunc_0_f_res_218184,
                                               defunc_0_m_fun_res_218163);
                float defunc_0_f_res_218192 = sitofp_i64_f32(binop_p_218191);
                float abs_res_218193 = (float) fabs(defunc_0_f_res_218192);
                float tmp1_218194 = abs_res_218193 / x_218161;
                float x_218195 = tmp1_218194 * tmp1_218194;
                float y_218196 = tmp1_218194 * x_218195;
                float tmp2_218197 = 1.0F - y_218196;
                float x_218198 = tmp2_218197 * tmp2_218197;
                float tmp3_218199 = tmp2_218197 * x_218198;
                float w_j_218200 = defunc_0_f_res_218188 * tmp3_218199;
                float xw_j_218201 = defunc_0_f_res_218192 * w_j_218200;
                float x2w_j_218202 = defunc_0_f_res_218192 * xw_j_218201;
                float x3w_j_218203 = defunc_0_f_res_218192 * x2w_j_218202;
                float x4w_j_218204 = defunc_0_f_res_218192 * x3w_j_218203;
                float defunc_1_op_res_218205 = w_j_218200 + redout_218178;
                float defunc_1_op_res_218206 = xw_j_218201 + redout_218179;
                float defunc_1_op_res_218207 = x2w_j_218202 + redout_218180;
                float defunc_1_op_res_218208 = x3w_j_218203 + redout_218181;
                float defunc_1_op_res_218209 = x4w_j_218204 + redout_218182;
                float redout_tmp_218292 = defunc_1_op_res_218205;
                float redout_tmp_218293 = defunc_1_op_res_218206;
                float redout_tmp_218294 = defunc_1_op_res_218207;
                float redout_tmp_218295 = defunc_1_op_res_218208;
                float redout_tmp_218296 = defunc_1_op_res_218209;
                
                redout_218178 = redout_tmp_218292;
                redout_218179 = redout_tmp_218293;
                redout_218180 = redout_tmp_218294;
                redout_218181 = redout_tmp_218295;
                redout_218182 = redout_tmp_218296;
            }
            defunc_2_reduce_res_218172 = redout_218178;
            defunc_2_reduce_res_218173 = redout_218179;
            defunc_2_reduce_res_218174 = redout_218180;
            defunc_2_reduce_res_218175 = redout_218181;
            defunc_2_reduce_res_218176 = redout_218182;
            
            float x_218210 = defunc_2_reduce_res_218174 *
                  defunc_2_reduce_res_218176;
            float y_218211 = defunc_2_reduce_res_218175 *
                  defunc_2_reduce_res_218175;
            float a12_218212 = x_218210 - y_218211;
            float x_218213 = defunc_2_reduce_res_218174 *
                  defunc_2_reduce_res_218175;
            float y_218214 = defunc_2_reduce_res_218173 *
                  defunc_2_reduce_res_218176;
            float b12_218215 = x_218213 - y_218214;
            float x_218216 = defunc_2_reduce_res_218173 *
                  defunc_2_reduce_res_218175;
            float y_218217 = defunc_2_reduce_res_218174 *
                  defunc_2_reduce_res_218174;
            float c12_218218 = x_218216 - y_218217;
            float x_218219 = defunc_2_reduce_res_218172 *
                  defunc_2_reduce_res_218176;
            float b2_218220 = x_218219 - y_218217;
            float x_218221 = defunc_2_reduce_res_218173 *
                  defunc_2_reduce_res_218174;
            float y_218222 = defunc_2_reduce_res_218172 *
                  defunc_2_reduce_res_218175;
            float c2_218223 = x_218221 - y_218222;
            float x_218224 = defunc_2_reduce_res_218172 * a12_218212;
            float y_218225 = defunc_2_reduce_res_218173 * b12_218215;
            float x_218226 = x_218224 + y_218225;
            float y_218227 = defunc_2_reduce_res_218174 * c12_218218;
            float y_218228 = x_218226 + y_218227;
            float det_218229 = 1.0F / y_218228;
            float a12_218230 = a12_218212 * det_218229;
            float b12_218231 = b12_218215 * det_218229;
            float c12_218232 = c12_218218 * det_218229;
            float b2_218233 = b2_218220 * det_218229;
            float c2_218234 = c2_218223 * det_218229;
            int64_t defunc_0_m_fun_res_218235;
            
            if (cond_218162) {
                defunc_0_m_fun_res_218235 = (int64_t) 0;
            } else {
                int64_t y_218236 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_218237 = i_218157 == y_218236;
                int64_t defunc_0_m_fun_res_f_res_218238;
                
                if (cond_218237) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_218239 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_218238 =
                        defunc_0_m_fun_res_f_res_t_res_218239;
                } else {
                    int64_t x_218240 = sub64(i_218157, (int64_t) 1);
                    int64_t x_218241 = mul64(jump_s_196701, x_218240);
                    int64_t min_arg_218242 = add64((int64_t) 1, x_218241);
                    int64_t min_res_218243 = smin64(defunc_0_f_res_196740,
                                                    min_arg_218242);
                    
                    defunc_0_m_fun_res_f_res_218238 = min_res_218243;
                }
                defunc_0_m_fun_res_218235 = defunc_0_m_fun_res_f_res_218238;
            }
            
            float defunc_2_reduce_res_218244;
            float defunc_2_reduce_res_218245;
            float redout_218247;
            float redout_218248;
            
            redout_218247 = 0.0F;
            redout_218248 = 0.0F;
            for (int64_t i_218246 = 0; i_218246 < q_s_196695; i_218246++) {
                bool cond_218249 = sle64(x_218015, i_218246);
                int64_t defunc_0_f_res_218250;
                
                if (cond_218249) {
                    defunc_0_f_res_218250 = (int64_t) 0;
                } else {
                    int64_t i_218251 = add64(x_218160, i_218246);
                    int64_t defunc_0_add_arg_218252;
                    
                    defunc_0_add_arg_218252 =
                        ((int64_t *) mem_210590.mem)[gtid_202507 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_218014 *
                                                     defunc_0_f_res_196740 +
                                                     i_218251];
                    
                    int64_t defunc_1_add_res_218253 = add64((int64_t) 1,
                                                            defunc_0_add_arg_218252);
                    
                    defunc_0_f_res_218250 = defunc_1_add_res_218253;
                }
                
                float defunc_0_f_res_218254;
                
                if (cond_218249) {
                    defunc_0_f_res_218254 = 0.0F;
                } else {
                    int64_t i_218255 = add64(x_218160, i_218246);
                    float defunc_0_add_arg_218256;
                    
                    defunc_0_add_arg_218256 =
                        ((float *) mem_211111.mem)[gtid_202507 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_218014 *
                                                   defunc_0_f_res_196740 +
                                                   i_218255];
                    defunc_0_f_res_218254 = defunc_0_add_arg_218256;
                }
                
                int64_t binop_p_218257 = sub64(defunc_0_f_res_218250,
                                               defunc_0_m_fun_res_218235);
                float defunc_0_f_res_218258 = sitofp_i64_f32(binop_p_218257);
                float abs_res_218259 = (float) fabs(defunc_0_f_res_218258);
                float tmp1_218260 = abs_res_218259 / x_218161;
                float x_218261 = tmp1_218260 * tmp1_218260;
                float y_218262 = tmp1_218260 * x_218261;
                float tmp2_218263 = 1.0F - y_218262;
                float x_218264 = tmp2_218263 * tmp2_218263;
                float tmp3_218265 = tmp2_218263 * x_218264;
                float tmp4_218266 = defunc_0_f_res_218254 * tmp3_218265;
                float defunc_1_f_res_218267 = defunc_0_f_res_218258 *
                      tmp4_218266;
                float defunc_1_f_res_218268 = defunc_0_f_res_218258 *
                      defunc_1_f_res_218267;
                float defunc_0_f_res_218269;
                
                if (cond_218249) {
                    defunc_0_f_res_218269 = 0.0F;
                } else {
                    int64_t i_218270 = add64(x_218160, i_218246);
                    float defunc_0_add_arg_218271;
                    
                    defunc_0_add_arg_218271 =
                        ((float *) mem_211106.mem)[gtid_202507 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_218014 *
                                                   defunc_0_f_res_196740 +
                                                   i_218270];
                    defunc_0_f_res_218269 = defunc_0_add_arg_218271;
                }
                
                float x_218272 = a12_218230 * tmp4_218266;
                float y_218273 = b12_218231 * defunc_1_f_res_218267;
                float x_218274 = x_218272 + y_218273;
                float y_218275 = c12_218232 * defunc_1_f_res_218268;
                float x_218276 = x_218274 + y_218275;
                float defunc_9_fit_fun_res_218277 = defunc_0_f_res_218269 *
                      x_218276;
                float x_218278 = b12_218231 * tmp4_218266;
                float y_218279 = b2_218233 * defunc_1_f_res_218267;
                float x_218280 = x_218278 + y_218279;
                float y_218281 = c2_218234 * defunc_1_f_res_218268;
                float x_218282 = x_218280 + y_218281;
                float defunc_9_slope_fun_res_218283 = defunc_0_f_res_218269 *
                      x_218282;
                float defunc_1_op_res_218284 = defunc_9_fit_fun_res_218277 +
                      redout_218247;
                float defunc_1_op_res_218285 = defunc_9_slope_fun_res_218283 +
                      redout_218248;
                float redout_tmp_218297 = defunc_1_op_res_218284;
                float redout_tmp_218298 = defunc_1_op_res_218285;
                
                redout_218247 = redout_tmp_218297;
                redout_218248 = redout_tmp_218298;
            }
            defunc_2_reduce_res_218244 = redout_218247;
            defunc_2_reduce_res_218245 = redout_218248;
            ((float *) mem_218016)[i_218157] = defunc_2_reduce_res_218244;
            ((float *) mem_218018)[i_218157] = defunc_2_reduce_res_218245;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211369.mem + gtid_218014 * s_n_m_196745 * (int64_t) 4,
                    mem_218016 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211373.mem + gtid_218014 * s_n_m_196745 * (int64_t) 4,
                    mem_218018 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_218016);
    free(mem_218018);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228658_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228658_end -
                 futhark_mc_segmap_parloop_228658_start;
        
        ctx->futhark_mc_segmap_parloop_228658_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228658_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228658_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228656(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218013 = tid;
    int num_tasks_218155 = info.nsubtasks;
    struct futhark_mc_task_228655 *futhark_mc_task_228655 =
                                  (struct futhark_mc_task_228655 *) args;
    struct futhark_context *ctx = futhark_mc_task_228655->ctx;
    uint64_t futhark_mc_segmap_task_228656_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228656_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228655->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228655->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228655->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228655->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228655->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228655->free_s_n_m_196745;
    int64_t gtid_202507 = futhark_mc_task_228655->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228655->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228655->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228655->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228655->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228655->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228655->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228655->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211369 = {.desc ="mem_211369", .mem =
                                  futhark_mc_task_228655->free_mem_211369,
                                  .size =0, .references =NULL};
    struct memblock mem_211373 = {.desc ="mem_211373", .mem =
                                  futhark_mc_task_228655->free_mem_211373,
                                  .size =0, .references =NULL};
    int64_t iter_218156;
    struct futhark_mc_segmap_parloop_struct_228657
    futhark_mc_segmap_parloop_struct_228657;
    
    futhark_mc_segmap_parloop_struct_228657.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228657.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228657.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228657.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228657.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228657.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228657.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228657.free_gtid_202507 = gtid_202507;
    futhark_mc_segmap_parloop_struct_228657.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228657.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228657.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228657.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228657.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228657.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228657.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228657.free_mem_211369 = mem_211369.mem;
    futhark_mc_segmap_parloop_struct_228657.free_mem_211373 = mem_211373.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228658_task;
    
    futhark_mc_segmap_parloop_228658_task.name =
        "futhark_mc_segmap_parloop_228658";
    futhark_mc_segmap_parloop_228658_task.fn = futhark_mc_segmap_parloop_228658;
    futhark_mc_segmap_parloop_228658_task.args =
        &futhark_mc_segmap_parloop_struct_228657;
    futhark_mc_segmap_parloop_228658_task.iterations = iterations;
    futhark_mc_segmap_parloop_228658_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228658_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228658_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228658_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228658_task);
    
    if (futhark_mc_segmap_parloop_228658_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228658_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228658_total_end -
                 futhark_mc_segmap_parloop_228658_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228658_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228658_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228658_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228656_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228656_end -
                 futhark_mc_segmap_task_228656_start;
        
        ctx->futhark_mc_segmap_task_228656_runs[tid]++;
        ctx->futhark_mc_segmap_task_228656_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228656_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228662 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    unsigned char *free_mem_211369;
    unsigned char *free_mem_211373;
};
struct futhark_mc_task_228666 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    unsigned char *free_mem_217744;
    unsigned char *free_mem_217745;
};
struct futhark_mc_segmap_parloop_struct_228668 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    unsigned char *free_mem_217744;
    unsigned char *free_mem_217745;
};
static int futhark_mc_segmap_parloop_228669(void *args, int64_t start,
                                            int64_t end, int flat_tid_218437,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228668
    *futhark_mc_segmap_parloop_struct_228668 =
    (struct futhark_mc_segmap_parloop_struct_228668 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228668->ctx;
    uint64_t futhark_mc_segmap_parloop_228669_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228669_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228668->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228668->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228668->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228668->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228668->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228668->free_s_n_m_196745;
    int64_t gtid_202507 =
            futhark_mc_segmap_parloop_struct_228668->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 =
            futhark_mc_segmap_parloop_struct_228668->free_gtid_217742;
    int64_t x_217743 = futhark_mc_segmap_parloop_struct_228668->free_x_217743;
    struct memblock mem_217744 = {.desc ="mem_217744", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_217744,
                                  .size =0, .references =NULL};
    struct memblock mem_217745 = {.desc ="mem_217745", .mem =
                                  futhark_mc_segmap_parloop_struct_228668->free_mem_217745,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_218568 = start;
    
    for (; iter_218568 < end; iter_218568++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_218658 = s_n_m_196745;
        int64_t gtid_218438 = iter_218568;
        int64_t remnant_218659 = iter_218568 - gtid_218438;
        int64_t x_218439;
        
        x_218439 = ((int64_t *) mem_210764.mem)[gtid_202507 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_217742 * s_n_m_196745 +
                                                gtid_218438];
        
        float x_218440;
        
        x_218440 = ((float *) mem_210769.mem)[gtid_202507 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_217742 * s_n_m_196745 +
                                              gtid_218438];
        
        bool cond_218441 = gtid_218438 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_218442;
        
        if (cond_218441) {
            defunc_0_m_fun_res_218442 = (int64_t) 0;
        } else {
            int64_t y_218569 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_218570 = gtid_218438 == y_218569;
            int64_t defunc_0_m_fun_res_f_res_218571;
            
            if (cond_218570) {
                int64_t defunc_0_m_fun_res_f_res_t_res_218572 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_218571 =
                    defunc_0_m_fun_res_f_res_t_res_218572;
            } else {
                int64_t x_218573 = sub64(gtid_218438, (int64_t) 1);
                int64_t x_218574 = mul64(jump_s_196701, x_218573);
                int64_t min_arg_218575 = add64((int64_t) 1, x_218574);
                int64_t min_res_218576 = smin64(defunc_0_f_res_196740,
                                                min_arg_218575);
                
                defunc_0_m_fun_res_f_res_218571 = min_res_218576;
            }
            defunc_0_m_fun_res_218442 = defunc_0_m_fun_res_f_res_218571;
        }
        
        float defunc_2_reduce_res_218451;
        float defunc_2_reduce_res_218452;
        float defunc_2_reduce_res_218453;
        float defunc_2_reduce_res_218454;
        float defunc_2_reduce_res_218455;
        float redout_218578;
        float redout_218579;
        float redout_218580;
        float redout_218581;
        float redout_218582;
        
        redout_218578 = 0.0F;
        redout_218579 = 0.0F;
        redout_218580 = 0.0F;
        redout_218581 = 0.0F;
        redout_218582 = 0.0F;
        for (int64_t i_218577 = 0; i_218577 < q_s_196695; i_218577++) {
            bool cond_218583 = sle64(x_217743, i_218577);
            int64_t defunc_0_f_res_218584;
            
            if (cond_218583) {
                defunc_0_f_res_218584 = (int64_t) 0;
            } else {
                int64_t i_218585 = add64(x_218439, i_218577);
                int64_t defunc_0_add_arg_218586;
                
                defunc_0_add_arg_218586 =
                    ((int64_t *) mem_210590.mem)[gtid_202507 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_217742 *
                                                 defunc_0_f_res_196740 +
                                                 i_218585];
                
                int64_t defunc_1_add_res_218587 = add64((int64_t) 1,
                                                        defunc_0_add_arg_218586);
                
                defunc_0_f_res_218584 = defunc_1_add_res_218587;
            }
            
            float defunc_0_f_res_218588;
            
            if (cond_218583) {
                defunc_0_f_res_218588 = 0.0F;
            } else {
                int64_t i_218589 = add64(x_218439, i_218577);
                float defunc_0_add_arg_218590;
                
                defunc_0_add_arg_218590 =
                    ((float *) mem_211111.mem)[gtid_202507 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_217742 *
                                               defunc_0_f_res_196740 +
                                               i_218589];
                defunc_0_f_res_218588 = defunc_0_add_arg_218590;
            }
            
            int64_t binop_p_218591 = sub64(defunc_0_f_res_218584,
                                           defunc_0_m_fun_res_218442);
            float defunc_0_f_res_218592 = sitofp_i64_f32(binop_p_218591);
            float abs_res_218593 = (float) fabs(defunc_0_f_res_218592);
            float tmp1_218594 = abs_res_218593 / x_218440;
            float x_218595 = tmp1_218594 * tmp1_218594;
            float y_218596 = tmp1_218594 * x_218595;
            float tmp2_218597 = 1.0F - y_218596;
            float x_218598 = tmp2_218597 * tmp2_218597;
            float tmp3_218599 = tmp2_218597 * x_218598;
            float w_j_218600 = defunc_0_f_res_218588 * tmp3_218599;
            float xw_j_218601 = defunc_0_f_res_218592 * w_j_218600;
            float x2w_j_218602 = defunc_0_f_res_218592 * xw_j_218601;
            float x3w_j_218603 = defunc_0_f_res_218592 * x2w_j_218602;
            float x4w_j_218604 = defunc_0_f_res_218592 * x3w_j_218603;
            float defunc_1_op_res_218605 = w_j_218600 + redout_218578;
            float defunc_1_op_res_218606 = xw_j_218601 + redout_218579;
            float defunc_1_op_res_218607 = x2w_j_218602 + redout_218580;
            float defunc_1_op_res_218608 = x3w_j_218603 + redout_218581;
            float defunc_1_op_res_218609 = x4w_j_218604 + redout_218582;
            float redout_tmp_218660 = defunc_1_op_res_218605;
            float redout_tmp_218661 = defunc_1_op_res_218606;
            float redout_tmp_218662 = defunc_1_op_res_218607;
            float redout_tmp_218663 = defunc_1_op_res_218608;
            float redout_tmp_218664 = defunc_1_op_res_218609;
            
            redout_218578 = redout_tmp_218660;
            redout_218579 = redout_tmp_218661;
            redout_218580 = redout_tmp_218662;
            redout_218581 = redout_tmp_218663;
            redout_218582 = redout_tmp_218664;
        }
        defunc_2_reduce_res_218451 = redout_218578;
        defunc_2_reduce_res_218452 = redout_218579;
        defunc_2_reduce_res_218453 = redout_218580;
        defunc_2_reduce_res_218454 = redout_218581;
        defunc_2_reduce_res_218455 = redout_218582;
        
        float x_218489 = defunc_2_reduce_res_218453 *
              defunc_2_reduce_res_218455;
        float y_218490 = defunc_2_reduce_res_218454 *
              defunc_2_reduce_res_218454;
        float a12_218491 = x_218489 - y_218490;
        float x_218492 = defunc_2_reduce_res_218453 *
              defunc_2_reduce_res_218454;
        float y_218493 = defunc_2_reduce_res_218452 *
              defunc_2_reduce_res_218455;
        float b12_218494 = x_218492 - y_218493;
        float x_218495 = defunc_2_reduce_res_218452 *
              defunc_2_reduce_res_218454;
        float y_218496 = defunc_2_reduce_res_218453 *
              defunc_2_reduce_res_218453;
        float c12_218497 = x_218495 - y_218496;
        float x_218498 = defunc_2_reduce_res_218451 *
              defunc_2_reduce_res_218455;
        float b2_218499 = x_218498 - y_218496;
        float x_218500 = defunc_2_reduce_res_218452 *
              defunc_2_reduce_res_218453;
        float y_218501 = defunc_2_reduce_res_218451 *
              defunc_2_reduce_res_218454;
        float c2_218502 = x_218500 - y_218501;
        float x_218503 = defunc_2_reduce_res_218451 * a12_218491;
        float y_218504 = defunc_2_reduce_res_218452 * b12_218494;
        float x_218505 = x_218503 + y_218504;
        float y_218506 = defunc_2_reduce_res_218453 * c12_218497;
        float y_218507 = x_218505 + y_218506;
        float det_218508 = 1.0F / y_218507;
        float a12_218509 = a12_218491 * det_218508;
        float b12_218510 = b12_218494 * det_218508;
        float c12_218511 = c12_218497 * det_218508;
        float b2_218512 = b2_218499 * det_218508;
        float c2_218513 = c2_218502 * det_218508;
        int64_t defunc_0_m_fun_res_218514;
        
        if (cond_218441) {
            defunc_0_m_fun_res_218514 = (int64_t) 0;
        } else {
            int64_t y_218610 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_218611 = gtid_218438 == y_218610;
            int64_t defunc_0_m_fun_res_f_res_218612;
            
            if (cond_218611) {
                int64_t defunc_0_m_fun_res_f_res_t_res_218613 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_218612 =
                    defunc_0_m_fun_res_f_res_t_res_218613;
            } else {
                int64_t x_218614 = sub64(gtid_218438, (int64_t) 1);
                int64_t x_218615 = mul64(jump_s_196701, x_218614);
                int64_t min_arg_218616 = add64((int64_t) 1, x_218615);
                int64_t min_res_218617 = smin64(defunc_0_f_res_196740,
                                                min_arg_218616);
                
                defunc_0_m_fun_res_f_res_218612 = min_res_218617;
            }
            defunc_0_m_fun_res_218514 = defunc_0_m_fun_res_f_res_218612;
        }
        
        float defunc_2_reduce_res_218523;
        float defunc_2_reduce_res_218524;
        float redout_218619;
        float redout_218620;
        
        redout_218619 = 0.0F;
        redout_218620 = 0.0F;
        for (int64_t i_218618 = 0; i_218618 < q_s_196695; i_218618++) {
            bool cond_218621 = sle64(x_217743, i_218618);
            int64_t defunc_0_f_res_218622;
            
            if (cond_218621) {
                defunc_0_f_res_218622 = (int64_t) 0;
            } else {
                int64_t i_218623 = add64(x_218439, i_218618);
                int64_t defunc_0_add_arg_218624;
                
                defunc_0_add_arg_218624 =
                    ((int64_t *) mem_210590.mem)[gtid_202507 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_217742 *
                                                 defunc_0_f_res_196740 +
                                                 i_218623];
                
                int64_t defunc_1_add_res_218625 = add64((int64_t) 1,
                                                        defunc_0_add_arg_218624);
                
                defunc_0_f_res_218622 = defunc_1_add_res_218625;
            }
            
            float defunc_0_f_res_218626;
            
            if (cond_218621) {
                defunc_0_f_res_218626 = 0.0F;
            } else {
                int64_t i_218627 = add64(x_218439, i_218618);
                float defunc_0_add_arg_218628;
                
                defunc_0_add_arg_218628 =
                    ((float *) mem_211111.mem)[gtid_202507 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_217742 *
                                               defunc_0_f_res_196740 +
                                               i_218627];
                defunc_0_f_res_218626 = defunc_0_add_arg_218628;
            }
            
            int64_t binop_p_218629 = sub64(defunc_0_f_res_218622,
                                           defunc_0_m_fun_res_218514);
            float defunc_0_f_res_218630 = sitofp_i64_f32(binop_p_218629);
            float abs_res_218631 = (float) fabs(defunc_0_f_res_218630);
            float tmp1_218632 = abs_res_218631 / x_218440;
            float x_218633 = tmp1_218632 * tmp1_218632;
            float y_218634 = tmp1_218632 * x_218633;
            float tmp2_218635 = 1.0F - y_218634;
            float x_218636 = tmp2_218635 * tmp2_218635;
            float tmp3_218637 = tmp2_218635 * x_218636;
            float tmp4_218638 = defunc_0_f_res_218626 * tmp3_218637;
            float defunc_1_f_res_218639 = defunc_0_f_res_218630 * tmp4_218638;
            float defunc_1_f_res_218640 = defunc_0_f_res_218630 *
                  defunc_1_f_res_218639;
            float defunc_0_f_res_218641;
            
            if (cond_218621) {
                defunc_0_f_res_218641 = 0.0F;
            } else {
                int64_t i_218642 = add64(x_218439, i_218618);
                float defunc_0_add_arg_218643;
                
                defunc_0_add_arg_218643 =
                    ((float *) mem_211106.mem)[gtid_202507 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_217742 *
                                               defunc_0_f_res_196740 +
                                               i_218642];
                defunc_0_f_res_218641 = defunc_0_add_arg_218643;
            }
            
            float x_218644 = a12_218509 * tmp4_218638;
            float y_218645 = b12_218510 * defunc_1_f_res_218639;
            float x_218646 = x_218644 + y_218645;
            float y_218647 = c12_218511 * defunc_1_f_res_218640;
            float x_218648 = x_218646 + y_218647;
            float defunc_9_fit_fun_res_218649 = defunc_0_f_res_218641 *
                  x_218648;
            float x_218650 = b12_218510 * tmp4_218638;
            float y_218651 = b2_218512 * defunc_1_f_res_218639;
            float x_218652 = x_218650 + y_218651;
            float y_218653 = c2_218513 * defunc_1_f_res_218640;
            float x_218654 = x_218652 + y_218653;
            float defunc_9_slope_fun_res_218655 = defunc_0_f_res_218641 *
                  x_218654;
            float defunc_1_op_res_218656 = defunc_9_fit_fun_res_218649 +
                  redout_218619;
            float defunc_1_op_res_218657 = defunc_9_slope_fun_res_218655 +
                  redout_218620;
            float redout_tmp_218665 = defunc_1_op_res_218656;
            float redout_tmp_218666 = defunc_1_op_res_218657;
            
            redout_218619 = redout_tmp_218665;
            redout_218620 = redout_tmp_218666;
        }
        defunc_2_reduce_res_218523 = redout_218619;
        defunc_2_reduce_res_218524 = redout_218620;
        ((float *) mem_217744.mem)[gtid_218438] = defunc_2_reduce_res_218523;
        ((float *) mem_217745.mem)[gtid_218438] = defunc_2_reduce_res_218524;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228669_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228669_end -
                 futhark_mc_segmap_parloop_228669_start;
        
        ctx->futhark_mc_segmap_parloop_228669_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228669_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228669_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228667(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218437 = tid;
    int num_tasks_218567 = info.nsubtasks;
    struct futhark_mc_task_228666 *futhark_mc_task_228666 =
                                  (struct futhark_mc_task_228666 *) args;
    struct futhark_context *ctx = futhark_mc_task_228666->ctx;
    uint64_t futhark_mc_segmap_task_228667_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228667_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228666->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228666->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228666->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228666->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228666->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228666->free_s_n_m_196745;
    int64_t gtid_202507 = futhark_mc_task_228666->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228666->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228666->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228666->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228666->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228666->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 = futhark_mc_task_228666->free_gtid_217742;
    int64_t x_217743 = futhark_mc_task_228666->free_x_217743;
    struct memblock mem_217744 = {.desc ="mem_217744", .mem =
                                  futhark_mc_task_228666->free_mem_217744,
                                  .size =0, .references =NULL};
    struct memblock mem_217745 = {.desc ="mem_217745", .mem =
                                  futhark_mc_task_228666->free_mem_217745,
                                  .size =0, .references =NULL};
    int64_t iter_218568;
    struct futhark_mc_segmap_parloop_struct_228668
    futhark_mc_segmap_parloop_struct_228668;
    
    futhark_mc_segmap_parloop_struct_228668.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228668.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228668.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228668.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228668.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228668.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228668.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228668.free_gtid_202507 = gtid_202507;
    futhark_mc_segmap_parloop_struct_228668.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228668.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228668.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228668.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228668.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228668.free_gtid_217742 = gtid_217742;
    futhark_mc_segmap_parloop_struct_228668.free_x_217743 = x_217743;
    futhark_mc_segmap_parloop_struct_228668.free_mem_217744 = mem_217744.mem;
    futhark_mc_segmap_parloop_struct_228668.free_mem_217745 = mem_217745.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228669_task;
    
    futhark_mc_segmap_parloop_228669_task.name =
        "futhark_mc_segmap_parloop_228669";
    futhark_mc_segmap_parloop_228669_task.fn = futhark_mc_segmap_parloop_228669;
    futhark_mc_segmap_parloop_228669_task.args =
        &futhark_mc_segmap_parloop_struct_228668;
    futhark_mc_segmap_parloop_228669_task.iterations = iterations;
    futhark_mc_segmap_parloop_228669_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228669_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228669_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228669_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228669_task);
    
    if (futhark_mc_segmap_parloop_228669_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228669_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228669_total_end -
                 futhark_mc_segmap_parloop_228669_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228669_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228669_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228669_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228667_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228667_end -
                 futhark_mc_segmap_task_228667_start;
        
        ctx->futhark_mc_segmap_task_228667_runs[tid]++;
        ctx->futhark_mc_segmap_task_228667_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228667_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228671 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    unsigned char *free_mem_217744;
    unsigned char *free_mem_217745;
};
struct futhark_mc_task_228673 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    int64_t free_x_218302;
    float free_x_218303;
    int64_t free_defunc_0_m_fun_res_218305;
    float *retval_defunc_2_reduce_res_218314;
    float *retval_defunc_2_reduce_res_218315;
    float *retval_defunc_2_reduce_res_218316;
    float *retval_defunc_2_reduce_res_218317;
    float *retval_defunc_2_reduce_res_218318;
};
struct futhark_mc_segred_stage_1_parloop_struct_228680 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    int64_t free_x_218302;
    float free_x_218303;
    int64_t free_defunc_0_m_fun_res_218305;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218769;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218771;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218773;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218775;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218777;
};
static int futhark_mc_segred_stage_1_parloop_228681(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_218676,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228680
    *futhark_mc_segred_stage_1_parloop_struct_228680 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228680 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228680->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228681_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228681_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_defunc_0_f_res_196740;
    int64_t gtid_202507 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228680->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228680->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_gtid_217742;
    int64_t x_217743 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_x_217743;
    int64_t x_218302 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_x_218302;
    float x_218303 =
          futhark_mc_segred_stage_1_parloop_struct_228680->free_x_218303;
    int64_t defunc_0_m_fun_res_218305 =
            futhark_mc_segred_stage_1_parloop_struct_228680->free_defunc_0_m_fun_res_218305;
    struct memblock reduce_stage_1_tid_res_arr_mem_218769 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218769",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228680->free_reduce_stage_1_tid_res_arr_mem_218769,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_218771 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218771",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228680->free_reduce_stage_1_tid_res_arr_mem_218771,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_218773 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218773",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228680->free_reduce_stage_1_tid_res_arr_mem_218773,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_218775 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218775",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228680->free_reduce_stage_1_tid_res_arr_mem_218775,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_218777 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218777",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228680->free_reduce_stage_1_tid_res_arr_mem_218777,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_218779 = start;
    float x_218678;
    float x_218679;
    float x_218681;
    float x_218682;
    float x_218684;
    float x_218685;
    float x_218687;
    float x_218688;
    float x_218690;
    float x_218691;
    float local_acc_218780 = 0.0F;
    float local_acc_218781 = 0.0F;
    float local_acc_218782 = 0.0F;
    float local_acc_218783 = 0.0F;
    float local_acc_218784 = 0.0F;
    
    for (; iter_218779 < end; iter_218779++) {
        int64_t gtid_218677 = iter_218779;
        bool cond_218693 = sle64(x_217743, gtid_218677);
        int64_t defunc_0_f_res_218694;
        
        if (cond_218693) {
            defunc_0_f_res_218694 = (int64_t) 0;
        } else {
            int64_t i_218695 = add64(x_218302, gtid_218677);
            int64_t defunc_0_add_arg_218696;
            
            defunc_0_add_arg_218696 = ((int64_t *) mem_210590.mem)[gtid_202507 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_217742 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_218695];
            
            int64_t defunc_1_add_res_218697 = add64((int64_t) 1,
                                                    defunc_0_add_arg_218696);
            
            defunc_0_f_res_218694 = defunc_1_add_res_218697;
        }
        
        float defunc_0_f_res_218698;
        
        if (cond_218693) {
            defunc_0_f_res_218698 = 0.0F;
        } else {
            int64_t i_218699 = add64(x_218302, gtid_218677);
            float defunc_0_add_arg_218700;
            
            defunc_0_add_arg_218700 = ((float *) mem_211111.mem)[gtid_202507 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_217742 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_218699];
            defunc_0_f_res_218698 = defunc_0_add_arg_218700;
        }
        
        int64_t binop_p_218701 = sub64(defunc_0_f_res_218694,
                                       defunc_0_m_fun_res_218305);
        float defunc_0_f_res_218702 = sitofp_i64_f32(binop_p_218701);
        float abs_res_218703 = (float) fabs(defunc_0_f_res_218702);
        float tmp1_218704 = abs_res_218703 / x_218303;
        float x_218705 = tmp1_218704 * tmp1_218704;
        float y_218706 = tmp1_218704 * x_218705;
        float tmp2_218707 = 1.0F - y_218706;
        float x_218708 = tmp2_218707 * tmp2_218707;
        float tmp3_218709 = tmp2_218707 * x_218708;
        float w_j_218710 = defunc_0_f_res_218698 * tmp3_218709;
        float xw_j_218711 = defunc_0_f_res_218702 * w_j_218710;
        float x2w_j_218712 = defunc_0_f_res_218702 * xw_j_218711;
        float x3w_j_218713 = defunc_0_f_res_218702 * x2w_j_218712;
        float x4w_j_218714 = defunc_0_f_res_218702 * x3w_j_218713;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_218678 = local_acc_218780;
        }
        // Load next params
        {
            x_218679 = w_j_218710;
        }
        // Red body
        {
            float defunc_1_op_res_218680 = x_218678 + x_218679;
            
            local_acc_218780 = defunc_1_op_res_218680;
        }
        // Load accum params
        {
            x_218681 = local_acc_218781;
        }
        // Load next params
        {
            x_218682 = xw_j_218711;
        }
        // Red body
        {
            float defunc_1_op_res_218683 = x_218681 + x_218682;
            
            local_acc_218781 = defunc_1_op_res_218683;
        }
        // Load accum params
        {
            x_218684 = local_acc_218782;
        }
        // Load next params
        {
            x_218685 = x2w_j_218712;
        }
        // Red body
        {
            float defunc_1_op_res_218686 = x_218684 + x_218685;
            
            local_acc_218782 = defunc_1_op_res_218686;
        }
        // Load accum params
        {
            x_218687 = local_acc_218783;
        }
        // Load next params
        {
            x_218688 = x3w_j_218713;
        }
        // Red body
        {
            float defunc_1_op_res_218689 = x_218687 + x_218688;
            
            local_acc_218783 = defunc_1_op_res_218689;
        }
        // Load accum params
        {
            x_218690 = local_acc_218784;
        }
        // Load next params
        {
            x_218691 = x4w_j_218714;
        }
        // Red body
        {
            float defunc_1_op_res_218692 = x_218690 + x_218691;
            
            local_acc_218784 = defunc_1_op_res_218692;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_218769.mem)[flat_tid_218676] =
        local_acc_218780;
    ((float *) reduce_stage_1_tid_res_arr_mem_218771.mem)[flat_tid_218676] =
        local_acc_218781;
    ((float *) reduce_stage_1_tid_res_arr_mem_218773.mem)[flat_tid_218676] =
        local_acc_218782;
    ((float *) reduce_stage_1_tid_res_arr_mem_218775.mem)[flat_tid_218676] =
        local_acc_218783;
    ((float *) reduce_stage_1_tid_res_arr_mem_218777.mem)[flat_tid_218676] =
        local_acc_218784;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228681_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228681_end -
                 futhark_mc_segred_stage_1_parloop_228681_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228681_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228681_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228681_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228674(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218676 = tid;
    int num_tasks_218768 = info.nsubtasks;
    struct futhark_mc_task_228673 *futhark_mc_task_228673 =
                                  (struct futhark_mc_task_228673 *) args;
    struct futhark_context *ctx = futhark_mc_task_228673->ctx;
    uint64_t futhark_mc_segred_task_228674_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228674_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228673->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228673->free_defunc_0_f_res_196740;
    int64_t gtid_202507 = futhark_mc_task_228673->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228673->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228673->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 = futhark_mc_task_228673->free_gtid_217742;
    int64_t x_217743 = futhark_mc_task_228673->free_x_217743;
    int64_t x_218302 = futhark_mc_task_228673->free_x_218302;
    float x_218303 = futhark_mc_task_228673->free_x_218303;
    int64_t defunc_0_m_fun_res_218305 =
            futhark_mc_task_228673->free_defunc_0_m_fun_res_218305;
    float defunc_2_reduce_res_218314 =
          *futhark_mc_task_228673->retval_defunc_2_reduce_res_218314;
    float defunc_2_reduce_res_218315 =
          *futhark_mc_task_228673->retval_defunc_2_reduce_res_218315;
    float defunc_2_reduce_res_218316 =
          *futhark_mc_task_228673->retval_defunc_2_reduce_res_218316;
    float defunc_2_reduce_res_218317 =
          *futhark_mc_task_228673->retval_defunc_2_reduce_res_218317;
    float defunc_2_reduce_res_218318 =
          *futhark_mc_task_228673->retval_defunc_2_reduce_res_218318;
    size_t reduce_stage_1_tid_res_arr_mem_218769_cached_sizze_228675 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218769 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_218771_cached_sizze_228676 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218771 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_218773_cached_sizze_228677 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218773 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_218775_cached_sizze_228678 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218775 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_218777_cached_sizze_228679 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218777 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_218769_cached_sizze_228675 <
        (size_t) ((int64_t) 4 * num_tasks_218768)) {
        reduce_stage_1_tid_res_arr_mem_218769 =
            realloc(reduce_stage_1_tid_res_arr_mem_218769, (int64_t) 4 *
                    num_tasks_218768);
        reduce_stage_1_tid_res_arr_mem_218769_cached_sizze_228675 =
            (int64_t) 4 * num_tasks_218768;
    }
    if (reduce_stage_1_tid_res_arr_mem_218771_cached_sizze_228676 <
        (size_t) ((int64_t) 4 * num_tasks_218768)) {
        reduce_stage_1_tid_res_arr_mem_218771 =
            realloc(reduce_stage_1_tid_res_arr_mem_218771, (int64_t) 4 *
                    num_tasks_218768);
        reduce_stage_1_tid_res_arr_mem_218771_cached_sizze_228676 =
            (int64_t) 4 * num_tasks_218768;
    }
    if (reduce_stage_1_tid_res_arr_mem_218773_cached_sizze_228677 <
        (size_t) ((int64_t) 4 * num_tasks_218768)) {
        reduce_stage_1_tid_res_arr_mem_218773 =
            realloc(reduce_stage_1_tid_res_arr_mem_218773, (int64_t) 4 *
                    num_tasks_218768);
        reduce_stage_1_tid_res_arr_mem_218773_cached_sizze_228677 =
            (int64_t) 4 * num_tasks_218768;
    }
    if (reduce_stage_1_tid_res_arr_mem_218775_cached_sizze_228678 <
        (size_t) ((int64_t) 4 * num_tasks_218768)) {
        reduce_stage_1_tid_res_arr_mem_218775 =
            realloc(reduce_stage_1_tid_res_arr_mem_218775, (int64_t) 4 *
                    num_tasks_218768);
        reduce_stage_1_tid_res_arr_mem_218775_cached_sizze_228678 =
            (int64_t) 4 * num_tasks_218768;
    }
    if (reduce_stage_1_tid_res_arr_mem_218777_cached_sizze_228679 <
        (size_t) ((int64_t) 4 * num_tasks_218768)) {
        reduce_stage_1_tid_res_arr_mem_218777 =
            realloc(reduce_stage_1_tid_res_arr_mem_218777, (int64_t) 4 *
                    num_tasks_218768);
        reduce_stage_1_tid_res_arr_mem_218777_cached_sizze_228679 =
            (int64_t) 4 * num_tasks_218768;
    }
    
    int64_t iter_218779;
    struct futhark_mc_segred_stage_1_parloop_struct_228680
    futhark_mc_segred_stage_1_parloop_struct_228680;
    
    futhark_mc_segred_stage_1_parloop_struct_228680.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_gtid_202507 =
        gtid_202507;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_gtid_217742 =
        gtid_217742;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_x_217743 = x_217743;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_x_218302 = x_218302;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_x_218303 = x_218303;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_defunc_0_m_fun_res_218305 =
        defunc_0_m_fun_res_218305;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_reduce_stage_1_tid_res_arr_mem_218769 =
        reduce_stage_1_tid_res_arr_mem_218769;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_reduce_stage_1_tid_res_arr_mem_218771 =
        reduce_stage_1_tid_res_arr_mem_218771;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_reduce_stage_1_tid_res_arr_mem_218773 =
        reduce_stage_1_tid_res_arr_mem_218773;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_reduce_stage_1_tid_res_arr_mem_218775 =
        reduce_stage_1_tid_res_arr_mem_218775;
    futhark_mc_segred_stage_1_parloop_struct_228680.free_reduce_stage_1_tid_res_arr_mem_218777 =
        reduce_stage_1_tid_res_arr_mem_218777;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228681_task;
    
    futhark_mc_segred_stage_1_parloop_228681_task.name =
        "futhark_mc_segred_stage_1_parloop_228681";
    futhark_mc_segred_stage_1_parloop_228681_task.fn =
        futhark_mc_segred_stage_1_parloop_228681;
    futhark_mc_segred_stage_1_parloop_228681_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228680;
    futhark_mc_segred_stage_1_parloop_228681_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228681_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228681_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228681_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228681_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228681_task);
    
    if (futhark_mc_segred_stage_1_parloop_228681_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228681_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228681_total_end -
                 futhark_mc_segred_stage_1_parloop_228681_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228681_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228681_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228681_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_218314 = 0.0F;
        defunc_2_reduce_res_218315 = 0.0F;
        defunc_2_reduce_res_218316 = 0.0F;
        defunc_2_reduce_res_218317 = 0.0F;
        defunc_2_reduce_res_218318 = 0.0F;
    }
    
    float x_218785;
    float x_218786;
    float x_218788;
    float x_218789;
    float x_218791;
    float x_218792;
    float x_218794;
    float x_218795;
    float x_218797;
    float x_218798;
    
    for (int32_t i_218800 = 0; i_218800 < num_tasks_218768; i_218800++) {
        flat_tid_218676 = i_218800;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_218785 = defunc_2_reduce_res_218314;
            }
            // load next params
            {
                x_218786 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218769)[flat_tid_218676];
            }
            // red body
            {
                float defunc_1_op_res_218787 = x_218785 + x_218786;
                
                defunc_2_reduce_res_218314 = defunc_1_op_res_218787;
            }
            // load acc params
            {
                x_218788 = defunc_2_reduce_res_218315;
            }
            // load next params
            {
                x_218789 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218771)[flat_tid_218676];
            }
            // red body
            {
                float defunc_1_op_res_218790 = x_218788 + x_218789;
                
                defunc_2_reduce_res_218315 = defunc_1_op_res_218790;
            }
            // load acc params
            {
                x_218791 = defunc_2_reduce_res_218316;
            }
            // load next params
            {
                x_218792 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218773)[flat_tid_218676];
            }
            // red body
            {
                float defunc_1_op_res_218793 = x_218791 + x_218792;
                
                defunc_2_reduce_res_218316 = defunc_1_op_res_218793;
            }
            // load acc params
            {
                x_218794 = defunc_2_reduce_res_218317;
            }
            // load next params
            {
                x_218795 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218775)[flat_tid_218676];
            }
            // red body
            {
                float defunc_1_op_res_218796 = x_218794 + x_218795;
                
                defunc_2_reduce_res_218317 = defunc_1_op_res_218796;
            }
            // load acc params
            {
                x_218797 = defunc_2_reduce_res_218318;
            }
            // load next params
            {
                x_218798 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218777)[flat_tid_218676];
            }
            // red body
            {
                float defunc_1_op_res_218799 = x_218797 + x_218798;
                
                defunc_2_reduce_res_218318 = defunc_1_op_res_218799;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_218769);
        free(reduce_stage_1_tid_res_arr_mem_218771);
        free(reduce_stage_1_tid_res_arr_mem_218773);
        free(reduce_stage_1_tid_res_arr_mem_218775);
        free(reduce_stage_1_tid_res_arr_mem_218777);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228674_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228674_end -
                 futhark_mc_segred_task_228674_start;
        
        ctx->futhark_mc_segred_task_228674_runs[tid]++;
        ctx->futhark_mc_segred_task_228674_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228674_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228673->retval_defunc_2_reduce_res_218314 =
            defunc_2_reduce_res_218314;
        *futhark_mc_task_228673->retval_defunc_2_reduce_res_218315 =
            defunc_2_reduce_res_218315;
        *futhark_mc_task_228673->retval_defunc_2_reduce_res_218316 =
            defunc_2_reduce_res_218316;
        *futhark_mc_task_228673->retval_defunc_2_reduce_res_218317 =
            defunc_2_reduce_res_218317;
        *futhark_mc_task_228673->retval_defunc_2_reduce_res_218318 =
            defunc_2_reduce_res_218318;
    }
    return err;
}
struct futhark_mc_task_228682 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    int64_t free_x_218302;
    float free_x_218303;
    float free_a12_218378;
    float free_b12_218379;
    float free_c12_218380;
    float free_b2_218381;
    float free_c2_218382;
    int64_t free_defunc_0_m_fun_res_218383;
    float *retval_defunc_2_reduce_res_218392;
    float *retval_defunc_2_reduce_res_218393;
};
struct futhark_mc_segred_stage_1_parloop_struct_228686 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_202507;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_gtid_217742;
    int64_t free_x_217743;
    int64_t free_x_218302;
    float free_x_218303;
    float free_a12_218378;
    float free_b12_218379;
    float free_c12_218380;
    float free_b2_218381;
    float free_c2_218382;
    int64_t free_defunc_0_m_fun_res_218383;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218802;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_218804;
};
static int futhark_mc_segred_stage_1_parloop_228687(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_218723,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228686
    *futhark_mc_segred_stage_1_parloop_struct_228686 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228686 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228686->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228687_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228687_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_defunc_0_f_res_196740;
    int64_t gtid_202507 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228686->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228686->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228686->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_gtid_217742;
    int64_t x_217743 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_x_217743;
    int64_t x_218302 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_x_218302;
    float x_218303 =
          futhark_mc_segred_stage_1_parloop_struct_228686->free_x_218303;
    float a12_218378 =
          futhark_mc_segred_stage_1_parloop_struct_228686->free_a12_218378;
    float b12_218379 =
          futhark_mc_segred_stage_1_parloop_struct_228686->free_b12_218379;
    float c12_218380 =
          futhark_mc_segred_stage_1_parloop_struct_228686->free_c12_218380;
    float b2_218381 =
          futhark_mc_segred_stage_1_parloop_struct_228686->free_b2_218381;
    float c2_218382 =
          futhark_mc_segred_stage_1_parloop_struct_228686->free_c2_218382;
    int64_t defunc_0_m_fun_res_218383 =
            futhark_mc_segred_stage_1_parloop_struct_228686->free_defunc_0_m_fun_res_218383;
    struct memblock reduce_stage_1_tid_res_arr_mem_218802 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218802",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228686->free_reduce_stage_1_tid_res_arr_mem_218802,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_218804 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_218804",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228686->free_reduce_stage_1_tid_res_arr_mem_218804,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_218806 = start;
    float x_218725;
    float x_218726;
    float x_218728;
    float x_218729;
    float local_acc_218807 = 0.0F;
    float local_acc_218808 = 0.0F;
    
    for (; iter_218806 < end; iter_218806++) {
        int64_t gtid_218724 = iter_218806;
        bool cond_218731 = sle64(x_217743, gtid_218724);
        int64_t defunc_0_f_res_218732;
        
        if (cond_218731) {
            defunc_0_f_res_218732 = (int64_t) 0;
        } else {
            int64_t i_218733 = add64(x_218302, gtid_218724);
            int64_t defunc_0_add_arg_218734;
            
            defunc_0_add_arg_218734 = ((int64_t *) mem_210590.mem)[gtid_202507 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_217742 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_218733];
            
            int64_t defunc_1_add_res_218735 = add64((int64_t) 1,
                                                    defunc_0_add_arg_218734);
            
            defunc_0_f_res_218732 = defunc_1_add_res_218735;
        }
        
        float defunc_0_f_res_218736;
        
        if (cond_218731) {
            defunc_0_f_res_218736 = 0.0F;
        } else {
            int64_t i_218737 = add64(x_218302, gtid_218724);
            float defunc_0_add_arg_218738;
            
            defunc_0_add_arg_218738 = ((float *) mem_211111.mem)[gtid_202507 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_217742 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_218737];
            defunc_0_f_res_218736 = defunc_0_add_arg_218738;
        }
        
        int64_t binop_p_218739 = sub64(defunc_0_f_res_218732,
                                       defunc_0_m_fun_res_218383);
        float defunc_0_f_res_218740 = sitofp_i64_f32(binop_p_218739);
        float abs_res_218741 = (float) fabs(defunc_0_f_res_218740);
        float tmp1_218742 = abs_res_218741 / x_218303;
        float x_218743 = tmp1_218742 * tmp1_218742;
        float y_218744 = tmp1_218742 * x_218743;
        float tmp2_218745 = 1.0F - y_218744;
        float x_218746 = tmp2_218745 * tmp2_218745;
        float tmp3_218747 = tmp2_218745 * x_218746;
        float tmp4_218748 = defunc_0_f_res_218736 * tmp3_218747;
        float defunc_1_f_res_218749 = defunc_0_f_res_218740 * tmp4_218748;
        float defunc_1_f_res_218750 = defunc_0_f_res_218740 *
              defunc_1_f_res_218749;
        float defunc_0_f_res_218751;
        
        if (cond_218731) {
            defunc_0_f_res_218751 = 0.0F;
        } else {
            int64_t i_218752 = add64(x_218302, gtid_218724);
            float defunc_0_add_arg_218753;
            
            defunc_0_add_arg_218753 = ((float *) mem_211106.mem)[gtid_202507 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_217742 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_218752];
            defunc_0_f_res_218751 = defunc_0_add_arg_218753;
        }
        
        float x_218754 = a12_218378 * tmp4_218748;
        float y_218755 = b12_218379 * defunc_1_f_res_218749;
        float x_218756 = x_218754 + y_218755;
        float y_218757 = c12_218380 * defunc_1_f_res_218750;
        float x_218758 = x_218756 + y_218757;
        float defunc_9_fit_fun_res_218759 = defunc_0_f_res_218751 * x_218758;
        float x_218760 = b12_218379 * tmp4_218748;
        float y_218761 = b2_218381 * defunc_1_f_res_218749;
        float x_218762 = x_218760 + y_218761;
        float y_218763 = c2_218382 * defunc_1_f_res_218750;
        float x_218764 = x_218762 + y_218763;
        float defunc_9_slope_fun_res_218765 = defunc_0_f_res_218751 * x_218764;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_218725 = local_acc_218807;
        }
        // Load next params
        {
            x_218726 = defunc_9_fit_fun_res_218759;
        }
        // Red body
        {
            float defunc_1_op_res_218727 = x_218725 + x_218726;
            
            local_acc_218807 = defunc_1_op_res_218727;
        }
        // Load accum params
        {
            x_218728 = local_acc_218808;
        }
        // Load next params
        {
            x_218729 = defunc_9_slope_fun_res_218765;
        }
        // Red body
        {
            float defunc_1_op_res_218730 = x_218728 + x_218729;
            
            local_acc_218808 = defunc_1_op_res_218730;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_218802.mem)[flat_tid_218723] =
        local_acc_218807;
    ((float *) reduce_stage_1_tid_res_arr_mem_218804.mem)[flat_tid_218723] =
        local_acc_218808;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228687_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228687_end -
                 futhark_mc_segred_stage_1_parloop_228687_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228687_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228687_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228687_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228683(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218723 = tid;
    int num_tasks_218801 = info.nsubtasks;
    struct futhark_mc_task_228682 *futhark_mc_task_228682 =
                                  (struct futhark_mc_task_228682 *) args;
    struct futhark_context *ctx = futhark_mc_task_228682->ctx;
    uint64_t futhark_mc_segred_task_228683_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228683_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228682->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228682->free_defunc_0_f_res_196740;
    int64_t gtid_202507 = futhark_mc_task_228682->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228682->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228682->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228682->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 = futhark_mc_task_228682->free_gtid_217742;
    int64_t x_217743 = futhark_mc_task_228682->free_x_217743;
    int64_t x_218302 = futhark_mc_task_228682->free_x_218302;
    float x_218303 = futhark_mc_task_228682->free_x_218303;
    float a12_218378 = futhark_mc_task_228682->free_a12_218378;
    float b12_218379 = futhark_mc_task_228682->free_b12_218379;
    float c12_218380 = futhark_mc_task_228682->free_c12_218380;
    float b2_218381 = futhark_mc_task_228682->free_b2_218381;
    float c2_218382 = futhark_mc_task_228682->free_c2_218382;
    int64_t defunc_0_m_fun_res_218383 =
            futhark_mc_task_228682->free_defunc_0_m_fun_res_218383;
    float defunc_2_reduce_res_218392 =
          *futhark_mc_task_228682->retval_defunc_2_reduce_res_218392;
    float defunc_2_reduce_res_218393 =
          *futhark_mc_task_228682->retval_defunc_2_reduce_res_218393;
    size_t reduce_stage_1_tid_res_arr_mem_218802_cached_sizze_228684 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218802 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_218804_cached_sizze_228685 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_218804 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_218802_cached_sizze_228684 <
        (size_t) ((int64_t) 4 * num_tasks_218801)) {
        reduce_stage_1_tid_res_arr_mem_218802 =
            realloc(reduce_stage_1_tid_res_arr_mem_218802, (int64_t) 4 *
                    num_tasks_218801);
        reduce_stage_1_tid_res_arr_mem_218802_cached_sizze_228684 =
            (int64_t) 4 * num_tasks_218801;
    }
    if (reduce_stage_1_tid_res_arr_mem_218804_cached_sizze_228685 <
        (size_t) ((int64_t) 4 * num_tasks_218801)) {
        reduce_stage_1_tid_res_arr_mem_218804 =
            realloc(reduce_stage_1_tid_res_arr_mem_218804, (int64_t) 4 *
                    num_tasks_218801);
        reduce_stage_1_tid_res_arr_mem_218804_cached_sizze_228685 =
            (int64_t) 4 * num_tasks_218801;
    }
    
    int64_t iter_218806;
    struct futhark_mc_segred_stage_1_parloop_struct_228686
    futhark_mc_segred_stage_1_parloop_struct_228686;
    
    futhark_mc_segred_stage_1_parloop_struct_228686.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_gtid_202507 =
        gtid_202507;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_mem_211106 =
        mem_211106.mem;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_gtid_217742 =
        gtid_217742;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_x_217743 = x_217743;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_x_218302 = x_218302;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_x_218303 = x_218303;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_a12_218378 =
        a12_218378;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_b12_218379 =
        b12_218379;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_c12_218380 =
        c12_218380;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_b2_218381 = b2_218381;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_c2_218382 = c2_218382;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_defunc_0_m_fun_res_218383 =
        defunc_0_m_fun_res_218383;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_reduce_stage_1_tid_res_arr_mem_218802 =
        reduce_stage_1_tid_res_arr_mem_218802;
    futhark_mc_segred_stage_1_parloop_struct_228686.free_reduce_stage_1_tid_res_arr_mem_218804 =
        reduce_stage_1_tid_res_arr_mem_218804;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228687_task;
    
    futhark_mc_segred_stage_1_parloop_228687_task.name =
        "futhark_mc_segred_stage_1_parloop_228687";
    futhark_mc_segred_stage_1_parloop_228687_task.fn =
        futhark_mc_segred_stage_1_parloop_228687;
    futhark_mc_segred_stage_1_parloop_228687_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228686;
    futhark_mc_segred_stage_1_parloop_228687_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228687_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228687_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228687_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228687_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228687_task);
    
    if (futhark_mc_segred_stage_1_parloop_228687_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228687_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228687_total_end -
                 futhark_mc_segred_stage_1_parloop_228687_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228687_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228687_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228687_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_218392 = 0.0F;
        defunc_2_reduce_res_218393 = 0.0F;
    }
    
    float x_218809;
    float x_218810;
    float x_218812;
    float x_218813;
    
    for (int32_t i_218815 = 0; i_218815 < num_tasks_218801; i_218815++) {
        flat_tid_218723 = i_218815;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_218809 = defunc_2_reduce_res_218392;
            }
            // load next params
            {
                x_218810 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218802)[flat_tid_218723];
            }
            // red body
            {
                float defunc_1_op_res_218811 = x_218809 + x_218810;
                
                defunc_2_reduce_res_218392 = defunc_1_op_res_218811;
            }
            // load acc params
            {
                x_218812 = defunc_2_reduce_res_218393;
            }
            // load next params
            {
                x_218813 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_218804)[flat_tid_218723];
            }
            // red body
            {
                float defunc_1_op_res_218814 = x_218812 + x_218813;
                
                defunc_2_reduce_res_218393 = defunc_1_op_res_218814;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_218802);
        free(reduce_stage_1_tid_res_arr_mem_218804);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228683_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228683_end -
                 futhark_mc_segred_task_228683_start;
        
        ctx->futhark_mc_segred_task_228683_runs[tid]++;
        ctx->futhark_mc_segred_task_228683_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228683_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228682->retval_defunc_2_reduce_res_218392 =
            defunc_2_reduce_res_218392;
        *futhark_mc_task_228682->retval_defunc_2_reduce_res_218393 =
            defunc_2_reduce_res_218393;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228672(void *args, int64_t start,
                                            int64_t end, int flat_tid_218300,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228671
    *futhark_mc_segmap_parloop_struct_228671 =
    (struct futhark_mc_segmap_parloop_struct_228671 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228671->ctx;
    uint64_t futhark_mc_segmap_parloop_228672_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228672_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228671->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228671->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228671->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228671->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228671->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228671->free_s_n_m_196745;
    int64_t gtid_202507 =
            futhark_mc_segmap_parloop_struct_228671->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 =
            futhark_mc_segmap_parloop_struct_228671->free_gtid_217742;
    int64_t x_217743 = futhark_mc_segmap_parloop_struct_228671->free_x_217743;
    struct memblock mem_217744 = {.desc ="mem_217744", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_217744,
                                  .size =0, .references =NULL};
    struct memblock mem_217745 = {.desc ="mem_217745", .mem =
                                  futhark_mc_segmap_parloop_struct_228671->free_mem_217745,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_218667 = start;
    
    for (; iter_218667 < end; iter_218667++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_218766 = s_n_m_196745;
        int64_t gtid_218301 = iter_218667;
        int64_t remnant_218767 = iter_218667 - gtid_218301;
        int64_t x_218302;
        
        x_218302 = ((int64_t *) mem_210764.mem)[gtid_202507 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_217742 * s_n_m_196745 +
                                                gtid_218301];
        
        float x_218303;
        
        x_218303 = ((float *) mem_210769.mem)[gtid_202507 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_217742 * s_n_m_196745 +
                                              gtid_218301];
        
        bool cond_218304 = gtid_218301 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_218305;
        
        if (cond_218304) {
            defunc_0_m_fun_res_218305 = (int64_t) 0;
        } else {
            int64_t y_218668 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_218669 = gtid_218301 == y_218668;
            int64_t defunc_0_m_fun_res_f_res_218670;
            
            if (cond_218669) {
                int64_t defunc_0_m_fun_res_f_res_t_res_218671 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_218670 =
                    defunc_0_m_fun_res_f_res_t_res_218671;
            } else {
                int64_t x_218672 = sub64(gtid_218301, (int64_t) 1);
                int64_t x_218673 = mul64(jump_s_196701, x_218672);
                int64_t min_arg_218674 = add64((int64_t) 1, x_218673);
                int64_t min_res_218675 = smin64(defunc_0_f_res_196740,
                                                min_arg_218674);
                
                defunc_0_m_fun_res_f_res_218670 = min_res_218675;
            }
            defunc_0_m_fun_res_218305 = defunc_0_m_fun_res_f_res_218670;
        }
        
        float defunc_2_reduce_res_218314;
        float defunc_2_reduce_res_218315;
        float defunc_2_reduce_res_218316;
        float defunc_2_reduce_res_218317;
        float defunc_2_reduce_res_218318;
        int64_t flat_tid_218676 = (int64_t) 0;
        int32_t num_tasks_218768;
        
        defunc_2_reduce_res_218314 = 0.0F;
        defunc_2_reduce_res_218315 = 0.0F;
        defunc_2_reduce_res_218316 = 0.0F;
        defunc_2_reduce_res_218317 = 0.0F;
        defunc_2_reduce_res_218318 = 0.0F;
        
        struct futhark_mc_task_228673 futhark_mc_task_228673;
        
        futhark_mc_task_228673.ctx = ctx;
        futhark_mc_task_228673.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228673.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228673.free_gtid_202507 = gtid_202507;
        futhark_mc_task_228673.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228673.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228673.free_gtid_217742 = gtid_217742;
        futhark_mc_task_228673.free_x_217743 = x_217743;
        futhark_mc_task_228673.free_x_218302 = x_218302;
        futhark_mc_task_228673.free_x_218303 = x_218303;
        futhark_mc_task_228673.free_defunc_0_m_fun_res_218305 =
            defunc_0_m_fun_res_218305;
        futhark_mc_task_228673.retval_defunc_2_reduce_res_218314 =
            &defunc_2_reduce_res_218314;
        futhark_mc_task_228673.retval_defunc_2_reduce_res_218315 =
            &defunc_2_reduce_res_218315;
        futhark_mc_task_228673.retval_defunc_2_reduce_res_218316 =
            &defunc_2_reduce_res_218316;
        futhark_mc_task_228673.retval_defunc_2_reduce_res_218317 =
            &defunc_2_reduce_res_218317;
        futhark_mc_task_228673.retval_defunc_2_reduce_res_218318 =
            &defunc_2_reduce_res_218318;
        
        struct scheduler_segop futhark_mc_task_228673_task;
        
        futhark_mc_task_228673_task.args = &futhark_mc_task_228673;
        futhark_mc_task_228673_task.top_level_fn =
            futhark_mc_segred_task_228674;
        futhark_mc_task_228673_task.name = "futhark_mc_segred_task_228674";
        futhark_mc_task_228673_task.iterations = q_s_196695;
        futhark_mc_task_228673_task.task_time =
            &ctx->futhark_mc_segred_task_228674_total_time;
        futhark_mc_task_228673_task.task_iter =
            &ctx->futhark_mc_segred_task_228674_total_iter;
        futhark_mc_task_228673_task.sched = STATIC;
        futhark_mc_task_228673_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228674_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228673_task);
        
        if (futhark_mc_segred_task_228674_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_218358 = defunc_2_reduce_res_218316 *
              defunc_2_reduce_res_218318;
        float y_218359 = defunc_2_reduce_res_218317 *
              defunc_2_reduce_res_218317;
        float a12_218360 = x_218358 - y_218359;
        float x_218361 = defunc_2_reduce_res_218316 *
              defunc_2_reduce_res_218317;
        float y_218362 = defunc_2_reduce_res_218315 *
              defunc_2_reduce_res_218318;
        float b12_218363 = x_218361 - y_218362;
        float x_218364 = defunc_2_reduce_res_218315 *
              defunc_2_reduce_res_218317;
        float y_218365 = defunc_2_reduce_res_218316 *
              defunc_2_reduce_res_218316;
        float c12_218366 = x_218364 - y_218365;
        float x_218367 = defunc_2_reduce_res_218314 *
              defunc_2_reduce_res_218318;
        float b2_218368 = x_218367 - y_218365;
        float x_218369 = defunc_2_reduce_res_218315 *
              defunc_2_reduce_res_218316;
        float y_218370 = defunc_2_reduce_res_218314 *
              defunc_2_reduce_res_218317;
        float c2_218371 = x_218369 - y_218370;
        float x_218372 = defunc_2_reduce_res_218314 * a12_218360;
        float y_218373 = defunc_2_reduce_res_218315 * b12_218363;
        float x_218374 = x_218372 + y_218373;
        float y_218375 = defunc_2_reduce_res_218316 * c12_218366;
        float y_218376 = x_218374 + y_218375;
        float det_218377 = 1.0F / y_218376;
        float a12_218378 = a12_218360 * det_218377;
        float b12_218379 = b12_218363 * det_218377;
        float c12_218380 = c12_218366 * det_218377;
        float b2_218381 = b2_218368 * det_218377;
        float c2_218382 = c2_218371 * det_218377;
        int64_t defunc_0_m_fun_res_218383;
        
        if (cond_218304) {
            defunc_0_m_fun_res_218383 = (int64_t) 0;
        } else {
            int64_t y_218715 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_218716 = gtid_218301 == y_218715;
            int64_t defunc_0_m_fun_res_f_res_218717;
            
            if (cond_218716) {
                int64_t defunc_0_m_fun_res_f_res_t_res_218718 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_218717 =
                    defunc_0_m_fun_res_f_res_t_res_218718;
            } else {
                int64_t x_218719 = sub64(gtid_218301, (int64_t) 1);
                int64_t x_218720 = mul64(jump_s_196701, x_218719);
                int64_t min_arg_218721 = add64((int64_t) 1, x_218720);
                int64_t min_res_218722 = smin64(defunc_0_f_res_196740,
                                                min_arg_218721);
                
                defunc_0_m_fun_res_f_res_218717 = min_res_218722;
            }
            defunc_0_m_fun_res_218383 = defunc_0_m_fun_res_f_res_218717;
        }
        
        float defunc_2_reduce_res_218392;
        float defunc_2_reduce_res_218393;
        int64_t flat_tid_218723 = (int64_t) 0;
        int32_t num_tasks_218801;
        
        defunc_2_reduce_res_218392 = 0.0F;
        defunc_2_reduce_res_218393 = 0.0F;
        
        struct futhark_mc_task_228682 futhark_mc_task_228682;
        
        futhark_mc_task_228682.ctx = ctx;
        futhark_mc_task_228682.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228682.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228682.free_gtid_202507 = gtid_202507;
        futhark_mc_task_228682.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228682.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228682.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228682.free_gtid_217742 = gtid_217742;
        futhark_mc_task_228682.free_x_217743 = x_217743;
        futhark_mc_task_228682.free_x_218302 = x_218302;
        futhark_mc_task_228682.free_x_218303 = x_218303;
        futhark_mc_task_228682.free_a12_218378 = a12_218378;
        futhark_mc_task_228682.free_b12_218379 = b12_218379;
        futhark_mc_task_228682.free_c12_218380 = c12_218380;
        futhark_mc_task_228682.free_b2_218381 = b2_218381;
        futhark_mc_task_228682.free_c2_218382 = c2_218382;
        futhark_mc_task_228682.free_defunc_0_m_fun_res_218383 =
            defunc_0_m_fun_res_218383;
        futhark_mc_task_228682.retval_defunc_2_reduce_res_218392 =
            &defunc_2_reduce_res_218392;
        futhark_mc_task_228682.retval_defunc_2_reduce_res_218393 =
            &defunc_2_reduce_res_218393;
        
        struct scheduler_segop futhark_mc_task_228682_task;
        
        futhark_mc_task_228682_task.args = &futhark_mc_task_228682;
        futhark_mc_task_228682_task.top_level_fn =
            futhark_mc_segred_task_228683;
        futhark_mc_task_228682_task.name = "futhark_mc_segred_task_228683";
        futhark_mc_task_228682_task.iterations = q_s_196695;
        futhark_mc_task_228682_task.task_time =
            &ctx->futhark_mc_segred_task_228683_total_time;
        futhark_mc_task_228682_task.task_iter =
            &ctx->futhark_mc_segred_task_228683_total_iter;
        futhark_mc_task_228682_task.sched = STATIC;
        futhark_mc_task_228682_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228683_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228682_task);
        
        if (futhark_mc_segred_task_228683_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_217744.mem)[gtid_218301] = defunc_2_reduce_res_218392;
        ((float *) mem_217745.mem)[gtid_218301] = defunc_2_reduce_res_218393;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228672_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228672_end -
                 futhark_mc_segmap_parloop_228672_start;
        
        ctx->futhark_mc_segmap_parloop_228672_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228672_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228672_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228670(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218300 = tid;
    int num_tasks_218567 = info.nsubtasks;
    struct futhark_mc_task_228666 *futhark_mc_task_228666 =
                                  (struct futhark_mc_task_228666 *) args;
    struct futhark_context *ctx = futhark_mc_task_228666->ctx;
    uint64_t futhark_mc_segmap_nested_task_228670_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228670_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228666->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228666->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228666->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228666->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228666->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228666->free_s_n_m_196745;
    int64_t gtid_202507 = futhark_mc_task_228666->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228666->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228666->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228666->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228666->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228666->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_217742 = futhark_mc_task_228666->free_gtid_217742;
    int64_t x_217743 = futhark_mc_task_228666->free_x_217743;
    struct memblock mem_217744 = {.desc ="mem_217744", .mem =
                                  futhark_mc_task_228666->free_mem_217744,
                                  .size =0, .references =NULL};
    struct memblock mem_217745 = {.desc ="mem_217745", .mem =
                                  futhark_mc_task_228666->free_mem_217745,
                                  .size =0, .references =NULL};
    int64_t iter_218667;
    struct futhark_mc_segmap_parloop_struct_228671
    futhark_mc_segmap_parloop_struct_228671;
    
    futhark_mc_segmap_parloop_struct_228671.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228671.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228671.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228671.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228671.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228671.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228671.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228671.free_gtid_202507 = gtid_202507;
    futhark_mc_segmap_parloop_struct_228671.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228671.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228671.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228671.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228671.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228671.free_gtid_217742 = gtid_217742;
    futhark_mc_segmap_parloop_struct_228671.free_x_217743 = x_217743;
    futhark_mc_segmap_parloop_struct_228671.free_mem_217744 = mem_217744.mem;
    futhark_mc_segmap_parloop_struct_228671.free_mem_217745 = mem_217745.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228672_task;
    
    futhark_mc_segmap_parloop_228672_task.name =
        "futhark_mc_segmap_parloop_228672";
    futhark_mc_segmap_parloop_228672_task.fn = futhark_mc_segmap_parloop_228672;
    futhark_mc_segmap_parloop_228672_task.args =
        &futhark_mc_segmap_parloop_struct_228671;
    futhark_mc_segmap_parloop_228672_task.iterations = iterations;
    futhark_mc_segmap_parloop_228672_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228672_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228672_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228672_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228672_task);
    
    if (futhark_mc_segmap_parloop_228672_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228672_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228672_total_end -
                 futhark_mc_segmap_parloop_228672_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228672_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228672_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228672_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228670_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228670_end -
                 futhark_mc_segmap_nested_task_228670_start;
        
        ctx->futhark_mc_segmap_nested_task_228670_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228670_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228670_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228663(void *args, int64_t start,
                                            int64_t end, int flat_tid_217741,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228662
    *futhark_mc_segmap_parloop_struct_228662 =
    (struct futhark_mc_segmap_parloop_struct_228662 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228662->ctx;
    uint64_t futhark_mc_segmap_parloop_228663_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228663_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228662->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228662->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228662->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228662->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228662->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228662->free_s_n_m_196745;
    int64_t gtid_202507 =
            futhark_mc_segmap_parloop_struct_228662->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228662->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211369 = {.desc ="mem_211369", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_211369,
                                  .size =0, .references =NULL};
    struct memblock mem_211373 = {.desc ="mem_211373", .mem =
                                  futhark_mc_segmap_parloop_struct_228662->free_mem_211373,
                                  .size =0, .references =NULL};
    size_t mem_217744_cached_sizze_228664 = 0;
    unsigned char *mem_217744 = NULL;
    size_t mem_217745_cached_sizze_228665 = 0;
    unsigned char *mem_217745 = NULL;
    int64_t iterations = end - start;
    int64_t iter_218299 = start;
    
    if (mem_217744_cached_sizze_228664 < (size_t) bytes_210599) {
        mem_217744 = realloc(mem_217744, bytes_210599);
        mem_217744_cached_sizze_228664 = bytes_210599;
    }
    if (mem_217745_cached_sizze_228665 < (size_t) bytes_210599) {
        mem_217745 = realloc(mem_217745, bytes_210599);
        mem_217745_cached_sizze_228665 = bytes_210599;
    }
    for (; iter_218299 < end; iter_218299++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_218565 = n_p_196694;
        int64_t gtid_217742 = iter_218299;
        int64_t remnant_218566 = iter_218299 - gtid_217742;
        int64_t x_217743;
        
        x_217743 = ((int64_t *) mem_210594.mem)[gtid_202507 * n_p_196694 +
                                                gtid_217742];
        
        int64_t flat_tid_218437 = (int64_t) 0;
        int32_t num_tasks_218567;
        int64_t flat_tid_218300 = (int64_t) 0;
        struct futhark_mc_task_228666 futhark_mc_task_228666;
        
        futhark_mc_task_228666.ctx = ctx;
        futhark_mc_task_228666.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228666.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228666.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228666.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228666.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228666.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228666.free_gtid_202507 = gtid_202507;
        futhark_mc_task_228666.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228666.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228666.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228666.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228666.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228666.free_gtid_217742 = gtid_217742;
        futhark_mc_task_228666.free_x_217743 = x_217743;
        futhark_mc_task_228666.free_mem_217744 = mem_217744;
        futhark_mc_task_228666.free_mem_217745 = mem_217745;
        
        struct scheduler_segop futhark_mc_task_228666_task;
        
        futhark_mc_task_228666_task.args = &futhark_mc_task_228666;
        futhark_mc_task_228666_task.top_level_fn =
            futhark_mc_segmap_task_228667;
        futhark_mc_task_228666_task.name = "futhark_mc_segmap_task_228667";
        futhark_mc_task_228666_task.iterations = s_n_m_196745;
        futhark_mc_task_228666_task.task_time =
            &ctx->futhark_mc_segmap_task_228667_total_time;
        futhark_mc_task_228666_task.task_iter =
            &ctx->futhark_mc_segmap_task_228667_total_iter;
        futhark_mc_task_228666_task.sched = STATIC;
        futhark_mc_task_228666_task.nested_fn =
            futhark_mc_segmap_nested_task_228670;
        
        int futhark_mc_segmap_task_228667_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228666_task);
        
        if (futhark_mc_segmap_task_228667_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211369.mem + gtid_217742 * s_n_m_196745 * (int64_t) 4,
                    mem_217744 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211373.mem + gtid_217742 * s_n_m_196745 * (int64_t) 4,
                    mem_217745 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_217744);
    free(mem_217745);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228663_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228663_end -
                 futhark_mc_segmap_parloop_228663_start;
        
        ctx->futhark_mc_segmap_parloop_228663_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228663_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228663_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228661(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_217741 = tid;
    int num_tasks_218155 = info.nsubtasks;
    struct futhark_mc_task_228655 *futhark_mc_task_228655 =
                                  (struct futhark_mc_task_228655 *) args;
    struct futhark_context *ctx = futhark_mc_task_228655->ctx;
    uint64_t futhark_mc_segmap_nested_task_228661_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228661_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228655->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228655->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228655->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228655->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228655->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228655->free_s_n_m_196745;
    int64_t gtid_202507 = futhark_mc_task_228655->free_gtid_202507;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228655->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228655->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228655->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228655->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228655->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228655->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228655->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211369 = {.desc ="mem_211369", .mem =
                                  futhark_mc_task_228655->free_mem_211369,
                                  .size =0, .references =NULL};
    struct memblock mem_211373 = {.desc ="mem_211373", .mem =
                                  futhark_mc_task_228655->free_mem_211373,
                                  .size =0, .references =NULL};
    int64_t iter_218299;
    struct futhark_mc_segmap_parloop_struct_228662
    futhark_mc_segmap_parloop_struct_228662;
    
    futhark_mc_segmap_parloop_struct_228662.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228662.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228662.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228662.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228662.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228662.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228662.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228662.free_gtid_202507 = gtid_202507;
    futhark_mc_segmap_parloop_struct_228662.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228662.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228662.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228662.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228662.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228662.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228662.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228662.free_mem_211369 = mem_211369.mem;
    futhark_mc_segmap_parloop_struct_228662.free_mem_211373 = mem_211373.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228663_task;
    
    futhark_mc_segmap_parloop_228663_task.name =
        "futhark_mc_segmap_parloop_228663";
    futhark_mc_segmap_parloop_228663_task.fn = futhark_mc_segmap_parloop_228663;
    futhark_mc_segmap_parloop_228663_task.args =
        &futhark_mc_segmap_parloop_struct_228662;
    futhark_mc_segmap_parloop_228663_task.iterations = iterations;
    futhark_mc_segmap_parloop_228663_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228663_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228663_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228663_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228663_task);
    
    if (futhark_mc_segmap_parloop_228663_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228663_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228663_total_end -
                 futhark_mc_segmap_parloop_228663_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228663_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228663_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228663_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228661_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228661_end -
                 futhark_mc_segmap_nested_task_228661_start;
        
        ctx->futhark_mc_segmap_nested_task_228661_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228661_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228661_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228652(void *args, int64_t start,
                                            int64_t end, int flat_tid_202506,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228651
    *futhark_mc_segmap_parloop_struct_228651 =
    (struct futhark_mc_segmap_parloop_struct_228651 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228651->ctx;
    uint64_t futhark_mc_segmap_parloop_228652_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228652_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228651->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228651->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228651->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228651->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228651->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228651->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228651->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228651->free_bytes_210599;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228651->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211466 = {.desc ="mem_211466", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_211466,
                                  .size =0, .references =NULL};
    struct memblock mem_211471 = {.desc ="mem_211471", .mem =
                                  futhark_mc_segmap_parloop_struct_228651->free_mem_211471,
                                  .size =0, .references =NULL};
    size_t mem_211369_cached_sizze_228653 = 0;
    unsigned char *mem_211369 = NULL;
    size_t mem_211373_cached_sizze_228654 = 0;
    unsigned char *mem_211373 = NULL;
    int64_t iterations = end - start;
    int64_t iter_217740 = start;
    
    if (mem_211369_cached_sizze_228653 < (size_t) bytes_210655) {
        mem_211369 = realloc(mem_211369, bytes_210655);
        mem_211369_cached_sizze_228653 = bytes_210655;
    }
    if (mem_211373_cached_sizze_228654 < (size_t) bytes_210655) {
        mem_211373 = realloc(mem_211373, bytes_210655);
        mem_211373_cached_sizze_228654 = bytes_210655;
    }
    for (; iter_217740 < end; iter_217740++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_218153 = m_196691;
        int64_t gtid_202507 = iter_217740;
        int64_t remnant_218154 = iter_217740 - gtid_202507;
        int64_t flat_tid_218013 = (int64_t) 0;
        int32_t num_tasks_218155;
        int64_t flat_tid_217741 = (int64_t) 0;
        struct futhark_mc_task_228655 futhark_mc_task_228655;
        
        futhark_mc_task_228655.ctx = ctx;
        futhark_mc_task_228655.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228655.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228655.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228655.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228655.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228655.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228655.free_gtid_202507 = gtid_202507;
        futhark_mc_task_228655.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228655.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228655.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228655.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228655.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228655.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228655.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228655.free_mem_211369 = mem_211369;
        futhark_mc_task_228655.free_mem_211373 = mem_211373;
        
        struct scheduler_segop futhark_mc_task_228655_task;
        
        futhark_mc_task_228655_task.args = &futhark_mc_task_228655;
        futhark_mc_task_228655_task.top_level_fn =
            futhark_mc_segmap_task_228656;
        futhark_mc_task_228655_task.name = "futhark_mc_segmap_task_228656";
        futhark_mc_task_228655_task.iterations = n_p_196694;
        futhark_mc_task_228655_task.task_time =
            &ctx->futhark_mc_segmap_task_228656_total_time;
        futhark_mc_task_228655_task.task_iter =
            &ctx->futhark_mc_segmap_task_228656_total_iter;
        futhark_mc_task_228655_task.sched = STATIC;
        futhark_mc_task_228655_task.nested_fn =
            futhark_mc_segmap_nested_task_228661;
        
        int futhark_mc_segmap_task_228656_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228655_task);
        
        if (futhark_mc_segmap_task_228656_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211466.mem + gtid_202507 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211369 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211471.mem + gtid_202507 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211373 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211369);
    free(mem_211373);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228652_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228652_end -
                 futhark_mc_segmap_parloop_228652_start;
        
        ctx->futhark_mc_segmap_parloop_228652_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228652_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228652_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228650(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_202506 = tid;
    int num_tasks_217588 = info.nsubtasks;
    struct futhark_mc_task_228644 *futhark_mc_task_228644 =
                                  (struct futhark_mc_task_228644 *) args;
    struct futhark_context *ctx = futhark_mc_task_228644->ctx;
    uint64_t futhark_mc_segmap_nested_task_228650_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228650_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228644->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228644->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228644->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228644->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228644->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228644->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228644->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228644->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228644->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228644->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228644->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228644->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228644->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228644->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228644->free_mem_211111,
                                  .size =0, .references =NULL};
    struct memblock mem_211466 = {.desc ="mem_211466", .mem =
                                  futhark_mc_task_228644->free_mem_211466,
                                  .size =0, .references =NULL};
    struct memblock mem_211471 = {.desc ="mem_211471", .mem =
                                  futhark_mc_task_228644->free_mem_211471,
                                  .size =0, .references =NULL};
    int64_t iter_217740;
    struct futhark_mc_segmap_parloop_struct_228651
    futhark_mc_segmap_parloop_struct_228651;
    
    futhark_mc_segmap_parloop_struct_228651.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228651.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228651.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228651.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228651.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228651.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228651.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228651.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228651.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228651.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228651.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228651.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228651.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228651.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228651.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228651.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228651.free_mem_211466 = mem_211466.mem;
    futhark_mc_segmap_parloop_struct_228651.free_mem_211471 = mem_211471.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228652_task;
    
    futhark_mc_segmap_parloop_228652_task.name =
        "futhark_mc_segmap_parloop_228652";
    futhark_mc_segmap_parloop_228652_task.fn = futhark_mc_segmap_parloop_228652;
    futhark_mc_segmap_parloop_228652_task.args =
        &futhark_mc_segmap_parloop_struct_228651;
    futhark_mc_segmap_parloop_228652_task.iterations = iterations;
    futhark_mc_segmap_parloop_228652_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228652_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228652_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228652_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228652_task);
    
    if (futhark_mc_segmap_parloop_228652_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228652_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228652_total_end -
                 futhark_mc_segmap_parloop_228652_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228652_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228652_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228652_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228650_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228650_end -
                 futhark_mc_segmap_nested_task_228650_start;
        
        ctx->futhark_mc_segmap_nested_task_228650_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228650_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228650_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228688 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    unsigned char *free_mem_211599;
};
struct futhark_mc_segmap_parloop_struct_228690 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    unsigned char *free_mem_211599;
};
static int futhark_mc_segmap_parloop_228691(void *args, int64_t start,
                                            int64_t end, int flat_tid_202946,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228690
    *futhark_mc_segmap_parloop_struct_228690 =
    (struct futhark_mc_segmap_parloop_struct_228690 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228690->ctx;
    uint64_t futhark_mc_segmap_parloop_228691_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228691_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228690->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228690->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228690->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228690->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228690->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228690->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228690->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228690->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 =
            futhark_mc_segmap_parloop_struct_228690->free_bytes_211482;
    struct memblock mem_211599 = {.desc ="mem_211599", .mem =
                                  futhark_mc_segmap_parloop_struct_228690->free_mem_211599,
                                  .size =0, .references =NULL};
    size_t mem_211539_cached_sizze_228692 = 0;
    unsigned char *mem_211539 = NULL;
    size_t mem_211563_cached_sizze_228693 = 0;
    unsigned char *mem_211563 = NULL;
    int64_t iterations = end - start;
    int64_t iter_218820 = start;
    
    if (mem_211539_cached_sizze_228692 < (size_t) bytes_210655) {
        mem_211539 = realloc(mem_211539, bytes_210655);
        mem_211539_cached_sizze_228692 = bytes_210655;
    }
    if (mem_211563_cached_sizze_228693 < (size_t) bytes_211482) {
        mem_211563 = realloc(mem_211563, bytes_211482);
        mem_211563_cached_sizze_228693 = bytes_211482;
    }
    for (; iter_218820 < end; iter_218820++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_218878 = m_196691;
        int64_t gtid_202947 = iter_218820;
        int64_t remnant_218879 = iter_218820 - gtid_202947;
        
        for (int64_t i_218821 = 0; i_218821 < n_p_196694; i_218821++) {
            int64_t x_218823;
            
            x_218823 = ((int64_t *) mem_210594.mem)[gtid_202947 * n_p_196694 +
                                                    i_218821];
            for (int64_t i_218825 = 0; i_218825 < s_n_m_196745; i_218825++) {
                int64_t x_218827;
                
                x_218827 = ((int64_t *) mem_210764.mem)[gtid_202947 *
                                                        (s_n_m_196745 *
                                                         n_p_196694) +
                                                        i_218821 *
                                                        s_n_m_196745 +
                                                        i_218825];
                
                float x_218828;
                
                x_218828 = ((float *) mem_210769.mem)[gtid_202947 *
                                                      (s_n_m_196745 *
                                                       n_p_196694) + i_218821 *
                                                      s_n_m_196745 + i_218825];
                
                bool cond_218829 = i_218825 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_218830;
                
                if (cond_218829) {
                    defunc_0_m_fun_res_218830 = (int64_t) 0;
                } else {
                    int64_t y_218831 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_218832 = i_218825 == y_218831;
                    int64_t defunc_0_m_fun_res_f_res_218833;
                    
                    if (cond_218832) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_218834 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_218833 =
                            defunc_0_m_fun_res_f_res_t_res_218834;
                    } else {
                        int64_t x_218835 = sub64(i_218825, (int64_t) 1);
                        int64_t x_218836 = mul64(jump_s_196701, x_218835);
                        int64_t min_arg_218837 = add64((int64_t) 1, x_218836);
                        int64_t min_res_218838 = smin64(defunc_0_f_res_196740,
                                                        min_arg_218837);
                        
                        defunc_0_m_fun_res_f_res_218833 = min_res_218838;
                    }
                    defunc_0_m_fun_res_218830 = defunc_0_m_fun_res_f_res_218833;
                }
                
                float defunc_2_reduce_res_218840;
                float redout_218843 = 0.0F;
                
                for (int64_t i_218842 = 0; i_218842 < q_s_196695; i_218842++) {
                    bool cond_218845 = sle64(x_218823, i_218842);
                    int64_t defunc_0_f_res_218846;
                    
                    if (cond_218845) {
                        defunc_0_f_res_218846 = (int64_t) 0;
                    } else {
                        int64_t i_218847 = add64(x_218827, i_218842);
                        int64_t defunc_0_add_arg_218848;
                        
                        defunc_0_add_arg_218848 =
                            ((int64_t *) mem_210590.mem)[gtid_202947 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_218821 *
                                                         defunc_0_f_res_196740 +
                                                         i_218847];
                        
                        int64_t defunc_1_add_res_218849 = add64((int64_t) 1,
                                                                defunc_0_add_arg_218848);
                        
                        defunc_0_f_res_218846 = defunc_1_add_res_218849;
                    }
                    
                    float defunc_0_f_res_218850;
                    
                    if (cond_218845) {
                        defunc_0_f_res_218850 = 0.0F;
                    } else {
                        int64_t i_218851 = add64(x_218827, i_218842);
                        float defunc_0_add_arg_218852;
                        
                        defunc_0_add_arg_218852 =
                            ((float *) mem_211111.mem)[gtid_202947 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_218821 *
                                                       defunc_0_f_res_196740 +
                                                       i_218851];
                        defunc_0_f_res_218850 = defunc_0_add_arg_218852;
                    }
                    
                    int64_t binop_p_218853 = sub64(defunc_0_f_res_218846,
                                                   defunc_0_m_fun_res_218830);
                    float defunc_0_f_res_218854 =
                          sitofp_i64_f32(binop_p_218853);
                    float abs_res_218855 = (float) fabs(defunc_0_f_res_218854);
                    float tmp1_218856 = abs_res_218855 / x_218828;
                    float x_218857 = tmp1_218856 * tmp1_218856;
                    float y_218858 = tmp1_218856 * x_218857;
                    float tmp2_218859 = 1.0F - y_218858;
                    float x_218860 = tmp2_218859 * tmp2_218859;
                    float tmp3_218861 = tmp2_218859 * x_218860;
                    float tmp4_218862 = defunc_0_f_res_218850 * tmp3_218861;
                    float defunc_1_op_res_218863 = tmp4_218862 + redout_218843;
                    
                    ((float *) mem_211563)[i_218842] = tmp4_218862;
                    
                    float redout_tmp_218882 = defunc_1_op_res_218863;
                    
                    redout_218843 = redout_tmp_218882;
                }
                defunc_2_reduce_res_218840 = redout_218843;
                
                float a0_218865 = 1.0F / defunc_2_reduce_res_218840;
                float defunc_2_reduce_res_218866;
                float redout_218868 = 0.0F;
                
                for (int64_t i_218867 = 0; i_218867 < q_s_196695; i_218867++) {
                    float x_218869;
                    
                    x_218869 = ((float *) mem_211563)[i_218867];
                    
                    bool cond_218870 = sle64(x_218823, i_218867);
                    float defunc_0_f_res_218871;
                    
                    if (cond_218870) {
                        defunc_0_f_res_218871 = 0.0F;
                    } else {
                        int64_t i_218872 = add64(x_218827, i_218867);
                        float defunc_0_add_arg_218873;
                        
                        defunc_0_add_arg_218873 =
                            ((float *) mem_211106.mem)[gtid_202947 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_218821 *
                                                       defunc_0_f_res_196740 +
                                                       i_218872];
                        defunc_0_f_res_218871 = defunc_0_add_arg_218873;
                    }
                    
                    float x_218874 = a0_218865 * x_218869;
                    float defunc_9_fit_fun_res_218875 = defunc_0_f_res_218871 *
                          x_218874;
                    float defunc_1_op_res_218876 = defunc_9_fit_fun_res_218875 +
                          redout_218868;
                    float redout_tmp_218884 = defunc_1_op_res_218876;
                    
                    redout_218868 = redout_tmp_218884;
                }
                defunc_2_reduce_res_218866 = redout_218868;
                ((float *) mem_211539)[i_218821 * s_n_m_196745 + i_218825] =
                    defunc_2_reduce_res_218866;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211599.mem + gtid_202947 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211539 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211539);
    free(mem_211563);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228691_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228691_end -
                 futhark_mc_segmap_parloop_228691_start;
        
        ctx->futhark_mc_segmap_parloop_228691_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228691_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228691_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228689(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_202946 = tid;
    int num_tasks_218819 = info.nsubtasks;
    struct futhark_mc_task_228688 *futhark_mc_task_228688 =
                                  (struct futhark_mc_task_228688 *) args;
    struct futhark_context *ctx = futhark_mc_task_228688->ctx;
    uint64_t futhark_mc_segmap_task_228689_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228689_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228688->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228688->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228688->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228688->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228688->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228688->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228688->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228688->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228688->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228688->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228688->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228688->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228688->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228688->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228688->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 = futhark_mc_task_228688->free_bytes_211482;
    struct memblock mem_211599 = {.desc ="mem_211599", .mem =
                                  futhark_mc_task_228688->free_mem_211599,
                                  .size =0, .references =NULL};
    int64_t iter_218820;
    struct futhark_mc_segmap_parloop_struct_228690
    futhark_mc_segmap_parloop_struct_228690;
    
    futhark_mc_segmap_parloop_struct_228690.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228690.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228690.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228690.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228690.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228690.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228690.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228690.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228690.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228690.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228690.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228690.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228690.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228690.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228690.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228690.free_bytes_211482 = bytes_211482;
    futhark_mc_segmap_parloop_struct_228690.free_mem_211599 = mem_211599.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228691_task;
    
    futhark_mc_segmap_parloop_228691_task.name =
        "futhark_mc_segmap_parloop_228691";
    futhark_mc_segmap_parloop_228691_task.fn = futhark_mc_segmap_parloop_228691;
    futhark_mc_segmap_parloop_228691_task.args =
        &futhark_mc_segmap_parloop_struct_228690;
    futhark_mc_segmap_parloop_228691_task.iterations = iterations;
    futhark_mc_segmap_parloop_228691_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228691_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228691_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228691_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228691_task);
    
    if (futhark_mc_segmap_parloop_228691_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228691_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228691_total_end -
                 futhark_mc_segmap_parloop_228691_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228691_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228691_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228691_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228689_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228689_end -
                 futhark_mc_segmap_task_228689_start;
        
        ctx->futhark_mc_segmap_task_228689_runs[tid]++;
        ctx->futhark_mc_segmap_task_228689_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228689_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228695 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    unsigned char *free_mem_211599;
};
struct futhark_mc_task_228698 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    unsigned char *free_mem_211535;
};
struct futhark_mc_segmap_parloop_struct_228700 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    unsigned char *free_mem_211535;
};
static int futhark_mc_segmap_parloop_228701(void *args, int64_t start,
                                            int64_t end, int flat_tid_218998,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228700
    *futhark_mc_segmap_parloop_struct_228700 =
    (struct futhark_mc_segmap_parloop_struct_228700 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228700->ctx;
    uint64_t futhark_mc_segmap_parloop_228701_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228701_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228700->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228700->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228700->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228700->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228700->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228700->free_s_n_m_196745;
    int64_t gtid_203136 =
            futhark_mc_segmap_parloop_struct_228700->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228700->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 =
            futhark_mc_segmap_parloop_struct_228700->free_bytes_211482;
    struct memblock mem_211535 = {.desc ="mem_211535", .mem =
                                  futhark_mc_segmap_parloop_struct_228700->free_mem_211535,
                                  .size =0, .references =NULL};
    size_t mem_219001_cached_sizze_228702 = 0;
    unsigned char *mem_219001 = NULL;
    size_t mem_219003_cached_sizze_228703 = 0;
    unsigned char *mem_219003 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219061 = start;
    
    if (mem_219001_cached_sizze_228702 < (size_t) bytes_210599) {
        mem_219001 = realloc(mem_219001, bytes_210599);
        mem_219001_cached_sizze_228702 = bytes_210599;
    }
    if (mem_219003_cached_sizze_228703 < (size_t) bytes_211482) {
        mem_219003 = realloc(mem_219003, bytes_211482);
        mem_219003_cached_sizze_228703 = bytes_211482;
    }
    for (; iter_219061 < end; iter_219061++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219115 = n_p_196694;
        int64_t gtid_218999 = iter_219061;
        int64_t remnant_219116 = iter_219061 - gtid_218999;
        int64_t x_219000;
        
        x_219000 = ((int64_t *) mem_210594.mem)[gtid_203136 * n_p_196694 +
                                                gtid_218999];
        for (int64_t i_219062 = 0; i_219062 < s_n_m_196745; i_219062++) {
            int64_t x_219064;
            
            x_219064 = ((int64_t *) mem_210764.mem)[gtid_203136 *
                                                    (s_n_m_196745 *
                                                     n_p_196694) + gtid_218999 *
                                                    s_n_m_196745 + i_219062];
            
            float x_219065;
            
            x_219065 = ((float *) mem_210769.mem)[gtid_203136 * (s_n_m_196745 *
                                                                 n_p_196694) +
                                                  gtid_218999 * s_n_m_196745 +
                                                  i_219062];
            
            bool cond_219066 = i_219062 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_219067;
            
            if (cond_219066) {
                defunc_0_m_fun_res_219067 = (int64_t) 0;
            } else {
                int64_t y_219068 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_219069 = i_219062 == y_219068;
                int64_t defunc_0_m_fun_res_f_res_219070;
                
                if (cond_219069) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_219071 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_219070 =
                        defunc_0_m_fun_res_f_res_t_res_219071;
                } else {
                    int64_t x_219072 = sub64(i_219062, (int64_t) 1);
                    int64_t x_219073 = mul64(jump_s_196701, x_219072);
                    int64_t min_arg_219074 = add64((int64_t) 1, x_219073);
                    int64_t min_res_219075 = smin64(defunc_0_f_res_196740,
                                                    min_arg_219074);
                    
                    defunc_0_m_fun_res_f_res_219070 = min_res_219075;
                }
                defunc_0_m_fun_res_219067 = defunc_0_m_fun_res_f_res_219070;
            }
            
            float defunc_2_reduce_res_219077;
            float redout_219080 = 0.0F;
            
            for (int64_t i_219079 = 0; i_219079 < q_s_196695; i_219079++) {
                bool cond_219082 = sle64(x_219000, i_219079);
                int64_t defunc_0_f_res_219083;
                
                if (cond_219082) {
                    defunc_0_f_res_219083 = (int64_t) 0;
                } else {
                    int64_t i_219084 = add64(x_219064, i_219079);
                    int64_t defunc_0_add_arg_219085;
                    
                    defunc_0_add_arg_219085 =
                        ((int64_t *) mem_210590.mem)[gtid_203136 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_218999 *
                                                     defunc_0_f_res_196740 +
                                                     i_219084];
                    
                    int64_t defunc_1_add_res_219086 = add64((int64_t) 1,
                                                            defunc_0_add_arg_219085);
                    
                    defunc_0_f_res_219083 = defunc_1_add_res_219086;
                }
                
                float defunc_0_f_res_219087;
                
                if (cond_219082) {
                    defunc_0_f_res_219087 = 0.0F;
                } else {
                    int64_t i_219088 = add64(x_219064, i_219079);
                    float defunc_0_add_arg_219089;
                    
                    defunc_0_add_arg_219089 =
                        ((float *) mem_211111.mem)[gtid_203136 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_218999 *
                                                   defunc_0_f_res_196740 +
                                                   i_219088];
                    defunc_0_f_res_219087 = defunc_0_add_arg_219089;
                }
                
                int64_t binop_p_219090 = sub64(defunc_0_f_res_219083,
                                               defunc_0_m_fun_res_219067);
                float defunc_0_f_res_219091 = sitofp_i64_f32(binop_p_219090);
                float abs_res_219092 = (float) fabs(defunc_0_f_res_219091);
                float tmp1_219093 = abs_res_219092 / x_219065;
                float x_219094 = tmp1_219093 * tmp1_219093;
                float y_219095 = tmp1_219093 * x_219094;
                float tmp2_219096 = 1.0F - y_219095;
                float x_219097 = tmp2_219096 * tmp2_219096;
                float tmp3_219098 = tmp2_219096 * x_219097;
                float tmp4_219099 = defunc_0_f_res_219087 * tmp3_219098;
                float defunc_1_op_res_219100 = tmp4_219099 + redout_219080;
                
                ((float *) mem_219003)[i_219079] = tmp4_219099;
                
                float redout_tmp_219118 = defunc_1_op_res_219100;
                
                redout_219080 = redout_tmp_219118;
            }
            defunc_2_reduce_res_219077 = redout_219080;
            
            float a0_219102 = 1.0F / defunc_2_reduce_res_219077;
            float defunc_2_reduce_res_219103;
            float redout_219105 = 0.0F;
            
            for (int64_t i_219104 = 0; i_219104 < q_s_196695; i_219104++) {
                float x_219106;
                
                x_219106 = ((float *) mem_219003)[i_219104];
                
                bool cond_219107 = sle64(x_219000, i_219104);
                float defunc_0_f_res_219108;
                
                if (cond_219107) {
                    defunc_0_f_res_219108 = 0.0F;
                } else {
                    int64_t i_219109 = add64(x_219064, i_219104);
                    float defunc_0_add_arg_219110;
                    
                    defunc_0_add_arg_219110 =
                        ((float *) mem_211106.mem)[gtid_203136 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_218999 *
                                                   defunc_0_f_res_196740 +
                                                   i_219109];
                    defunc_0_f_res_219108 = defunc_0_add_arg_219110;
                }
                
                float x_219111 = a0_219102 * x_219106;
                float defunc_9_fit_fun_res_219112 = defunc_0_f_res_219108 *
                      x_219111;
                float defunc_1_op_res_219113 = defunc_9_fit_fun_res_219112 +
                      redout_219105;
                float redout_tmp_219120 = defunc_1_op_res_219113;
                
                redout_219105 = redout_tmp_219120;
            }
            defunc_2_reduce_res_219103 = redout_219105;
            ((float *) mem_219001)[i_219062] = defunc_2_reduce_res_219103;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211535.mem + gtid_218999 * s_n_m_196745 * (int64_t) 4,
                    mem_219001 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_219001);
    free(mem_219003);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228701_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228701_end -
                 futhark_mc_segmap_parloop_228701_start;
        
        ctx->futhark_mc_segmap_parloop_228701_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228701_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228701_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228699(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218998 = tid;
    int num_tasks_219060 = info.nsubtasks;
    struct futhark_mc_task_228698 *futhark_mc_task_228698 =
                                  (struct futhark_mc_task_228698 *) args;
    struct futhark_context *ctx = futhark_mc_task_228698->ctx;
    uint64_t futhark_mc_segmap_task_228699_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228699_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228698->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228698->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228698->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228698->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228698->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228698->free_s_n_m_196745;
    int64_t gtid_203136 = futhark_mc_task_228698->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228698->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228698->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228698->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228698->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228698->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228698->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228698->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 = futhark_mc_task_228698->free_bytes_211482;
    struct memblock mem_211535 = {.desc ="mem_211535", .mem =
                                  futhark_mc_task_228698->free_mem_211535,
                                  .size =0, .references =NULL};
    int64_t iter_219061;
    struct futhark_mc_segmap_parloop_struct_228700
    futhark_mc_segmap_parloop_struct_228700;
    
    futhark_mc_segmap_parloop_struct_228700.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228700.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228700.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228700.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228700.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228700.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228700.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228700.free_gtid_203136 = gtid_203136;
    futhark_mc_segmap_parloop_struct_228700.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228700.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228700.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228700.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228700.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228700.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228700.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228700.free_bytes_211482 = bytes_211482;
    futhark_mc_segmap_parloop_struct_228700.free_mem_211535 = mem_211535.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228701_task;
    
    futhark_mc_segmap_parloop_228701_task.name =
        "futhark_mc_segmap_parloop_228701";
    futhark_mc_segmap_parloop_228701_task.fn = futhark_mc_segmap_parloop_228701;
    futhark_mc_segmap_parloop_228701_task.args =
        &futhark_mc_segmap_parloop_struct_228700;
    futhark_mc_segmap_parloop_228701_task.iterations = iterations;
    futhark_mc_segmap_parloop_228701_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228701_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228701_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228701_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228701_task);
    
    if (futhark_mc_segmap_parloop_228701_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228701_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228701_total_end -
                 futhark_mc_segmap_parloop_228701_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228701_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228701_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228701_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228699_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228699_end -
                 futhark_mc_segmap_task_228699_start;
        
        ctx->futhark_mc_segmap_task_228699_runs[tid]++;
        ctx->futhark_mc_segmap_task_228699_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228699_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228705 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    unsigned char *free_mem_211535;
};
struct futhark_mc_task_228708 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    unsigned char *free_mem_218889;
};
struct futhark_mc_segmap_parloop_struct_228710 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    unsigned char *free_mem_218889;
};
static int futhark_mc_segmap_parloop_228711(void *args, int64_t start,
                                            int64_t end, int flat_tid_219176,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228710
    *futhark_mc_segmap_parloop_struct_228710 =
    (struct futhark_mc_segmap_parloop_struct_228710 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228710->ctx;
    uint64_t futhark_mc_segmap_parloop_228711_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228711_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228710->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228710->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228710->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228710->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228710->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228710->free_s_n_m_196745;
    int64_t gtid_203136 =
            futhark_mc_segmap_parloop_struct_228710->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228710->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228710->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228710->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228710->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228710->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 =
            futhark_mc_segmap_parloop_struct_228710->free_bytes_211482;
    int64_t gtid_218887 =
            futhark_mc_segmap_parloop_struct_228710->free_gtid_218887;
    int64_t x_218888 = futhark_mc_segmap_parloop_struct_228710->free_x_218888;
    struct memblock mem_218889 = {.desc ="mem_218889", .mem =
                                  futhark_mc_segmap_parloop_struct_228710->free_mem_218889,
                                  .size =0, .references =NULL};
    size_t mem_219190_cached_sizze_228712 = 0;
    unsigned char *mem_219190 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219232 = start;
    
    if (mem_219190_cached_sizze_228712 < (size_t) bytes_211482) {
        mem_219190 = realloc(mem_219190, bytes_211482);
        mem_219190_cached_sizze_228712 = bytes_211482;
    }
    for (; iter_219232 < end; iter_219232++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219274 = s_n_m_196745;
        int64_t gtid_219177 = iter_219232;
        int64_t remnant_219275 = iter_219232 - gtid_219177;
        int64_t x_219178;
        
        x_219178 = ((int64_t *) mem_210764.mem)[gtid_203136 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_218887 * s_n_m_196745 +
                                                gtid_219177];
        
        float x_219179;
        
        x_219179 = ((float *) mem_210769.mem)[gtid_203136 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_218887 * s_n_m_196745 +
                                              gtid_219177];
        
        bool cond_219180 = gtid_219177 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_219181;
        
        if (cond_219180) {
            defunc_0_m_fun_res_219181 = (int64_t) 0;
        } else {
            int64_t y_219233 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_219234 = gtid_219177 == y_219233;
            int64_t defunc_0_m_fun_res_f_res_219235;
            
            if (cond_219234) {
                int64_t defunc_0_m_fun_res_f_res_t_res_219236 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_219235 =
                    defunc_0_m_fun_res_f_res_t_res_219236;
            } else {
                int64_t x_219237 = sub64(gtid_219177, (int64_t) 1);
                int64_t x_219238 = mul64(jump_s_196701, x_219237);
                int64_t min_arg_219239 = add64((int64_t) 1, x_219238);
                int64_t min_res_219240 = smin64(defunc_0_f_res_196740,
                                                min_arg_219239);
                
                defunc_0_m_fun_res_f_res_219235 = min_res_219240;
            }
            defunc_0_m_fun_res_219181 = defunc_0_m_fun_res_f_res_219235;
        }
        
        float defunc_2_reduce_res_219192;
        float redout_219242 = 0.0F;
        
        for (int64_t i_219241 = 0; i_219241 < q_s_196695; i_219241++) {
            bool cond_219244 = sle64(x_218888, i_219241);
            int64_t defunc_0_f_res_219245;
            
            if (cond_219244) {
                defunc_0_f_res_219245 = (int64_t) 0;
            } else {
                int64_t i_219246 = add64(x_219178, i_219241);
                int64_t defunc_0_add_arg_219247;
                
                defunc_0_add_arg_219247 =
                    ((int64_t *) mem_210590.mem)[gtid_203136 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_218887 *
                                                 defunc_0_f_res_196740 +
                                                 i_219246];
                
                int64_t defunc_1_add_res_219248 = add64((int64_t) 1,
                                                        defunc_0_add_arg_219247);
                
                defunc_0_f_res_219245 = defunc_1_add_res_219248;
            }
            
            float defunc_0_f_res_219249;
            
            if (cond_219244) {
                defunc_0_f_res_219249 = 0.0F;
            } else {
                int64_t i_219250 = add64(x_219178, i_219241);
                float defunc_0_add_arg_219251;
                
                defunc_0_add_arg_219251 =
                    ((float *) mem_211111.mem)[gtid_203136 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_218887 *
                                               defunc_0_f_res_196740 +
                                               i_219250];
                defunc_0_f_res_219249 = defunc_0_add_arg_219251;
            }
            
            int64_t binop_p_219252 = sub64(defunc_0_f_res_219245,
                                           defunc_0_m_fun_res_219181);
            float defunc_0_f_res_219253 = sitofp_i64_f32(binop_p_219252);
            float abs_res_219254 = (float) fabs(defunc_0_f_res_219253);
            float tmp1_219255 = abs_res_219254 / x_219179;
            float x_219256 = tmp1_219255 * tmp1_219255;
            float y_219257 = tmp1_219255 * x_219256;
            float tmp2_219258 = 1.0F - y_219257;
            float x_219259 = tmp2_219258 * tmp2_219258;
            float tmp3_219260 = tmp2_219258 * x_219259;
            float tmp4_219261 = defunc_0_f_res_219249 * tmp3_219260;
            float defunc_1_op_res_219262 = tmp4_219261 + redout_219242;
            
            ((float *) mem_219190)[i_219241] = tmp4_219261;
            
            float redout_tmp_219276 = defunc_1_op_res_219262;
            
            redout_219242 = redout_tmp_219276;
        }
        defunc_2_reduce_res_219192 = redout_219242;
        
        float a0_219217 = 1.0F / defunc_2_reduce_res_219192;
        float defunc_2_reduce_res_219218;
        float redout_219265 = 0.0F;
        
        for (int64_t i_219264 = 0; i_219264 < q_s_196695; i_219264++) {
            float x_219266;
            
            x_219266 = ((float *) mem_219190)[i_219264];
            
            bool cond_219267 = sle64(x_218888, i_219264);
            float defunc_0_f_res_219268;
            
            if (cond_219267) {
                defunc_0_f_res_219268 = 0.0F;
            } else {
                int64_t i_219269 = add64(x_219178, i_219264);
                float defunc_0_add_arg_219270;
                
                defunc_0_add_arg_219270 =
                    ((float *) mem_211106.mem)[gtid_203136 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_218887 *
                                               defunc_0_f_res_196740 +
                                               i_219269];
                defunc_0_f_res_219268 = defunc_0_add_arg_219270;
            }
            
            float x_219271 = a0_219217 * x_219266;
            float defunc_9_fit_fun_res_219272 = defunc_0_f_res_219268 *
                  x_219271;
            float defunc_1_op_res_219273 = defunc_9_fit_fun_res_219272 +
                  redout_219265;
            float redout_tmp_219278 = defunc_1_op_res_219273;
            
            redout_219265 = redout_tmp_219278;
        }
        defunc_2_reduce_res_219218 = redout_219265;
        ((float *) mem_218889.mem)[gtid_219177] = defunc_2_reduce_res_219218;
    }
    
  cleanup:
    { }
    free(mem_219190);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228711_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228711_end -
                 futhark_mc_segmap_parloop_228711_start;
        
        ctx->futhark_mc_segmap_parloop_228711_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228711_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228711_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228709(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219176 = tid;
    int num_tasks_219231 = info.nsubtasks;
    struct futhark_mc_task_228708 *futhark_mc_task_228708 =
                                  (struct futhark_mc_task_228708 *) args;
    struct futhark_context *ctx = futhark_mc_task_228708->ctx;
    uint64_t futhark_mc_segmap_task_228709_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228709_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228708->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228708->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228708->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228708->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228708->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228708->free_s_n_m_196745;
    int64_t gtid_203136 = futhark_mc_task_228708->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228708->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228708->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228708->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228708->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228708->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 = futhark_mc_task_228708->free_bytes_211482;
    int64_t gtid_218887 = futhark_mc_task_228708->free_gtid_218887;
    int64_t x_218888 = futhark_mc_task_228708->free_x_218888;
    struct memblock mem_218889 = {.desc ="mem_218889", .mem =
                                  futhark_mc_task_228708->free_mem_218889,
                                  .size =0, .references =NULL};
    int64_t iter_219232;
    struct futhark_mc_segmap_parloop_struct_228710
    futhark_mc_segmap_parloop_struct_228710;
    
    futhark_mc_segmap_parloop_struct_228710.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228710.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228710.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228710.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228710.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228710.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228710.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228710.free_gtid_203136 = gtid_203136;
    futhark_mc_segmap_parloop_struct_228710.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228710.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228710.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228710.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228710.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228710.free_bytes_211482 = bytes_211482;
    futhark_mc_segmap_parloop_struct_228710.free_gtid_218887 = gtid_218887;
    futhark_mc_segmap_parloop_struct_228710.free_x_218888 = x_218888;
    futhark_mc_segmap_parloop_struct_228710.free_mem_218889 = mem_218889.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228711_task;
    
    futhark_mc_segmap_parloop_228711_task.name =
        "futhark_mc_segmap_parloop_228711";
    futhark_mc_segmap_parloop_228711_task.fn = futhark_mc_segmap_parloop_228711;
    futhark_mc_segmap_parloop_228711_task.args =
        &futhark_mc_segmap_parloop_struct_228710;
    futhark_mc_segmap_parloop_228711_task.iterations = iterations;
    futhark_mc_segmap_parloop_228711_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228711_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228711_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228711_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228711_task);
    
    if (futhark_mc_segmap_parloop_228711_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228711_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228711_total_end -
                 futhark_mc_segmap_parloop_228711_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228711_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228711_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228711_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228709_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228709_end -
                 futhark_mc_segmap_task_228709_start;
        
        ctx->futhark_mc_segmap_task_228709_runs[tid]++;
        ctx->futhark_mc_segmap_task_228709_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228709_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228714 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211482;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    unsigned char *free_mem_218889;
};
struct futhark_mc_task_228717 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    int64_t free_x_219124;
    float free_x_219125;
    int64_t free_defunc_0_m_fun_res_219127;
    float *retval_defunc_2_reduce_res_219137;
    unsigned char *retval_mem_219136;
};
struct futhark_mc_segred_stage_1_parloop_struct_228720 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203136;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    int64_t free_x_219124;
    float free_x_219125;
    int64_t free_defunc_0_m_fun_res_219127;
    unsigned char *free_mem_219136;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_219326;
};
static int futhark_mc_segred_stage_1_parloop_228721(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_219288,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228720
    *futhark_mc_segred_stage_1_parloop_struct_228720 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228720 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228720->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228721_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228721_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_defunc_0_f_res_196740;
    int64_t gtid_203136 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228720->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228720->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_218887 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_gtid_218887;
    int64_t x_218888 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_x_218888;
    int64_t x_219124 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_x_219124;
    float x_219125 =
          futhark_mc_segred_stage_1_parloop_struct_228720->free_x_219125;
    int64_t defunc_0_m_fun_res_219127 =
            futhark_mc_segred_stage_1_parloop_struct_228720->free_defunc_0_m_fun_res_219127;
    struct memblock mem_219136 = {.desc ="mem_219136", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228720->free_mem_219136,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_219326 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_219326",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228720->free_reduce_stage_1_tid_res_arr_mem_219326,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_219328 = start;
    float x_219290;
    float x_219291;
    float local_acc_219329 = 0.0F;
    
    for (; iter_219328 < end; iter_219328++) {
        int64_t gtid_219289 = iter_219328;
        bool cond_219293 = sle64(x_218888, gtid_219289);
        int64_t defunc_0_f_res_219294;
        
        if (cond_219293) {
            defunc_0_f_res_219294 = (int64_t) 0;
        } else {
            int64_t i_219295 = add64(x_219124, gtid_219289);
            int64_t defunc_0_add_arg_219296;
            
            defunc_0_add_arg_219296 = ((int64_t *) mem_210590.mem)[gtid_203136 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_218887 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_219295];
            
            int64_t defunc_1_add_res_219297 = add64((int64_t) 1,
                                                    defunc_0_add_arg_219296);
            
            defunc_0_f_res_219294 = defunc_1_add_res_219297;
        }
        
        float defunc_0_f_res_219298;
        
        if (cond_219293) {
            defunc_0_f_res_219298 = 0.0F;
        } else {
            int64_t i_219299 = add64(x_219124, gtid_219289);
            float defunc_0_add_arg_219300;
            
            defunc_0_add_arg_219300 = ((float *) mem_211111.mem)[gtid_203136 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_218887 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_219299];
            defunc_0_f_res_219298 = defunc_0_add_arg_219300;
        }
        
        int64_t binop_p_219301 = sub64(defunc_0_f_res_219294,
                                       defunc_0_m_fun_res_219127);
        float defunc_0_f_res_219302 = sitofp_i64_f32(binop_p_219301);
        float abs_res_219303 = (float) fabs(defunc_0_f_res_219302);
        float tmp1_219304 = abs_res_219303 / x_219125;
        float x_219305 = tmp1_219304 * tmp1_219304;
        float y_219306 = tmp1_219304 * x_219305;
        float tmp2_219307 = 1.0F - y_219306;
        float x_219308 = tmp2_219307 * tmp2_219307;
        float tmp3_219309 = tmp2_219307 * x_219308;
        float tmp4_219310 = defunc_0_f_res_219298 * tmp3_219309;
        
        // save map-out results
        {
            ((float *) mem_219136.mem)[gtid_219289] = tmp4_219310;
        }
        // Load accum params
        {
            x_219290 = local_acc_219329;
        }
        // Load next params
        {
            x_219291 = tmp4_219310;
        }
        // Red body
        {
            float defunc_1_op_res_219292 = x_219290 + x_219291;
            
            local_acc_219329 = defunc_1_op_res_219292;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_219326.mem)[flat_tid_219288] =
        local_acc_219329;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228721_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228721_end -
                 futhark_mc_segred_stage_1_parloop_228721_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228721_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228721_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228721_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228718(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219288 = tid;
    int num_tasks_219325 = info.nsubtasks;
    struct futhark_mc_task_228717 *futhark_mc_task_228717 =
                                  (struct futhark_mc_task_228717 *) args;
    struct futhark_context *ctx = futhark_mc_task_228717->ctx;
    uint64_t futhark_mc_segred_task_228718_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228718_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228717->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228717->free_defunc_0_f_res_196740;
    int64_t gtid_203136 = futhark_mc_task_228717->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228717->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228717->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_218887 = futhark_mc_task_228717->free_gtid_218887;
    int64_t x_218888 = futhark_mc_task_228717->free_x_218888;
    int64_t x_219124 = futhark_mc_task_228717->free_x_219124;
    float x_219125 = futhark_mc_task_228717->free_x_219125;
    int64_t defunc_0_m_fun_res_219127 =
            futhark_mc_task_228717->free_defunc_0_m_fun_res_219127;
    float defunc_2_reduce_res_219137 =
          *futhark_mc_task_228717->retval_defunc_2_reduce_res_219137;
    struct memblock mem_219136 = {.desc ="mem_219136", .mem =
                                  futhark_mc_task_228717->retval_mem_219136,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_219326_cached_sizze_228719 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_219326 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_219326_cached_sizze_228719 <
        (size_t) ((int64_t) 4 * num_tasks_219325)) {
        reduce_stage_1_tid_res_arr_mem_219326 =
            realloc(reduce_stage_1_tid_res_arr_mem_219326, (int64_t) 4 *
                    num_tasks_219325);
        reduce_stage_1_tid_res_arr_mem_219326_cached_sizze_228719 =
            (int64_t) 4 * num_tasks_219325;
    }
    
    int64_t iter_219328;
    struct futhark_mc_segred_stage_1_parloop_struct_228720
    futhark_mc_segred_stage_1_parloop_struct_228720;
    
    futhark_mc_segred_stage_1_parloop_struct_228720.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_gtid_203136 =
        gtid_203136;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_gtid_218887 =
        gtid_218887;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_x_218888 = x_218888;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_x_219124 = x_219124;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_x_219125 = x_219125;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_defunc_0_m_fun_res_219127 =
        defunc_0_m_fun_res_219127;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_mem_219136 =
        mem_219136.mem;
    futhark_mc_segred_stage_1_parloop_struct_228720.free_reduce_stage_1_tid_res_arr_mem_219326 =
        reduce_stage_1_tid_res_arr_mem_219326;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228721_task;
    
    futhark_mc_segred_stage_1_parloop_228721_task.name =
        "futhark_mc_segred_stage_1_parloop_228721";
    futhark_mc_segred_stage_1_parloop_228721_task.fn =
        futhark_mc_segred_stage_1_parloop_228721;
    futhark_mc_segred_stage_1_parloop_228721_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228720;
    futhark_mc_segred_stage_1_parloop_228721_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228721_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228721_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228721_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228721_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228721_task);
    
    if (futhark_mc_segred_stage_1_parloop_228721_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228721_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228721_total_end -
                 futhark_mc_segred_stage_1_parloop_228721_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228721_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228721_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228721_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_219137 = 0.0F;
    }
    
    float x_219330;
    float x_219331;
    
    for (int32_t i_219333 = 0; i_219333 < num_tasks_219325; i_219333++) {
        flat_tid_219288 = i_219333;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_219330 = defunc_2_reduce_res_219137;
            }
            // load next params
            {
                x_219331 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_219326)[flat_tid_219288];
            }
            // red body
            {
                float defunc_1_op_res_219332 = x_219330 + x_219331;
                
                defunc_2_reduce_res_219137 = defunc_1_op_res_219332;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_219326);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228718_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228718_end -
                 futhark_mc_segred_task_228718_start;
        
        ctx->futhark_mc_segred_task_228718_runs[tid]++;
        ctx->futhark_mc_segred_task_228718_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228718_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228717->retval_defunc_2_reduce_res_219137 =
            defunc_2_reduce_res_219137;
        futhark_mc_task_228717->retval_mem_219136 = mem_219136.mem;
    }
    return err;
}
struct futhark_mc_task_228722 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203136;
    unsigned char *free_mem_211106;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    int64_t free_x_219124;
    unsigned char *free_mem_219136;
    float free_a0_219162;
    float *retval_defunc_2_reduce_res_219163;
};
struct futhark_mc_segred_stage_1_parloop_struct_228725 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203136;
    unsigned char *free_mem_211106;
    int64_t free_gtid_218887;
    int64_t free_x_218888;
    int64_t free_x_219124;
    unsigned char *free_mem_219136;
    float free_a0_219162;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_219335;
};
static int futhark_mc_segred_stage_1_parloop_228726(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_219311,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228725
    *futhark_mc_segred_stage_1_parloop_struct_228725 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228725 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228725->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228726_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228726_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228725->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228725->free_defunc_0_f_res_196740;
    int64_t gtid_203136 =
            futhark_mc_segred_stage_1_parloop_struct_228725->free_gtid_203136;
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228725->free_mem_211106,
                                  .size =0, .references =NULL};
    int64_t gtid_218887 =
            futhark_mc_segred_stage_1_parloop_struct_228725->free_gtid_218887;
    int64_t x_218888 =
            futhark_mc_segred_stage_1_parloop_struct_228725->free_x_218888;
    int64_t x_219124 =
            futhark_mc_segred_stage_1_parloop_struct_228725->free_x_219124;
    struct memblock mem_219136 = {.desc ="mem_219136", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228725->free_mem_219136,
                                  .size =0, .references =NULL};
    float a0_219162 =
          futhark_mc_segred_stage_1_parloop_struct_228725->free_a0_219162;
    struct memblock reduce_stage_1_tid_res_arr_mem_219335 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_219335",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228725->free_reduce_stage_1_tid_res_arr_mem_219335,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_219337 = start;
    float x_219313;
    float x_219314;
    float local_acc_219338 = 0.0F;
    
    for (; iter_219337 < end; iter_219337++) {
        int64_t gtid_219312 = iter_219337;
        float x_219316;
        
        x_219316 = ((float *) mem_219136.mem)[gtid_219312];
        
        bool cond_219317 = sle64(x_218888, gtid_219312);
        float defunc_0_f_res_219318;
        
        if (cond_219317) {
            defunc_0_f_res_219318 = 0.0F;
        } else {
            int64_t i_219319 = add64(x_219124, gtid_219312);
            float defunc_0_add_arg_219320;
            
            defunc_0_add_arg_219320 = ((float *) mem_211106.mem)[gtid_203136 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_218887 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_219319];
            defunc_0_f_res_219318 = defunc_0_add_arg_219320;
        }
        
        float x_219321 = a0_219162 * x_219316;
        float defunc_9_fit_fun_res_219322 = defunc_0_f_res_219318 * x_219321;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_219313 = local_acc_219338;
        }
        // Load next params
        {
            x_219314 = defunc_9_fit_fun_res_219322;
        }
        // Red body
        {
            float defunc_1_op_res_219315 = x_219313 + x_219314;
            
            local_acc_219338 = defunc_1_op_res_219315;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_219335.mem)[flat_tid_219311] =
        local_acc_219338;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228726_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228726_end -
                 futhark_mc_segred_stage_1_parloop_228726_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228726_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228726_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228726_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228723(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219311 = tid;
    int num_tasks_219334 = info.nsubtasks;
    struct futhark_mc_task_228722 *futhark_mc_task_228722 =
                                  (struct futhark_mc_task_228722 *) args;
    struct futhark_context *ctx = futhark_mc_task_228722->ctx;
    uint64_t futhark_mc_segred_task_228723_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228723_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228722->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228722->free_defunc_0_f_res_196740;
    int64_t gtid_203136 = futhark_mc_task_228722->free_gtid_203136;
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228722->free_mem_211106,
                                  .size =0, .references =NULL};
    int64_t gtid_218887 = futhark_mc_task_228722->free_gtid_218887;
    int64_t x_218888 = futhark_mc_task_228722->free_x_218888;
    int64_t x_219124 = futhark_mc_task_228722->free_x_219124;
    struct memblock mem_219136 = {.desc ="mem_219136", .mem =
                                  futhark_mc_task_228722->free_mem_219136,
                                  .size =0, .references =NULL};
    float a0_219162 = futhark_mc_task_228722->free_a0_219162;
    float defunc_2_reduce_res_219163 =
          *futhark_mc_task_228722->retval_defunc_2_reduce_res_219163;
    size_t reduce_stage_1_tid_res_arr_mem_219335_cached_sizze_228724 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_219335 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_219335_cached_sizze_228724 <
        (size_t) ((int64_t) 4 * num_tasks_219334)) {
        reduce_stage_1_tid_res_arr_mem_219335 =
            realloc(reduce_stage_1_tid_res_arr_mem_219335, (int64_t) 4 *
                    num_tasks_219334);
        reduce_stage_1_tid_res_arr_mem_219335_cached_sizze_228724 =
            (int64_t) 4 * num_tasks_219334;
    }
    
    int64_t iter_219337;
    struct futhark_mc_segred_stage_1_parloop_struct_228725
    futhark_mc_segred_stage_1_parloop_struct_228725;
    
    futhark_mc_segred_stage_1_parloop_struct_228725.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_gtid_203136 =
        gtid_203136;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_mem_211106 =
        mem_211106.mem;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_gtid_218887 =
        gtid_218887;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_x_218888 = x_218888;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_x_219124 = x_219124;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_mem_219136 =
        mem_219136.mem;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_a0_219162 = a0_219162;
    futhark_mc_segred_stage_1_parloop_struct_228725.free_reduce_stage_1_tid_res_arr_mem_219335 =
        reduce_stage_1_tid_res_arr_mem_219335;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228726_task;
    
    futhark_mc_segred_stage_1_parloop_228726_task.name =
        "futhark_mc_segred_stage_1_parloop_228726";
    futhark_mc_segred_stage_1_parloop_228726_task.fn =
        futhark_mc_segred_stage_1_parloop_228726;
    futhark_mc_segred_stage_1_parloop_228726_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228725;
    futhark_mc_segred_stage_1_parloop_228726_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228726_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228726_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228726_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228726_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228726_task);
    
    if (futhark_mc_segred_stage_1_parloop_228726_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228726_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228726_total_end -
                 futhark_mc_segred_stage_1_parloop_228726_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228726_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228726_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228726_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_219163 = 0.0F;
    }
    
    float x_219339;
    float x_219340;
    
    for (int32_t i_219342 = 0; i_219342 < num_tasks_219334; i_219342++) {
        flat_tid_219311 = i_219342;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_219339 = defunc_2_reduce_res_219163;
            }
            // load next params
            {
                x_219340 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_219335)[flat_tid_219311];
            }
            // red body
            {
                float defunc_1_op_res_219341 = x_219339 + x_219340;
                
                defunc_2_reduce_res_219163 = defunc_1_op_res_219341;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_219335);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228723_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228723_end -
                 futhark_mc_segred_task_228723_start;
        
        ctx->futhark_mc_segred_task_228723_runs[tid]++;
        ctx->futhark_mc_segred_task_228723_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228723_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228722->retval_defunc_2_reduce_res_219163 =
            defunc_2_reduce_res_219163;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228715(void *args, int64_t start,
                                            int64_t end, int flat_tid_219122,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228714
    *futhark_mc_segmap_parloop_struct_228714 =
    (struct futhark_mc_segmap_parloop_struct_228714 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228714->ctx;
    uint64_t futhark_mc_segmap_parloop_228715_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228715_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228714->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228714->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228714->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228714->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228714->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228714->free_s_n_m_196745;
    int64_t gtid_203136 =
            futhark_mc_segmap_parloop_struct_228714->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228714->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228714->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228714->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228714->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228714->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 =
            futhark_mc_segmap_parloop_struct_228714->free_bytes_211482;
    int64_t gtid_218887 =
            futhark_mc_segmap_parloop_struct_228714->free_gtid_218887;
    int64_t x_218888 = futhark_mc_segmap_parloop_struct_228714->free_x_218888;
    struct memblock mem_218889 = {.desc ="mem_218889", .mem =
                                  futhark_mc_segmap_parloop_struct_228714->free_mem_218889,
                                  .size =0, .references =NULL};
    size_t mem_219136_cached_sizze_228716 = 0;
    unsigned char *mem_219136 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219279 = start;
    
    if (mem_219136_cached_sizze_228716 < (size_t) bytes_211482) {
        mem_219136 = realloc(mem_219136, bytes_211482);
        mem_219136_cached_sizze_228716 = bytes_211482;
    }
    for (; iter_219279 < end; iter_219279++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219323 = s_n_m_196745;
        int64_t gtid_219123 = iter_219279;
        int64_t remnant_219324 = iter_219279 - gtid_219123;
        int64_t x_219124;
        
        x_219124 = ((int64_t *) mem_210764.mem)[gtid_203136 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_218887 * s_n_m_196745 +
                                                gtid_219123];
        
        float x_219125;
        
        x_219125 = ((float *) mem_210769.mem)[gtid_203136 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_218887 * s_n_m_196745 +
                                              gtid_219123];
        
        bool cond_219126 = gtid_219123 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_219127;
        
        if (cond_219126) {
            defunc_0_m_fun_res_219127 = (int64_t) 0;
        } else {
            int64_t y_219280 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_219281 = gtid_219123 == y_219280;
            int64_t defunc_0_m_fun_res_f_res_219282;
            
            if (cond_219281) {
                int64_t defunc_0_m_fun_res_f_res_t_res_219283 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_219282 =
                    defunc_0_m_fun_res_f_res_t_res_219283;
            } else {
                int64_t x_219284 = sub64(gtid_219123, (int64_t) 1);
                int64_t x_219285 = mul64(jump_s_196701, x_219284);
                int64_t min_arg_219286 = add64((int64_t) 1, x_219285);
                int64_t min_res_219287 = smin64(defunc_0_f_res_196740,
                                                min_arg_219286);
                
                defunc_0_m_fun_res_f_res_219282 = min_res_219287;
            }
            defunc_0_m_fun_res_219127 = defunc_0_m_fun_res_f_res_219282;
        }
        
        float defunc_2_reduce_res_219137;
        int64_t flat_tid_219288 = (int64_t) 0;
        int32_t num_tasks_219325;
        
        defunc_2_reduce_res_219137 = 0.0F;
        
        struct futhark_mc_task_228717 futhark_mc_task_228717;
        
        futhark_mc_task_228717.ctx = ctx;
        futhark_mc_task_228717.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228717.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228717.free_gtid_203136 = gtid_203136;
        futhark_mc_task_228717.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228717.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228717.free_gtid_218887 = gtid_218887;
        futhark_mc_task_228717.free_x_218888 = x_218888;
        futhark_mc_task_228717.free_x_219124 = x_219124;
        futhark_mc_task_228717.free_x_219125 = x_219125;
        futhark_mc_task_228717.free_defunc_0_m_fun_res_219127 =
            defunc_0_m_fun_res_219127;
        futhark_mc_task_228717.retval_defunc_2_reduce_res_219137 =
            &defunc_2_reduce_res_219137;
        futhark_mc_task_228717.retval_mem_219136 = mem_219136;
        
        struct scheduler_segop futhark_mc_task_228717_task;
        
        futhark_mc_task_228717_task.args = &futhark_mc_task_228717;
        futhark_mc_task_228717_task.top_level_fn =
            futhark_mc_segred_task_228718;
        futhark_mc_task_228717_task.name = "futhark_mc_segred_task_228718";
        futhark_mc_task_228717_task.iterations = q_s_196695;
        futhark_mc_task_228717_task.task_time =
            &ctx->futhark_mc_segred_task_228718_total_time;
        futhark_mc_task_228717_task.task_iter =
            &ctx->futhark_mc_segred_task_228718_total_iter;
        futhark_mc_task_228717_task.sched = STATIC;
        futhark_mc_task_228717_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228718_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228717_task);
        
        if (futhark_mc_segred_task_228718_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float a0_219162 = 1.0F / defunc_2_reduce_res_219137;
        float defunc_2_reduce_res_219163;
        int64_t flat_tid_219311 = (int64_t) 0;
        int32_t num_tasks_219334;
        
        defunc_2_reduce_res_219163 = 0.0F;
        
        struct futhark_mc_task_228722 futhark_mc_task_228722;
        
        futhark_mc_task_228722.ctx = ctx;
        futhark_mc_task_228722.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228722.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228722.free_gtid_203136 = gtid_203136;
        futhark_mc_task_228722.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228722.free_gtid_218887 = gtid_218887;
        futhark_mc_task_228722.free_x_218888 = x_218888;
        futhark_mc_task_228722.free_x_219124 = x_219124;
        futhark_mc_task_228722.free_mem_219136 = mem_219136;
        futhark_mc_task_228722.free_a0_219162 = a0_219162;
        futhark_mc_task_228722.retval_defunc_2_reduce_res_219163 =
            &defunc_2_reduce_res_219163;
        
        struct scheduler_segop futhark_mc_task_228722_task;
        
        futhark_mc_task_228722_task.args = &futhark_mc_task_228722;
        futhark_mc_task_228722_task.top_level_fn =
            futhark_mc_segred_task_228723;
        futhark_mc_task_228722_task.name = "futhark_mc_segred_task_228723";
        futhark_mc_task_228722_task.iterations = q_s_196695;
        futhark_mc_task_228722_task.task_time =
            &ctx->futhark_mc_segred_task_228723_total_time;
        futhark_mc_task_228722_task.task_iter =
            &ctx->futhark_mc_segred_task_228723_total_iter;
        futhark_mc_task_228722_task.sched = STATIC;
        futhark_mc_task_228722_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228723_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228722_task);
        
        if (futhark_mc_segred_task_228723_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_218889.mem)[gtid_219123] = defunc_2_reduce_res_219163;
    }
    
  cleanup:
    { }
    free(mem_219136);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228715_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228715_end -
                 futhark_mc_segmap_parloop_228715_start;
        
        ctx->futhark_mc_segmap_parloop_228715_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228715_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228715_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228713(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219122 = tid;
    int num_tasks_219231 = info.nsubtasks;
    struct futhark_mc_task_228708 *futhark_mc_task_228708 =
                                  (struct futhark_mc_task_228708 *) args;
    struct futhark_context *ctx = futhark_mc_task_228708->ctx;
    uint64_t futhark_mc_segmap_nested_task_228713_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228713_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228708->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228708->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228708->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228708->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228708->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228708->free_s_n_m_196745;
    int64_t gtid_203136 = futhark_mc_task_228708->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228708->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228708->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228708->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228708->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228708->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 = futhark_mc_task_228708->free_bytes_211482;
    int64_t gtid_218887 = futhark_mc_task_228708->free_gtid_218887;
    int64_t x_218888 = futhark_mc_task_228708->free_x_218888;
    struct memblock mem_218889 = {.desc ="mem_218889", .mem =
                                  futhark_mc_task_228708->free_mem_218889,
                                  .size =0, .references =NULL};
    int64_t iter_219279;
    struct futhark_mc_segmap_parloop_struct_228714
    futhark_mc_segmap_parloop_struct_228714;
    
    futhark_mc_segmap_parloop_struct_228714.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228714.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228714.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228714.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228714.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228714.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228714.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228714.free_gtid_203136 = gtid_203136;
    futhark_mc_segmap_parloop_struct_228714.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228714.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228714.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228714.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228714.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228714.free_bytes_211482 = bytes_211482;
    futhark_mc_segmap_parloop_struct_228714.free_gtid_218887 = gtid_218887;
    futhark_mc_segmap_parloop_struct_228714.free_x_218888 = x_218888;
    futhark_mc_segmap_parloop_struct_228714.free_mem_218889 = mem_218889.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228715_task;
    
    futhark_mc_segmap_parloop_228715_task.name =
        "futhark_mc_segmap_parloop_228715";
    futhark_mc_segmap_parloop_228715_task.fn = futhark_mc_segmap_parloop_228715;
    futhark_mc_segmap_parloop_228715_task.args =
        &futhark_mc_segmap_parloop_struct_228714;
    futhark_mc_segmap_parloop_228715_task.iterations = iterations;
    futhark_mc_segmap_parloop_228715_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228715_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228715_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228715_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228715_task);
    
    if (futhark_mc_segmap_parloop_228715_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228715_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228715_total_end -
                 futhark_mc_segmap_parloop_228715_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228715_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228715_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228715_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228713_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228713_end -
                 futhark_mc_segmap_nested_task_228713_start;
        
        ctx->futhark_mc_segmap_nested_task_228713_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228713_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228713_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228706(void *args, int64_t start,
                                            int64_t end, int flat_tid_218886,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228705
    *futhark_mc_segmap_parloop_struct_228705 =
    (struct futhark_mc_segmap_parloop_struct_228705 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228705->ctx;
    uint64_t futhark_mc_segmap_parloop_228706_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228706_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228705->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228705->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228705->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228705->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228705->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228705->free_s_n_m_196745;
    int64_t gtid_203136 =
            futhark_mc_segmap_parloop_struct_228705->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228705->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 =
            futhark_mc_segmap_parloop_struct_228705->free_bytes_211482;
    struct memblock mem_211535 = {.desc ="mem_211535", .mem =
                                  futhark_mc_segmap_parloop_struct_228705->free_mem_211535,
                                  .size =0, .references =NULL};
    size_t mem_218889_cached_sizze_228707 = 0;
    unsigned char *mem_218889 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219121 = start;
    
    if (mem_218889_cached_sizze_228707 < (size_t) bytes_210599) {
        mem_218889 = realloc(mem_218889, bytes_210599);
        mem_218889_cached_sizze_228707 = bytes_210599;
    }
    for (; iter_219121 < end; iter_219121++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219229 = n_p_196694;
        int64_t gtid_218887 = iter_219121;
        int64_t remnant_219230 = iter_219121 - gtid_218887;
        int64_t x_218888;
        
        x_218888 = ((int64_t *) mem_210594.mem)[gtid_203136 * n_p_196694 +
                                                gtid_218887];
        
        int64_t flat_tid_219176 = (int64_t) 0;
        int32_t num_tasks_219231;
        int64_t flat_tid_219122 = (int64_t) 0;
        struct futhark_mc_task_228708 futhark_mc_task_228708;
        
        futhark_mc_task_228708.ctx = ctx;
        futhark_mc_task_228708.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228708.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228708.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228708.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228708.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228708.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228708.free_gtid_203136 = gtid_203136;
        futhark_mc_task_228708.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228708.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228708.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228708.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228708.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228708.free_bytes_211482 = bytes_211482;
        futhark_mc_task_228708.free_gtid_218887 = gtid_218887;
        futhark_mc_task_228708.free_x_218888 = x_218888;
        futhark_mc_task_228708.free_mem_218889 = mem_218889;
        
        struct scheduler_segop futhark_mc_task_228708_task;
        
        futhark_mc_task_228708_task.args = &futhark_mc_task_228708;
        futhark_mc_task_228708_task.top_level_fn =
            futhark_mc_segmap_task_228709;
        futhark_mc_task_228708_task.name = "futhark_mc_segmap_task_228709";
        futhark_mc_task_228708_task.iterations = s_n_m_196745;
        futhark_mc_task_228708_task.task_time =
            &ctx->futhark_mc_segmap_task_228709_total_time;
        futhark_mc_task_228708_task.task_iter =
            &ctx->futhark_mc_segmap_task_228709_total_iter;
        futhark_mc_task_228708_task.sched = STATIC;
        futhark_mc_task_228708_task.nested_fn =
            futhark_mc_segmap_nested_task_228713;
        
        int futhark_mc_segmap_task_228709_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228708_task);
        
        if (futhark_mc_segmap_task_228709_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211535.mem + gtid_218887 * s_n_m_196745 * (int64_t) 4,
                    mem_218889 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_218889);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228706_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228706_end -
                 futhark_mc_segmap_parloop_228706_start;
        
        ctx->futhark_mc_segmap_parloop_228706_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228706_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228706_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228704(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_218886 = tid;
    int num_tasks_219060 = info.nsubtasks;
    struct futhark_mc_task_228698 *futhark_mc_task_228698 =
                                  (struct futhark_mc_task_228698 *) args;
    struct futhark_context *ctx = futhark_mc_task_228698->ctx;
    uint64_t futhark_mc_segmap_nested_task_228704_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228704_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228698->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228698->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228698->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228698->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228698->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228698->free_s_n_m_196745;
    int64_t gtid_203136 = futhark_mc_task_228698->free_gtid_203136;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228698->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228698->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228698->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228698->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228698->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228698->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228698->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 = futhark_mc_task_228698->free_bytes_211482;
    struct memblock mem_211535 = {.desc ="mem_211535", .mem =
                                  futhark_mc_task_228698->free_mem_211535,
                                  .size =0, .references =NULL};
    int64_t iter_219121;
    struct futhark_mc_segmap_parloop_struct_228705
    futhark_mc_segmap_parloop_struct_228705;
    
    futhark_mc_segmap_parloop_struct_228705.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228705.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228705.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228705.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228705.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228705.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228705.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228705.free_gtid_203136 = gtid_203136;
    futhark_mc_segmap_parloop_struct_228705.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228705.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228705.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228705.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228705.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228705.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228705.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228705.free_bytes_211482 = bytes_211482;
    futhark_mc_segmap_parloop_struct_228705.free_mem_211535 = mem_211535.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228706_task;
    
    futhark_mc_segmap_parloop_228706_task.name =
        "futhark_mc_segmap_parloop_228706";
    futhark_mc_segmap_parloop_228706_task.fn = futhark_mc_segmap_parloop_228706;
    futhark_mc_segmap_parloop_228706_task.args =
        &futhark_mc_segmap_parloop_struct_228705;
    futhark_mc_segmap_parloop_228706_task.iterations = iterations;
    futhark_mc_segmap_parloop_228706_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228706_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228706_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228706_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228706_task);
    
    if (futhark_mc_segmap_parloop_228706_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228706_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228706_total_end -
                 futhark_mc_segmap_parloop_228706_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228706_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228706_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228706_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228704_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228704_end -
                 futhark_mc_segmap_nested_task_228704_start;
        
        ctx->futhark_mc_segmap_nested_task_228704_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228704_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228704_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228696(void *args, int64_t start,
                                            int64_t end, int flat_tid_203135,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228695
    *futhark_mc_segmap_parloop_struct_228695 =
    (struct futhark_mc_segmap_parloop_struct_228695 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228695->ctx;
    uint64_t futhark_mc_segmap_parloop_228696_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228696_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228695->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228695->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228695->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228695->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228695->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228695->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228695->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228695->free_bytes_210599;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228695->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 =
            futhark_mc_segmap_parloop_struct_228695->free_bytes_211482;
    struct memblock mem_211599 = {.desc ="mem_211599", .mem =
                                  futhark_mc_segmap_parloop_struct_228695->free_mem_211599,
                                  .size =0, .references =NULL};
    size_t mem_211535_cached_sizze_228697 = 0;
    unsigned char *mem_211535 = NULL;
    int64_t iterations = end - start;
    int64_t iter_218885 = start;
    
    if (mem_211535_cached_sizze_228697 < (size_t) bytes_210655) {
        mem_211535 = realloc(mem_211535, bytes_210655);
        mem_211535_cached_sizze_228697 = bytes_210655;
    }
    for (; iter_218885 < end; iter_218885++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219058 = m_196691;
        int64_t gtid_203136 = iter_218885;
        int64_t remnant_219059 = iter_218885 - gtid_203136;
        int64_t flat_tid_218998 = (int64_t) 0;
        int32_t num_tasks_219060;
        int64_t flat_tid_218886 = (int64_t) 0;
        struct futhark_mc_task_228698 futhark_mc_task_228698;
        
        futhark_mc_task_228698.ctx = ctx;
        futhark_mc_task_228698.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228698.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228698.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228698.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228698.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228698.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228698.free_gtid_203136 = gtid_203136;
        futhark_mc_task_228698.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228698.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228698.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228698.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228698.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228698.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228698.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228698.free_bytes_211482 = bytes_211482;
        futhark_mc_task_228698.free_mem_211535 = mem_211535;
        
        struct scheduler_segop futhark_mc_task_228698_task;
        
        futhark_mc_task_228698_task.args = &futhark_mc_task_228698;
        futhark_mc_task_228698_task.top_level_fn =
            futhark_mc_segmap_task_228699;
        futhark_mc_task_228698_task.name = "futhark_mc_segmap_task_228699";
        futhark_mc_task_228698_task.iterations = n_p_196694;
        futhark_mc_task_228698_task.task_time =
            &ctx->futhark_mc_segmap_task_228699_total_time;
        futhark_mc_task_228698_task.task_iter =
            &ctx->futhark_mc_segmap_task_228699_total_iter;
        futhark_mc_task_228698_task.sched = STATIC;
        futhark_mc_task_228698_task.nested_fn =
            futhark_mc_segmap_nested_task_228704;
        
        int futhark_mc_segmap_task_228699_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228698_task);
        
        if (futhark_mc_segmap_task_228699_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211599.mem + gtid_203136 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211535 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211535);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228696_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228696_end -
                 futhark_mc_segmap_parloop_228696_start;
        
        ctx->futhark_mc_segmap_parloop_228696_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228696_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228696_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228694(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_203135 = tid;
    int num_tasks_218819 = info.nsubtasks;
    struct futhark_mc_task_228688 *futhark_mc_task_228688 =
                                  (struct futhark_mc_task_228688 *) args;
    struct futhark_context *ctx = futhark_mc_task_228688->ctx;
    uint64_t futhark_mc_segmap_nested_task_228694_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228694_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228688->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228688->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228688->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228688->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228688->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228688->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228688->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228688->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228688->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228688->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228688->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228688->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228688->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228688->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228688->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211482 = futhark_mc_task_228688->free_bytes_211482;
    struct memblock mem_211599 = {.desc ="mem_211599", .mem =
                                  futhark_mc_task_228688->free_mem_211599,
                                  .size =0, .references =NULL};
    int64_t iter_218885;
    struct futhark_mc_segmap_parloop_struct_228695
    futhark_mc_segmap_parloop_struct_228695;
    
    futhark_mc_segmap_parloop_struct_228695.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228695.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228695.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228695.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228695.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228695.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228695.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228695.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228695.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228695.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228695.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228695.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228695.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228695.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228695.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228695.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228695.free_bytes_211482 = bytes_211482;
    futhark_mc_segmap_parloop_struct_228695.free_mem_211599 = mem_211599.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228696_task;
    
    futhark_mc_segmap_parloop_228696_task.name =
        "futhark_mc_segmap_parloop_228696";
    futhark_mc_segmap_parloop_228696_task.fn = futhark_mc_segmap_parloop_228696;
    futhark_mc_segmap_parloop_228696_task.args =
        &futhark_mc_segmap_parloop_struct_228695;
    futhark_mc_segmap_parloop_228696_task.iterations = iterations;
    futhark_mc_segmap_parloop_228696_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228696_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228696_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228696_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228696_task);
    
    if (futhark_mc_segmap_parloop_228696_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228696_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228696_total_end -
                 futhark_mc_segmap_parloop_228696_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228696_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228696_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228696_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228694_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228694_end -
                 futhark_mc_segmap_nested_task_228694_start;
        
        ctx->futhark_mc_segmap_nested_task_228694_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228694_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228694_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228727 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    unsigned char *free_mem_211832;
    unsigned char *free_mem_211837;
};
struct futhark_mc_segmap_parloop_struct_228729 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    unsigned char *free_mem_211832;
    unsigned char *free_mem_211837;
};
static int futhark_mc_segmap_parloop_228730(void *args, int64_t start,
                                            int64_t end, int flat_tid_203320,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228729
    *futhark_mc_segmap_parloop_struct_228729 =
    (struct futhark_mc_segmap_parloop_struct_228729 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228729->ctx;
    uint64_t futhark_mc_segmap_parloop_228730_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228730_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228729->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228729->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228729->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228729->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228729->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228729->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228729->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228729->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 =
            futhark_mc_segmap_parloop_struct_228729->free_bytes_211601;
    struct memblock mem_211832 = {.desc ="mem_211832", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_211832,
                                  .size =0, .references =NULL};
    struct memblock mem_211837 = {.desc ="mem_211837", .mem =
                                  futhark_mc_segmap_parloop_struct_228729->free_mem_211837,
                                  .size =0, .references =NULL};
    size_t mem_211713_cached_sizze_228731 = 0;
    unsigned char *mem_211713 = NULL;
    size_t mem_211717_cached_sizze_228732 = 0;
    unsigned char *mem_211717 = NULL;
    size_t mem_211762_cached_sizze_228733 = 0;
    unsigned char *mem_211762 = NULL;
    size_t mem_211765_cached_sizze_228734 = 0;
    unsigned char *mem_211765 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219344 = start;
    
    if (mem_211713_cached_sizze_228731 < (size_t) bytes_210655) {
        mem_211713 = realloc(mem_211713, bytes_210655);
        mem_211713_cached_sizze_228731 = bytes_210655;
    }
    if (mem_211717_cached_sizze_228732 < (size_t) bytes_210655) {
        mem_211717 = realloc(mem_211717, bytes_210655);
        mem_211717_cached_sizze_228732 = bytes_210655;
    }
    if (mem_211762_cached_sizze_228733 < (size_t) bytes_211601) {
        mem_211762 = realloc(mem_211762, bytes_211601);
        mem_211762_cached_sizze_228733 = bytes_211601;
    }
    if (mem_211765_cached_sizze_228734 < (size_t) bytes_211601) {
        mem_211765 = realloc(mem_211765, bytes_211601);
        mem_211765_cached_sizze_228734 = bytes_211601;
    }
    for (; iter_219344 < end; iter_219344++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219435 = m_196691;
        int64_t gtid_203321 = iter_219344;
        int64_t remnant_219436 = iter_219344 - gtid_203321;
        
        for (int64_t i_219345 = 0; i_219345 < n_p_196694; i_219345++) {
            int64_t x_219348;
            
            x_219348 = ((int64_t *) mem_210594.mem)[gtid_203321 * n_p_196694 +
                                                    i_219345];
            for (int64_t i_219351 = 0; i_219351 < s_n_m_196745; i_219351++) {
                int64_t x_219354;
                
                x_219354 = ((int64_t *) mem_210764.mem)[gtid_203321 *
                                                        (s_n_m_196745 *
                                                         n_p_196694) +
                                                        i_219345 *
                                                        s_n_m_196745 +
                                                        i_219351];
                
                float x_219355;
                
                x_219355 = ((float *) mem_210769.mem)[gtid_203321 *
                                                      (s_n_m_196745 *
                                                       n_p_196694) + i_219345 *
                                                      s_n_m_196745 + i_219351];
                
                bool cond_219356 = i_219351 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_219357;
                
                if (cond_219356) {
                    defunc_0_m_fun_res_219357 = (int64_t) 0;
                } else {
                    int64_t y_219358 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_219359 = i_219351 == y_219358;
                    int64_t defunc_0_m_fun_res_f_res_219360;
                    
                    if (cond_219359) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_219361 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_219360 =
                            defunc_0_m_fun_res_f_res_t_res_219361;
                    } else {
                        int64_t x_219362 = sub64(i_219351, (int64_t) 1);
                        int64_t x_219363 = mul64(jump_s_196701, x_219362);
                        int64_t min_arg_219364 = add64((int64_t) 1, x_219363);
                        int64_t min_res_219365 = smin64(defunc_0_f_res_196740,
                                                        min_arg_219364);
                        
                        defunc_0_m_fun_res_f_res_219360 = min_res_219365;
                    }
                    defunc_0_m_fun_res_219357 = defunc_0_m_fun_res_f_res_219360;
                }
                
                float defunc_2_reduce_res_219368;
                float defunc_2_reduce_res_219369;
                float defunc_2_reduce_res_219370;
                float redout_219374;
                float redout_219375;
                float redout_219376;
                
                redout_219374 = 0.0F;
                redout_219375 = 0.0F;
                redout_219376 = 0.0F;
                for (int64_t i_219373 = 0; i_219373 < q_s_196695; i_219373++) {
                    bool cond_219379 = sle64(x_219348, i_219373);
                    int64_t defunc_0_f_res_219380;
                    
                    if (cond_219379) {
                        defunc_0_f_res_219380 = (int64_t) 0;
                    } else {
                        int64_t i_219381 = add64(x_219354, i_219373);
                        int64_t defunc_0_add_arg_219382;
                        
                        defunc_0_add_arg_219382 =
                            ((int64_t *) mem_210590.mem)[gtid_203321 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_219345 *
                                                         defunc_0_f_res_196740 +
                                                         i_219381];
                        
                        int64_t defunc_1_add_res_219383 = add64((int64_t) 1,
                                                                defunc_0_add_arg_219382);
                        
                        defunc_0_f_res_219380 = defunc_1_add_res_219383;
                    }
                    
                    float defunc_0_f_res_219384;
                    
                    if (cond_219379) {
                        defunc_0_f_res_219384 = 0.0F;
                    } else {
                        int64_t i_219385 = add64(x_219354, i_219373);
                        float defunc_0_add_arg_219386;
                        
                        defunc_0_add_arg_219386 =
                            ((float *) mem_211111.mem)[gtid_203321 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_219345 *
                                                       defunc_0_f_res_196740 +
                                                       i_219385];
                        defunc_0_f_res_219384 = defunc_0_add_arg_219386;
                    }
                    
                    int64_t binop_p_219387 = sub64(defunc_0_f_res_219380,
                                                   defunc_0_m_fun_res_219357);
                    float defunc_0_f_res_219388 =
                          sitofp_i64_f32(binop_p_219387);
                    float abs_res_219389 = (float) fabs(defunc_0_f_res_219388);
                    float tmp1_219390 = abs_res_219389 / x_219355;
                    float x_219391 = tmp1_219390 * tmp1_219390;
                    float y_219392 = tmp1_219390 * x_219391;
                    float tmp2_219393 = 1.0F - y_219392;
                    float x_219394 = tmp2_219393 * tmp2_219393;
                    float tmp3_219395 = tmp2_219393 * x_219394;
                    float tmp4_219396 = defunc_0_f_res_219384 * tmp3_219395;
                    float defunc_1_f_res_219397 = defunc_0_f_res_219388 *
                          tmp4_219396;
                    float defunc_1_f_res_219398 = defunc_0_f_res_219388 *
                          defunc_1_f_res_219397;
                    float defunc_1_op_res_219399 = tmp4_219396 + redout_219374;
                    float defunc_1_op_res_219400 = defunc_1_f_res_219397 +
                          redout_219375;
                    float defunc_1_op_res_219401 = defunc_1_f_res_219398 +
                          redout_219376;
                    
                    ((float *) mem_211762)[i_219373] = defunc_1_f_res_219397;
                    ((float *) mem_211765)[i_219373] = tmp4_219396;
                    
                    float redout_tmp_219441 = defunc_1_op_res_219399;
                    float redout_tmp_219442 = defunc_1_op_res_219400;
                    float redout_tmp_219443 = defunc_1_op_res_219401;
                    
                    redout_219374 = redout_tmp_219441;
                    redout_219375 = redout_tmp_219442;
                    redout_219376 = redout_tmp_219443;
                }
                defunc_2_reduce_res_219368 = redout_219374;
                defunc_2_reduce_res_219369 = redout_219375;
                defunc_2_reduce_res_219370 = redout_219376;
                
                float x_219404 = defunc_2_reduce_res_219368 *
                      defunc_2_reduce_res_219370;
                float y_219405 = defunc_2_reduce_res_219369 *
                      defunc_2_reduce_res_219369;
                float y_219406 = x_219404 - y_219405;
                float det1_219407 = 1.0F / y_219406;
                float a11_219408 = defunc_2_reduce_res_219370 * det1_219407;
                float x_219409 = 0.0F - defunc_2_reduce_res_219369;
                float b11_219410 = det1_219407 * x_219409;
                float c11_219411 = defunc_2_reduce_res_219368 * det1_219407;
                float defunc_2_reduce_res_219412;
                float defunc_2_reduce_res_219413;
                float redout_219415;
                float redout_219416;
                
                redout_219415 = 0.0F;
                redout_219416 = 0.0F;
                for (int64_t i_219414 = 0; i_219414 < q_s_196695; i_219414++) {
                    float x_219417;
                    
                    x_219417 = ((float *) mem_211765)[i_219414];
                    
                    float x_219418;
                    
                    x_219418 = ((float *) mem_211762)[i_219414];
                    
                    bool cond_219419 = sle64(x_219348, i_219414);
                    float defunc_0_f_res_219420;
                    
                    if (cond_219419) {
                        defunc_0_f_res_219420 = 0.0F;
                    } else {
                        int64_t i_219421 = add64(x_219354, i_219414);
                        float defunc_0_add_arg_219422;
                        
                        defunc_0_add_arg_219422 =
                            ((float *) mem_211106.mem)[gtid_203321 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_219345 *
                                                       defunc_0_f_res_196740 +
                                                       i_219421];
                        defunc_0_f_res_219420 = defunc_0_add_arg_219422;
                    }
                    
                    float x_219423 = a11_219408 * x_219417;
                    float y_219424 = b11_219410 * x_219418;
                    float x_219425 = x_219423 + y_219424;
                    float defunc_9_fit_fun_res_219426 = defunc_0_f_res_219420 *
                          x_219425;
                    float x_219427 = b11_219410 * x_219417;
                    float y_219428 = c11_219411 * x_219418;
                    float x_219429 = x_219427 + y_219428;
                    float defunc_9_slope_fun_res_219430 =
                          defunc_0_f_res_219420 * x_219429;
                    float defunc_1_op_res_219431 = defunc_9_fit_fun_res_219426 +
                          redout_219415;
                    float defunc_1_op_res_219432 =
                          defunc_9_slope_fun_res_219430 + redout_219416;
                    float redout_tmp_219446 = defunc_1_op_res_219431;
                    float redout_tmp_219447 = defunc_1_op_res_219432;
                    
                    redout_219415 = redout_tmp_219446;
                    redout_219416 = redout_tmp_219447;
                }
                defunc_2_reduce_res_219412 = redout_219415;
                defunc_2_reduce_res_219413 = redout_219416;
                ((float *) mem_211713)[i_219345 * s_n_m_196745 + i_219351] =
                    defunc_2_reduce_res_219412;
                ((float *) mem_211717)[i_219345 * s_n_m_196745 + i_219351] =
                    defunc_2_reduce_res_219413;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211832.mem + gtid_203321 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211713 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211837.mem + gtid_203321 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211717 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211713);
    free(mem_211717);
    free(mem_211762);
    free(mem_211765);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228730_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228730_end -
                 futhark_mc_segmap_parloop_228730_start;
        
        ctx->futhark_mc_segmap_parloop_228730_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228730_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228730_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228728(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_203320 = tid;
    int num_tasks_219343 = info.nsubtasks;
    struct futhark_mc_task_228727 *futhark_mc_task_228727 =
                                  (struct futhark_mc_task_228727 *) args;
    struct futhark_context *ctx = futhark_mc_task_228727->ctx;
    uint64_t futhark_mc_segmap_task_228728_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228728_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228727->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228727->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228727->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228727->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228727->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228727->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228727->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228727->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228727->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228727->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228727->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228727->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228727->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228727->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228727->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 = futhark_mc_task_228727->free_bytes_211601;
    struct memblock mem_211832 = {.desc ="mem_211832", .mem =
                                  futhark_mc_task_228727->free_mem_211832,
                                  .size =0, .references =NULL};
    struct memblock mem_211837 = {.desc ="mem_211837", .mem =
                                  futhark_mc_task_228727->free_mem_211837,
                                  .size =0, .references =NULL};
    int64_t iter_219344;
    struct futhark_mc_segmap_parloop_struct_228729
    futhark_mc_segmap_parloop_struct_228729;
    
    futhark_mc_segmap_parloop_struct_228729.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228729.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228729.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228729.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228729.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228729.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228729.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228729.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228729.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228729.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228729.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228729.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228729.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228729.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228729.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228729.free_bytes_211601 = bytes_211601;
    futhark_mc_segmap_parloop_struct_228729.free_mem_211832 = mem_211832.mem;
    futhark_mc_segmap_parloop_struct_228729.free_mem_211837 = mem_211837.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228730_task;
    
    futhark_mc_segmap_parloop_228730_task.name =
        "futhark_mc_segmap_parloop_228730";
    futhark_mc_segmap_parloop_228730_task.fn = futhark_mc_segmap_parloop_228730;
    futhark_mc_segmap_parloop_228730_task.args =
        &futhark_mc_segmap_parloop_struct_228729;
    futhark_mc_segmap_parloop_228730_task.iterations = iterations;
    futhark_mc_segmap_parloop_228730_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228730_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228730_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228730_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228730_task);
    
    if (futhark_mc_segmap_parloop_228730_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228730_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228730_total_end -
                 futhark_mc_segmap_parloop_228730_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228730_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228730_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228730_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228728_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228728_end -
                 futhark_mc_segmap_task_228728_start;
        
        ctx->futhark_mc_segmap_task_228728_runs[tid]++;
        ctx->futhark_mc_segmap_task_228728_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228728_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228736 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    unsigned char *free_mem_211832;
    unsigned char *free_mem_211837;
};
struct futhark_mc_task_228740 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    unsigned char *free_mem_211705;
    unsigned char *free_mem_211709;
};
struct futhark_mc_segmap_parloop_struct_228742 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    unsigned char *free_mem_211705;
    unsigned char *free_mem_211709;
};
static int futhark_mc_segmap_parloop_228743(void *args, int64_t start,
                                            int64_t end, int flat_tid_219623,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228742
    *futhark_mc_segmap_parloop_struct_228742 =
    (struct futhark_mc_segmap_parloop_struct_228742 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228742->ctx;
    uint64_t futhark_mc_segmap_parloop_228743_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228743_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228742->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228742->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228742->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228742->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228742->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228742->free_s_n_m_196745;
    int64_t gtid_203598 =
            futhark_mc_segmap_parloop_struct_228742->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228742->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 =
            futhark_mc_segmap_parloop_struct_228742->free_bytes_211601;
    struct memblock mem_211705 = {.desc ="mem_211705", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_211705,
                                  .size =0, .references =NULL};
    struct memblock mem_211709 = {.desc ="mem_211709", .mem =
                                  futhark_mc_segmap_parloop_struct_228742->free_mem_211709,
                                  .size =0, .references =NULL};
    size_t mem_219626_cached_sizze_228744 = 0;
    unsigned char *mem_219626 = NULL;
    size_t mem_219628_cached_sizze_228745 = 0;
    unsigned char *mem_219628 = NULL;
    size_t mem_219630_cached_sizze_228746 = 0;
    unsigned char *mem_219630 = NULL;
    size_t mem_219631_cached_sizze_228747 = 0;
    unsigned char *mem_219631 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219721 = start;
    
    if (mem_219626_cached_sizze_228744 < (size_t) bytes_210599) {
        mem_219626 = realloc(mem_219626, bytes_210599);
        mem_219626_cached_sizze_228744 = bytes_210599;
    }
    if (mem_219628_cached_sizze_228745 < (size_t) bytes_210599) {
        mem_219628 = realloc(mem_219628, bytes_210599);
        mem_219628_cached_sizze_228745 = bytes_210599;
    }
    if (mem_219630_cached_sizze_228746 < (size_t) bytes_211601) {
        mem_219630 = realloc(mem_219630, bytes_211601);
        mem_219630_cached_sizze_228746 = bytes_211601;
    }
    if (mem_219631_cached_sizze_228747 < (size_t) bytes_211601) {
        mem_219631 = realloc(mem_219631, bytes_211601);
        mem_219631_cached_sizze_228747 = bytes_211601;
    }
    for (; iter_219721 < end; iter_219721++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219806 = n_p_196694;
        int64_t gtid_219624 = iter_219721;
        int64_t remnant_219807 = iter_219721 - gtid_219624;
        int64_t x_219625;
        
        x_219625 = ((int64_t *) mem_210594.mem)[gtid_203598 * n_p_196694 +
                                                gtid_219624];
        for (int64_t i_219722 = 0; i_219722 < s_n_m_196745; i_219722++) {
            int64_t x_219725;
            
            x_219725 = ((int64_t *) mem_210764.mem)[gtid_203598 *
                                                    (s_n_m_196745 *
                                                     n_p_196694) + gtid_219624 *
                                                    s_n_m_196745 + i_219722];
            
            float x_219726;
            
            x_219726 = ((float *) mem_210769.mem)[gtid_203598 * (s_n_m_196745 *
                                                                 n_p_196694) +
                                                  gtid_219624 * s_n_m_196745 +
                                                  i_219722];
            
            bool cond_219727 = i_219722 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_219728;
            
            if (cond_219727) {
                defunc_0_m_fun_res_219728 = (int64_t) 0;
            } else {
                int64_t y_219729 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_219730 = i_219722 == y_219729;
                int64_t defunc_0_m_fun_res_f_res_219731;
                
                if (cond_219730) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_219732 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_219731 =
                        defunc_0_m_fun_res_f_res_t_res_219732;
                } else {
                    int64_t x_219733 = sub64(i_219722, (int64_t) 1);
                    int64_t x_219734 = mul64(jump_s_196701, x_219733);
                    int64_t min_arg_219735 = add64((int64_t) 1, x_219734);
                    int64_t min_res_219736 = smin64(defunc_0_f_res_196740,
                                                    min_arg_219735);
                    
                    defunc_0_m_fun_res_f_res_219731 = min_res_219736;
                }
                defunc_0_m_fun_res_219728 = defunc_0_m_fun_res_f_res_219731;
            }
            
            float defunc_2_reduce_res_219739;
            float defunc_2_reduce_res_219740;
            float defunc_2_reduce_res_219741;
            float redout_219745;
            float redout_219746;
            float redout_219747;
            
            redout_219745 = 0.0F;
            redout_219746 = 0.0F;
            redout_219747 = 0.0F;
            for (int64_t i_219744 = 0; i_219744 < q_s_196695; i_219744++) {
                bool cond_219750 = sle64(x_219625, i_219744);
                int64_t defunc_0_f_res_219751;
                
                if (cond_219750) {
                    defunc_0_f_res_219751 = (int64_t) 0;
                } else {
                    int64_t i_219752 = add64(x_219725, i_219744);
                    int64_t defunc_0_add_arg_219753;
                    
                    defunc_0_add_arg_219753 =
                        ((int64_t *) mem_210590.mem)[gtid_203598 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_219624 *
                                                     defunc_0_f_res_196740 +
                                                     i_219752];
                    
                    int64_t defunc_1_add_res_219754 = add64((int64_t) 1,
                                                            defunc_0_add_arg_219753);
                    
                    defunc_0_f_res_219751 = defunc_1_add_res_219754;
                }
                
                float defunc_0_f_res_219755;
                
                if (cond_219750) {
                    defunc_0_f_res_219755 = 0.0F;
                } else {
                    int64_t i_219756 = add64(x_219725, i_219744);
                    float defunc_0_add_arg_219757;
                    
                    defunc_0_add_arg_219757 =
                        ((float *) mem_211111.mem)[gtid_203598 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_219624 *
                                                   defunc_0_f_res_196740 +
                                                   i_219756];
                    defunc_0_f_res_219755 = defunc_0_add_arg_219757;
                }
                
                int64_t binop_p_219758 = sub64(defunc_0_f_res_219751,
                                               defunc_0_m_fun_res_219728);
                float defunc_0_f_res_219759 = sitofp_i64_f32(binop_p_219758);
                float abs_res_219760 = (float) fabs(defunc_0_f_res_219759);
                float tmp1_219761 = abs_res_219760 / x_219726;
                float x_219762 = tmp1_219761 * tmp1_219761;
                float y_219763 = tmp1_219761 * x_219762;
                float tmp2_219764 = 1.0F - y_219763;
                float x_219765 = tmp2_219764 * tmp2_219764;
                float tmp3_219766 = tmp2_219764 * x_219765;
                float tmp4_219767 = defunc_0_f_res_219755 * tmp3_219766;
                float defunc_1_f_res_219768 = defunc_0_f_res_219759 *
                      tmp4_219767;
                float defunc_1_f_res_219769 = defunc_0_f_res_219759 *
                      defunc_1_f_res_219768;
                float defunc_1_op_res_219770 = tmp4_219767 + redout_219745;
                float defunc_1_op_res_219771 = defunc_1_f_res_219768 +
                      redout_219746;
                float defunc_1_op_res_219772 = defunc_1_f_res_219769 +
                      redout_219747;
                
                ((float *) mem_219630)[i_219744] = defunc_1_f_res_219768;
                ((float *) mem_219631)[i_219744] = tmp4_219767;
                
                float redout_tmp_219810 = defunc_1_op_res_219770;
                float redout_tmp_219811 = defunc_1_op_res_219771;
                float redout_tmp_219812 = defunc_1_op_res_219772;
                
                redout_219745 = redout_tmp_219810;
                redout_219746 = redout_tmp_219811;
                redout_219747 = redout_tmp_219812;
            }
            defunc_2_reduce_res_219739 = redout_219745;
            defunc_2_reduce_res_219740 = redout_219746;
            defunc_2_reduce_res_219741 = redout_219747;
            
            float x_219775 = defunc_2_reduce_res_219739 *
                  defunc_2_reduce_res_219741;
            float y_219776 = defunc_2_reduce_res_219740 *
                  defunc_2_reduce_res_219740;
            float y_219777 = x_219775 - y_219776;
            float det1_219778 = 1.0F / y_219777;
            float a11_219779 = defunc_2_reduce_res_219741 * det1_219778;
            float x_219780 = 0.0F - defunc_2_reduce_res_219740;
            float b11_219781 = det1_219778 * x_219780;
            float c11_219782 = defunc_2_reduce_res_219739 * det1_219778;
            float defunc_2_reduce_res_219783;
            float defunc_2_reduce_res_219784;
            float redout_219786;
            float redout_219787;
            
            redout_219786 = 0.0F;
            redout_219787 = 0.0F;
            for (int64_t i_219785 = 0; i_219785 < q_s_196695; i_219785++) {
                float x_219788;
                
                x_219788 = ((float *) mem_219631)[i_219785];
                
                float x_219789;
                
                x_219789 = ((float *) mem_219630)[i_219785];
                
                bool cond_219790 = sle64(x_219625, i_219785);
                float defunc_0_f_res_219791;
                
                if (cond_219790) {
                    defunc_0_f_res_219791 = 0.0F;
                } else {
                    int64_t i_219792 = add64(x_219725, i_219785);
                    float defunc_0_add_arg_219793;
                    
                    defunc_0_add_arg_219793 =
                        ((float *) mem_211106.mem)[gtid_203598 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_219624 *
                                                   defunc_0_f_res_196740 +
                                                   i_219792];
                    defunc_0_f_res_219791 = defunc_0_add_arg_219793;
                }
                
                float x_219794 = a11_219779 * x_219788;
                float y_219795 = b11_219781 * x_219789;
                float x_219796 = x_219794 + y_219795;
                float defunc_9_fit_fun_res_219797 = defunc_0_f_res_219791 *
                      x_219796;
                float x_219798 = b11_219781 * x_219788;
                float y_219799 = c11_219782 * x_219789;
                float x_219800 = x_219798 + y_219799;
                float defunc_9_slope_fun_res_219801 = defunc_0_f_res_219791 *
                      x_219800;
                float defunc_1_op_res_219802 = defunc_9_fit_fun_res_219797 +
                      redout_219786;
                float defunc_1_op_res_219803 = defunc_9_slope_fun_res_219801 +
                      redout_219787;
                float redout_tmp_219815 = defunc_1_op_res_219802;
                float redout_tmp_219816 = defunc_1_op_res_219803;
                
                redout_219786 = redout_tmp_219815;
                redout_219787 = redout_tmp_219816;
            }
            defunc_2_reduce_res_219783 = redout_219786;
            defunc_2_reduce_res_219784 = redout_219787;
            ((float *) mem_219626)[i_219722] = defunc_2_reduce_res_219783;
            ((float *) mem_219628)[i_219722] = defunc_2_reduce_res_219784;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211705.mem + gtid_219624 * s_n_m_196745 * (int64_t) 4,
                    mem_219626 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211709.mem + gtid_219624 * s_n_m_196745 * (int64_t) 4,
                    mem_219628 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_219626);
    free(mem_219628);
    free(mem_219630);
    free(mem_219631);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228743_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228743_end -
                 futhark_mc_segmap_parloop_228743_start;
        
        ctx->futhark_mc_segmap_parloop_228743_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228743_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228743_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228741(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219623 = tid;
    int num_tasks_219720 = info.nsubtasks;
    struct futhark_mc_task_228740 *futhark_mc_task_228740 =
                                  (struct futhark_mc_task_228740 *) args;
    struct futhark_context *ctx = futhark_mc_task_228740->ctx;
    uint64_t futhark_mc_segmap_task_228741_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228741_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228740->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228740->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228740->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228740->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228740->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228740->free_s_n_m_196745;
    int64_t gtid_203598 = futhark_mc_task_228740->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228740->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228740->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228740->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228740->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228740->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228740->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228740->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 = futhark_mc_task_228740->free_bytes_211601;
    struct memblock mem_211705 = {.desc ="mem_211705", .mem =
                                  futhark_mc_task_228740->free_mem_211705,
                                  .size =0, .references =NULL};
    struct memblock mem_211709 = {.desc ="mem_211709", .mem =
                                  futhark_mc_task_228740->free_mem_211709,
                                  .size =0, .references =NULL};
    int64_t iter_219721;
    struct futhark_mc_segmap_parloop_struct_228742
    futhark_mc_segmap_parloop_struct_228742;
    
    futhark_mc_segmap_parloop_struct_228742.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228742.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228742.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228742.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228742.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228742.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228742.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228742.free_gtid_203598 = gtid_203598;
    futhark_mc_segmap_parloop_struct_228742.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228742.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228742.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228742.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228742.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228742.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228742.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228742.free_bytes_211601 = bytes_211601;
    futhark_mc_segmap_parloop_struct_228742.free_mem_211705 = mem_211705.mem;
    futhark_mc_segmap_parloop_struct_228742.free_mem_211709 = mem_211709.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228743_task;
    
    futhark_mc_segmap_parloop_228743_task.name =
        "futhark_mc_segmap_parloop_228743";
    futhark_mc_segmap_parloop_228743_task.fn = futhark_mc_segmap_parloop_228743;
    futhark_mc_segmap_parloop_228743_task.args =
        &futhark_mc_segmap_parloop_struct_228742;
    futhark_mc_segmap_parloop_228743_task.iterations = iterations;
    futhark_mc_segmap_parloop_228743_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228743_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228743_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228743_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228743_task);
    
    if (futhark_mc_segmap_parloop_228743_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228743_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228743_total_end -
                 futhark_mc_segmap_parloop_228743_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228743_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228743_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228743_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228741_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228741_end -
                 futhark_mc_segmap_task_228741_start;
        
        ctx->futhark_mc_segmap_task_228741_runs[tid]++;
        ctx->futhark_mc_segmap_task_228741_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228741_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228749 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    unsigned char *free_mem_211705;
    unsigned char *free_mem_211709;
};
struct futhark_mc_task_228753 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    unsigned char *free_mem_219452;
    unsigned char *free_mem_219453;
};
struct futhark_mc_segmap_parloop_struct_228755 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    unsigned char *free_mem_219452;
    unsigned char *free_mem_219453;
};
static int futhark_mc_segmap_parloop_228756(void *args, int64_t start,
                                            int64_t end, int flat_tid_219902,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228755
    *futhark_mc_segmap_parloop_struct_228755 =
    (struct futhark_mc_segmap_parloop_struct_228755 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228755->ctx;
    uint64_t futhark_mc_segmap_parloop_228756_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228756_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228755->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228755->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228755->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228755->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228755->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228755->free_s_n_m_196745;
    int64_t gtid_203598 =
            futhark_mc_segmap_parloop_struct_228755->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 =
            futhark_mc_segmap_parloop_struct_228755->free_bytes_211601;
    int64_t gtid_219450 =
            futhark_mc_segmap_parloop_struct_228755->free_gtid_219450;
    int64_t x_219451 = futhark_mc_segmap_parloop_struct_228755->free_x_219451;
    struct memblock mem_219452 = {.desc ="mem_219452", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_219452,
                                  .size =0, .references =NULL};
    struct memblock mem_219453 = {.desc ="mem_219453", .mem =
                                  futhark_mc_segmap_parloop_struct_228755->free_mem_219453,
                                  .size =0, .references =NULL};
    size_t mem_219916_cached_sizze_228757 = 0;
    unsigned char *mem_219916 = NULL;
    size_t mem_219918_cached_sizze_228758 = 0;
    unsigned char *mem_219918 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219988 = start;
    
    if (mem_219916_cached_sizze_228757 < (size_t) bytes_211601) {
        mem_219916 = realloc(mem_219916, bytes_211601);
        mem_219916_cached_sizze_228757 = bytes_211601;
    }
    if (mem_219918_cached_sizze_228758 < (size_t) bytes_211601) {
        mem_219918 = realloc(mem_219918, bytes_211601);
        mem_219918_cached_sizze_228758 = bytes_211601;
    }
    for (; iter_219988 < end; iter_219988++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_220047 = s_n_m_196745;
        int64_t gtid_219903 = iter_219988;
        int64_t remnant_220048 = iter_219988 - gtid_219903;
        int64_t x_219904;
        
        x_219904 = ((int64_t *) mem_210764.mem)[gtid_203598 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_219450 * s_n_m_196745 +
                                                gtid_219903];
        
        float x_219905;
        
        x_219905 = ((float *) mem_210769.mem)[gtid_203598 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_219450 * s_n_m_196745 +
                                              gtid_219903];
        
        bool cond_219906 = gtid_219903 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_219907;
        
        if (cond_219906) {
            defunc_0_m_fun_res_219907 = (int64_t) 0;
        } else {
            int64_t y_219989 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_219990 = gtid_219903 == y_219989;
            int64_t defunc_0_m_fun_res_f_res_219991;
            
            if (cond_219990) {
                int64_t defunc_0_m_fun_res_f_res_t_res_219992 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_219991 =
                    defunc_0_m_fun_res_f_res_t_res_219992;
            } else {
                int64_t x_219993 = sub64(gtid_219903, (int64_t) 1);
                int64_t x_219994 = mul64(jump_s_196701, x_219993);
                int64_t min_arg_219995 = add64((int64_t) 1, x_219994);
                int64_t min_res_219996 = smin64(defunc_0_f_res_196740,
                                                min_arg_219995);
                
                defunc_0_m_fun_res_f_res_219991 = min_res_219996;
            }
            defunc_0_m_fun_res_219907 = defunc_0_m_fun_res_f_res_219991;
        }
        
        float defunc_2_reduce_res_219920;
        float defunc_2_reduce_res_219921;
        float defunc_2_reduce_res_219922;
        float redout_219998;
        float redout_219999;
        float redout_220000;
        
        redout_219998 = 0.0F;
        redout_219999 = 0.0F;
        redout_220000 = 0.0F;
        for (int64_t i_219997 = 0; i_219997 < q_s_196695; i_219997++) {
            bool cond_220003 = sle64(x_219451, i_219997);
            int64_t defunc_0_f_res_220004;
            
            if (cond_220003) {
                defunc_0_f_res_220004 = (int64_t) 0;
            } else {
                int64_t i_220005 = add64(x_219904, i_219997);
                int64_t defunc_0_add_arg_220006;
                
                defunc_0_add_arg_220006 =
                    ((int64_t *) mem_210590.mem)[gtid_203598 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_219450 *
                                                 defunc_0_f_res_196740 +
                                                 i_220005];
                
                int64_t defunc_1_add_res_220007 = add64((int64_t) 1,
                                                        defunc_0_add_arg_220006);
                
                defunc_0_f_res_220004 = defunc_1_add_res_220007;
            }
            
            float defunc_0_f_res_220008;
            
            if (cond_220003) {
                defunc_0_f_res_220008 = 0.0F;
            } else {
                int64_t i_220009 = add64(x_219904, i_219997);
                float defunc_0_add_arg_220010;
                
                defunc_0_add_arg_220010 =
                    ((float *) mem_211111.mem)[gtid_203598 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_219450 *
                                               defunc_0_f_res_196740 +
                                               i_220009];
                defunc_0_f_res_220008 = defunc_0_add_arg_220010;
            }
            
            int64_t binop_p_220011 = sub64(defunc_0_f_res_220004,
                                           defunc_0_m_fun_res_219907);
            float defunc_0_f_res_220012 = sitofp_i64_f32(binop_p_220011);
            float abs_res_220013 = (float) fabs(defunc_0_f_res_220012);
            float tmp1_220014 = abs_res_220013 / x_219905;
            float x_220015 = tmp1_220014 * tmp1_220014;
            float y_220016 = tmp1_220014 * x_220015;
            float tmp2_220017 = 1.0F - y_220016;
            float x_220018 = tmp2_220017 * tmp2_220017;
            float tmp3_220019 = tmp2_220017 * x_220018;
            float tmp4_220020 = defunc_0_f_res_220008 * tmp3_220019;
            float defunc_1_f_res_220021 = defunc_0_f_res_220012 * tmp4_220020;
            float defunc_1_f_res_220022 = defunc_0_f_res_220012 *
                  defunc_1_f_res_220021;
            float defunc_1_op_res_220023 = tmp4_220020 + redout_219998;
            float defunc_1_op_res_220024 = defunc_1_f_res_220021 +
                  redout_219999;
            float defunc_1_op_res_220025 = defunc_1_f_res_220022 +
                  redout_220000;
            
            ((float *) mem_219916)[i_219997] = defunc_1_f_res_220021;
            ((float *) mem_219918)[i_219997] = tmp4_220020;
            
            float redout_tmp_220049 = defunc_1_op_res_220023;
            float redout_tmp_220050 = defunc_1_op_res_220024;
            float redout_tmp_220051 = defunc_1_op_res_220025;
            
            redout_219998 = redout_tmp_220049;
            redout_219999 = redout_tmp_220050;
            redout_220000 = redout_tmp_220051;
        }
        defunc_2_reduce_res_219920 = redout_219998;
        defunc_2_reduce_res_219921 = redout_219999;
        defunc_2_reduce_res_219922 = redout_220000;
        
        float x_219956 = defunc_2_reduce_res_219920 *
              defunc_2_reduce_res_219922;
        float y_219957 = defunc_2_reduce_res_219921 *
              defunc_2_reduce_res_219921;
        float y_219958 = x_219956 - y_219957;
        float det1_219959 = 1.0F / y_219958;
        float a11_219960 = defunc_2_reduce_res_219922 * det1_219959;
        float x_219961 = 0.0F - defunc_2_reduce_res_219921;
        float b11_219962 = det1_219959 * x_219961;
        float c11_219963 = defunc_2_reduce_res_219920 * det1_219959;
        float defunc_2_reduce_res_219964;
        float defunc_2_reduce_res_219965;
        float redout_220029;
        float redout_220030;
        
        redout_220029 = 0.0F;
        redout_220030 = 0.0F;
        for (int64_t i_220028 = 0; i_220028 < q_s_196695; i_220028++) {
            float x_220031;
            
            x_220031 = ((float *) mem_219918)[i_220028];
            
            float x_220032;
            
            x_220032 = ((float *) mem_219916)[i_220028];
            
            bool cond_220033 = sle64(x_219451, i_220028);
            float defunc_0_f_res_220034;
            
            if (cond_220033) {
                defunc_0_f_res_220034 = 0.0F;
            } else {
                int64_t i_220035 = add64(x_219904, i_220028);
                float defunc_0_add_arg_220036;
                
                defunc_0_add_arg_220036 =
                    ((float *) mem_211106.mem)[gtid_203598 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_219450 *
                                               defunc_0_f_res_196740 +
                                               i_220035];
                defunc_0_f_res_220034 = defunc_0_add_arg_220036;
            }
            
            float x_220037 = a11_219960 * x_220031;
            float y_220038 = b11_219962 * x_220032;
            float x_220039 = x_220037 + y_220038;
            float defunc_9_fit_fun_res_220040 = defunc_0_f_res_220034 *
                  x_220039;
            float x_220041 = b11_219962 * x_220031;
            float y_220042 = c11_219963 * x_220032;
            float x_220043 = x_220041 + y_220042;
            float defunc_9_slope_fun_res_220044 = defunc_0_f_res_220034 *
                  x_220043;
            float defunc_1_op_res_220045 = defunc_9_fit_fun_res_220040 +
                  redout_220029;
            float defunc_1_op_res_220046 = defunc_9_slope_fun_res_220044 +
                  redout_220030;
            float redout_tmp_220054 = defunc_1_op_res_220045;
            float redout_tmp_220055 = defunc_1_op_res_220046;
            
            redout_220029 = redout_tmp_220054;
            redout_220030 = redout_tmp_220055;
        }
        defunc_2_reduce_res_219964 = redout_220029;
        defunc_2_reduce_res_219965 = redout_220030;
        ((float *) mem_219452.mem)[gtid_219903] = defunc_2_reduce_res_219964;
        ((float *) mem_219453.mem)[gtid_219903] = defunc_2_reduce_res_219965;
    }
    
  cleanup:
    { }
    free(mem_219916);
    free(mem_219918);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228756_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228756_end -
                 futhark_mc_segmap_parloop_228756_start;
        
        ctx->futhark_mc_segmap_parloop_228756_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228756_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228756_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228754(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219902 = tid;
    int num_tasks_219987 = info.nsubtasks;
    struct futhark_mc_task_228753 *futhark_mc_task_228753 =
                                  (struct futhark_mc_task_228753 *) args;
    struct futhark_context *ctx = futhark_mc_task_228753->ctx;
    uint64_t futhark_mc_segmap_task_228754_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228754_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228753->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228753->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228753->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228753->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228753->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228753->free_s_n_m_196745;
    int64_t gtid_203598 = futhark_mc_task_228753->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228753->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228753->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228753->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228753->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228753->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 = futhark_mc_task_228753->free_bytes_211601;
    int64_t gtid_219450 = futhark_mc_task_228753->free_gtid_219450;
    int64_t x_219451 = futhark_mc_task_228753->free_x_219451;
    struct memblock mem_219452 = {.desc ="mem_219452", .mem =
                                  futhark_mc_task_228753->free_mem_219452,
                                  .size =0, .references =NULL};
    struct memblock mem_219453 = {.desc ="mem_219453", .mem =
                                  futhark_mc_task_228753->free_mem_219453,
                                  .size =0, .references =NULL};
    int64_t iter_219988;
    struct futhark_mc_segmap_parloop_struct_228755
    futhark_mc_segmap_parloop_struct_228755;
    
    futhark_mc_segmap_parloop_struct_228755.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228755.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228755.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228755.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228755.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228755.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228755.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228755.free_gtid_203598 = gtid_203598;
    futhark_mc_segmap_parloop_struct_228755.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228755.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228755.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228755.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228755.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228755.free_bytes_211601 = bytes_211601;
    futhark_mc_segmap_parloop_struct_228755.free_gtid_219450 = gtid_219450;
    futhark_mc_segmap_parloop_struct_228755.free_x_219451 = x_219451;
    futhark_mc_segmap_parloop_struct_228755.free_mem_219452 = mem_219452.mem;
    futhark_mc_segmap_parloop_struct_228755.free_mem_219453 = mem_219453.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228756_task;
    
    futhark_mc_segmap_parloop_228756_task.name =
        "futhark_mc_segmap_parloop_228756";
    futhark_mc_segmap_parloop_228756_task.fn = futhark_mc_segmap_parloop_228756;
    futhark_mc_segmap_parloop_228756_task.args =
        &futhark_mc_segmap_parloop_struct_228755;
    futhark_mc_segmap_parloop_228756_task.iterations = iterations;
    futhark_mc_segmap_parloop_228756_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228756_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228756_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228756_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228756_task);
    
    if (futhark_mc_segmap_parloop_228756_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228756_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228756_total_end -
                 futhark_mc_segmap_parloop_228756_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228756_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228756_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228756_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228754_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228754_end -
                 futhark_mc_segmap_task_228754_start;
        
        ctx->futhark_mc_segmap_task_228754_runs[tid]++;
        ctx->futhark_mc_segmap_task_228754_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228754_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228760 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211601;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    unsigned char *free_mem_219452;
    unsigned char *free_mem_219453;
};
struct futhark_mc_task_228764 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    int64_t free_x_219820;
    float free_x_219821;
    int64_t free_defunc_0_m_fun_res_219823;
    float *retval_defunc_2_reduce_res_219834;
    float *retval_defunc_2_reduce_res_219835;
    float *retval_defunc_2_reduce_res_219836;
    unsigned char *retval_mem_219832;
    unsigned char *retval_mem_219833;
};
struct futhark_mc_segred_stage_1_parloop_struct_228769 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203598;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    int64_t free_x_219820;
    float free_x_219821;
    int64_t free_defunc_0_m_fun_res_219823;
    unsigned char *free_mem_219832;
    unsigned char *free_mem_219833;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_220121;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_220123;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_220125;
};
static int futhark_mc_segred_stage_1_parloop_228770(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_220065,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228769
    *futhark_mc_segred_stage_1_parloop_struct_228769 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228769 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228769->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228770_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228770_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_defunc_0_f_res_196740;
    int64_t gtid_203598 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228769->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228769->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_219450 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_gtid_219450;
    int64_t x_219451 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_x_219451;
    int64_t x_219820 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_x_219820;
    float x_219821 =
          futhark_mc_segred_stage_1_parloop_struct_228769->free_x_219821;
    int64_t defunc_0_m_fun_res_219823 =
            futhark_mc_segred_stage_1_parloop_struct_228769->free_defunc_0_m_fun_res_219823;
    struct memblock mem_219832 = {.desc ="mem_219832", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228769->free_mem_219832,
                                  .size =0, .references =NULL};
    struct memblock mem_219833 = {.desc ="mem_219833", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228769->free_mem_219833,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_220121 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_220121",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228769->free_reduce_stage_1_tid_res_arr_mem_220121,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_220123 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_220123",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228769->free_reduce_stage_1_tid_res_arr_mem_220123,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_220125 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_220125",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228769->free_reduce_stage_1_tid_res_arr_mem_220125,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_220127 = start;
    float x_220067;
    float x_220068;
    float x_220070;
    float x_220071;
    float x_220073;
    float x_220074;
    float local_acc_220128 = 0.0F;
    float local_acc_220129 = 0.0F;
    float local_acc_220130 = 0.0F;
    
    for (; iter_220127 < end; iter_220127++) {
        int64_t gtid_220066 = iter_220127;
        bool cond_220076 = sle64(x_219451, gtid_220066);
        int64_t defunc_0_f_res_220077;
        
        if (cond_220076) {
            defunc_0_f_res_220077 = (int64_t) 0;
        } else {
            int64_t i_220078 = add64(x_219820, gtid_220066);
            int64_t defunc_0_add_arg_220079;
            
            defunc_0_add_arg_220079 = ((int64_t *) mem_210590.mem)[gtid_203598 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_219450 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_220078];
            
            int64_t defunc_1_add_res_220080 = add64((int64_t) 1,
                                                    defunc_0_add_arg_220079);
            
            defunc_0_f_res_220077 = defunc_1_add_res_220080;
        }
        
        float defunc_0_f_res_220081;
        
        if (cond_220076) {
            defunc_0_f_res_220081 = 0.0F;
        } else {
            int64_t i_220082 = add64(x_219820, gtid_220066);
            float defunc_0_add_arg_220083;
            
            defunc_0_add_arg_220083 = ((float *) mem_211111.mem)[gtid_203598 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_219450 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_220082];
            defunc_0_f_res_220081 = defunc_0_add_arg_220083;
        }
        
        int64_t binop_p_220084 = sub64(defunc_0_f_res_220077,
                                       defunc_0_m_fun_res_219823);
        float defunc_0_f_res_220085 = sitofp_i64_f32(binop_p_220084);
        float abs_res_220086 = (float) fabs(defunc_0_f_res_220085);
        float tmp1_220087 = abs_res_220086 / x_219821;
        float x_220088 = tmp1_220087 * tmp1_220087;
        float y_220089 = tmp1_220087 * x_220088;
        float tmp2_220090 = 1.0F - y_220089;
        float x_220091 = tmp2_220090 * tmp2_220090;
        float tmp3_220092 = tmp2_220090 * x_220091;
        float tmp4_220093 = defunc_0_f_res_220081 * tmp3_220092;
        float defunc_1_f_res_220094 = defunc_0_f_res_220085 * tmp4_220093;
        float defunc_1_f_res_220095 = defunc_0_f_res_220085 *
              defunc_1_f_res_220094;
        
        // save map-out results
        {
            ((float *) mem_219832.mem)[gtid_220066] = defunc_1_f_res_220094;
            ((float *) mem_219833.mem)[gtid_220066] = tmp4_220093;
        }
        // Load accum params
        {
            x_220067 = local_acc_220128;
        }
        // Load next params
        {
            x_220068 = tmp4_220093;
        }
        // Red body
        {
            float defunc_1_op_res_220069 = x_220067 + x_220068;
            
            local_acc_220128 = defunc_1_op_res_220069;
        }
        // Load accum params
        {
            x_220070 = local_acc_220129;
        }
        // Load next params
        {
            x_220071 = defunc_1_f_res_220094;
        }
        // Red body
        {
            float defunc_1_op_res_220072 = x_220070 + x_220071;
            
            local_acc_220129 = defunc_1_op_res_220072;
        }
        // Load accum params
        {
            x_220073 = local_acc_220130;
        }
        // Load next params
        {
            x_220074 = defunc_1_f_res_220095;
        }
        // Red body
        {
            float defunc_1_op_res_220075 = x_220073 + x_220074;
            
            local_acc_220130 = defunc_1_op_res_220075;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_220121.mem)[flat_tid_220065] =
        local_acc_220128;
    ((float *) reduce_stage_1_tid_res_arr_mem_220123.mem)[flat_tid_220065] =
        local_acc_220129;
    ((float *) reduce_stage_1_tid_res_arr_mem_220125.mem)[flat_tid_220065] =
        local_acc_220130;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228770_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228770_end -
                 futhark_mc_segred_stage_1_parloop_228770_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228770_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228770_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228770_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228765(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_220065 = tid;
    int num_tasks_220120 = info.nsubtasks;
    struct futhark_mc_task_228764 *futhark_mc_task_228764 =
                                  (struct futhark_mc_task_228764 *) args;
    struct futhark_context *ctx = futhark_mc_task_228764->ctx;
    uint64_t futhark_mc_segred_task_228765_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228765_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228764->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228764->free_defunc_0_f_res_196740;
    int64_t gtid_203598 = futhark_mc_task_228764->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228764->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228764->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_219450 = futhark_mc_task_228764->free_gtid_219450;
    int64_t x_219451 = futhark_mc_task_228764->free_x_219451;
    int64_t x_219820 = futhark_mc_task_228764->free_x_219820;
    float x_219821 = futhark_mc_task_228764->free_x_219821;
    int64_t defunc_0_m_fun_res_219823 =
            futhark_mc_task_228764->free_defunc_0_m_fun_res_219823;
    float defunc_2_reduce_res_219834 =
          *futhark_mc_task_228764->retval_defunc_2_reduce_res_219834;
    float defunc_2_reduce_res_219835 =
          *futhark_mc_task_228764->retval_defunc_2_reduce_res_219835;
    float defunc_2_reduce_res_219836 =
          *futhark_mc_task_228764->retval_defunc_2_reduce_res_219836;
    struct memblock mem_219832 = {.desc ="mem_219832", .mem =
                                  futhark_mc_task_228764->retval_mem_219832,
                                  .size =0, .references =NULL};
    struct memblock mem_219833 = {.desc ="mem_219833", .mem =
                                  futhark_mc_task_228764->retval_mem_219833,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_220121_cached_sizze_228766 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_220121 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_220123_cached_sizze_228767 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_220123 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_220125_cached_sizze_228768 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_220125 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_220121_cached_sizze_228766 <
        (size_t) ((int64_t) 4 * num_tasks_220120)) {
        reduce_stage_1_tid_res_arr_mem_220121 =
            realloc(reduce_stage_1_tid_res_arr_mem_220121, (int64_t) 4 *
                    num_tasks_220120);
        reduce_stage_1_tid_res_arr_mem_220121_cached_sizze_228766 =
            (int64_t) 4 * num_tasks_220120;
    }
    if (reduce_stage_1_tid_res_arr_mem_220123_cached_sizze_228767 <
        (size_t) ((int64_t) 4 * num_tasks_220120)) {
        reduce_stage_1_tid_res_arr_mem_220123 =
            realloc(reduce_stage_1_tid_res_arr_mem_220123, (int64_t) 4 *
                    num_tasks_220120);
        reduce_stage_1_tid_res_arr_mem_220123_cached_sizze_228767 =
            (int64_t) 4 * num_tasks_220120;
    }
    if (reduce_stage_1_tid_res_arr_mem_220125_cached_sizze_228768 <
        (size_t) ((int64_t) 4 * num_tasks_220120)) {
        reduce_stage_1_tid_res_arr_mem_220125 =
            realloc(reduce_stage_1_tid_res_arr_mem_220125, (int64_t) 4 *
                    num_tasks_220120);
        reduce_stage_1_tid_res_arr_mem_220125_cached_sizze_228768 =
            (int64_t) 4 * num_tasks_220120;
    }
    
    int64_t iter_220127;
    struct futhark_mc_segred_stage_1_parloop_struct_228769
    futhark_mc_segred_stage_1_parloop_struct_228769;
    
    futhark_mc_segred_stage_1_parloop_struct_228769.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_gtid_203598 =
        gtid_203598;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_mem_210590 =
        mem_210590.mem;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_mem_211111 =
        mem_211111.mem;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_gtid_219450 =
        gtid_219450;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_x_219451 = x_219451;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_x_219820 = x_219820;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_x_219821 = x_219821;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_defunc_0_m_fun_res_219823 =
        defunc_0_m_fun_res_219823;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_mem_219832 =
        mem_219832.mem;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_mem_219833 =
        mem_219833.mem;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_reduce_stage_1_tid_res_arr_mem_220121 =
        reduce_stage_1_tid_res_arr_mem_220121;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_reduce_stage_1_tid_res_arr_mem_220123 =
        reduce_stage_1_tid_res_arr_mem_220123;
    futhark_mc_segred_stage_1_parloop_struct_228769.free_reduce_stage_1_tid_res_arr_mem_220125 =
        reduce_stage_1_tid_res_arr_mem_220125;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228770_task;
    
    futhark_mc_segred_stage_1_parloop_228770_task.name =
        "futhark_mc_segred_stage_1_parloop_228770";
    futhark_mc_segred_stage_1_parloop_228770_task.fn =
        futhark_mc_segred_stage_1_parloop_228770;
    futhark_mc_segred_stage_1_parloop_228770_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228769;
    futhark_mc_segred_stage_1_parloop_228770_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228770_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228770_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228770_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228770_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228770_task);
    
    if (futhark_mc_segred_stage_1_parloop_228770_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228770_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228770_total_end -
                 futhark_mc_segred_stage_1_parloop_228770_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228770_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228770_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228770_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_219834 = 0.0F;
        defunc_2_reduce_res_219835 = 0.0F;
        defunc_2_reduce_res_219836 = 0.0F;
    }
    
    float x_220131;
    float x_220132;
    float x_220134;
    float x_220135;
    float x_220137;
    float x_220138;
    
    for (int32_t i_220140 = 0; i_220140 < num_tasks_220120; i_220140++) {
        flat_tid_220065 = i_220140;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_220131 = defunc_2_reduce_res_219834;
            }
            // load next params
            {
                x_220132 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_220121)[flat_tid_220065];
            }
            // red body
            {
                float defunc_1_op_res_220133 = x_220131 + x_220132;
                
                defunc_2_reduce_res_219834 = defunc_1_op_res_220133;
            }
            // load acc params
            {
                x_220134 = defunc_2_reduce_res_219835;
            }
            // load next params
            {
                x_220135 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_220123)[flat_tid_220065];
            }
            // red body
            {
                float defunc_1_op_res_220136 = x_220134 + x_220135;
                
                defunc_2_reduce_res_219835 = defunc_1_op_res_220136;
            }
            // load acc params
            {
                x_220137 = defunc_2_reduce_res_219836;
            }
            // load next params
            {
                x_220138 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_220125)[flat_tid_220065];
            }
            // red body
            {
                float defunc_1_op_res_220139 = x_220137 + x_220138;
                
                defunc_2_reduce_res_219836 = defunc_1_op_res_220139;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_220121);
        free(reduce_stage_1_tid_res_arr_mem_220123);
        free(reduce_stage_1_tid_res_arr_mem_220125);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228765_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228765_end -
                 futhark_mc_segred_task_228765_start;
        
        ctx->futhark_mc_segred_task_228765_runs[tid]++;
        ctx->futhark_mc_segred_task_228765_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228765_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228764->retval_defunc_2_reduce_res_219834 =
            defunc_2_reduce_res_219834;
        *futhark_mc_task_228764->retval_defunc_2_reduce_res_219835 =
            defunc_2_reduce_res_219835;
        *futhark_mc_task_228764->retval_defunc_2_reduce_res_219836 =
            defunc_2_reduce_res_219836;
        futhark_mc_task_228764->retval_mem_219832 = mem_219832.mem;
        futhark_mc_task_228764->retval_mem_219833 = mem_219833.mem;
    }
    return err;
}
struct futhark_mc_task_228771 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203598;
    unsigned char *free_mem_211106;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    int64_t free_x_219820;
    unsigned char *free_mem_219832;
    unsigned char *free_mem_219833;
    float free_a11_219874;
    float free_b11_219876;
    float free_c11_219877;
    float *retval_defunc_2_reduce_res_219878;
    float *retval_defunc_2_reduce_res_219879;
};
struct futhark_mc_segred_stage_1_parloop_struct_228775 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_203598;
    unsigned char *free_mem_211106;
    int64_t free_gtid_219450;
    int64_t free_x_219451;
    int64_t free_x_219820;
    unsigned char *free_mem_219832;
    unsigned char *free_mem_219833;
    float free_a11_219874;
    float free_b11_219876;
    float free_c11_219877;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_220142;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_220144;
};
static int futhark_mc_segred_stage_1_parloop_228776(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_220096,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228775
    *futhark_mc_segred_stage_1_parloop_struct_228775 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228775 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228775->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228776_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228776_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228775->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228775->free_defunc_0_f_res_196740;
    int64_t gtid_203598 =
            futhark_mc_segred_stage_1_parloop_struct_228775->free_gtid_203598;
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228775->free_mem_211106,
                                  .size =0, .references =NULL};
    int64_t gtid_219450 =
            futhark_mc_segred_stage_1_parloop_struct_228775->free_gtid_219450;
    int64_t x_219451 =
            futhark_mc_segred_stage_1_parloop_struct_228775->free_x_219451;
    int64_t x_219820 =
            futhark_mc_segred_stage_1_parloop_struct_228775->free_x_219820;
    struct memblock mem_219832 = {.desc ="mem_219832", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228775->free_mem_219832,
                                  .size =0, .references =NULL};
    struct memblock mem_219833 = {.desc ="mem_219833", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228775->free_mem_219833,
                                  .size =0, .references =NULL};
    float a11_219874 =
          futhark_mc_segred_stage_1_parloop_struct_228775->free_a11_219874;
    float b11_219876 =
          futhark_mc_segred_stage_1_parloop_struct_228775->free_b11_219876;
    float c11_219877 =
          futhark_mc_segred_stage_1_parloop_struct_228775->free_c11_219877;
    struct memblock reduce_stage_1_tid_res_arr_mem_220142 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_220142",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228775->free_reduce_stage_1_tid_res_arr_mem_220142,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_220144 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_220144",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228775->free_reduce_stage_1_tid_res_arr_mem_220144,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_220146 = start;
    float x_220098;
    float x_220099;
    float x_220101;
    float x_220102;
    float local_acc_220147 = 0.0F;
    float local_acc_220148 = 0.0F;
    
    for (; iter_220146 < end; iter_220146++) {
        int64_t gtid_220097 = iter_220146;
        float x_220104;
        
        x_220104 = ((float *) mem_219833.mem)[gtid_220097];
        
        float x_220105;
        
        x_220105 = ((float *) mem_219832.mem)[gtid_220097];
        
        bool cond_220106 = sle64(x_219451, gtid_220097);
        float defunc_0_f_res_220107;
        
        if (cond_220106) {
            defunc_0_f_res_220107 = 0.0F;
        } else {
            int64_t i_220108 = add64(x_219820, gtid_220097);
            float defunc_0_add_arg_220109;
            
            defunc_0_add_arg_220109 = ((float *) mem_211106.mem)[gtid_203598 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_219450 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_220108];
            defunc_0_f_res_220107 = defunc_0_add_arg_220109;
        }
        
        float x_220110 = a11_219874 * x_220104;
        float y_220111 = b11_219876 * x_220105;
        float x_220112 = x_220110 + y_220111;
        float defunc_9_fit_fun_res_220113 = defunc_0_f_res_220107 * x_220112;
        float x_220114 = b11_219876 * x_220104;
        float y_220115 = c11_219877 * x_220105;
        float x_220116 = x_220114 + y_220115;
        float defunc_9_slope_fun_res_220117 = defunc_0_f_res_220107 * x_220116;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_220098 = local_acc_220147;
        }
        // Load next params
        {
            x_220099 = defunc_9_fit_fun_res_220113;
        }
        // Red body
        {
            float defunc_1_op_res_220100 = x_220098 + x_220099;
            
            local_acc_220147 = defunc_1_op_res_220100;
        }
        // Load accum params
        {
            x_220101 = local_acc_220148;
        }
        // Load next params
        {
            x_220102 = defunc_9_slope_fun_res_220117;
        }
        // Red body
        {
            float defunc_1_op_res_220103 = x_220101 + x_220102;
            
            local_acc_220148 = defunc_1_op_res_220103;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_220142.mem)[flat_tid_220096] =
        local_acc_220147;
    ((float *) reduce_stage_1_tid_res_arr_mem_220144.mem)[flat_tid_220096] =
        local_acc_220148;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228776_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228776_end -
                 futhark_mc_segred_stage_1_parloop_228776_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228776_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228776_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228776_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228772(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_220096 = tid;
    int num_tasks_220141 = info.nsubtasks;
    struct futhark_mc_task_228771 *futhark_mc_task_228771 =
                                  (struct futhark_mc_task_228771 *) args;
    struct futhark_context *ctx = futhark_mc_task_228771->ctx;
    uint64_t futhark_mc_segred_task_228772_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228772_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228771->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228771->free_defunc_0_f_res_196740;
    int64_t gtid_203598 = futhark_mc_task_228771->free_gtid_203598;
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228771->free_mem_211106,
                                  .size =0, .references =NULL};
    int64_t gtid_219450 = futhark_mc_task_228771->free_gtid_219450;
    int64_t x_219451 = futhark_mc_task_228771->free_x_219451;
    int64_t x_219820 = futhark_mc_task_228771->free_x_219820;
    struct memblock mem_219832 = {.desc ="mem_219832", .mem =
                                  futhark_mc_task_228771->free_mem_219832,
                                  .size =0, .references =NULL};
    struct memblock mem_219833 = {.desc ="mem_219833", .mem =
                                  futhark_mc_task_228771->free_mem_219833,
                                  .size =0, .references =NULL};
    float a11_219874 = futhark_mc_task_228771->free_a11_219874;
    float b11_219876 = futhark_mc_task_228771->free_b11_219876;
    float c11_219877 = futhark_mc_task_228771->free_c11_219877;
    float defunc_2_reduce_res_219878 =
          *futhark_mc_task_228771->retval_defunc_2_reduce_res_219878;
    float defunc_2_reduce_res_219879 =
          *futhark_mc_task_228771->retval_defunc_2_reduce_res_219879;
    size_t reduce_stage_1_tid_res_arr_mem_220142_cached_sizze_228773 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_220142 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_220144_cached_sizze_228774 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_220144 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_220142_cached_sizze_228773 <
        (size_t) ((int64_t) 4 * num_tasks_220141)) {
        reduce_stage_1_tid_res_arr_mem_220142 =
            realloc(reduce_stage_1_tid_res_arr_mem_220142, (int64_t) 4 *
                    num_tasks_220141);
        reduce_stage_1_tid_res_arr_mem_220142_cached_sizze_228773 =
            (int64_t) 4 * num_tasks_220141;
    }
    if (reduce_stage_1_tid_res_arr_mem_220144_cached_sizze_228774 <
        (size_t) ((int64_t) 4 * num_tasks_220141)) {
        reduce_stage_1_tid_res_arr_mem_220144 =
            realloc(reduce_stage_1_tid_res_arr_mem_220144, (int64_t) 4 *
                    num_tasks_220141);
        reduce_stage_1_tid_res_arr_mem_220144_cached_sizze_228774 =
            (int64_t) 4 * num_tasks_220141;
    }
    
    int64_t iter_220146;
    struct futhark_mc_segred_stage_1_parloop_struct_228775
    futhark_mc_segred_stage_1_parloop_struct_228775;
    
    futhark_mc_segred_stage_1_parloop_struct_228775.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_gtid_203598 =
        gtid_203598;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_mem_211106 =
        mem_211106.mem;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_gtid_219450 =
        gtid_219450;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_x_219451 = x_219451;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_x_219820 = x_219820;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_mem_219832 =
        mem_219832.mem;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_mem_219833 =
        mem_219833.mem;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_a11_219874 =
        a11_219874;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_b11_219876 =
        b11_219876;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_c11_219877 =
        c11_219877;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_reduce_stage_1_tid_res_arr_mem_220142 =
        reduce_stage_1_tid_res_arr_mem_220142;
    futhark_mc_segred_stage_1_parloop_struct_228775.free_reduce_stage_1_tid_res_arr_mem_220144 =
        reduce_stage_1_tid_res_arr_mem_220144;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228776_task;
    
    futhark_mc_segred_stage_1_parloop_228776_task.name =
        "futhark_mc_segred_stage_1_parloop_228776";
    futhark_mc_segred_stage_1_parloop_228776_task.fn =
        futhark_mc_segred_stage_1_parloop_228776;
    futhark_mc_segred_stage_1_parloop_228776_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228775;
    futhark_mc_segred_stage_1_parloop_228776_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228776_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228776_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228776_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228776_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228776_task);
    
    if (futhark_mc_segred_stage_1_parloop_228776_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228776_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228776_total_end -
                 futhark_mc_segred_stage_1_parloop_228776_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228776_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228776_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228776_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_219878 = 0.0F;
        defunc_2_reduce_res_219879 = 0.0F;
    }
    
    float x_220149;
    float x_220150;
    float x_220152;
    float x_220153;
    
    for (int32_t i_220155 = 0; i_220155 < num_tasks_220141; i_220155++) {
        flat_tid_220096 = i_220155;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_220149 = defunc_2_reduce_res_219878;
            }
            // load next params
            {
                x_220150 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_220142)[flat_tid_220096];
            }
            // red body
            {
                float defunc_1_op_res_220151 = x_220149 + x_220150;
                
                defunc_2_reduce_res_219878 = defunc_1_op_res_220151;
            }
            // load acc params
            {
                x_220152 = defunc_2_reduce_res_219879;
            }
            // load next params
            {
                x_220153 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_220144)[flat_tid_220096];
            }
            // red body
            {
                float defunc_1_op_res_220154 = x_220152 + x_220153;
                
                defunc_2_reduce_res_219879 = defunc_1_op_res_220154;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_220142);
        free(reduce_stage_1_tid_res_arr_mem_220144);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228772_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228772_end -
                 futhark_mc_segred_task_228772_start;
        
        ctx->futhark_mc_segred_task_228772_runs[tid]++;
        ctx->futhark_mc_segred_task_228772_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228772_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228771->retval_defunc_2_reduce_res_219878 =
            defunc_2_reduce_res_219878;
        *futhark_mc_task_228771->retval_defunc_2_reduce_res_219879 =
            defunc_2_reduce_res_219879;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228761(void *args, int64_t start,
                                            int64_t end, int flat_tid_219818,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228760
    *futhark_mc_segmap_parloop_struct_228760 =
    (struct futhark_mc_segmap_parloop_struct_228760 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228760->ctx;
    uint64_t futhark_mc_segmap_parloop_228761_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228761_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228760->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228760->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228760->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228760->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228760->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228760->free_s_n_m_196745;
    int64_t gtid_203598 =
            futhark_mc_segmap_parloop_struct_228760->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 =
            futhark_mc_segmap_parloop_struct_228760->free_bytes_211601;
    int64_t gtid_219450 =
            futhark_mc_segmap_parloop_struct_228760->free_gtid_219450;
    int64_t x_219451 = futhark_mc_segmap_parloop_struct_228760->free_x_219451;
    struct memblock mem_219452 = {.desc ="mem_219452", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_219452,
                                  .size =0, .references =NULL};
    struct memblock mem_219453 = {.desc ="mem_219453", .mem =
                                  futhark_mc_segmap_parloop_struct_228760->free_mem_219453,
                                  .size =0, .references =NULL};
    size_t mem_219832_cached_sizze_228762 = 0;
    unsigned char *mem_219832 = NULL;
    size_t mem_219833_cached_sizze_228763 = 0;
    unsigned char *mem_219833 = NULL;
    int64_t iterations = end - start;
    int64_t iter_220056 = start;
    
    if (mem_219832_cached_sizze_228762 < (size_t) bytes_211601) {
        mem_219832 = realloc(mem_219832, bytes_211601);
        mem_219832_cached_sizze_228762 = bytes_211601;
    }
    if (mem_219833_cached_sizze_228763 < (size_t) bytes_211601) {
        mem_219833 = realloc(mem_219833, bytes_211601);
        mem_219833_cached_sizze_228763 = bytes_211601;
    }
    for (; iter_220056 < end; iter_220056++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_220118 = s_n_m_196745;
        int64_t gtid_219819 = iter_220056;
        int64_t remnant_220119 = iter_220056 - gtid_219819;
        int64_t x_219820;
        
        x_219820 = ((int64_t *) mem_210764.mem)[gtid_203598 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_219450 * s_n_m_196745 +
                                                gtid_219819];
        
        float x_219821;
        
        x_219821 = ((float *) mem_210769.mem)[gtid_203598 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_219450 * s_n_m_196745 +
                                              gtid_219819];
        
        bool cond_219822 = gtid_219819 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_219823;
        
        if (cond_219822) {
            defunc_0_m_fun_res_219823 = (int64_t) 0;
        } else {
            int64_t y_220057 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_220058 = gtid_219819 == y_220057;
            int64_t defunc_0_m_fun_res_f_res_220059;
            
            if (cond_220058) {
                int64_t defunc_0_m_fun_res_f_res_t_res_220060 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_220059 =
                    defunc_0_m_fun_res_f_res_t_res_220060;
            } else {
                int64_t x_220061 = sub64(gtid_219819, (int64_t) 1);
                int64_t x_220062 = mul64(jump_s_196701, x_220061);
                int64_t min_arg_220063 = add64((int64_t) 1, x_220062);
                int64_t min_res_220064 = smin64(defunc_0_f_res_196740,
                                                min_arg_220063);
                
                defunc_0_m_fun_res_f_res_220059 = min_res_220064;
            }
            defunc_0_m_fun_res_219823 = defunc_0_m_fun_res_f_res_220059;
        }
        
        float defunc_2_reduce_res_219834;
        float defunc_2_reduce_res_219835;
        float defunc_2_reduce_res_219836;
        int64_t flat_tid_220065 = (int64_t) 0;
        int32_t num_tasks_220120;
        
        defunc_2_reduce_res_219834 = 0.0F;
        defunc_2_reduce_res_219835 = 0.0F;
        defunc_2_reduce_res_219836 = 0.0F;
        
        struct futhark_mc_task_228764 futhark_mc_task_228764;
        
        futhark_mc_task_228764.ctx = ctx;
        futhark_mc_task_228764.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228764.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228764.free_gtid_203598 = gtid_203598;
        futhark_mc_task_228764.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228764.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228764.free_gtid_219450 = gtid_219450;
        futhark_mc_task_228764.free_x_219451 = x_219451;
        futhark_mc_task_228764.free_x_219820 = x_219820;
        futhark_mc_task_228764.free_x_219821 = x_219821;
        futhark_mc_task_228764.free_defunc_0_m_fun_res_219823 =
            defunc_0_m_fun_res_219823;
        futhark_mc_task_228764.retval_defunc_2_reduce_res_219834 =
            &defunc_2_reduce_res_219834;
        futhark_mc_task_228764.retval_defunc_2_reduce_res_219835 =
            &defunc_2_reduce_res_219835;
        futhark_mc_task_228764.retval_defunc_2_reduce_res_219836 =
            &defunc_2_reduce_res_219836;
        futhark_mc_task_228764.retval_mem_219832 = mem_219832;
        futhark_mc_task_228764.retval_mem_219833 = mem_219833;
        
        struct scheduler_segop futhark_mc_task_228764_task;
        
        futhark_mc_task_228764_task.args = &futhark_mc_task_228764;
        futhark_mc_task_228764_task.top_level_fn =
            futhark_mc_segred_task_228765;
        futhark_mc_task_228764_task.name = "futhark_mc_segred_task_228765";
        futhark_mc_task_228764_task.iterations = q_s_196695;
        futhark_mc_task_228764_task.task_time =
            &ctx->futhark_mc_segred_task_228765_total_time;
        futhark_mc_task_228764_task.task_iter =
            &ctx->futhark_mc_segred_task_228765_total_iter;
        futhark_mc_task_228764_task.sched = STATIC;
        futhark_mc_task_228764_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228765_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228764_task);
        
        if (futhark_mc_segred_task_228765_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_219870 = defunc_2_reduce_res_219834 *
              defunc_2_reduce_res_219836;
        float y_219871 = defunc_2_reduce_res_219835 *
              defunc_2_reduce_res_219835;
        float y_219872 = x_219870 - y_219871;
        float det1_219873 = 1.0F / y_219872;
        float a11_219874 = defunc_2_reduce_res_219836 * det1_219873;
        float x_219875 = 0.0F - defunc_2_reduce_res_219835;
        float b11_219876 = det1_219873 * x_219875;
        float c11_219877 = defunc_2_reduce_res_219834 * det1_219873;
        float defunc_2_reduce_res_219878;
        float defunc_2_reduce_res_219879;
        int64_t flat_tid_220096 = (int64_t) 0;
        int32_t num_tasks_220141;
        
        defunc_2_reduce_res_219878 = 0.0F;
        defunc_2_reduce_res_219879 = 0.0F;
        
        struct futhark_mc_task_228771 futhark_mc_task_228771;
        
        futhark_mc_task_228771.ctx = ctx;
        futhark_mc_task_228771.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228771.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228771.free_gtid_203598 = gtid_203598;
        futhark_mc_task_228771.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228771.free_gtid_219450 = gtid_219450;
        futhark_mc_task_228771.free_x_219451 = x_219451;
        futhark_mc_task_228771.free_x_219820 = x_219820;
        futhark_mc_task_228771.free_mem_219832 = mem_219832;
        futhark_mc_task_228771.free_mem_219833 = mem_219833;
        futhark_mc_task_228771.free_a11_219874 = a11_219874;
        futhark_mc_task_228771.free_b11_219876 = b11_219876;
        futhark_mc_task_228771.free_c11_219877 = c11_219877;
        futhark_mc_task_228771.retval_defunc_2_reduce_res_219878 =
            &defunc_2_reduce_res_219878;
        futhark_mc_task_228771.retval_defunc_2_reduce_res_219879 =
            &defunc_2_reduce_res_219879;
        
        struct scheduler_segop futhark_mc_task_228771_task;
        
        futhark_mc_task_228771_task.args = &futhark_mc_task_228771;
        futhark_mc_task_228771_task.top_level_fn =
            futhark_mc_segred_task_228772;
        futhark_mc_task_228771_task.name = "futhark_mc_segred_task_228772";
        futhark_mc_task_228771_task.iterations = q_s_196695;
        futhark_mc_task_228771_task.task_time =
            &ctx->futhark_mc_segred_task_228772_total_time;
        futhark_mc_task_228771_task.task_iter =
            &ctx->futhark_mc_segred_task_228772_total_iter;
        futhark_mc_task_228771_task.sched = STATIC;
        futhark_mc_task_228771_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228772_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228771_task);
        
        if (futhark_mc_segred_task_228772_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_219452.mem)[gtid_219819] = defunc_2_reduce_res_219878;
        ((float *) mem_219453.mem)[gtid_219819] = defunc_2_reduce_res_219879;
    }
    
  cleanup:
    { }
    free(mem_219832);
    free(mem_219833);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228761_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228761_end -
                 futhark_mc_segmap_parloop_228761_start;
        
        ctx->futhark_mc_segmap_parloop_228761_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228761_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228761_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228759(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219818 = tid;
    int num_tasks_219987 = info.nsubtasks;
    struct futhark_mc_task_228753 *futhark_mc_task_228753 =
                                  (struct futhark_mc_task_228753 *) args;
    struct futhark_context *ctx = futhark_mc_task_228753->ctx;
    uint64_t futhark_mc_segmap_nested_task_228759_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228759_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228753->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228753->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228753->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228753->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228753->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228753->free_s_n_m_196745;
    int64_t gtid_203598 = futhark_mc_task_228753->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228753->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228753->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228753->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228753->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228753->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 = futhark_mc_task_228753->free_bytes_211601;
    int64_t gtid_219450 = futhark_mc_task_228753->free_gtid_219450;
    int64_t x_219451 = futhark_mc_task_228753->free_x_219451;
    struct memblock mem_219452 = {.desc ="mem_219452", .mem =
                                  futhark_mc_task_228753->free_mem_219452,
                                  .size =0, .references =NULL};
    struct memblock mem_219453 = {.desc ="mem_219453", .mem =
                                  futhark_mc_task_228753->free_mem_219453,
                                  .size =0, .references =NULL};
    int64_t iter_220056;
    struct futhark_mc_segmap_parloop_struct_228760
    futhark_mc_segmap_parloop_struct_228760;
    
    futhark_mc_segmap_parloop_struct_228760.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228760.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228760.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228760.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228760.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228760.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228760.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228760.free_gtid_203598 = gtid_203598;
    futhark_mc_segmap_parloop_struct_228760.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228760.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228760.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228760.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228760.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228760.free_bytes_211601 = bytes_211601;
    futhark_mc_segmap_parloop_struct_228760.free_gtid_219450 = gtid_219450;
    futhark_mc_segmap_parloop_struct_228760.free_x_219451 = x_219451;
    futhark_mc_segmap_parloop_struct_228760.free_mem_219452 = mem_219452.mem;
    futhark_mc_segmap_parloop_struct_228760.free_mem_219453 = mem_219453.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228761_task;
    
    futhark_mc_segmap_parloop_228761_task.name =
        "futhark_mc_segmap_parloop_228761";
    futhark_mc_segmap_parloop_228761_task.fn = futhark_mc_segmap_parloop_228761;
    futhark_mc_segmap_parloop_228761_task.args =
        &futhark_mc_segmap_parloop_struct_228760;
    futhark_mc_segmap_parloop_228761_task.iterations = iterations;
    futhark_mc_segmap_parloop_228761_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228761_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228761_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228761_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228761_task);
    
    if (futhark_mc_segmap_parloop_228761_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228761_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228761_total_end -
                 futhark_mc_segmap_parloop_228761_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228761_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228761_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228761_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228759_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228759_end -
                 futhark_mc_segmap_nested_task_228759_start;
        
        ctx->futhark_mc_segmap_nested_task_228759_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228759_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228759_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228750(void *args, int64_t start,
                                            int64_t end, int flat_tid_219449,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228749
    *futhark_mc_segmap_parloop_struct_228749 =
    (struct futhark_mc_segmap_parloop_struct_228749 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228749->ctx;
    uint64_t futhark_mc_segmap_parloop_228750_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228750_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228749->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228749->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228749->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228749->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228749->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228749->free_s_n_m_196745;
    int64_t gtid_203598 =
            futhark_mc_segmap_parloop_struct_228749->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228749->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 =
            futhark_mc_segmap_parloop_struct_228749->free_bytes_211601;
    struct memblock mem_211705 = {.desc ="mem_211705", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_211705,
                                  .size =0, .references =NULL};
    struct memblock mem_211709 = {.desc ="mem_211709", .mem =
                                  futhark_mc_segmap_parloop_struct_228749->free_mem_211709,
                                  .size =0, .references =NULL};
    size_t mem_219452_cached_sizze_228751 = 0;
    unsigned char *mem_219452 = NULL;
    size_t mem_219453_cached_sizze_228752 = 0;
    unsigned char *mem_219453 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219817 = start;
    
    if (mem_219452_cached_sizze_228751 < (size_t) bytes_210599) {
        mem_219452 = realloc(mem_219452, bytes_210599);
        mem_219452_cached_sizze_228751 = bytes_210599;
    }
    if (mem_219453_cached_sizze_228752 < (size_t) bytes_210599) {
        mem_219453 = realloc(mem_219453, bytes_210599);
        mem_219453_cached_sizze_228752 = bytes_210599;
    }
    for (; iter_219817 < end; iter_219817++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219985 = n_p_196694;
        int64_t gtid_219450 = iter_219817;
        int64_t remnant_219986 = iter_219817 - gtid_219450;
        int64_t x_219451;
        
        x_219451 = ((int64_t *) mem_210594.mem)[gtid_203598 * n_p_196694 +
                                                gtid_219450];
        
        int64_t flat_tid_219902 = (int64_t) 0;
        int32_t num_tasks_219987;
        int64_t flat_tid_219818 = (int64_t) 0;
        struct futhark_mc_task_228753 futhark_mc_task_228753;
        
        futhark_mc_task_228753.ctx = ctx;
        futhark_mc_task_228753.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228753.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228753.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228753.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228753.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228753.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228753.free_gtid_203598 = gtid_203598;
        futhark_mc_task_228753.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228753.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228753.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228753.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228753.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228753.free_bytes_211601 = bytes_211601;
        futhark_mc_task_228753.free_gtid_219450 = gtid_219450;
        futhark_mc_task_228753.free_x_219451 = x_219451;
        futhark_mc_task_228753.free_mem_219452 = mem_219452;
        futhark_mc_task_228753.free_mem_219453 = mem_219453;
        
        struct scheduler_segop futhark_mc_task_228753_task;
        
        futhark_mc_task_228753_task.args = &futhark_mc_task_228753;
        futhark_mc_task_228753_task.top_level_fn =
            futhark_mc_segmap_task_228754;
        futhark_mc_task_228753_task.name = "futhark_mc_segmap_task_228754";
        futhark_mc_task_228753_task.iterations = s_n_m_196745;
        futhark_mc_task_228753_task.task_time =
            &ctx->futhark_mc_segmap_task_228754_total_time;
        futhark_mc_task_228753_task.task_iter =
            &ctx->futhark_mc_segmap_task_228754_total_iter;
        futhark_mc_task_228753_task.sched = STATIC;
        futhark_mc_task_228753_task.nested_fn =
            futhark_mc_segmap_nested_task_228759;
        
        int futhark_mc_segmap_task_228754_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228753_task);
        
        if (futhark_mc_segmap_task_228754_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211705.mem + gtid_219450 * s_n_m_196745 * (int64_t) 4,
                    mem_219452 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211709.mem + gtid_219450 * s_n_m_196745 * (int64_t) 4,
                    mem_219453 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_219452);
    free(mem_219453);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228750_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228750_end -
                 futhark_mc_segmap_parloop_228750_start;
        
        ctx->futhark_mc_segmap_parloop_228750_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228750_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228750_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228748(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_219449 = tid;
    int num_tasks_219720 = info.nsubtasks;
    struct futhark_mc_task_228740 *futhark_mc_task_228740 =
                                  (struct futhark_mc_task_228740 *) args;
    struct futhark_context *ctx = futhark_mc_task_228740->ctx;
    uint64_t futhark_mc_segmap_nested_task_228748_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228748_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228740->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228740->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228740->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228740->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228740->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228740->free_s_n_m_196745;
    int64_t gtid_203598 = futhark_mc_task_228740->free_gtid_203598;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228740->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228740->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228740->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228740->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228740->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228740->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228740->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 = futhark_mc_task_228740->free_bytes_211601;
    struct memblock mem_211705 = {.desc ="mem_211705", .mem =
                                  futhark_mc_task_228740->free_mem_211705,
                                  .size =0, .references =NULL};
    struct memblock mem_211709 = {.desc ="mem_211709", .mem =
                                  futhark_mc_task_228740->free_mem_211709,
                                  .size =0, .references =NULL};
    int64_t iter_219817;
    struct futhark_mc_segmap_parloop_struct_228749
    futhark_mc_segmap_parloop_struct_228749;
    
    futhark_mc_segmap_parloop_struct_228749.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228749.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228749.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228749.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228749.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228749.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228749.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228749.free_gtid_203598 = gtid_203598;
    futhark_mc_segmap_parloop_struct_228749.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228749.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228749.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228749.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228749.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228749.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228749.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228749.free_bytes_211601 = bytes_211601;
    futhark_mc_segmap_parloop_struct_228749.free_mem_211705 = mem_211705.mem;
    futhark_mc_segmap_parloop_struct_228749.free_mem_211709 = mem_211709.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228750_task;
    
    futhark_mc_segmap_parloop_228750_task.name =
        "futhark_mc_segmap_parloop_228750";
    futhark_mc_segmap_parloop_228750_task.fn = futhark_mc_segmap_parloop_228750;
    futhark_mc_segmap_parloop_228750_task.args =
        &futhark_mc_segmap_parloop_struct_228749;
    futhark_mc_segmap_parloop_228750_task.iterations = iterations;
    futhark_mc_segmap_parloop_228750_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228750_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228750_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228750_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228750_task);
    
    if (futhark_mc_segmap_parloop_228750_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228750_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228750_total_end -
                 futhark_mc_segmap_parloop_228750_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228750_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228750_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228750_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228748_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228748_end -
                 futhark_mc_segmap_nested_task_228748_start;
        
        ctx->futhark_mc_segmap_nested_task_228748_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228748_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228748_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228737(void *args, int64_t start,
                                            int64_t end, int flat_tid_203597,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228736
    *futhark_mc_segmap_parloop_struct_228736 =
    (struct futhark_mc_segmap_parloop_struct_228736 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228736->ctx;
    uint64_t futhark_mc_segmap_parloop_228737_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228737_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228736->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228736->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228736->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228736->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228736->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228736->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228736->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228736->free_bytes_210599;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228736->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 =
            futhark_mc_segmap_parloop_struct_228736->free_bytes_211601;
    struct memblock mem_211832 = {.desc ="mem_211832", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_211832,
                                  .size =0, .references =NULL};
    struct memblock mem_211837 = {.desc ="mem_211837", .mem =
                                  futhark_mc_segmap_parloop_struct_228736->free_mem_211837,
                                  .size =0, .references =NULL};
    size_t mem_211705_cached_sizze_228738 = 0;
    unsigned char *mem_211705 = NULL;
    size_t mem_211709_cached_sizze_228739 = 0;
    unsigned char *mem_211709 = NULL;
    int64_t iterations = end - start;
    int64_t iter_219448 = start;
    
    if (mem_211705_cached_sizze_228738 < (size_t) bytes_210655) {
        mem_211705 = realloc(mem_211705, bytes_210655);
        mem_211705_cached_sizze_228738 = bytes_210655;
    }
    if (mem_211709_cached_sizze_228739 < (size_t) bytes_210655) {
        mem_211709 = realloc(mem_211709, bytes_210655);
        mem_211709_cached_sizze_228739 = bytes_210655;
    }
    for (; iter_219448 < end; iter_219448++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_219718 = m_196691;
        int64_t gtid_203598 = iter_219448;
        int64_t remnant_219719 = iter_219448 - gtid_203598;
        int64_t flat_tid_219623 = (int64_t) 0;
        int32_t num_tasks_219720;
        int64_t flat_tid_219449 = (int64_t) 0;
        struct futhark_mc_task_228740 futhark_mc_task_228740;
        
        futhark_mc_task_228740.ctx = ctx;
        futhark_mc_task_228740.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228740.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228740.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228740.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228740.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228740.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228740.free_gtid_203598 = gtid_203598;
        futhark_mc_task_228740.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228740.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228740.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228740.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228740.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228740.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228740.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228740.free_bytes_211601 = bytes_211601;
        futhark_mc_task_228740.free_mem_211705 = mem_211705;
        futhark_mc_task_228740.free_mem_211709 = mem_211709;
        
        struct scheduler_segop futhark_mc_task_228740_task;
        
        futhark_mc_task_228740_task.args = &futhark_mc_task_228740;
        futhark_mc_task_228740_task.top_level_fn =
            futhark_mc_segmap_task_228741;
        futhark_mc_task_228740_task.name = "futhark_mc_segmap_task_228741";
        futhark_mc_task_228740_task.iterations = n_p_196694;
        futhark_mc_task_228740_task.task_time =
            &ctx->futhark_mc_segmap_task_228741_total_time;
        futhark_mc_task_228740_task.task_iter =
            &ctx->futhark_mc_segmap_task_228741_total_iter;
        futhark_mc_task_228740_task.sched = STATIC;
        futhark_mc_task_228740_task.nested_fn =
            futhark_mc_segmap_nested_task_228748;
        
        int futhark_mc_segmap_task_228741_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228740_task);
        
        if (futhark_mc_segmap_task_228741_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211832.mem + gtid_203598 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211705 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_211837.mem + gtid_203598 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_211709 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_211705);
    free(mem_211709);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228737_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228737_end -
                 futhark_mc_segmap_parloop_228737_start;
        
        ctx->futhark_mc_segmap_parloop_228737_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228737_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228737_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228735(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_203597 = tid;
    int num_tasks_219343 = info.nsubtasks;
    struct futhark_mc_task_228727 *futhark_mc_task_228727 =
                                  (struct futhark_mc_task_228727 *) args;
    struct futhark_context *ctx = futhark_mc_task_228727->ctx;
    uint64_t futhark_mc_segmap_nested_task_228735_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228735_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228727->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228727->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228727->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228727->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228727->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228727->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228727->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228727->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228727->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228727->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228727->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228727->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228727->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228727->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228727->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211601 = futhark_mc_task_228727->free_bytes_211601;
    struct memblock mem_211832 = {.desc ="mem_211832", .mem =
                                  futhark_mc_task_228727->free_mem_211832,
                                  .size =0, .references =NULL};
    struct memblock mem_211837 = {.desc ="mem_211837", .mem =
                                  futhark_mc_task_228727->free_mem_211837,
                                  .size =0, .references =NULL};
    int64_t iter_219448;
    struct futhark_mc_segmap_parloop_struct_228736
    futhark_mc_segmap_parloop_struct_228736;
    
    futhark_mc_segmap_parloop_struct_228736.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228736.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228736.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228736.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228736.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228736.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228736.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228736.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228736.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228736.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228736.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228736.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228736.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228736.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228736.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228736.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228736.free_bytes_211601 = bytes_211601;
    futhark_mc_segmap_parloop_struct_228736.free_mem_211832 = mem_211832.mem;
    futhark_mc_segmap_parloop_struct_228736.free_mem_211837 = mem_211837.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228737_task;
    
    futhark_mc_segmap_parloop_228737_task.name =
        "futhark_mc_segmap_parloop_228737";
    futhark_mc_segmap_parloop_228737_task.fn = futhark_mc_segmap_parloop_228737;
    futhark_mc_segmap_parloop_228737_task.args =
        &futhark_mc_segmap_parloop_struct_228736;
    futhark_mc_segmap_parloop_228737_task.iterations = iterations;
    futhark_mc_segmap_parloop_228737_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228737_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228737_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228737_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228737_task);
    
    if (futhark_mc_segmap_parloop_228737_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228737_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228737_total_end -
                 futhark_mc_segmap_parloop_228737_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228737_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228737_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228737_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228735_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228735_end -
                 futhark_mc_segmap_nested_task_228735_start;
        
        ctx->futhark_mc_segmap_nested_task_228735_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228735_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228735_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228777 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    unsigned char *free_mem_212166;
    unsigned char *free_mem_212171;
};
struct futhark_mc_segmap_parloop_struct_228779 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    unsigned char *free_mem_212166;
    unsigned char *free_mem_212171;
};
static int futhark_mc_segmap_parloop_228780(void *args, int64_t start,
                                            int64_t end, int flat_tid_203872,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228779
    *futhark_mc_segmap_parloop_struct_228779 =
    (struct futhark_mc_segmap_parloop_struct_228779 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228779->ctx;
    uint64_t futhark_mc_segmap_parloop_228780_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228780_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228779->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228779->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228779->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228779->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228779->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228779->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228779->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228779->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 =
            futhark_mc_segmap_parloop_struct_228779->free_bytes_211839;
    struct memblock mem_212166 = {.desc ="mem_212166", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_212166,
                                  .size =0, .references =NULL};
    struct memblock mem_212171 = {.desc ="mem_212171", .mem =
                                  futhark_mc_segmap_parloop_struct_228779->free_mem_212171,
                                  .size =0, .references =NULL};
    size_t mem_212017_cached_sizze_228781 = 0;
    unsigned char *mem_212017 = NULL;
    size_t mem_212021_cached_sizze_228782 = 0;
    unsigned char *mem_212021 = NULL;
    size_t mem_212066_cached_sizze_228783 = 0;
    unsigned char *mem_212066 = NULL;
    size_t mem_212069_cached_sizze_228784 = 0;
    unsigned char *mem_212069 = NULL;
    size_t mem_212096_cached_sizze_228785 = 0;
    unsigned char *mem_212096 = NULL;
    size_t mem_212099_cached_sizze_228786 = 0;
    unsigned char *mem_212099 = NULL;
    int64_t iterations = end - start;
    int64_t iter_220157 = start;
    
    if (mem_212017_cached_sizze_228781 < (size_t) bytes_210655) {
        mem_212017 = realloc(mem_212017, bytes_210655);
        mem_212017_cached_sizze_228781 = bytes_210655;
    }
    if (mem_212021_cached_sizze_228782 < (size_t) bytes_210655) {
        mem_212021 = realloc(mem_212021, bytes_210655);
        mem_212021_cached_sizze_228782 = bytes_210655;
    }
    if (mem_212066_cached_sizze_228783 < (size_t) bytes_211839) {
        mem_212066 = realloc(mem_212066, bytes_211839);
        mem_212066_cached_sizze_228783 = bytes_211839;
    }
    if (mem_212069_cached_sizze_228784 < (size_t) bytes_211839) {
        mem_212069 = realloc(mem_212069, bytes_211839);
        mem_212069_cached_sizze_228784 = bytes_211839;
    }
    if (mem_212096_cached_sizze_228785 < (size_t) bytes_211839) {
        mem_212096 = realloc(mem_212096, bytes_211839);
        mem_212096_cached_sizze_228785 = bytes_211839;
    }
    if (mem_212099_cached_sizze_228786 < (size_t) bytes_211839) {
        mem_212099 = realloc(mem_212099, bytes_211839);
        mem_212099_cached_sizze_228786 = bytes_211839;
    }
    for (; iter_220157 < end; iter_220157++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_220289 = m_196691;
        int64_t gtid_203873 = iter_220157;
        int64_t remnant_220290 = iter_220157 - gtid_203873;
        
        for (int64_t i_220158 = 0; i_220158 < n_p_196694; i_220158++) {
            int64_t x_220161;
            
            x_220161 = ((int64_t *) mem_210594.mem)[gtid_203873 * n_p_196694 +
                                                    i_220158];
            for (int64_t i_220164 = 0; i_220164 < s_n_m_196745; i_220164++) {
                int64_t x_220167;
                
                x_220167 = ((int64_t *) mem_210764.mem)[gtid_203873 *
                                                        (s_n_m_196745 *
                                                         n_p_196694) +
                                                        i_220158 *
                                                        s_n_m_196745 +
                                                        i_220164];
                
                float x_220168;
                
                x_220168 = ((float *) mem_210769.mem)[gtid_203873 *
                                                      (s_n_m_196745 *
                                                       n_p_196694) + i_220158 *
                                                      s_n_m_196745 + i_220164];
                
                bool cond_220169 = i_220164 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_220170;
                
                if (cond_220169) {
                    defunc_0_m_fun_res_220170 = (int64_t) 0;
                } else {
                    int64_t y_220171 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_220172 = i_220164 == y_220171;
                    int64_t defunc_0_m_fun_res_f_res_220173;
                    
                    if (cond_220172) {
                        int64_t defunc_0_m_fun_res_f_res_t_res_220174 =
                                sub64(pad_css_len_196741, (int64_t) 1);
                        
                        defunc_0_m_fun_res_f_res_220173 =
                            defunc_0_m_fun_res_f_res_t_res_220174;
                    } else {
                        int64_t x_220175 = sub64(i_220164, (int64_t) 1);
                        int64_t x_220176 = mul64(jump_s_196701, x_220175);
                        int64_t min_arg_220177 = add64((int64_t) 1, x_220176);
                        int64_t min_res_220178 = smin64(defunc_0_f_res_196740,
                                                        min_arg_220177);
                        
                        defunc_0_m_fun_res_f_res_220173 = min_res_220178;
                    }
                    defunc_0_m_fun_res_220170 = defunc_0_m_fun_res_f_res_220173;
                }
                for (int64_t i_220183 = 0; i_220183 < q_s_196695; i_220183++) {
                    bool cond_220186 = sle64(x_220161, i_220183);
                    int64_t defunc_0_f_res_220187;
                    
                    if (cond_220186) {
                        defunc_0_f_res_220187 = (int64_t) 0;
                    } else {
                        int64_t i_220188 = add64(x_220167, i_220183);
                        int64_t defunc_0_add_arg_220189;
                        
                        defunc_0_add_arg_220189 =
                            ((int64_t *) mem_210590.mem)[gtid_203873 *
                                                         (defunc_0_f_res_196740 *
                                                          n_p_196694) +
                                                         i_220158 *
                                                         defunc_0_f_res_196740 +
                                                         i_220188];
                        
                        int64_t defunc_1_add_res_220190 = add64((int64_t) 1,
                                                                defunc_0_add_arg_220189);
                        
                        defunc_0_f_res_220187 = defunc_1_add_res_220190;
                    }
                    
                    float defunc_0_f_res_220191;
                    
                    if (cond_220186) {
                        defunc_0_f_res_220191 = 0.0F;
                    } else {
                        int64_t i_220192 = add64(x_220167, i_220183);
                        float defunc_0_add_arg_220193;
                        
                        defunc_0_add_arg_220193 =
                            ((float *) mem_211111.mem)[gtid_203873 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_220158 *
                                                       defunc_0_f_res_196740 +
                                                       i_220192];
                        defunc_0_f_res_220191 = defunc_0_add_arg_220193;
                    }
                    
                    int64_t binop_p_220194 = sub64(defunc_0_f_res_220187,
                                                   defunc_0_m_fun_res_220170);
                    float defunc_0_f_res_220195 =
                          sitofp_i64_f32(binop_p_220194);
                    float abs_res_220196 = (float) fabs(defunc_0_f_res_220195);
                    float tmp1_220197 = abs_res_220196 / x_220168;
                    float x_220198 = tmp1_220197 * tmp1_220197;
                    float y_220199 = tmp1_220197 * x_220198;
                    float tmp2_220200 = 1.0F - y_220199;
                    float x_220201 = tmp2_220200 * tmp2_220200;
                    float tmp3_220202 = tmp2_220200 * x_220201;
                    float tmp4_220203 = defunc_0_f_res_220191 * tmp3_220202;
                    
                    ((float *) mem_212066)[i_220183] = defunc_0_f_res_220195;
                    ((float *) mem_212069)[i_220183] = tmp4_220203;
                }
                
                float defunc_2_reduce_res_220208;
                float defunc_2_reduce_res_220209;
                float defunc_2_reduce_res_220210;
                float defunc_2_reduce_res_220211;
                float defunc_2_reduce_res_220212;
                float redout_220216;
                float redout_220217;
                float redout_220218;
                float redout_220219;
                float redout_220220;
                
                redout_220216 = 0.0F;
                redout_220217 = 0.0F;
                redout_220218 = 0.0F;
                redout_220219 = 0.0F;
                redout_220220 = 0.0F;
                for (int64_t i_220215 = 0; i_220215 < q_s_196695; i_220215++) {
                    float x_220223;
                    
                    x_220223 = ((float *) mem_212066)[i_220215];
                    
                    float x_220224;
                    
                    x_220224 = ((float *) mem_212069)[i_220215];
                    
                    float defunc_1_f_res_220225 = x_220223 * x_220224;
                    float defunc_1_f_res_220226 = x_220223 *
                          defunc_1_f_res_220225;
                    float defunc_1_f_res_220227 = x_220223 *
                          defunc_1_f_res_220226;
                    float defunc_1_f_res_220228 = x_220223 *
                          defunc_1_f_res_220227;
                    float defunc_1_op_res_220229 = x_220224 + redout_220216;
                    float defunc_1_op_res_220230 = defunc_1_f_res_220225 +
                          redout_220217;
                    float defunc_1_op_res_220231 = defunc_1_f_res_220226 +
                          redout_220218;
                    float defunc_1_op_res_220232 = defunc_1_f_res_220227 +
                          redout_220219;
                    float defunc_1_op_res_220233 = defunc_1_f_res_220228 +
                          redout_220220;
                    
                    ((float *) mem_212096)[i_220215] = defunc_1_f_res_220226;
                    ((float *) mem_212099)[i_220215] = defunc_1_f_res_220225;
                    
                    float redout_tmp_220297 = defunc_1_op_res_220229;
                    float redout_tmp_220298 = defunc_1_op_res_220230;
                    float redout_tmp_220299 = defunc_1_op_res_220231;
                    float redout_tmp_220300 = defunc_1_op_res_220232;
                    float redout_tmp_220301 = defunc_1_op_res_220233;
                    
                    redout_220216 = redout_tmp_220297;
                    redout_220217 = redout_tmp_220298;
                    redout_220218 = redout_tmp_220299;
                    redout_220219 = redout_tmp_220300;
                    redout_220220 = redout_tmp_220301;
                }
                defunc_2_reduce_res_220208 = redout_220216;
                defunc_2_reduce_res_220209 = redout_220217;
                defunc_2_reduce_res_220210 = redout_220218;
                defunc_2_reduce_res_220211 = redout_220219;
                defunc_2_reduce_res_220212 = redout_220220;
                
                float x_220236 = defunc_2_reduce_res_220210 *
                      defunc_2_reduce_res_220212;
                float y_220237 = defunc_2_reduce_res_220211 *
                      defunc_2_reduce_res_220211;
                float a12_220238 = x_220236 - y_220237;
                float x_220239 = defunc_2_reduce_res_220210 *
                      defunc_2_reduce_res_220211;
                float y_220240 = defunc_2_reduce_res_220209 *
                      defunc_2_reduce_res_220212;
                float b12_220241 = x_220239 - y_220240;
                float x_220242 = defunc_2_reduce_res_220209 *
                      defunc_2_reduce_res_220211;
                float y_220243 = defunc_2_reduce_res_220210 *
                      defunc_2_reduce_res_220210;
                float c12_220244 = x_220242 - y_220243;
                float x_220245 = defunc_2_reduce_res_220208 *
                      defunc_2_reduce_res_220212;
                float b2_220246 = x_220245 - y_220243;
                float x_220247 = defunc_2_reduce_res_220209 *
                      defunc_2_reduce_res_220210;
                float y_220248 = defunc_2_reduce_res_220208 *
                      defunc_2_reduce_res_220211;
                float c2_220249 = x_220247 - y_220248;
                float x_220250 = defunc_2_reduce_res_220208 * a12_220238;
                float y_220251 = defunc_2_reduce_res_220209 * b12_220241;
                float x_220252 = x_220250 + y_220251;
                float y_220253 = defunc_2_reduce_res_220210 * c12_220244;
                float y_220254 = x_220252 + y_220253;
                float det_220255 = 1.0F / y_220254;
                float a12_220256 = a12_220238 * det_220255;
                float b12_220257 = b12_220241 * det_220255;
                float c12_220258 = c12_220244 * det_220255;
                float b2_220259 = b2_220246 * det_220255;
                float c2_220260 = c2_220249 * det_220255;
                float defunc_2_reduce_res_220261;
                float defunc_2_reduce_res_220262;
                float redout_220264;
                float redout_220265;
                
                redout_220264 = 0.0F;
                redout_220265 = 0.0F;
                for (int64_t i_220263 = 0; i_220263 < q_s_196695; i_220263++) {
                    float x_220266;
                    
                    x_220266 = ((float *) mem_212069)[i_220263];
                    
                    float x_220267;
                    
                    x_220267 = ((float *) mem_212099)[i_220263];
                    
                    float x_220268;
                    
                    x_220268 = ((float *) mem_212096)[i_220263];
                    
                    bool cond_220269 = sle64(x_220161, i_220263);
                    float defunc_0_f_res_220270;
                    
                    if (cond_220269) {
                        defunc_0_f_res_220270 = 0.0F;
                    } else {
                        int64_t i_220271 = add64(x_220167, i_220263);
                        float defunc_0_add_arg_220272;
                        
                        defunc_0_add_arg_220272 =
                            ((float *) mem_211106.mem)[gtid_203873 *
                                                       (defunc_0_f_res_196740 *
                                                        n_p_196694) + i_220158 *
                                                       defunc_0_f_res_196740 +
                                                       i_220271];
                        defunc_0_f_res_220270 = defunc_0_add_arg_220272;
                    }
                    
                    float x_220273 = a12_220256 * x_220266;
                    float y_220274 = b12_220257 * x_220267;
                    float x_220275 = x_220273 + y_220274;
                    float y_220276 = c12_220258 * x_220268;
                    float x_220277 = x_220275 + y_220276;
                    float defunc_9_fit_fun_res_220278 = defunc_0_f_res_220270 *
                          x_220277;
                    float x_220279 = b12_220257 * x_220266;
                    float y_220280 = b2_220259 * x_220267;
                    float x_220281 = x_220279 + y_220280;
                    float y_220282 = c2_220260 * x_220268;
                    float x_220283 = x_220281 + y_220282;
                    float defunc_9_slope_fun_res_220284 =
                          defunc_0_f_res_220270 * x_220283;
                    float defunc_1_op_res_220285 = defunc_9_fit_fun_res_220278 +
                          redout_220264;
                    float defunc_1_op_res_220286 =
                          defunc_9_slope_fun_res_220284 + redout_220265;
                    float redout_tmp_220304 = defunc_1_op_res_220285;
                    float redout_tmp_220305 = defunc_1_op_res_220286;
                    
                    redout_220264 = redout_tmp_220304;
                    redout_220265 = redout_tmp_220305;
                }
                defunc_2_reduce_res_220261 = redout_220264;
                defunc_2_reduce_res_220262 = redout_220265;
                ((float *) mem_212017)[i_220158 * s_n_m_196745 + i_220164] =
                    defunc_2_reduce_res_220261;
                ((float *) mem_212021)[i_220158 * s_n_m_196745 + i_220164] =
                    defunc_2_reduce_res_220262;
            }
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212166.mem + gtid_203873 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_212017 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212171.mem + gtid_203873 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_212021 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212017);
    free(mem_212021);
    free(mem_212066);
    free(mem_212069);
    free(mem_212096);
    free(mem_212099);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228780_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228780_end -
                 futhark_mc_segmap_parloop_228780_start;
        
        ctx->futhark_mc_segmap_parloop_228780_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228780_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228780_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228778(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_203872 = tid;
    int num_tasks_220156 = info.nsubtasks;
    struct futhark_mc_task_228777 *futhark_mc_task_228777 =
                                  (struct futhark_mc_task_228777 *) args;
    struct futhark_context *ctx = futhark_mc_task_228777->ctx;
    uint64_t futhark_mc_segmap_task_228778_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228778_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228777->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228777->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228777->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228777->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228777->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228777->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228777->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228777->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228777->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228777->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228777->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228777->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228777->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228777->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228777->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 = futhark_mc_task_228777->free_bytes_211839;
    struct memblock mem_212166 = {.desc ="mem_212166", .mem =
                                  futhark_mc_task_228777->free_mem_212166,
                                  .size =0, .references =NULL};
    struct memblock mem_212171 = {.desc ="mem_212171", .mem =
                                  futhark_mc_task_228777->free_mem_212171,
                                  .size =0, .references =NULL};
    int64_t iter_220157;
    struct futhark_mc_segmap_parloop_struct_228779
    futhark_mc_segmap_parloop_struct_228779;
    
    futhark_mc_segmap_parloop_struct_228779.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228779.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228779.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228779.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228779.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228779.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228779.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228779.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228779.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228779.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228779.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228779.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228779.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228779.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228779.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228779.free_bytes_211839 = bytes_211839;
    futhark_mc_segmap_parloop_struct_228779.free_mem_212166 = mem_212166.mem;
    futhark_mc_segmap_parloop_struct_228779.free_mem_212171 = mem_212171.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228780_task;
    
    futhark_mc_segmap_parloop_228780_task.name =
        "futhark_mc_segmap_parloop_228780";
    futhark_mc_segmap_parloop_228780_task.fn = futhark_mc_segmap_parloop_228780;
    futhark_mc_segmap_parloop_228780_task.args =
        &futhark_mc_segmap_parloop_struct_228779;
    futhark_mc_segmap_parloop_228780_task.iterations = iterations;
    futhark_mc_segmap_parloop_228780_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228780_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228780_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228780_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228780_task);
    
    if (futhark_mc_segmap_parloop_228780_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228780_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228780_total_end -
                 futhark_mc_segmap_parloop_228780_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228780_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228780_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228780_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228778_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228778_end -
                 futhark_mc_segmap_task_228778_start;
        
        ctx->futhark_mc_segmap_task_228778_runs[tid]++;
        ctx->futhark_mc_segmap_task_228778_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228778_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228788 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    int64_t free_bytes_210655;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    unsigned char *free_mem_212166;
    unsigned char *free_mem_212171;
};
struct futhark_mc_task_228792 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    unsigned char *free_mem_212009;
    unsigned char *free_mem_212013;
};
struct futhark_mc_segmap_parloop_struct_228794 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    unsigned char *free_mem_212009;
    unsigned char *free_mem_212013;
};
static int futhark_mc_segmap_parloop_228795(void *args, int64_t start,
                                            int64_t end, int flat_tid_220564,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228794
    *futhark_mc_segmap_parloop_struct_228794 =
    (struct futhark_mc_segmap_parloop_struct_228794 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228794->ctx;
    uint64_t futhark_mc_segmap_parloop_228795_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228795_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228794->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228794->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228794->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228794->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228794->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228794->free_s_n_m_196745;
    int64_t gtid_204264 =
            futhark_mc_segmap_parloop_struct_228794->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228794->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 =
            futhark_mc_segmap_parloop_struct_228794->free_bytes_211839;
    struct memblock mem_212009 = {.desc ="mem_212009", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_212009,
                                  .size =0, .references =NULL};
    struct memblock mem_212013 = {.desc ="mem_212013", .mem =
                                  futhark_mc_segmap_parloop_struct_228794->free_mem_212013,
                                  .size =0, .references =NULL};
    size_t mem_220567_cached_sizze_228796 = 0;
    unsigned char *mem_220567 = NULL;
    size_t mem_220569_cached_sizze_228797 = 0;
    unsigned char *mem_220569 = NULL;
    size_t mem_220571_cached_sizze_228798 = 0;
    unsigned char *mem_220571 = NULL;
    size_t mem_220572_cached_sizze_228799 = 0;
    unsigned char *mem_220572 = NULL;
    size_t mem_220573_cached_sizze_228800 = 0;
    unsigned char *mem_220573 = NULL;
    size_t mem_220574_cached_sizze_228801 = 0;
    unsigned char *mem_220574 = NULL;
    int64_t iterations = end - start;
    int64_t iter_220705 = start;
    
    if (mem_220567_cached_sizze_228796 < (size_t) bytes_210599) {
        mem_220567 = realloc(mem_220567, bytes_210599);
        mem_220567_cached_sizze_228796 = bytes_210599;
    }
    if (mem_220569_cached_sizze_228797 < (size_t) bytes_210599) {
        mem_220569 = realloc(mem_220569, bytes_210599);
        mem_220569_cached_sizze_228797 = bytes_210599;
    }
    if (mem_220571_cached_sizze_228798 < (size_t) bytes_211839) {
        mem_220571 = realloc(mem_220571, bytes_211839);
        mem_220571_cached_sizze_228798 = bytes_211839;
    }
    if (mem_220572_cached_sizze_228799 < (size_t) bytes_211839) {
        mem_220572 = realloc(mem_220572, bytes_211839);
        mem_220572_cached_sizze_228799 = bytes_211839;
    }
    if (mem_220573_cached_sizze_228800 < (size_t) bytes_211839) {
        mem_220573 = realloc(mem_220573, bytes_211839);
        mem_220573_cached_sizze_228800 = bytes_211839;
    }
    if (mem_220574_cached_sizze_228801 < (size_t) bytes_211839) {
        mem_220574 = realloc(mem_220574, bytes_211839);
        mem_220574_cached_sizze_228801 = bytes_211839;
    }
    for (; iter_220705 < end; iter_220705++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_220831 = n_p_196694;
        int64_t gtid_220565 = iter_220705;
        int64_t remnant_220832 = iter_220705 - gtid_220565;
        int64_t x_220566;
        
        x_220566 = ((int64_t *) mem_210594.mem)[gtid_204264 * n_p_196694 +
                                                gtid_220565];
        for (int64_t i_220706 = 0; i_220706 < s_n_m_196745; i_220706++) {
            int64_t x_220709;
            
            x_220709 = ((int64_t *) mem_210764.mem)[gtid_204264 *
                                                    (s_n_m_196745 *
                                                     n_p_196694) + gtid_220565 *
                                                    s_n_m_196745 + i_220706];
            
            float x_220710;
            
            x_220710 = ((float *) mem_210769.mem)[gtid_204264 * (s_n_m_196745 *
                                                                 n_p_196694) +
                                                  gtid_220565 * s_n_m_196745 +
                                                  i_220706];
            
            bool cond_220711 = i_220706 == (int64_t) 0;
            int64_t defunc_0_m_fun_res_220712;
            
            if (cond_220711) {
                defunc_0_m_fun_res_220712 = (int64_t) 0;
            } else {
                int64_t y_220713 = sub64(s_n_m_196745, (int64_t) 1);
                bool cond_220714 = i_220706 == y_220713;
                int64_t defunc_0_m_fun_res_f_res_220715;
                
                if (cond_220714) {
                    int64_t defunc_0_m_fun_res_f_res_t_res_220716 =
                            sub64(pad_css_len_196741, (int64_t) 1);
                    
                    defunc_0_m_fun_res_f_res_220715 =
                        defunc_0_m_fun_res_f_res_t_res_220716;
                } else {
                    int64_t x_220717 = sub64(i_220706, (int64_t) 1);
                    int64_t x_220718 = mul64(jump_s_196701, x_220717);
                    int64_t min_arg_220719 = add64((int64_t) 1, x_220718);
                    int64_t min_res_220720 = smin64(defunc_0_f_res_196740,
                                                    min_arg_220719);
                    
                    defunc_0_m_fun_res_f_res_220715 = min_res_220720;
                }
                defunc_0_m_fun_res_220712 = defunc_0_m_fun_res_f_res_220715;
            }
            for (int64_t i_220725 = 0; i_220725 < q_s_196695; i_220725++) {
                bool cond_220728 = sle64(x_220566, i_220725);
                int64_t defunc_0_f_res_220729;
                
                if (cond_220728) {
                    defunc_0_f_res_220729 = (int64_t) 0;
                } else {
                    int64_t i_220730 = add64(x_220709, i_220725);
                    int64_t defunc_0_add_arg_220731;
                    
                    defunc_0_add_arg_220731 =
                        ((int64_t *) mem_210590.mem)[gtid_204264 *
                                                     (defunc_0_f_res_196740 *
                                                      n_p_196694) +
                                                     gtid_220565 *
                                                     defunc_0_f_res_196740 +
                                                     i_220730];
                    
                    int64_t defunc_1_add_res_220732 = add64((int64_t) 1,
                                                            defunc_0_add_arg_220731);
                    
                    defunc_0_f_res_220729 = defunc_1_add_res_220732;
                }
                
                float defunc_0_f_res_220733;
                
                if (cond_220728) {
                    defunc_0_f_res_220733 = 0.0F;
                } else {
                    int64_t i_220734 = add64(x_220709, i_220725);
                    float defunc_0_add_arg_220735;
                    
                    defunc_0_add_arg_220735 =
                        ((float *) mem_211111.mem)[gtid_204264 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_220565 *
                                                   defunc_0_f_res_196740 +
                                                   i_220734];
                    defunc_0_f_res_220733 = defunc_0_add_arg_220735;
                }
                
                int64_t binop_p_220736 = sub64(defunc_0_f_res_220729,
                                               defunc_0_m_fun_res_220712);
                float defunc_0_f_res_220737 = sitofp_i64_f32(binop_p_220736);
                float abs_res_220738 = (float) fabs(defunc_0_f_res_220737);
                float tmp1_220739 = abs_res_220738 / x_220710;
                float x_220740 = tmp1_220739 * tmp1_220739;
                float y_220741 = tmp1_220739 * x_220740;
                float tmp2_220742 = 1.0F - y_220741;
                float x_220743 = tmp2_220742 * tmp2_220742;
                float tmp3_220744 = tmp2_220742 * x_220743;
                float tmp4_220745 = defunc_0_f_res_220733 * tmp3_220744;
                
                ((float *) mem_220571)[i_220725] = defunc_0_f_res_220737;
                ((float *) mem_220572)[i_220725] = tmp4_220745;
            }
            
            float defunc_2_reduce_res_220750;
            float defunc_2_reduce_res_220751;
            float defunc_2_reduce_res_220752;
            float defunc_2_reduce_res_220753;
            float defunc_2_reduce_res_220754;
            float redout_220758;
            float redout_220759;
            float redout_220760;
            float redout_220761;
            float redout_220762;
            
            redout_220758 = 0.0F;
            redout_220759 = 0.0F;
            redout_220760 = 0.0F;
            redout_220761 = 0.0F;
            redout_220762 = 0.0F;
            for (int64_t i_220757 = 0; i_220757 < q_s_196695; i_220757++) {
                float x_220765;
                
                x_220765 = ((float *) mem_220571)[i_220757];
                
                float x_220766;
                
                x_220766 = ((float *) mem_220572)[i_220757];
                
                float defunc_1_f_res_220767 = x_220765 * x_220766;
                float defunc_1_f_res_220768 = x_220765 * defunc_1_f_res_220767;
                float defunc_1_f_res_220769 = x_220765 * defunc_1_f_res_220768;
                float defunc_1_f_res_220770 = x_220765 * defunc_1_f_res_220769;
                float defunc_1_op_res_220771 = x_220766 + redout_220758;
                float defunc_1_op_res_220772 = defunc_1_f_res_220767 +
                      redout_220759;
                float defunc_1_op_res_220773 = defunc_1_f_res_220768 +
                      redout_220760;
                float defunc_1_op_res_220774 = defunc_1_f_res_220769 +
                      redout_220761;
                float defunc_1_op_res_220775 = defunc_1_f_res_220770 +
                      redout_220762;
                
                ((float *) mem_220573)[i_220757] = defunc_1_f_res_220768;
                ((float *) mem_220574)[i_220757] = defunc_1_f_res_220767;
                
                float redout_tmp_220837 = defunc_1_op_res_220771;
                float redout_tmp_220838 = defunc_1_op_res_220772;
                float redout_tmp_220839 = defunc_1_op_res_220773;
                float redout_tmp_220840 = defunc_1_op_res_220774;
                float redout_tmp_220841 = defunc_1_op_res_220775;
                
                redout_220758 = redout_tmp_220837;
                redout_220759 = redout_tmp_220838;
                redout_220760 = redout_tmp_220839;
                redout_220761 = redout_tmp_220840;
                redout_220762 = redout_tmp_220841;
            }
            defunc_2_reduce_res_220750 = redout_220758;
            defunc_2_reduce_res_220751 = redout_220759;
            defunc_2_reduce_res_220752 = redout_220760;
            defunc_2_reduce_res_220753 = redout_220761;
            defunc_2_reduce_res_220754 = redout_220762;
            
            float x_220778 = defunc_2_reduce_res_220752 *
                  defunc_2_reduce_res_220754;
            float y_220779 = defunc_2_reduce_res_220753 *
                  defunc_2_reduce_res_220753;
            float a12_220780 = x_220778 - y_220779;
            float x_220781 = defunc_2_reduce_res_220752 *
                  defunc_2_reduce_res_220753;
            float y_220782 = defunc_2_reduce_res_220751 *
                  defunc_2_reduce_res_220754;
            float b12_220783 = x_220781 - y_220782;
            float x_220784 = defunc_2_reduce_res_220751 *
                  defunc_2_reduce_res_220753;
            float y_220785 = defunc_2_reduce_res_220752 *
                  defunc_2_reduce_res_220752;
            float c12_220786 = x_220784 - y_220785;
            float x_220787 = defunc_2_reduce_res_220750 *
                  defunc_2_reduce_res_220754;
            float b2_220788 = x_220787 - y_220785;
            float x_220789 = defunc_2_reduce_res_220751 *
                  defunc_2_reduce_res_220752;
            float y_220790 = defunc_2_reduce_res_220750 *
                  defunc_2_reduce_res_220753;
            float c2_220791 = x_220789 - y_220790;
            float x_220792 = defunc_2_reduce_res_220750 * a12_220780;
            float y_220793 = defunc_2_reduce_res_220751 * b12_220783;
            float x_220794 = x_220792 + y_220793;
            float y_220795 = defunc_2_reduce_res_220752 * c12_220786;
            float y_220796 = x_220794 + y_220795;
            float det_220797 = 1.0F / y_220796;
            float a12_220798 = a12_220780 * det_220797;
            float b12_220799 = b12_220783 * det_220797;
            float c12_220800 = c12_220786 * det_220797;
            float b2_220801 = b2_220788 * det_220797;
            float c2_220802 = c2_220791 * det_220797;
            float defunc_2_reduce_res_220803;
            float defunc_2_reduce_res_220804;
            float redout_220806;
            float redout_220807;
            
            redout_220806 = 0.0F;
            redout_220807 = 0.0F;
            for (int64_t i_220805 = 0; i_220805 < q_s_196695; i_220805++) {
                float x_220808;
                
                x_220808 = ((float *) mem_220572)[i_220805];
                
                float x_220809;
                
                x_220809 = ((float *) mem_220574)[i_220805];
                
                float x_220810;
                
                x_220810 = ((float *) mem_220573)[i_220805];
                
                bool cond_220811 = sle64(x_220566, i_220805);
                float defunc_0_f_res_220812;
                
                if (cond_220811) {
                    defunc_0_f_res_220812 = 0.0F;
                } else {
                    int64_t i_220813 = add64(x_220709, i_220805);
                    float defunc_0_add_arg_220814;
                    
                    defunc_0_add_arg_220814 =
                        ((float *) mem_211106.mem)[gtid_204264 *
                                                   (defunc_0_f_res_196740 *
                                                    n_p_196694) + gtid_220565 *
                                                   defunc_0_f_res_196740 +
                                                   i_220813];
                    defunc_0_f_res_220812 = defunc_0_add_arg_220814;
                }
                
                float x_220815 = a12_220798 * x_220808;
                float y_220816 = b12_220799 * x_220809;
                float x_220817 = x_220815 + y_220816;
                float y_220818 = c12_220800 * x_220810;
                float x_220819 = x_220817 + y_220818;
                float defunc_9_fit_fun_res_220820 = defunc_0_f_res_220812 *
                      x_220819;
                float x_220821 = b12_220799 * x_220808;
                float y_220822 = b2_220801 * x_220809;
                float x_220823 = x_220821 + y_220822;
                float y_220824 = c2_220802 * x_220810;
                float x_220825 = x_220823 + y_220824;
                float defunc_9_slope_fun_res_220826 = defunc_0_f_res_220812 *
                      x_220825;
                float defunc_1_op_res_220827 = defunc_9_fit_fun_res_220820 +
                      redout_220806;
                float defunc_1_op_res_220828 = defunc_9_slope_fun_res_220826 +
                      redout_220807;
                float redout_tmp_220844 = defunc_1_op_res_220827;
                float redout_tmp_220845 = defunc_1_op_res_220828;
                
                redout_220806 = redout_tmp_220844;
                redout_220807 = redout_tmp_220845;
            }
            defunc_2_reduce_res_220803 = redout_220806;
            defunc_2_reduce_res_220804 = redout_220807;
            ((float *) mem_220567)[i_220706] = defunc_2_reduce_res_220803;
            ((float *) mem_220569)[i_220706] = defunc_2_reduce_res_220804;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212009.mem + gtid_220565 * s_n_m_196745 * (int64_t) 4,
                    mem_220567 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212013.mem + gtid_220565 * s_n_m_196745 * (int64_t) 4,
                    mem_220569 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_220567);
    free(mem_220569);
    free(mem_220571);
    free(mem_220572);
    free(mem_220573);
    free(mem_220574);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228795_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228795_end -
                 futhark_mc_segmap_parloop_228795_start;
        
        ctx->futhark_mc_segmap_parloop_228795_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228795_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228795_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228793(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_220564 = tid;
    int num_tasks_220704 = info.nsubtasks;
    struct futhark_mc_task_228792 *futhark_mc_task_228792 =
                                  (struct futhark_mc_task_228792 *) args;
    struct futhark_context *ctx = futhark_mc_task_228792->ctx;
    uint64_t futhark_mc_segmap_task_228793_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228793_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228792->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228792->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228792->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228792->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228792->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228792->free_s_n_m_196745;
    int64_t gtid_204264 = futhark_mc_task_228792->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228792->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228792->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228792->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228792->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228792->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228792->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228792->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 = futhark_mc_task_228792->free_bytes_211839;
    struct memblock mem_212009 = {.desc ="mem_212009", .mem =
                                  futhark_mc_task_228792->free_mem_212009,
                                  .size =0, .references =NULL};
    struct memblock mem_212013 = {.desc ="mem_212013", .mem =
                                  futhark_mc_task_228792->free_mem_212013,
                                  .size =0, .references =NULL};
    int64_t iter_220705;
    struct futhark_mc_segmap_parloop_struct_228794
    futhark_mc_segmap_parloop_struct_228794;
    
    futhark_mc_segmap_parloop_struct_228794.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228794.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228794.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228794.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228794.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228794.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228794.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228794.free_gtid_204264 = gtid_204264;
    futhark_mc_segmap_parloop_struct_228794.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228794.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228794.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228794.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228794.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228794.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228794.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228794.free_bytes_211839 = bytes_211839;
    futhark_mc_segmap_parloop_struct_228794.free_mem_212009 = mem_212009.mem;
    futhark_mc_segmap_parloop_struct_228794.free_mem_212013 = mem_212013.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228795_task;
    
    futhark_mc_segmap_parloop_228795_task.name =
        "futhark_mc_segmap_parloop_228795";
    futhark_mc_segmap_parloop_228795_task.fn = futhark_mc_segmap_parloop_228795;
    futhark_mc_segmap_parloop_228795_task.args =
        &futhark_mc_segmap_parloop_struct_228794;
    futhark_mc_segmap_parloop_228795_task.iterations = iterations;
    futhark_mc_segmap_parloop_228795_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228795_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228795_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228795_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228795_task);
    
    if (futhark_mc_segmap_parloop_228795_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228795_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228795_total_end -
                 futhark_mc_segmap_parloop_228795_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228795_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228795_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228795_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228793_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228793_end -
                 futhark_mc_segmap_task_228793_start;
        
        ctx->futhark_mc_segmap_task_228793_runs[tid]++;
        ctx->futhark_mc_segmap_task_228793_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228793_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228803 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210594;
    int64_t free_bytes_210599;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    unsigned char *free_mem_212009;
    unsigned char *free_mem_212013;
};
struct futhark_mc_task_228807 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    unsigned char *free_mem_220310;
    unsigned char *free_mem_220311;
};
struct futhark_mc_segmap_parloop_struct_228809 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    unsigned char *free_mem_220310;
    unsigned char *free_mem_220311;
};
static int futhark_mc_segmap_parloop_228810(void *args, int64_t start,
                                            int64_t end, int flat_tid_220971,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228809
    *futhark_mc_segmap_parloop_struct_228809 =
    (struct futhark_mc_segmap_parloop_struct_228809 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228809->ctx;
    uint64_t futhark_mc_segmap_parloop_228810_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228810_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228809->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228809->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228809->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228809->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228809->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228809->free_s_n_m_196745;
    int64_t gtid_204264 =
            futhark_mc_segmap_parloop_struct_228809->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 =
            futhark_mc_segmap_parloop_struct_228809->free_bytes_211839;
    int64_t gtid_220308 =
            futhark_mc_segmap_parloop_struct_228809->free_gtid_220308;
    int64_t x_220309 = futhark_mc_segmap_parloop_struct_228809->free_x_220309;
    struct memblock mem_220310 = {.desc ="mem_220310", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_220310,
                                  .size =0, .references =NULL};
    struct memblock mem_220311 = {.desc ="mem_220311", .mem =
                                  futhark_mc_segmap_parloop_struct_228809->free_mem_220311,
                                  .size =0, .references =NULL};
    size_t mem_220985_cached_sizze_228811 = 0;
    unsigned char *mem_220985 = NULL;
    size_t mem_220987_cached_sizze_228812 = 0;
    unsigned char *mem_220987 = NULL;
    size_t mem_221014_cached_sizze_228813 = 0;
    unsigned char *mem_221014 = NULL;
    size_t mem_221016_cached_sizze_228814 = 0;
    unsigned char *mem_221016 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221100 = start;
    
    if (mem_220985_cached_sizze_228811 < (size_t) bytes_211839) {
        mem_220985 = realloc(mem_220985, bytes_211839);
        mem_220985_cached_sizze_228811 = bytes_211839;
    }
    if (mem_220987_cached_sizze_228812 < (size_t) bytes_211839) {
        mem_220987 = realloc(mem_220987, bytes_211839);
        mem_220987_cached_sizze_228812 = bytes_211839;
    }
    if (mem_221014_cached_sizze_228813 < (size_t) bytes_211839) {
        mem_221014 = realloc(mem_221014, bytes_211839);
        mem_221014_cached_sizze_228813 = bytes_211839;
    }
    if (mem_221016_cached_sizze_228814 < (size_t) bytes_211839) {
        mem_221016 = realloc(mem_221016, bytes_211839);
        mem_221016_cached_sizze_228814 = bytes_211839;
    }
    for (; iter_221100 < end; iter_221100++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221177 = s_n_m_196745;
        int64_t gtid_220972 = iter_221100;
        int64_t remnant_221178 = iter_221100 - gtid_220972;
        int64_t x_220973;
        
        x_220973 = ((int64_t *) mem_210764.mem)[gtid_204264 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_220308 * s_n_m_196745 +
                                                gtid_220972];
        
        float x_220974;
        
        x_220974 = ((float *) mem_210769.mem)[gtid_204264 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_220308 * s_n_m_196745 +
                                              gtid_220972];
        
        bool cond_220975 = gtid_220972 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_220976;
        
        if (cond_220975) {
            defunc_0_m_fun_res_220976 = (int64_t) 0;
        } else {
            int64_t y_221101 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_221102 = gtid_220972 == y_221101;
            int64_t defunc_0_m_fun_res_f_res_221103;
            
            if (cond_221102) {
                int64_t defunc_0_m_fun_res_f_res_t_res_221104 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_221103 =
                    defunc_0_m_fun_res_f_res_t_res_221104;
            } else {
                int64_t x_221105 = sub64(gtid_220972, (int64_t) 1);
                int64_t x_221106 = mul64(jump_s_196701, x_221105);
                int64_t min_arg_221107 = add64((int64_t) 1, x_221106);
                int64_t min_res_221108 = smin64(defunc_0_f_res_196740,
                                                min_arg_221107);
                
                defunc_0_m_fun_res_f_res_221103 = min_res_221108;
            }
            defunc_0_m_fun_res_220976 = defunc_0_m_fun_res_f_res_221103;
        }
        for (int64_t i_221109 = 0; i_221109 < q_s_196695; i_221109++) {
            bool cond_221112 = sle64(x_220309, i_221109);
            int64_t defunc_0_f_res_221113;
            
            if (cond_221112) {
                defunc_0_f_res_221113 = (int64_t) 0;
            } else {
                int64_t i_221114 = add64(x_220973, i_221109);
                int64_t defunc_0_add_arg_221115;
                
                defunc_0_add_arg_221115 =
                    ((int64_t *) mem_210590.mem)[gtid_204264 *
                                                 (defunc_0_f_res_196740 *
                                                  n_p_196694) + gtid_220308 *
                                                 defunc_0_f_res_196740 +
                                                 i_221114];
                
                int64_t defunc_1_add_res_221116 = add64((int64_t) 1,
                                                        defunc_0_add_arg_221115);
                
                defunc_0_f_res_221113 = defunc_1_add_res_221116;
            }
            
            float defunc_0_f_res_221117;
            
            if (cond_221112) {
                defunc_0_f_res_221117 = 0.0F;
            } else {
                int64_t i_221118 = add64(x_220973, i_221109);
                float defunc_0_add_arg_221119;
                
                defunc_0_add_arg_221119 =
                    ((float *) mem_211111.mem)[gtid_204264 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_220308 *
                                               defunc_0_f_res_196740 +
                                               i_221118];
                defunc_0_f_res_221117 = defunc_0_add_arg_221119;
            }
            
            int64_t binop_p_221120 = sub64(defunc_0_f_res_221113,
                                           defunc_0_m_fun_res_220976);
            float defunc_0_f_res_221121 = sitofp_i64_f32(binop_p_221120);
            float abs_res_221122 = (float) fabs(defunc_0_f_res_221121);
            float tmp1_221123 = abs_res_221122 / x_220974;
            float x_221124 = tmp1_221123 * tmp1_221123;
            float y_221125 = tmp1_221123 * x_221124;
            float tmp2_221126 = 1.0F - y_221125;
            float x_221127 = tmp2_221126 * tmp2_221126;
            float tmp3_221128 = tmp2_221126 * x_221127;
            float tmp4_221129 = defunc_0_f_res_221117 * tmp3_221128;
            
            ((float *) mem_220985)[i_221109] = defunc_0_f_res_221121;
            ((float *) mem_220987)[i_221109] = tmp4_221129;
        }
        
        float defunc_2_reduce_res_221018;
        float defunc_2_reduce_res_221019;
        float defunc_2_reduce_res_221020;
        float defunc_2_reduce_res_221021;
        float defunc_2_reduce_res_221022;
        float redout_221133;
        float redout_221134;
        float redout_221135;
        float redout_221136;
        float redout_221137;
        
        redout_221133 = 0.0F;
        redout_221134 = 0.0F;
        redout_221135 = 0.0F;
        redout_221136 = 0.0F;
        redout_221137 = 0.0F;
        for (int64_t i_221132 = 0; i_221132 < q_s_196695; i_221132++) {
            float x_221140;
            
            x_221140 = ((float *) mem_220985)[i_221132];
            
            float x_221141;
            
            x_221141 = ((float *) mem_220987)[i_221132];
            
            float defunc_1_f_res_221142 = x_221140 * x_221141;
            float defunc_1_f_res_221143 = x_221140 * defunc_1_f_res_221142;
            float defunc_1_f_res_221144 = x_221140 * defunc_1_f_res_221143;
            float defunc_1_f_res_221145 = x_221140 * defunc_1_f_res_221144;
            float defunc_1_op_res_221146 = x_221141 + redout_221133;
            float defunc_1_op_res_221147 = defunc_1_f_res_221142 +
                  redout_221134;
            float defunc_1_op_res_221148 = defunc_1_f_res_221143 +
                  redout_221135;
            float defunc_1_op_res_221149 = defunc_1_f_res_221144 +
                  redout_221136;
            float defunc_1_op_res_221150 = defunc_1_f_res_221145 +
                  redout_221137;
            
            ((float *) mem_221014)[i_221132] = defunc_1_f_res_221143;
            ((float *) mem_221016)[i_221132] = defunc_1_f_res_221142;
            
            float redout_tmp_221181 = defunc_1_op_res_221146;
            float redout_tmp_221182 = defunc_1_op_res_221147;
            float redout_tmp_221183 = defunc_1_op_res_221148;
            float redout_tmp_221184 = defunc_1_op_res_221149;
            float redout_tmp_221185 = defunc_1_op_res_221150;
            
            redout_221133 = redout_tmp_221181;
            redout_221134 = redout_tmp_221182;
            redout_221135 = redout_tmp_221183;
            redout_221136 = redout_tmp_221184;
            redout_221137 = redout_tmp_221185;
        }
        defunc_2_reduce_res_221018 = redout_221133;
        defunc_2_reduce_res_221019 = redout_221134;
        defunc_2_reduce_res_221020 = redout_221135;
        defunc_2_reduce_res_221021 = redout_221136;
        defunc_2_reduce_res_221022 = redout_221137;
        
        float x_221046 = defunc_2_reduce_res_221020 *
              defunc_2_reduce_res_221022;
        float y_221047 = defunc_2_reduce_res_221021 *
              defunc_2_reduce_res_221021;
        float a12_221048 = x_221046 - y_221047;
        float x_221049 = defunc_2_reduce_res_221020 *
              defunc_2_reduce_res_221021;
        float y_221050 = defunc_2_reduce_res_221019 *
              defunc_2_reduce_res_221022;
        float b12_221051 = x_221049 - y_221050;
        float x_221052 = defunc_2_reduce_res_221019 *
              defunc_2_reduce_res_221021;
        float y_221053 = defunc_2_reduce_res_221020 *
              defunc_2_reduce_res_221020;
        float c12_221054 = x_221052 - y_221053;
        float x_221055 = defunc_2_reduce_res_221018 *
              defunc_2_reduce_res_221022;
        float b2_221056 = x_221055 - y_221053;
        float x_221057 = defunc_2_reduce_res_221019 *
              defunc_2_reduce_res_221020;
        float y_221058 = defunc_2_reduce_res_221018 *
              defunc_2_reduce_res_221021;
        float c2_221059 = x_221057 - y_221058;
        float x_221060 = defunc_2_reduce_res_221018 * a12_221048;
        float y_221061 = defunc_2_reduce_res_221019 * b12_221051;
        float x_221062 = x_221060 + y_221061;
        float y_221063 = defunc_2_reduce_res_221020 * c12_221054;
        float y_221064 = x_221062 + y_221063;
        float det_221065 = 1.0F / y_221064;
        float a12_221066 = a12_221048 * det_221065;
        float b12_221067 = b12_221051 * det_221065;
        float c12_221068 = c12_221054 * det_221065;
        float b2_221069 = b2_221056 * det_221065;
        float c2_221070 = c2_221059 * det_221065;
        float defunc_2_reduce_res_221071;
        float defunc_2_reduce_res_221072;
        float redout_221154;
        float redout_221155;
        
        redout_221154 = 0.0F;
        redout_221155 = 0.0F;
        for (int64_t i_221153 = 0; i_221153 < q_s_196695; i_221153++) {
            float x_221156;
            
            x_221156 = ((float *) mem_220987)[i_221153];
            
            float x_221157;
            
            x_221157 = ((float *) mem_221016)[i_221153];
            
            float x_221158;
            
            x_221158 = ((float *) mem_221014)[i_221153];
            
            bool cond_221159 = sle64(x_220309, i_221153);
            float defunc_0_f_res_221160;
            
            if (cond_221159) {
                defunc_0_f_res_221160 = 0.0F;
            } else {
                int64_t i_221161 = add64(x_220973, i_221153);
                float defunc_0_add_arg_221162;
                
                defunc_0_add_arg_221162 =
                    ((float *) mem_211106.mem)[gtid_204264 *
                                               (defunc_0_f_res_196740 *
                                                n_p_196694) + gtid_220308 *
                                               defunc_0_f_res_196740 +
                                               i_221161];
                defunc_0_f_res_221160 = defunc_0_add_arg_221162;
            }
            
            float x_221163 = a12_221066 * x_221156;
            float y_221164 = b12_221067 * x_221157;
            float x_221165 = x_221163 + y_221164;
            float y_221166 = c12_221068 * x_221158;
            float x_221167 = x_221165 + y_221166;
            float defunc_9_fit_fun_res_221168 = defunc_0_f_res_221160 *
                  x_221167;
            float x_221169 = b12_221067 * x_221156;
            float y_221170 = b2_221069 * x_221157;
            float x_221171 = x_221169 + y_221170;
            float y_221172 = c2_221070 * x_221158;
            float x_221173 = x_221171 + y_221172;
            float defunc_9_slope_fun_res_221174 = defunc_0_f_res_221160 *
                  x_221173;
            float defunc_1_op_res_221175 = defunc_9_fit_fun_res_221168 +
                  redout_221154;
            float defunc_1_op_res_221176 = defunc_9_slope_fun_res_221174 +
                  redout_221155;
            float redout_tmp_221188 = defunc_1_op_res_221175;
            float redout_tmp_221189 = defunc_1_op_res_221176;
            
            redout_221154 = redout_tmp_221188;
            redout_221155 = redout_tmp_221189;
        }
        defunc_2_reduce_res_221071 = redout_221154;
        defunc_2_reduce_res_221072 = redout_221155;
        ((float *) mem_220310.mem)[gtid_220972] = defunc_2_reduce_res_221071;
        ((float *) mem_220311.mem)[gtid_220972] = defunc_2_reduce_res_221072;
    }
    
  cleanup:
    { }
    free(mem_220985);
    free(mem_220987);
    free(mem_221014);
    free(mem_221016);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228810_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228810_end -
                 futhark_mc_segmap_parloop_228810_start;
        
        ctx->futhark_mc_segmap_parloop_228810_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228810_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228810_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228808(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_220971 = tid;
    int num_tasks_221099 = info.nsubtasks;
    struct futhark_mc_task_228807 *futhark_mc_task_228807 =
                                  (struct futhark_mc_task_228807 *) args;
    struct futhark_context *ctx = futhark_mc_task_228807->ctx;
    uint64_t futhark_mc_segmap_task_228808_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228808_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228807->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228807->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228807->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228807->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228807->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228807->free_s_n_m_196745;
    int64_t gtid_204264 = futhark_mc_task_228807->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228807->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228807->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228807->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228807->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228807->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 = futhark_mc_task_228807->free_bytes_211839;
    int64_t gtid_220308 = futhark_mc_task_228807->free_gtid_220308;
    int64_t x_220309 = futhark_mc_task_228807->free_x_220309;
    struct memblock mem_220310 = {.desc ="mem_220310", .mem =
                                  futhark_mc_task_228807->free_mem_220310,
                                  .size =0, .references =NULL};
    struct memblock mem_220311 = {.desc ="mem_220311", .mem =
                                  futhark_mc_task_228807->free_mem_220311,
                                  .size =0, .references =NULL};
    int64_t iter_221100;
    struct futhark_mc_segmap_parloop_struct_228809
    futhark_mc_segmap_parloop_struct_228809;
    
    futhark_mc_segmap_parloop_struct_228809.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228809.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228809.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228809.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228809.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228809.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228809.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228809.free_gtid_204264 = gtid_204264;
    futhark_mc_segmap_parloop_struct_228809.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228809.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228809.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228809.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228809.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228809.free_bytes_211839 = bytes_211839;
    futhark_mc_segmap_parloop_struct_228809.free_gtid_220308 = gtid_220308;
    futhark_mc_segmap_parloop_struct_228809.free_x_220309 = x_220309;
    futhark_mc_segmap_parloop_struct_228809.free_mem_220310 = mem_220310.mem;
    futhark_mc_segmap_parloop_struct_228809.free_mem_220311 = mem_220311.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228810_task;
    
    futhark_mc_segmap_parloop_228810_task.name =
        "futhark_mc_segmap_parloop_228810";
    futhark_mc_segmap_parloop_228810_task.fn = futhark_mc_segmap_parloop_228810;
    futhark_mc_segmap_parloop_228810_task.args =
        &futhark_mc_segmap_parloop_struct_228809;
    futhark_mc_segmap_parloop_228810_task.iterations = iterations;
    futhark_mc_segmap_parloop_228810_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228810_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228810_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228810_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228810_task);
    
    if (futhark_mc_segmap_parloop_228810_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228810_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228810_total_end -
                 futhark_mc_segmap_parloop_228810_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228810_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228810_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228810_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228808_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228808_end -
                 futhark_mc_segmap_task_228808_start;
        
        ctx->futhark_mc_segmap_task_228808_runs[tid]++;
        ctx->futhark_mc_segmap_task_228808_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228808_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228816 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_210764;
    unsigned char *free_mem_210769;
    unsigned char *free_mem_211106;
    unsigned char *free_mem_211111;
    int64_t free_bytes_211839;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    unsigned char *free_mem_220310;
    unsigned char *free_mem_220311;
};
struct futhark_mc_task_228822 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    int64_t free_x_220849;
    float free_x_220850;
    int64_t free_defunc_0_m_fun_res_220852;
    unsigned char *free_mem_220861;
    unsigned char *free_mem_220862;
};
struct futhark_mc_segmap_parloop_struct_228824 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_q_s_196695;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_204264;
    unsigned char *free_mem_210590;
    unsigned char *free_mem_211111;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    int64_t free_x_220849;
    float free_x_220850;
    int64_t free_defunc_0_m_fun_res_220852;
    unsigned char *free_mem_220861;
    unsigned char *free_mem_220862;
};
static int futhark_mc_segmap_parloop_228825(void *args, int64_t start,
                                            int64_t end, int flat_tid_221199,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228824
    *futhark_mc_segmap_parloop_struct_228824 =
    (struct futhark_mc_segmap_parloop_struct_228824 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228824->ctx;
    uint64_t futhark_mc_segmap_parloop_228825_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228825_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228824->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228824->free_q_s_196695;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228824->free_defunc_0_f_res_196740;
    int64_t gtid_204264 =
            futhark_mc_segmap_parloop_struct_228824->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228824->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228824->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_220308 =
            futhark_mc_segmap_parloop_struct_228824->free_gtid_220308;
    int64_t x_220309 = futhark_mc_segmap_parloop_struct_228824->free_x_220309;
    int64_t x_220849 = futhark_mc_segmap_parloop_struct_228824->free_x_220849;
    float x_220850 = futhark_mc_segmap_parloop_struct_228824->free_x_220850;
    int64_t defunc_0_m_fun_res_220852 =
            futhark_mc_segmap_parloop_struct_228824->free_defunc_0_m_fun_res_220852;
    struct memblock mem_220861 = {.desc ="mem_220861", .mem =
                                  futhark_mc_segmap_parloop_struct_228824->free_mem_220861,
                                  .size =0, .references =NULL};
    struct memblock mem_220862 = {.desc ="mem_220862", .mem =
                                  futhark_mc_segmap_parloop_struct_228824->free_mem_220862,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221272 = start;
    
    for (; iter_221272 < end; iter_221272++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221278 = q_s_196695;
        int64_t gtid_221200 = iter_221272;
        int64_t remnant_221279 = iter_221272 - gtid_221200;
        bool cond_221201 = sle64(x_220309, gtid_221200);
        int64_t defunc_0_f_res_221202;
        
        if (cond_221201) {
            defunc_0_f_res_221202 = (int64_t) 0;
        } else {
            int64_t i_221273 = add64(x_220849, gtid_221200);
            int64_t defunc_0_add_arg_221274;
            
            defunc_0_add_arg_221274 = ((int64_t *) mem_210590.mem)[gtid_204264 *
                                                                   (defunc_0_f_res_196740 *
                                                                    n_p_196694) +
                                                                   gtid_220308 *
                                                                   defunc_0_f_res_196740 +
                                                                   i_221273];
            
            int64_t defunc_1_add_res_221275 = add64((int64_t) 1,
                                                    defunc_0_add_arg_221274);
            
            defunc_0_f_res_221202 = defunc_1_add_res_221275;
        }
        
        float defunc_0_f_res_221206;
        
        if (cond_221201) {
            defunc_0_f_res_221206 = 0.0F;
        } else {
            int64_t i_221276 = add64(x_220849, gtid_221200);
            float defunc_0_add_arg_221277;
            
            defunc_0_add_arg_221277 = ((float *) mem_211111.mem)[gtid_204264 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_220308 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_221276];
            defunc_0_f_res_221206 = defunc_0_add_arg_221277;
        }
        
        int64_t binop_p_221209 = sub64(defunc_0_f_res_221202,
                                       defunc_0_m_fun_res_220852);
        float defunc_0_f_res_221210 = sitofp_i64_f32(binop_p_221209);
        float abs_res_221211 = (float) fabs(defunc_0_f_res_221210);
        float tmp1_221212 = abs_res_221211 / x_220850;
        float x_221213 = tmp1_221212 * tmp1_221212;
        float y_221214 = tmp1_221212 * x_221213;
        float tmp2_221215 = 1.0F - y_221214;
        float x_221216 = tmp2_221215 * tmp2_221215;
        float tmp3_221217 = tmp2_221215 * x_221216;
        float tmp4_221218 = defunc_0_f_res_221206 * tmp3_221217;
        
        ((float *) mem_220861.mem)[gtid_221200] = defunc_0_f_res_221210;
        ((float *) mem_220862.mem)[gtid_221200] = tmp4_221218;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228825_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228825_end -
                 futhark_mc_segmap_parloop_228825_start;
        
        ctx->futhark_mc_segmap_parloop_228825_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228825_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228825_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228823(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221199 = tid;
    int num_tasks_221271 = info.nsubtasks;
    struct futhark_mc_task_228822 *futhark_mc_task_228822 =
                                  (struct futhark_mc_task_228822 *) args;
    struct futhark_context *ctx = futhark_mc_task_228822->ctx;
    uint64_t futhark_mc_segmap_task_228823_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228823_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228822->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228822->free_q_s_196695;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228822->free_defunc_0_f_res_196740;
    int64_t gtid_204264 = futhark_mc_task_228822->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228822->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228822->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t gtid_220308 = futhark_mc_task_228822->free_gtid_220308;
    int64_t x_220309 = futhark_mc_task_228822->free_x_220309;
    int64_t x_220849 = futhark_mc_task_228822->free_x_220849;
    float x_220850 = futhark_mc_task_228822->free_x_220850;
    int64_t defunc_0_m_fun_res_220852 =
            futhark_mc_task_228822->free_defunc_0_m_fun_res_220852;
    struct memblock mem_220861 = {.desc ="mem_220861", .mem =
                                  futhark_mc_task_228822->free_mem_220861,
                                  .size =0, .references =NULL};
    struct memblock mem_220862 = {.desc ="mem_220862", .mem =
                                  futhark_mc_task_228822->free_mem_220862,
                                  .size =0, .references =NULL};
    int64_t iter_221272;
    struct futhark_mc_segmap_parloop_struct_228824
    futhark_mc_segmap_parloop_struct_228824;
    
    futhark_mc_segmap_parloop_struct_228824.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228824.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228824.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228824.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228824.free_gtid_204264 = gtid_204264;
    futhark_mc_segmap_parloop_struct_228824.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228824.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228824.free_gtid_220308 = gtid_220308;
    futhark_mc_segmap_parloop_struct_228824.free_x_220309 = x_220309;
    futhark_mc_segmap_parloop_struct_228824.free_x_220849 = x_220849;
    futhark_mc_segmap_parloop_struct_228824.free_x_220850 = x_220850;
    futhark_mc_segmap_parloop_struct_228824.free_defunc_0_m_fun_res_220852 =
        defunc_0_m_fun_res_220852;
    futhark_mc_segmap_parloop_struct_228824.free_mem_220861 = mem_220861.mem;
    futhark_mc_segmap_parloop_struct_228824.free_mem_220862 = mem_220862.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228825_task;
    
    futhark_mc_segmap_parloop_228825_task.name =
        "futhark_mc_segmap_parloop_228825";
    futhark_mc_segmap_parloop_228825_task.fn = futhark_mc_segmap_parloop_228825;
    futhark_mc_segmap_parloop_228825_task.args =
        &futhark_mc_segmap_parloop_struct_228824;
    futhark_mc_segmap_parloop_228825_task.iterations = iterations;
    futhark_mc_segmap_parloop_228825_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228825_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228825_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228825_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228825_task);
    
    if (futhark_mc_segmap_parloop_228825_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228825_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228825_total_end -
                 futhark_mc_segmap_parloop_228825_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228825_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228825_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228825_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228823_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228823_end -
                 futhark_mc_segmap_task_228823_start;
        
        ctx->futhark_mc_segmap_task_228823_runs[tid]++;
        ctx->futhark_mc_segmap_task_228823_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228823_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228826 {
    struct futhark_context *ctx;
    unsigned char *free_mem_220861;
    unsigned char *free_mem_220862;
    float *retval_defunc_2_reduce_res_220887;
    float *retval_defunc_2_reduce_res_220888;
    float *retval_defunc_2_reduce_res_220889;
    float *retval_defunc_2_reduce_res_220890;
    float *retval_defunc_2_reduce_res_220891;
    unsigned char *retval_mem_220885;
    unsigned char *retval_mem_220886;
};
struct futhark_mc_segred_stage_1_parloop_struct_228833 {
    struct futhark_context *ctx;
    unsigned char *free_mem_220861;
    unsigned char *free_mem_220862;
    unsigned char *free_mem_220885;
    unsigned char *free_mem_220886;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221281;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221283;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221285;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221287;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221289;
};
static int futhark_mc_segred_stage_1_parloop_228834(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_221219,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228833
    *futhark_mc_segred_stage_1_parloop_struct_228833 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228833 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228833->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228834_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228834_start = get_wall_time();
    
    struct memblock mem_220861 = {.desc ="mem_220861", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228833->free_mem_220861,
                                  .size =0, .references =NULL};
    struct memblock mem_220862 = {.desc ="mem_220862", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228833->free_mem_220862,
                                  .size =0, .references =NULL};
    struct memblock mem_220885 = {.desc ="mem_220885", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228833->free_mem_220885,
                                  .size =0, .references =NULL};
    struct memblock mem_220886 = {.desc ="mem_220886", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228833->free_mem_220886,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221281 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221281",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228833->free_reduce_stage_1_tid_res_arr_mem_221281,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221283 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221283",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228833->free_reduce_stage_1_tid_res_arr_mem_221283,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221285 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221285",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228833->free_reduce_stage_1_tid_res_arr_mem_221285,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221287 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221287",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228833->free_reduce_stage_1_tid_res_arr_mem_221287,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221289 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221289",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228833->free_reduce_stage_1_tid_res_arr_mem_221289,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221291 = start;
    float x_221221;
    float x_221222;
    float x_221224;
    float x_221225;
    float x_221227;
    float x_221228;
    float x_221230;
    float x_221231;
    float x_221233;
    float x_221234;
    float local_acc_221292 = 0.0F;
    float local_acc_221293 = 0.0F;
    float local_acc_221294 = 0.0F;
    float local_acc_221295 = 0.0F;
    float local_acc_221296 = 0.0F;
    
    for (; iter_221291 < end; iter_221291++) {
        int64_t gtid_221220 = iter_221291;
        float x_221236;
        
        x_221236 = ((float *) mem_220861.mem)[gtid_221220];
        
        float x_221237;
        
        x_221237 = ((float *) mem_220862.mem)[gtid_221220];
        
        float defunc_1_f_res_221238 = x_221236 * x_221237;
        float defunc_1_f_res_221239 = x_221236 * defunc_1_f_res_221238;
        float defunc_1_f_res_221240 = x_221236 * defunc_1_f_res_221239;
        float defunc_1_f_res_221241 = x_221236 * defunc_1_f_res_221240;
        
        // save map-out results
        {
            ((float *) mem_220885.mem)[gtid_221220] = defunc_1_f_res_221239;
            ((float *) mem_220886.mem)[gtid_221220] = defunc_1_f_res_221238;
        }
        // Load accum params
        {
            x_221221 = local_acc_221292;
        }
        // Load next params
        {
            x_221222 = x_221237;
        }
        // Red body
        {
            float defunc_1_op_res_221223 = x_221221 + x_221222;
            
            local_acc_221292 = defunc_1_op_res_221223;
        }
        // Load accum params
        {
            x_221224 = local_acc_221293;
        }
        // Load next params
        {
            x_221225 = defunc_1_f_res_221238;
        }
        // Red body
        {
            float defunc_1_op_res_221226 = x_221224 + x_221225;
            
            local_acc_221293 = defunc_1_op_res_221226;
        }
        // Load accum params
        {
            x_221227 = local_acc_221294;
        }
        // Load next params
        {
            x_221228 = defunc_1_f_res_221239;
        }
        // Red body
        {
            float defunc_1_op_res_221229 = x_221227 + x_221228;
            
            local_acc_221294 = defunc_1_op_res_221229;
        }
        // Load accum params
        {
            x_221230 = local_acc_221295;
        }
        // Load next params
        {
            x_221231 = defunc_1_f_res_221240;
        }
        // Red body
        {
            float defunc_1_op_res_221232 = x_221230 + x_221231;
            
            local_acc_221295 = defunc_1_op_res_221232;
        }
        // Load accum params
        {
            x_221233 = local_acc_221296;
        }
        // Load next params
        {
            x_221234 = defunc_1_f_res_221241;
        }
        // Red body
        {
            float defunc_1_op_res_221235 = x_221233 + x_221234;
            
            local_acc_221296 = defunc_1_op_res_221235;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_221281.mem)[flat_tid_221219] =
        local_acc_221292;
    ((float *) reduce_stage_1_tid_res_arr_mem_221283.mem)[flat_tid_221219] =
        local_acc_221293;
    ((float *) reduce_stage_1_tid_res_arr_mem_221285.mem)[flat_tid_221219] =
        local_acc_221294;
    ((float *) reduce_stage_1_tid_res_arr_mem_221287.mem)[flat_tid_221219] =
        local_acc_221295;
    ((float *) reduce_stage_1_tid_res_arr_mem_221289.mem)[flat_tid_221219] =
        local_acc_221296;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228834_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228834_end -
                 futhark_mc_segred_stage_1_parloop_228834_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228834_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228834_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228834_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228827(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221219 = tid;
    int num_tasks_221280 = info.nsubtasks;
    struct futhark_mc_task_228826 *futhark_mc_task_228826 =
                                  (struct futhark_mc_task_228826 *) args;
    struct futhark_context *ctx = futhark_mc_task_228826->ctx;
    uint64_t futhark_mc_segred_task_228827_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228827_start = get_wall_time();
    
    struct memblock mem_220861 = {.desc ="mem_220861", .mem =
                                  futhark_mc_task_228826->free_mem_220861,
                                  .size =0, .references =NULL};
    struct memblock mem_220862 = {.desc ="mem_220862", .mem =
                                  futhark_mc_task_228826->free_mem_220862,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_220887 =
          *futhark_mc_task_228826->retval_defunc_2_reduce_res_220887;
    float defunc_2_reduce_res_220888 =
          *futhark_mc_task_228826->retval_defunc_2_reduce_res_220888;
    float defunc_2_reduce_res_220889 =
          *futhark_mc_task_228826->retval_defunc_2_reduce_res_220889;
    float defunc_2_reduce_res_220890 =
          *futhark_mc_task_228826->retval_defunc_2_reduce_res_220890;
    float defunc_2_reduce_res_220891 =
          *futhark_mc_task_228826->retval_defunc_2_reduce_res_220891;
    struct memblock mem_220885 = {.desc ="mem_220885", .mem =
                                  futhark_mc_task_228826->retval_mem_220885,
                                  .size =0, .references =NULL};
    struct memblock mem_220886 = {.desc ="mem_220886", .mem =
                                  futhark_mc_task_228826->retval_mem_220886,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_221281_cached_sizze_228828 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221281 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_221283_cached_sizze_228829 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221283 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_221285_cached_sizze_228830 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221285 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_221287_cached_sizze_228831 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221287 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_221289_cached_sizze_228832 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221289 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_221281_cached_sizze_228828 <
        (size_t) ((int64_t) 4 * num_tasks_221280)) {
        reduce_stage_1_tid_res_arr_mem_221281 =
            realloc(reduce_stage_1_tid_res_arr_mem_221281, (int64_t) 4 *
                    num_tasks_221280);
        reduce_stage_1_tid_res_arr_mem_221281_cached_sizze_228828 =
            (int64_t) 4 * num_tasks_221280;
    }
    if (reduce_stage_1_tid_res_arr_mem_221283_cached_sizze_228829 <
        (size_t) ((int64_t) 4 * num_tasks_221280)) {
        reduce_stage_1_tid_res_arr_mem_221283 =
            realloc(reduce_stage_1_tid_res_arr_mem_221283, (int64_t) 4 *
                    num_tasks_221280);
        reduce_stage_1_tid_res_arr_mem_221283_cached_sizze_228829 =
            (int64_t) 4 * num_tasks_221280;
    }
    if (reduce_stage_1_tid_res_arr_mem_221285_cached_sizze_228830 <
        (size_t) ((int64_t) 4 * num_tasks_221280)) {
        reduce_stage_1_tid_res_arr_mem_221285 =
            realloc(reduce_stage_1_tid_res_arr_mem_221285, (int64_t) 4 *
                    num_tasks_221280);
        reduce_stage_1_tid_res_arr_mem_221285_cached_sizze_228830 =
            (int64_t) 4 * num_tasks_221280;
    }
    if (reduce_stage_1_tid_res_arr_mem_221287_cached_sizze_228831 <
        (size_t) ((int64_t) 4 * num_tasks_221280)) {
        reduce_stage_1_tid_res_arr_mem_221287 =
            realloc(reduce_stage_1_tid_res_arr_mem_221287, (int64_t) 4 *
                    num_tasks_221280);
        reduce_stage_1_tid_res_arr_mem_221287_cached_sizze_228831 =
            (int64_t) 4 * num_tasks_221280;
    }
    if (reduce_stage_1_tid_res_arr_mem_221289_cached_sizze_228832 <
        (size_t) ((int64_t) 4 * num_tasks_221280)) {
        reduce_stage_1_tid_res_arr_mem_221289 =
            realloc(reduce_stage_1_tid_res_arr_mem_221289, (int64_t) 4 *
                    num_tasks_221280);
        reduce_stage_1_tid_res_arr_mem_221289_cached_sizze_228832 =
            (int64_t) 4 * num_tasks_221280;
    }
    
    int64_t iter_221291;
    struct futhark_mc_segred_stage_1_parloop_struct_228833
    futhark_mc_segred_stage_1_parloop_struct_228833;
    
    futhark_mc_segred_stage_1_parloop_struct_228833.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_mem_220861 =
        mem_220861.mem;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_mem_220862 =
        mem_220862.mem;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_mem_220885 =
        mem_220885.mem;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_mem_220886 =
        mem_220886.mem;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_reduce_stage_1_tid_res_arr_mem_221281 =
        reduce_stage_1_tid_res_arr_mem_221281;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_reduce_stage_1_tid_res_arr_mem_221283 =
        reduce_stage_1_tid_res_arr_mem_221283;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_reduce_stage_1_tid_res_arr_mem_221285 =
        reduce_stage_1_tid_res_arr_mem_221285;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_reduce_stage_1_tid_res_arr_mem_221287 =
        reduce_stage_1_tid_res_arr_mem_221287;
    futhark_mc_segred_stage_1_parloop_struct_228833.free_reduce_stage_1_tid_res_arr_mem_221289 =
        reduce_stage_1_tid_res_arr_mem_221289;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228834_task;
    
    futhark_mc_segred_stage_1_parloop_228834_task.name =
        "futhark_mc_segred_stage_1_parloop_228834";
    futhark_mc_segred_stage_1_parloop_228834_task.fn =
        futhark_mc_segred_stage_1_parloop_228834;
    futhark_mc_segred_stage_1_parloop_228834_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228833;
    futhark_mc_segred_stage_1_parloop_228834_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228834_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228834_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228834_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228834_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228834_task);
    
    if (futhark_mc_segred_stage_1_parloop_228834_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228834_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228834_total_end -
                 futhark_mc_segred_stage_1_parloop_228834_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228834_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228834_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228834_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_220887 = 0.0F;
        defunc_2_reduce_res_220888 = 0.0F;
        defunc_2_reduce_res_220889 = 0.0F;
        defunc_2_reduce_res_220890 = 0.0F;
        defunc_2_reduce_res_220891 = 0.0F;
    }
    
    float x_221297;
    float x_221298;
    float x_221300;
    float x_221301;
    float x_221303;
    float x_221304;
    float x_221306;
    float x_221307;
    float x_221309;
    float x_221310;
    
    for (int32_t i_221312 = 0; i_221312 < num_tasks_221280; i_221312++) {
        flat_tid_221219 = i_221312;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_221297 = defunc_2_reduce_res_220887;
            }
            // load next params
            {
                x_221298 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221281)[flat_tid_221219];
            }
            // red body
            {
                float defunc_1_op_res_221299 = x_221297 + x_221298;
                
                defunc_2_reduce_res_220887 = defunc_1_op_res_221299;
            }
            // load acc params
            {
                x_221300 = defunc_2_reduce_res_220888;
            }
            // load next params
            {
                x_221301 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221283)[flat_tid_221219];
            }
            // red body
            {
                float defunc_1_op_res_221302 = x_221300 + x_221301;
                
                defunc_2_reduce_res_220888 = defunc_1_op_res_221302;
            }
            // load acc params
            {
                x_221303 = defunc_2_reduce_res_220889;
            }
            // load next params
            {
                x_221304 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221285)[flat_tid_221219];
            }
            // red body
            {
                float defunc_1_op_res_221305 = x_221303 + x_221304;
                
                defunc_2_reduce_res_220889 = defunc_1_op_res_221305;
            }
            // load acc params
            {
                x_221306 = defunc_2_reduce_res_220890;
            }
            // load next params
            {
                x_221307 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221287)[flat_tid_221219];
            }
            // red body
            {
                float defunc_1_op_res_221308 = x_221306 + x_221307;
                
                defunc_2_reduce_res_220890 = defunc_1_op_res_221308;
            }
            // load acc params
            {
                x_221309 = defunc_2_reduce_res_220891;
            }
            // load next params
            {
                x_221310 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221289)[flat_tid_221219];
            }
            // red body
            {
                float defunc_1_op_res_221311 = x_221309 + x_221310;
                
                defunc_2_reduce_res_220891 = defunc_1_op_res_221311;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_221281);
        free(reduce_stage_1_tid_res_arr_mem_221283);
        free(reduce_stage_1_tid_res_arr_mem_221285);
        free(reduce_stage_1_tid_res_arr_mem_221287);
        free(reduce_stage_1_tid_res_arr_mem_221289);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228827_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228827_end -
                 futhark_mc_segred_task_228827_start;
        
        ctx->futhark_mc_segred_task_228827_runs[tid]++;
        ctx->futhark_mc_segred_task_228827_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228827_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228826->retval_defunc_2_reduce_res_220887 =
            defunc_2_reduce_res_220887;
        *futhark_mc_task_228826->retval_defunc_2_reduce_res_220888 =
            defunc_2_reduce_res_220888;
        *futhark_mc_task_228826->retval_defunc_2_reduce_res_220889 =
            defunc_2_reduce_res_220889;
        *futhark_mc_task_228826->retval_defunc_2_reduce_res_220890 =
            defunc_2_reduce_res_220890;
        *futhark_mc_task_228826->retval_defunc_2_reduce_res_220891 =
            defunc_2_reduce_res_220891;
        futhark_mc_task_228826->retval_mem_220885 = mem_220885.mem;
        futhark_mc_task_228826->retval_mem_220886 = mem_220886.mem;
    }
    return err;
}
struct futhark_mc_task_228835 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_204264;
    unsigned char *free_mem_211106;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    int64_t free_x_220849;
    unsigned char *free_mem_220862;
    unsigned char *free_mem_220885;
    unsigned char *free_mem_220886;
    float free_a12_220937;
    float free_b12_220938;
    float free_c12_220939;
    float free_b2_220940;
    float free_c2_220941;
    float *retval_defunc_2_reduce_res_220942;
    float *retval_defunc_2_reduce_res_220943;
};
struct futhark_mc_segred_stage_1_parloop_struct_228839 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_gtid_204264;
    unsigned char *free_mem_211106;
    int64_t free_gtid_220308;
    int64_t free_x_220309;
    int64_t free_x_220849;
    unsigned char *free_mem_220862;
    unsigned char *free_mem_220885;
    unsigned char *free_mem_220886;
    float free_a12_220937;
    float free_b12_220938;
    float free_c12_220939;
    float free_b2_220940;
    float free_c2_220941;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221314;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221316;
};
static int futhark_mc_segred_stage_1_parloop_228840(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_221242,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228839
    *futhark_mc_segred_stage_1_parloop_struct_228839 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228839 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228839->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228840_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228840_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segred_stage_1_parloop_struct_228839->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segred_stage_1_parloop_struct_228839->free_defunc_0_f_res_196740;
    int64_t gtid_204264 =
            futhark_mc_segred_stage_1_parloop_struct_228839->free_gtid_204264;
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228839->free_mem_211106,
                                  .size =0, .references =NULL};
    int64_t gtid_220308 =
            futhark_mc_segred_stage_1_parloop_struct_228839->free_gtid_220308;
    int64_t x_220309 =
            futhark_mc_segred_stage_1_parloop_struct_228839->free_x_220309;
    int64_t x_220849 =
            futhark_mc_segred_stage_1_parloop_struct_228839->free_x_220849;
    struct memblock mem_220862 = {.desc ="mem_220862", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228839->free_mem_220862,
                                  .size =0, .references =NULL};
    struct memblock mem_220885 = {.desc ="mem_220885", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228839->free_mem_220885,
                                  .size =0, .references =NULL};
    struct memblock mem_220886 = {.desc ="mem_220886", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228839->free_mem_220886,
                                  .size =0, .references =NULL};
    float a12_220937 =
          futhark_mc_segred_stage_1_parloop_struct_228839->free_a12_220937;
    float b12_220938 =
          futhark_mc_segred_stage_1_parloop_struct_228839->free_b12_220938;
    float c12_220939 =
          futhark_mc_segred_stage_1_parloop_struct_228839->free_c12_220939;
    float b2_220940 =
          futhark_mc_segred_stage_1_parloop_struct_228839->free_b2_220940;
    float c2_220941 =
          futhark_mc_segred_stage_1_parloop_struct_228839->free_c2_220941;
    struct memblock reduce_stage_1_tid_res_arr_mem_221314 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221314",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228839->free_reduce_stage_1_tid_res_arr_mem_221314,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221316 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221316",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228839->free_reduce_stage_1_tid_res_arr_mem_221316,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221318 = start;
    float x_221244;
    float x_221245;
    float x_221247;
    float x_221248;
    float local_acc_221319 = 0.0F;
    float local_acc_221320 = 0.0F;
    
    for (; iter_221318 < end; iter_221318++) {
        int64_t gtid_221243 = iter_221318;
        float x_221250;
        
        x_221250 = ((float *) mem_220862.mem)[gtid_221243];
        
        float x_221251;
        
        x_221251 = ((float *) mem_220886.mem)[gtid_221243];
        
        float x_221252;
        
        x_221252 = ((float *) mem_220885.mem)[gtid_221243];
        
        bool cond_221253 = sle64(x_220309, gtid_221243);
        float defunc_0_f_res_221254;
        
        if (cond_221253) {
            defunc_0_f_res_221254 = 0.0F;
        } else {
            int64_t i_221255 = add64(x_220849, gtid_221243);
            float defunc_0_add_arg_221256;
            
            defunc_0_add_arg_221256 = ((float *) mem_211106.mem)[gtid_204264 *
                                                                 (defunc_0_f_res_196740 *
                                                                  n_p_196694) +
                                                                 gtid_220308 *
                                                                 defunc_0_f_res_196740 +
                                                                 i_221255];
            defunc_0_f_res_221254 = defunc_0_add_arg_221256;
        }
        
        float x_221257 = a12_220937 * x_221250;
        float y_221258 = b12_220938 * x_221251;
        float x_221259 = x_221257 + y_221258;
        float y_221260 = c12_220939 * x_221252;
        float x_221261 = x_221259 + y_221260;
        float defunc_9_fit_fun_res_221262 = defunc_0_f_res_221254 * x_221261;
        float x_221263 = b12_220938 * x_221250;
        float y_221264 = b2_220940 * x_221251;
        float x_221265 = x_221263 + y_221264;
        float y_221266 = c2_220941 * x_221252;
        float x_221267 = x_221265 + y_221266;
        float defunc_9_slope_fun_res_221268 = defunc_0_f_res_221254 * x_221267;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_221244 = local_acc_221319;
        }
        // Load next params
        {
            x_221245 = defunc_9_fit_fun_res_221262;
        }
        // Red body
        {
            float defunc_1_op_res_221246 = x_221244 + x_221245;
            
            local_acc_221319 = defunc_1_op_res_221246;
        }
        // Load accum params
        {
            x_221247 = local_acc_221320;
        }
        // Load next params
        {
            x_221248 = defunc_9_slope_fun_res_221268;
        }
        // Red body
        {
            float defunc_1_op_res_221249 = x_221247 + x_221248;
            
            local_acc_221320 = defunc_1_op_res_221249;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_221314.mem)[flat_tid_221242] =
        local_acc_221319;
    ((float *) reduce_stage_1_tid_res_arr_mem_221316.mem)[flat_tid_221242] =
        local_acc_221320;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228840_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228840_end -
                 futhark_mc_segred_stage_1_parloop_228840_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228840_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228840_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228840_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228836(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221242 = tid;
    int num_tasks_221313 = info.nsubtasks;
    struct futhark_mc_task_228835 *futhark_mc_task_228835 =
                                  (struct futhark_mc_task_228835 *) args;
    struct futhark_context *ctx = futhark_mc_task_228835->ctx;
    uint64_t futhark_mc_segred_task_228836_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228836_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228835->free_n_p_196694;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228835->free_defunc_0_f_res_196740;
    int64_t gtid_204264 = futhark_mc_task_228835->free_gtid_204264;
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228835->free_mem_211106,
                                  .size =0, .references =NULL};
    int64_t gtid_220308 = futhark_mc_task_228835->free_gtid_220308;
    int64_t x_220309 = futhark_mc_task_228835->free_x_220309;
    int64_t x_220849 = futhark_mc_task_228835->free_x_220849;
    struct memblock mem_220862 = {.desc ="mem_220862", .mem =
                                  futhark_mc_task_228835->free_mem_220862,
                                  .size =0, .references =NULL};
    struct memblock mem_220885 = {.desc ="mem_220885", .mem =
                                  futhark_mc_task_228835->free_mem_220885,
                                  .size =0, .references =NULL};
    struct memblock mem_220886 = {.desc ="mem_220886", .mem =
                                  futhark_mc_task_228835->free_mem_220886,
                                  .size =0, .references =NULL};
    float a12_220937 = futhark_mc_task_228835->free_a12_220937;
    float b12_220938 = futhark_mc_task_228835->free_b12_220938;
    float c12_220939 = futhark_mc_task_228835->free_c12_220939;
    float b2_220940 = futhark_mc_task_228835->free_b2_220940;
    float c2_220941 = futhark_mc_task_228835->free_c2_220941;
    float defunc_2_reduce_res_220942 =
          *futhark_mc_task_228835->retval_defunc_2_reduce_res_220942;
    float defunc_2_reduce_res_220943 =
          *futhark_mc_task_228835->retval_defunc_2_reduce_res_220943;
    size_t reduce_stage_1_tid_res_arr_mem_221314_cached_sizze_228837 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221314 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_221316_cached_sizze_228838 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221316 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_221314_cached_sizze_228837 <
        (size_t) ((int64_t) 4 * num_tasks_221313)) {
        reduce_stage_1_tid_res_arr_mem_221314 =
            realloc(reduce_stage_1_tid_res_arr_mem_221314, (int64_t) 4 *
                    num_tasks_221313);
        reduce_stage_1_tid_res_arr_mem_221314_cached_sizze_228837 =
            (int64_t) 4 * num_tasks_221313;
    }
    if (reduce_stage_1_tid_res_arr_mem_221316_cached_sizze_228838 <
        (size_t) ((int64_t) 4 * num_tasks_221313)) {
        reduce_stage_1_tid_res_arr_mem_221316 =
            realloc(reduce_stage_1_tid_res_arr_mem_221316, (int64_t) 4 *
                    num_tasks_221313);
        reduce_stage_1_tid_res_arr_mem_221316_cached_sizze_228838 =
            (int64_t) 4 * num_tasks_221313;
    }
    
    int64_t iter_221318;
    struct futhark_mc_segred_stage_1_parloop_struct_228839
    futhark_mc_segred_stage_1_parloop_struct_228839;
    
    futhark_mc_segred_stage_1_parloop_struct_228839.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_n_p_196694 =
        n_p_196694;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_gtid_204264 =
        gtid_204264;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_mem_211106 =
        mem_211106.mem;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_gtid_220308 =
        gtid_220308;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_x_220309 = x_220309;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_x_220849 = x_220849;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_mem_220862 =
        mem_220862.mem;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_mem_220885 =
        mem_220885.mem;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_mem_220886 =
        mem_220886.mem;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_a12_220937 =
        a12_220937;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_b12_220938 =
        b12_220938;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_c12_220939 =
        c12_220939;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_b2_220940 = b2_220940;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_c2_220941 = c2_220941;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_reduce_stage_1_tid_res_arr_mem_221314 =
        reduce_stage_1_tid_res_arr_mem_221314;
    futhark_mc_segred_stage_1_parloop_struct_228839.free_reduce_stage_1_tid_res_arr_mem_221316 =
        reduce_stage_1_tid_res_arr_mem_221316;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228840_task;
    
    futhark_mc_segred_stage_1_parloop_228840_task.name =
        "futhark_mc_segred_stage_1_parloop_228840";
    futhark_mc_segred_stage_1_parloop_228840_task.fn =
        futhark_mc_segred_stage_1_parloop_228840;
    futhark_mc_segred_stage_1_parloop_228840_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228839;
    futhark_mc_segred_stage_1_parloop_228840_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228840_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228840_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228840_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228840_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228840_task);
    
    if (futhark_mc_segred_stage_1_parloop_228840_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228840_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228840_total_end -
                 futhark_mc_segred_stage_1_parloop_228840_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228840_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228840_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228840_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_220942 = 0.0F;
        defunc_2_reduce_res_220943 = 0.0F;
    }
    
    float x_221321;
    float x_221322;
    float x_221324;
    float x_221325;
    
    for (int32_t i_221327 = 0; i_221327 < num_tasks_221313; i_221327++) {
        flat_tid_221242 = i_221327;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_221321 = defunc_2_reduce_res_220942;
            }
            // load next params
            {
                x_221322 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221314)[flat_tid_221242];
            }
            // red body
            {
                float defunc_1_op_res_221323 = x_221321 + x_221322;
                
                defunc_2_reduce_res_220942 = defunc_1_op_res_221323;
            }
            // load acc params
            {
                x_221324 = defunc_2_reduce_res_220943;
            }
            // load next params
            {
                x_221325 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221316)[flat_tid_221242];
            }
            // red body
            {
                float defunc_1_op_res_221326 = x_221324 + x_221325;
                
                defunc_2_reduce_res_220943 = defunc_1_op_res_221326;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_221314);
        free(reduce_stage_1_tid_res_arr_mem_221316);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228836_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228836_end -
                 futhark_mc_segred_task_228836_start;
        
        ctx->futhark_mc_segred_task_228836_runs[tid]++;
        ctx->futhark_mc_segred_task_228836_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228836_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228835->retval_defunc_2_reduce_res_220942 =
            defunc_2_reduce_res_220942;
        *futhark_mc_task_228835->retval_defunc_2_reduce_res_220943 =
            defunc_2_reduce_res_220943;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228817(void *args, int64_t start,
                                            int64_t end, int flat_tid_220847,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228816
    *futhark_mc_segmap_parloop_struct_228816 =
    (struct futhark_mc_segmap_parloop_struct_228816 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228816->ctx;
    uint64_t futhark_mc_segmap_parloop_228817_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228817_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228816->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228816->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228816->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228816->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228816->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228816->free_s_n_m_196745;
    int64_t gtid_204264 =
            futhark_mc_segmap_parloop_struct_228816->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 =
            futhark_mc_segmap_parloop_struct_228816->free_bytes_211839;
    int64_t gtid_220308 =
            futhark_mc_segmap_parloop_struct_228816->free_gtid_220308;
    int64_t x_220309 = futhark_mc_segmap_parloop_struct_228816->free_x_220309;
    struct memblock mem_220310 = {.desc ="mem_220310", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_220310,
                                  .size =0, .references =NULL};
    struct memblock mem_220311 = {.desc ="mem_220311", .mem =
                                  futhark_mc_segmap_parloop_struct_228816->free_mem_220311,
                                  .size =0, .references =NULL};
    size_t mem_220861_cached_sizze_228818 = 0;
    unsigned char *mem_220861 = NULL;
    size_t mem_220862_cached_sizze_228819 = 0;
    unsigned char *mem_220862 = NULL;
    size_t mem_220885_cached_sizze_228820 = 0;
    unsigned char *mem_220885 = NULL;
    size_t mem_220886_cached_sizze_228821 = 0;
    unsigned char *mem_220886 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221190 = start;
    
    if (mem_220861_cached_sizze_228818 < (size_t) bytes_211839) {
        mem_220861 = realloc(mem_220861, bytes_211839);
        mem_220861_cached_sizze_228818 = bytes_211839;
    }
    if (mem_220862_cached_sizze_228819 < (size_t) bytes_211839) {
        mem_220862 = realloc(mem_220862, bytes_211839);
        mem_220862_cached_sizze_228819 = bytes_211839;
    }
    if (mem_220885_cached_sizze_228820 < (size_t) bytes_211839) {
        mem_220885 = realloc(mem_220885, bytes_211839);
        mem_220885_cached_sizze_228820 = bytes_211839;
    }
    if (mem_220886_cached_sizze_228821 < (size_t) bytes_211839) {
        mem_220886 = realloc(mem_220886, bytes_211839);
        mem_220886_cached_sizze_228821 = bytes_211839;
    }
    for (; iter_221190 < end; iter_221190++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221269 = s_n_m_196745;
        int64_t gtid_220848 = iter_221190;
        int64_t remnant_221270 = iter_221190 - gtid_220848;
        int64_t x_220849;
        
        x_220849 = ((int64_t *) mem_210764.mem)[gtid_204264 * (s_n_m_196745 *
                                                               n_p_196694) +
                                                gtid_220308 * s_n_m_196745 +
                                                gtid_220848];
        
        float x_220850;
        
        x_220850 = ((float *) mem_210769.mem)[gtid_204264 * (s_n_m_196745 *
                                                             n_p_196694) +
                                              gtid_220308 * s_n_m_196745 +
                                              gtid_220848];
        
        bool cond_220851 = gtid_220848 == (int64_t) 0;
        int64_t defunc_0_m_fun_res_220852;
        
        if (cond_220851) {
            defunc_0_m_fun_res_220852 = (int64_t) 0;
        } else {
            int64_t y_221191 = sub64(s_n_m_196745, (int64_t) 1);
            bool cond_221192 = gtid_220848 == y_221191;
            int64_t defunc_0_m_fun_res_f_res_221193;
            
            if (cond_221192) {
                int64_t defunc_0_m_fun_res_f_res_t_res_221194 =
                        sub64(pad_css_len_196741, (int64_t) 1);
                
                defunc_0_m_fun_res_f_res_221193 =
                    defunc_0_m_fun_res_f_res_t_res_221194;
            } else {
                int64_t x_221195 = sub64(gtid_220848, (int64_t) 1);
                int64_t x_221196 = mul64(jump_s_196701, x_221195);
                int64_t min_arg_221197 = add64((int64_t) 1, x_221196);
                int64_t min_res_221198 = smin64(defunc_0_f_res_196740,
                                                min_arg_221197);
                
                defunc_0_m_fun_res_f_res_221193 = min_res_221198;
            }
            defunc_0_m_fun_res_220852 = defunc_0_m_fun_res_f_res_221193;
        }
        
        int64_t flat_tid_221199 = (int64_t) 0;
        int32_t num_tasks_221271;
        struct futhark_mc_task_228822 futhark_mc_task_228822;
        
        futhark_mc_task_228822.ctx = ctx;
        futhark_mc_task_228822.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228822.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228822.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228822.free_gtid_204264 = gtid_204264;
        futhark_mc_task_228822.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228822.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228822.free_gtid_220308 = gtid_220308;
        futhark_mc_task_228822.free_x_220309 = x_220309;
        futhark_mc_task_228822.free_x_220849 = x_220849;
        futhark_mc_task_228822.free_x_220850 = x_220850;
        futhark_mc_task_228822.free_defunc_0_m_fun_res_220852 =
            defunc_0_m_fun_res_220852;
        futhark_mc_task_228822.free_mem_220861 = mem_220861;
        futhark_mc_task_228822.free_mem_220862 = mem_220862;
        
        struct scheduler_segop futhark_mc_task_228822_task;
        
        futhark_mc_task_228822_task.args = &futhark_mc_task_228822;
        futhark_mc_task_228822_task.top_level_fn =
            futhark_mc_segmap_task_228823;
        futhark_mc_task_228822_task.name = "futhark_mc_segmap_task_228823";
        futhark_mc_task_228822_task.iterations = q_s_196695;
        futhark_mc_task_228822_task.task_time =
            &ctx->futhark_mc_segmap_task_228823_total_time;
        futhark_mc_task_228822_task.task_iter =
            &ctx->futhark_mc_segmap_task_228823_total_iter;
        futhark_mc_task_228822_task.sched = STATIC;
        futhark_mc_task_228822_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228823_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228822_task);
        
        if (futhark_mc_segmap_task_228823_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float defunc_2_reduce_res_220887;
        float defunc_2_reduce_res_220888;
        float defunc_2_reduce_res_220889;
        float defunc_2_reduce_res_220890;
        float defunc_2_reduce_res_220891;
        int64_t flat_tid_221219 = (int64_t) 0;
        int32_t num_tasks_221280;
        
        defunc_2_reduce_res_220887 = 0.0F;
        defunc_2_reduce_res_220888 = 0.0F;
        defunc_2_reduce_res_220889 = 0.0F;
        defunc_2_reduce_res_220890 = 0.0F;
        defunc_2_reduce_res_220891 = 0.0F;
        
        struct futhark_mc_task_228826 futhark_mc_task_228826;
        
        futhark_mc_task_228826.ctx = ctx;
        futhark_mc_task_228826.free_mem_220861 = mem_220861;
        futhark_mc_task_228826.free_mem_220862 = mem_220862;
        futhark_mc_task_228826.retval_defunc_2_reduce_res_220887 =
            &defunc_2_reduce_res_220887;
        futhark_mc_task_228826.retval_defunc_2_reduce_res_220888 =
            &defunc_2_reduce_res_220888;
        futhark_mc_task_228826.retval_defunc_2_reduce_res_220889 =
            &defunc_2_reduce_res_220889;
        futhark_mc_task_228826.retval_defunc_2_reduce_res_220890 =
            &defunc_2_reduce_res_220890;
        futhark_mc_task_228826.retval_defunc_2_reduce_res_220891 =
            &defunc_2_reduce_res_220891;
        futhark_mc_task_228826.retval_mem_220885 = mem_220885;
        futhark_mc_task_228826.retval_mem_220886 = mem_220886;
        
        struct scheduler_segop futhark_mc_task_228826_task;
        
        futhark_mc_task_228826_task.args = &futhark_mc_task_228826;
        futhark_mc_task_228826_task.top_level_fn =
            futhark_mc_segred_task_228827;
        futhark_mc_task_228826_task.name = "futhark_mc_segred_task_228827";
        futhark_mc_task_228826_task.iterations = q_s_196695;
        futhark_mc_task_228826_task.task_time =
            &ctx->futhark_mc_segred_task_228827_total_time;
        futhark_mc_task_228826_task.task_iter =
            &ctx->futhark_mc_segred_task_228827_total_iter;
        futhark_mc_task_228826_task.sched = STATIC;
        futhark_mc_task_228826_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228827_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228826_task);
        
        if (futhark_mc_segred_task_228827_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_220917 = defunc_2_reduce_res_220889 *
              defunc_2_reduce_res_220891;
        float y_220918 = defunc_2_reduce_res_220890 *
              defunc_2_reduce_res_220890;
        float a12_220919 = x_220917 - y_220918;
        float x_220920 = defunc_2_reduce_res_220889 *
              defunc_2_reduce_res_220890;
        float y_220921 = defunc_2_reduce_res_220888 *
              defunc_2_reduce_res_220891;
        float b12_220922 = x_220920 - y_220921;
        float x_220923 = defunc_2_reduce_res_220888 *
              defunc_2_reduce_res_220890;
        float y_220924 = defunc_2_reduce_res_220889 *
              defunc_2_reduce_res_220889;
        float c12_220925 = x_220923 - y_220924;
        float x_220926 = defunc_2_reduce_res_220887 *
              defunc_2_reduce_res_220891;
        float b2_220927 = x_220926 - y_220924;
        float x_220928 = defunc_2_reduce_res_220888 *
              defunc_2_reduce_res_220889;
        float y_220929 = defunc_2_reduce_res_220887 *
              defunc_2_reduce_res_220890;
        float c2_220930 = x_220928 - y_220929;
        float x_220931 = defunc_2_reduce_res_220887 * a12_220919;
        float y_220932 = defunc_2_reduce_res_220888 * b12_220922;
        float x_220933 = x_220931 + y_220932;
        float y_220934 = defunc_2_reduce_res_220889 * c12_220925;
        float y_220935 = x_220933 + y_220934;
        float det_220936 = 1.0F / y_220935;
        float a12_220937 = a12_220919 * det_220936;
        float b12_220938 = b12_220922 * det_220936;
        float c12_220939 = c12_220925 * det_220936;
        float b2_220940 = b2_220927 * det_220936;
        float c2_220941 = c2_220930 * det_220936;
        float defunc_2_reduce_res_220942;
        float defunc_2_reduce_res_220943;
        int64_t flat_tid_221242 = (int64_t) 0;
        int32_t num_tasks_221313;
        
        defunc_2_reduce_res_220942 = 0.0F;
        defunc_2_reduce_res_220943 = 0.0F;
        
        struct futhark_mc_task_228835 futhark_mc_task_228835;
        
        futhark_mc_task_228835.ctx = ctx;
        futhark_mc_task_228835.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228835.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228835.free_gtid_204264 = gtid_204264;
        futhark_mc_task_228835.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228835.free_gtid_220308 = gtid_220308;
        futhark_mc_task_228835.free_x_220309 = x_220309;
        futhark_mc_task_228835.free_x_220849 = x_220849;
        futhark_mc_task_228835.free_mem_220862 = mem_220862;
        futhark_mc_task_228835.free_mem_220885 = mem_220885;
        futhark_mc_task_228835.free_mem_220886 = mem_220886;
        futhark_mc_task_228835.free_a12_220937 = a12_220937;
        futhark_mc_task_228835.free_b12_220938 = b12_220938;
        futhark_mc_task_228835.free_c12_220939 = c12_220939;
        futhark_mc_task_228835.free_b2_220940 = b2_220940;
        futhark_mc_task_228835.free_c2_220941 = c2_220941;
        futhark_mc_task_228835.retval_defunc_2_reduce_res_220942 =
            &defunc_2_reduce_res_220942;
        futhark_mc_task_228835.retval_defunc_2_reduce_res_220943 =
            &defunc_2_reduce_res_220943;
        
        struct scheduler_segop futhark_mc_task_228835_task;
        
        futhark_mc_task_228835_task.args = &futhark_mc_task_228835;
        futhark_mc_task_228835_task.top_level_fn =
            futhark_mc_segred_task_228836;
        futhark_mc_task_228835_task.name = "futhark_mc_segred_task_228836";
        futhark_mc_task_228835_task.iterations = q_s_196695;
        futhark_mc_task_228835_task.task_time =
            &ctx->futhark_mc_segred_task_228836_total_time;
        futhark_mc_task_228835_task.task_iter =
            &ctx->futhark_mc_segred_task_228836_total_iter;
        futhark_mc_task_228835_task.sched = STATIC;
        futhark_mc_task_228835_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228836_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228835_task);
        
        if (futhark_mc_segred_task_228836_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_220310.mem)[gtid_220848] = defunc_2_reduce_res_220942;
        ((float *) mem_220311.mem)[gtid_220848] = defunc_2_reduce_res_220943;
    }
    
  cleanup:
    { }
    free(mem_220861);
    free(mem_220862);
    free(mem_220885);
    free(mem_220886);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228817_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228817_end -
                 futhark_mc_segmap_parloop_228817_start;
        
        ctx->futhark_mc_segmap_parloop_228817_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228817_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228817_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228815(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_220847 = tid;
    int num_tasks_221099 = info.nsubtasks;
    struct futhark_mc_task_228807 *futhark_mc_task_228807 =
                                  (struct futhark_mc_task_228807 *) args;
    struct futhark_context *ctx = futhark_mc_task_228807->ctx;
    uint64_t futhark_mc_segmap_nested_task_228815_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228815_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228807->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228807->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228807->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228807->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228807->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228807->free_s_n_m_196745;
    int64_t gtid_204264 = futhark_mc_task_228807->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228807->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228807->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228807->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228807->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228807->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 = futhark_mc_task_228807->free_bytes_211839;
    int64_t gtid_220308 = futhark_mc_task_228807->free_gtid_220308;
    int64_t x_220309 = futhark_mc_task_228807->free_x_220309;
    struct memblock mem_220310 = {.desc ="mem_220310", .mem =
                                  futhark_mc_task_228807->free_mem_220310,
                                  .size =0, .references =NULL};
    struct memblock mem_220311 = {.desc ="mem_220311", .mem =
                                  futhark_mc_task_228807->free_mem_220311,
                                  .size =0, .references =NULL};
    int64_t iter_221190;
    struct futhark_mc_segmap_parloop_struct_228816
    futhark_mc_segmap_parloop_struct_228816;
    
    futhark_mc_segmap_parloop_struct_228816.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228816.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228816.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228816.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228816.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228816.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228816.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228816.free_gtid_204264 = gtid_204264;
    futhark_mc_segmap_parloop_struct_228816.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228816.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228816.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228816.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228816.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228816.free_bytes_211839 = bytes_211839;
    futhark_mc_segmap_parloop_struct_228816.free_gtid_220308 = gtid_220308;
    futhark_mc_segmap_parloop_struct_228816.free_x_220309 = x_220309;
    futhark_mc_segmap_parloop_struct_228816.free_mem_220310 = mem_220310.mem;
    futhark_mc_segmap_parloop_struct_228816.free_mem_220311 = mem_220311.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228817_task;
    
    futhark_mc_segmap_parloop_228817_task.name =
        "futhark_mc_segmap_parloop_228817";
    futhark_mc_segmap_parloop_228817_task.fn = futhark_mc_segmap_parloop_228817;
    futhark_mc_segmap_parloop_228817_task.args =
        &futhark_mc_segmap_parloop_struct_228816;
    futhark_mc_segmap_parloop_228817_task.iterations = iterations;
    futhark_mc_segmap_parloop_228817_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228817_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228817_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228817_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228817_task);
    
    if (futhark_mc_segmap_parloop_228817_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228817_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228817_total_end -
                 futhark_mc_segmap_parloop_228817_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228817_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228817_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228817_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228815_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228815_end -
                 futhark_mc_segmap_nested_task_228815_start;
        
        ctx->futhark_mc_segmap_nested_task_228815_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228815_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228815_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228804(void *args, int64_t start,
                                            int64_t end, int flat_tid_220307,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228803
    *futhark_mc_segmap_parloop_struct_228803 =
    (struct futhark_mc_segmap_parloop_struct_228803 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228803->ctx;
    uint64_t futhark_mc_segmap_parloop_228804_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228804_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228803->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228803->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228803->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228803->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228803->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228803->free_s_n_m_196745;
    int64_t gtid_204264 =
            futhark_mc_segmap_parloop_struct_228803->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228803->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 =
            futhark_mc_segmap_parloop_struct_228803->free_bytes_211839;
    struct memblock mem_212009 = {.desc ="mem_212009", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_212009,
                                  .size =0, .references =NULL};
    struct memblock mem_212013 = {.desc ="mem_212013", .mem =
                                  futhark_mc_segmap_parloop_struct_228803->free_mem_212013,
                                  .size =0, .references =NULL};
    size_t mem_220310_cached_sizze_228805 = 0;
    unsigned char *mem_220310 = NULL;
    size_t mem_220311_cached_sizze_228806 = 0;
    unsigned char *mem_220311 = NULL;
    int64_t iterations = end - start;
    int64_t iter_220846 = start;
    
    if (mem_220310_cached_sizze_228805 < (size_t) bytes_210599) {
        mem_220310 = realloc(mem_220310, bytes_210599);
        mem_220310_cached_sizze_228805 = bytes_210599;
    }
    if (mem_220311_cached_sizze_228806 < (size_t) bytes_210599) {
        mem_220311 = realloc(mem_220311, bytes_210599);
        mem_220311_cached_sizze_228806 = bytes_210599;
    }
    for (; iter_220846 < end; iter_220846++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221097 = n_p_196694;
        int64_t gtid_220308 = iter_220846;
        int64_t remnant_221098 = iter_220846 - gtid_220308;
        int64_t x_220309;
        
        x_220309 = ((int64_t *) mem_210594.mem)[gtid_204264 * n_p_196694 +
                                                gtid_220308];
        
        int64_t flat_tid_220971 = (int64_t) 0;
        int32_t num_tasks_221099;
        int64_t flat_tid_220847 = (int64_t) 0;
        struct futhark_mc_task_228807 futhark_mc_task_228807;
        
        futhark_mc_task_228807.ctx = ctx;
        futhark_mc_task_228807.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228807.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228807.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228807.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228807.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228807.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228807.free_gtid_204264 = gtid_204264;
        futhark_mc_task_228807.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228807.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228807.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228807.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228807.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228807.free_bytes_211839 = bytes_211839;
        futhark_mc_task_228807.free_gtid_220308 = gtid_220308;
        futhark_mc_task_228807.free_x_220309 = x_220309;
        futhark_mc_task_228807.free_mem_220310 = mem_220310;
        futhark_mc_task_228807.free_mem_220311 = mem_220311;
        
        struct scheduler_segop futhark_mc_task_228807_task;
        
        futhark_mc_task_228807_task.args = &futhark_mc_task_228807;
        futhark_mc_task_228807_task.top_level_fn =
            futhark_mc_segmap_task_228808;
        futhark_mc_task_228807_task.name = "futhark_mc_segmap_task_228808";
        futhark_mc_task_228807_task.iterations = s_n_m_196745;
        futhark_mc_task_228807_task.task_time =
            &ctx->futhark_mc_segmap_task_228808_total_time;
        futhark_mc_task_228807_task.task_iter =
            &ctx->futhark_mc_segmap_task_228808_total_iter;
        futhark_mc_task_228807_task.sched = STATIC;
        futhark_mc_task_228807_task.nested_fn =
            futhark_mc_segmap_nested_task_228815;
        
        int futhark_mc_segmap_task_228808_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228807_task);
        
        if (futhark_mc_segmap_task_228808_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212009.mem + gtid_220308 * s_n_m_196745 * (int64_t) 4,
                    mem_220310 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
        if (s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212013.mem + gtid_220308 * s_n_m_196745 * (int64_t) 4,
                    mem_220311 + (int64_t) 0, s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_220310);
    free(mem_220311);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228804_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228804_end -
                 futhark_mc_segmap_parloop_228804_start;
        
        ctx->futhark_mc_segmap_parloop_228804_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228804_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228804_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228802(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_220307 = tid;
    int num_tasks_220704 = info.nsubtasks;
    struct futhark_mc_task_228792 *futhark_mc_task_228792 =
                                  (struct futhark_mc_task_228792 *) args;
    struct futhark_context *ctx = futhark_mc_task_228792->ctx;
    uint64_t futhark_mc_segmap_nested_task_228802_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228802_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228792->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228792->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228792->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228792->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228792->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228792->free_s_n_m_196745;
    int64_t gtid_204264 = futhark_mc_task_228792->free_gtid_204264;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228792->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228792->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228792->free_bytes_210599;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228792->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228792->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228792->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228792->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 = futhark_mc_task_228792->free_bytes_211839;
    struct memblock mem_212009 = {.desc ="mem_212009", .mem =
                                  futhark_mc_task_228792->free_mem_212009,
                                  .size =0, .references =NULL};
    struct memblock mem_212013 = {.desc ="mem_212013", .mem =
                                  futhark_mc_task_228792->free_mem_212013,
                                  .size =0, .references =NULL};
    int64_t iter_220846;
    struct futhark_mc_segmap_parloop_struct_228803
    futhark_mc_segmap_parloop_struct_228803;
    
    futhark_mc_segmap_parloop_struct_228803.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228803.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228803.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228803.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228803.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228803.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228803.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228803.free_gtid_204264 = gtid_204264;
    futhark_mc_segmap_parloop_struct_228803.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228803.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228803.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228803.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228803.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228803.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228803.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228803.free_bytes_211839 = bytes_211839;
    futhark_mc_segmap_parloop_struct_228803.free_mem_212009 = mem_212009.mem;
    futhark_mc_segmap_parloop_struct_228803.free_mem_212013 = mem_212013.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228804_task;
    
    futhark_mc_segmap_parloop_228804_task.name =
        "futhark_mc_segmap_parloop_228804";
    futhark_mc_segmap_parloop_228804_task.fn = futhark_mc_segmap_parloop_228804;
    futhark_mc_segmap_parloop_228804_task.args =
        &futhark_mc_segmap_parloop_struct_228803;
    futhark_mc_segmap_parloop_228804_task.iterations = iterations;
    futhark_mc_segmap_parloop_228804_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228804_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228804_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228804_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228804_task);
    
    if (futhark_mc_segmap_parloop_228804_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228804_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228804_total_end -
                 futhark_mc_segmap_parloop_228804_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228804_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228804_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228804_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228802_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228802_end -
                 futhark_mc_segmap_nested_task_228802_start;
        
        ctx->futhark_mc_segmap_nested_task_228802_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228802_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228802_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228789(void *args, int64_t start,
                                            int64_t end, int flat_tid_204263,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228788
    *futhark_mc_segmap_parloop_struct_228788 =
    (struct futhark_mc_segmap_parloop_struct_228788 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228788->ctx;
    uint64_t futhark_mc_segmap_parloop_228789_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228789_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228788->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228788->free_n_p_196694;
    int64_t q_s_196695 =
            futhark_mc_segmap_parloop_struct_228788->free_q_s_196695;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228788->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228788->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228788->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228788->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 =
            futhark_mc_segmap_parloop_struct_228788->free_bytes_210599;
    int64_t bytes_210655 =
            futhark_mc_segmap_parloop_struct_228788->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 =
            futhark_mc_segmap_parloop_struct_228788->free_bytes_211839;
    struct memblock mem_212166 = {.desc ="mem_212166", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_212166,
                                  .size =0, .references =NULL};
    struct memblock mem_212171 = {.desc ="mem_212171", .mem =
                                  futhark_mc_segmap_parloop_struct_228788->free_mem_212171,
                                  .size =0, .references =NULL};
    size_t mem_212009_cached_sizze_228790 = 0;
    unsigned char *mem_212009 = NULL;
    size_t mem_212013_cached_sizze_228791 = 0;
    unsigned char *mem_212013 = NULL;
    int64_t iterations = end - start;
    int64_t iter_220306 = start;
    
    if (mem_212009_cached_sizze_228790 < (size_t) bytes_210655) {
        mem_212009 = realloc(mem_212009, bytes_210655);
        mem_212009_cached_sizze_228790 = bytes_210655;
    }
    if (mem_212013_cached_sizze_228791 < (size_t) bytes_210655) {
        mem_212013 = realloc(mem_212013, bytes_210655);
        mem_212013_cached_sizze_228791 = bytes_210655;
    }
    for (; iter_220306 < end; iter_220306++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_220702 = m_196691;
        int64_t gtid_204264 = iter_220306;
        int64_t remnant_220703 = iter_220306 - gtid_204264;
        int64_t flat_tid_220564 = (int64_t) 0;
        int32_t num_tasks_220704;
        int64_t flat_tid_220307 = (int64_t) 0;
        struct futhark_mc_task_228792 futhark_mc_task_228792;
        
        futhark_mc_task_228792.ctx = ctx;
        futhark_mc_task_228792.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228792.free_q_s_196695 = q_s_196695;
        futhark_mc_task_228792.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228792.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228792.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228792.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228792.free_gtid_204264 = gtid_204264;
        futhark_mc_task_228792.free_mem_210590 = mem_210590.mem;
        futhark_mc_task_228792.free_mem_210594 = mem_210594.mem;
        futhark_mc_task_228792.free_bytes_210599 = bytes_210599;
        futhark_mc_task_228792.free_mem_210764 = mem_210764.mem;
        futhark_mc_task_228792.free_mem_210769 = mem_210769.mem;
        futhark_mc_task_228792.free_mem_211106 = mem_211106.mem;
        futhark_mc_task_228792.free_mem_211111 = mem_211111.mem;
        futhark_mc_task_228792.free_bytes_211839 = bytes_211839;
        futhark_mc_task_228792.free_mem_212009 = mem_212009;
        futhark_mc_task_228792.free_mem_212013 = mem_212013;
        
        struct scheduler_segop futhark_mc_task_228792_task;
        
        futhark_mc_task_228792_task.args = &futhark_mc_task_228792;
        futhark_mc_task_228792_task.top_level_fn =
            futhark_mc_segmap_task_228793;
        futhark_mc_task_228792_task.name = "futhark_mc_segmap_task_228793";
        futhark_mc_task_228792_task.iterations = n_p_196694;
        futhark_mc_task_228792_task.task_time =
            &ctx->futhark_mc_segmap_task_228793_total_time;
        futhark_mc_task_228792_task.task_iter =
            &ctx->futhark_mc_segmap_task_228793_total_iter;
        futhark_mc_task_228792_task.sched = STATIC;
        futhark_mc_task_228792_task.nested_fn =
            futhark_mc_segmap_nested_task_228802;
        
        int futhark_mc_segmap_task_228793_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228792_task);
        
        if (futhark_mc_segmap_task_228793_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212166.mem + gtid_204264 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_212009 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
        if (n_p_196694 * s_n_m_196745 * (int64_t) 4 > 0)
            memmove(mem_212171.mem + gtid_204264 * (s_n_m_196745 * n_p_196694) *
                    (int64_t) 4, mem_212013 + (int64_t) 0, n_p_196694 *
                    s_n_m_196745 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212009);
    free(mem_212013);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228789_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228789_end -
                 futhark_mc_segmap_parloop_228789_start;
        
        ctx->futhark_mc_segmap_parloop_228789_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228789_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228789_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228787(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204263 = tid;
    int num_tasks_220156 = info.nsubtasks;
    struct futhark_mc_task_228777 *futhark_mc_task_228777 =
                                  (struct futhark_mc_task_228777 *) args;
    struct futhark_context *ctx = futhark_mc_task_228777->ctx;
    uint64_t futhark_mc_segmap_nested_task_228787_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228787_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228777->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228777->free_n_p_196694;
    int64_t q_s_196695 = futhark_mc_task_228777->free_q_s_196695;
    int64_t jump_s_196701 = futhark_mc_task_228777->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228777->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228777->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228777->free_s_n_m_196745;
    struct memblock mem_210590 = {.desc ="mem_210590", .mem =
                                  futhark_mc_task_228777->free_mem_210590,
                                  .size =0, .references =NULL};
    struct memblock mem_210594 = {.desc ="mem_210594", .mem =
                                  futhark_mc_task_228777->free_mem_210594,
                                  .size =0, .references =NULL};
    int64_t bytes_210599 = futhark_mc_task_228777->free_bytes_210599;
    int64_t bytes_210655 = futhark_mc_task_228777->free_bytes_210655;
    struct memblock mem_210764 = {.desc ="mem_210764", .mem =
                                  futhark_mc_task_228777->free_mem_210764,
                                  .size =0, .references =NULL};
    struct memblock mem_210769 = {.desc ="mem_210769", .mem =
                                  futhark_mc_task_228777->free_mem_210769,
                                  .size =0, .references =NULL};
    struct memblock mem_211106 = {.desc ="mem_211106", .mem =
                                  futhark_mc_task_228777->free_mem_211106,
                                  .size =0, .references =NULL};
    struct memblock mem_211111 = {.desc ="mem_211111", .mem =
                                  futhark_mc_task_228777->free_mem_211111,
                                  .size =0, .references =NULL};
    int64_t bytes_211839 = futhark_mc_task_228777->free_bytes_211839;
    struct memblock mem_212166 = {.desc ="mem_212166", .mem =
                                  futhark_mc_task_228777->free_mem_212166,
                                  .size =0, .references =NULL};
    struct memblock mem_212171 = {.desc ="mem_212171", .mem =
                                  futhark_mc_task_228777->free_mem_212171,
                                  .size =0, .references =NULL};
    int64_t iter_220306;
    struct futhark_mc_segmap_parloop_struct_228788
    futhark_mc_segmap_parloop_struct_228788;
    
    futhark_mc_segmap_parloop_struct_228788.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228788.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228788.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228788.free_q_s_196695 = q_s_196695;
    futhark_mc_segmap_parloop_struct_228788.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228788.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228788.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228788.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228788.free_mem_210590 = mem_210590.mem;
    futhark_mc_segmap_parloop_struct_228788.free_mem_210594 = mem_210594.mem;
    futhark_mc_segmap_parloop_struct_228788.free_bytes_210599 = bytes_210599;
    futhark_mc_segmap_parloop_struct_228788.free_bytes_210655 = bytes_210655;
    futhark_mc_segmap_parloop_struct_228788.free_mem_210764 = mem_210764.mem;
    futhark_mc_segmap_parloop_struct_228788.free_mem_210769 = mem_210769.mem;
    futhark_mc_segmap_parloop_struct_228788.free_mem_211106 = mem_211106.mem;
    futhark_mc_segmap_parloop_struct_228788.free_mem_211111 = mem_211111.mem;
    futhark_mc_segmap_parloop_struct_228788.free_bytes_211839 = bytes_211839;
    futhark_mc_segmap_parloop_struct_228788.free_mem_212166 = mem_212166.mem;
    futhark_mc_segmap_parloop_struct_228788.free_mem_212171 = mem_212171.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228789_task;
    
    futhark_mc_segmap_parloop_228789_task.name =
        "futhark_mc_segmap_parloop_228789";
    futhark_mc_segmap_parloop_228789_task.fn = futhark_mc_segmap_parloop_228789;
    futhark_mc_segmap_parloop_228789_task.args =
        &futhark_mc_segmap_parloop_struct_228788;
    futhark_mc_segmap_parloop_228789_task.iterations = iterations;
    futhark_mc_segmap_parloop_228789_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228789_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228789_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228789_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228789_task);
    
    if (futhark_mc_segmap_parloop_228789_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228789_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228789_total_end -
                 futhark_mc_segmap_parloop_228789_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228789_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228789_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228789_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228787_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228787_end -
                 futhark_mc_segmap_nested_task_228787_start;
        
        ctx->futhark_mc_segmap_nested_task_228787_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228787_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228787_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228841 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_bytes_212179;
    int64_t free_bytes_212198;
    unsigned char *free_mem_212248;
};
struct futhark_mc_segmap_parloop_struct_228843 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_bytes_212198;
    unsigned char *free_mem_212248;
};
static int futhark_mc_segmap_parloop_228844(void *args, int64_t start,
                                            int64_t end, int flat_tid_204648,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228843
    *futhark_mc_segmap_parloop_struct_228843 =
    (struct futhark_mc_segmap_parloop_struct_228843 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228843->ctx;
    uint64_t futhark_mc_segmap_parloop_228844_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228844_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228843->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228843->free_n_p_196694;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228843->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228843->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228843->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228843->free_s_n_m_196745;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_segmap_parloop_struct_228843->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_segmap_parloop_struct_228843->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212198 =
            futhark_mc_segmap_parloop_struct_228843->free_bytes_212198;
    struct memblock mem_212248 = {.desc ="mem_212248", .mem =
                                  futhark_mc_segmap_parloop_struct_228843->free_mem_212248,
                                  .size =0, .references =NULL};
    size_t mem_212203_cached_sizze_228845 = 0;
    unsigned char *mem_212203 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221329 = start;
    
    if (mem_212203_cached_sizze_228845 < (size_t) bytes_212198) {
        mem_212203 = realloc(mem_212203, bytes_212198);
        mem_212203_cached_sizze_228845 = bytes_212198;
    }
    for (; iter_221329 < end; iter_221329++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221415 = m_196691;
        int64_t gtid_204649 = iter_221329;
        int64_t remnant_221416 = iter_221329 - gtid_204649;
        
        for (int64_t i_221330 = 0; i_221330 < n_p_196694; i_221330++) {
            for (int64_t i_221333 = 0; i_221333 < pad_css_len_196741;
                 i_221333++) {
                bool cond_221335 = i_221333 == (int64_t) 0;
                float defunc_0_f_res_221336;
                
                if (cond_221335) {
                    bool y_221337 = slt64((int64_t) 0, s_n_m_196745);
                    bool index_certs_221338;
                    
                    if (!y_221337) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) (int64_t) 0,
                                      "] out of bounds for array of shape [",
                                      (long long) s_n_m_196745, "].",
                                      "-> #0  /prelude/array.fut:21:29-32\n   #1  loess.fut:558:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    float head_res_221339;
                    
                    head_res_221339 =
                        ((float *) ext_mem_212177.mem)[gtid_204649 *
                                                       (s_n_m_196745 *
                                                        n_p_196694) + i_221330 *
                                                       s_n_m_196745];
                    defunc_0_f_res_221336 = head_res_221339;
                } else {
                    int64_t y_221340 = sub64(pad_css_len_196741, (int64_t) 1);
                    bool cond_221341 = i_221333 == y_221340;
                    float defunc_0_f_res_f_res_221342;
                    
                    if (cond_221341) {
                        int64_t i_221343 = sub64(s_n_m_196745, (int64_t) 1);
                        bool x_221344 = sle64((int64_t) 0, i_221343);
                        bool y_221345 = slt64(i_221343, s_n_m_196745);
                        bool bounds_check_221346 = x_221344 && y_221345;
                        bool index_certs_221347;
                        
                        if (!bounds_check_221346) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", (long long) i_221343,
                                          "] out of bounds for array of shape [",
                                          (long long) s_n_m_196745, "].",
                                          "-> #0  /prelude/array.fut:26:29-34\n   #1  loess.fut:560:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                            err = 1;
                            goto cleanup;
                        }
                        
                        float last_res_221348;
                        
                        last_res_221348 =
                            ((float *) ext_mem_212177.mem)[gtid_204649 *
                                                           (s_n_m_196745 *
                                                            n_p_196694) +
                                                           i_221330 *
                                                           s_n_m_196745 +
                                                           i_221343];
                        defunc_0_f_res_f_res_221342 = last_res_221348;
                    } else {
                        int64_t x_221349 = sub64(i_221333, (int64_t) 1);
                        bool zzero_221350 = jump_s_196701 == (int64_t) 0;
                        bool nonzzero_221351 = !zzero_221350;
                        bool nonzzero_cert_221352;
                        
                        if (!nonzzero_221351) {
                            ctx->error =
                                msgprintf("Error: %s\n\nBacktrace:\n%s",
                                          "division by zero",
                                          "-> #0  loess.fut:562:22-35\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:556:3-565:9\n   #5  stl.fut:220:31-96\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:219:23-221:48\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:218:15-222:44\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t x_221353 = sdiv64(x_221349, jump_s_196701);
                        int64_t m_v_221354 = add64((int64_t) 1, x_221353);
                        int64_t j_221355;
                        
                        if (cond_221335) {
                            j_221355 = (int64_t) 0;
                        } else {
                            int64_t y_221356 = sub64(s_n_m_196745, (int64_t) 1);
                            bool cond_221357 = m_v_221354 == y_221356;
                            int64_t j_f_res_221358;
                            
                            if (cond_221357) {
                                j_f_res_221358 = x_221353;
                            } else {
                                j_f_res_221358 = m_v_221354;
                            }
                            j_221355 = j_f_res_221358;
                        }
                        
                        bool cond_221359 = j_221355 == (int64_t) 0;
                        int64_t defunc_0_m_fun_res_221360;
                        
                        if (cond_221359) {
                            defunc_0_m_fun_res_221360 = (int64_t) 0;
                        } else {
                            int64_t y_221361 = sub64(s_n_m_196745, (int64_t) 1);
                            bool cond_221362 = j_221355 == y_221361;
                            int64_t defunc_0_m_fun_res_f_res_221363;
                            
                            if (cond_221362) {
                                defunc_0_m_fun_res_f_res_221363 = y_221340;
                            } else {
                                int64_t x_221364 = sub64(j_221355, (int64_t) 1);
                                int64_t x_221365 = mul64(jump_s_196701,
                                                         x_221364);
                                int64_t min_arg_221366 = add64((int64_t) 1,
                                                               x_221365);
                                int64_t min_res_221367 =
                                        smin64(defunc_0_f_res_196740,
                                               min_arg_221366);
                                
                                defunc_0_m_fun_res_f_res_221363 =
                                    min_res_221367;
                            }
                            defunc_0_m_fun_res_221360 =
                                defunc_0_m_fun_res_f_res_221363;
                        }
                        
                        int64_t defunc_0_m_fun_arg_221368 = add64((int64_t) 1,
                                                                  j_221355);
                        bool cond_221369 = defunc_0_m_fun_arg_221368 ==
                             (int64_t) 0;
                        int64_t defunc_0_m_fun_res_221370;
                        
                        if (cond_221369) {
                            defunc_0_m_fun_res_221370 = (int64_t) 0;
                        } else {
                            int64_t y_221371 = sub64(s_n_m_196745, (int64_t) 1);
                            bool cond_221372 = defunc_0_m_fun_arg_221368 ==
                                 y_221371;
                            int64_t defunc_0_m_fun_res_f_res_221373;
                            
                            if (cond_221372) {
                                defunc_0_m_fun_res_f_res_221373 = y_221340;
                            } else {
                                int64_t x_221374 = mul64(jump_s_196701,
                                                         j_221355);
                                int64_t min_arg_221375 = add64((int64_t) 1,
                                                               x_221374);
                                int64_t min_res_221376 =
                                        smin64(defunc_0_f_res_196740,
                                               min_arg_221375);
                                
                                defunc_0_m_fun_res_f_res_221373 =
                                    min_res_221376;
                            }
                            defunc_0_m_fun_res_221370 =
                                defunc_0_m_fun_res_f_res_221373;
                        }
                        
                        int64_t i64_arg_221377 =
                                sub64(defunc_0_m_fun_res_221370,
                                      defunc_0_m_fun_res_221360);
                        float i64_res_221378 = sitofp_i64_f32(i64_arg_221377);
                        int64_t i64_arg_221379 = sub64(i_221333,
                                                       defunc_0_m_fun_res_221360);
                        float i64_res_221380 = sitofp_i64_f32(i64_arg_221379);
                        float u_221381 = i64_res_221380 / i64_res_221378;
                        float u2_221382 = u_221381 * u_221381;
                        float u3_221383 = u_221381 * u2_221382;
                        float x_221384 = 2.0F * u3_221383;
                        float y_221385 = 3.0F * u2_221382;
                        float x_221386 = x_221384 - y_221385;
                        float x_221387 = 1.0F + x_221386;
                        bool x_221388 = sle64((int64_t) 0, j_221355);
                        bool y_221389 = slt64(j_221355, s_n_m_196745);
                        bool bounds_check_221390 = x_221388 && y_221389;
                        bool index_certs_221391;
                        
                        if (!bounds_check_221390) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [", (long long) j_221355,
                                          "] out of bounds for array of shape [",
                                          (long long) s_n_m_196745, "].",
                                          "-> #0  loess.fut:535:27-33\n   #1  loess.fut:564:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                            err = 1;
                            goto cleanup;
                        }
                        
                        float y_221392;
                        
                        y_221392 = ((float *) ext_mem_212177.mem)[gtid_204649 *
                                                                  (s_n_m_196745 *
                                                                   n_p_196694) +
                                                                  i_221330 *
                                                                  s_n_m_196745 +
                                                                  j_221355];
                        
                        float x_221393 = x_221387 * y_221392;
                        float x_221394 = y_221385 - x_221384;
                        bool x_221395 = sle64((int64_t) 0,
                                              defunc_0_m_fun_arg_221368);
                        bool y_221396 = slt64(defunc_0_m_fun_arg_221368,
                                              s_n_m_196745);
                        bool bounds_check_221397 = x_221395 && y_221396;
                        bool index_certs_221398;
                        
                        if (!bounds_check_221397) {
                            ctx->error =
                                msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                          "Index [",
                                          (long long) defunc_0_m_fun_arg_221368,
                                          "] out of bounds for array of shape [",
                                          (long long) s_n_m_196745, "].",
                                          "-> #0  loess.fut:536:27-37\n   #1  loess.fut:564:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                            err = 1;
                            goto cleanup;
                        }
                        
                        float y_221399;
                        
                        y_221399 = ((float *) ext_mem_212177.mem)[gtid_204649 *
                                                                  (s_n_m_196745 *
                                                                   n_p_196694) +
                                                                  i_221330 *
                                                                  s_n_m_196745 +
                                                                  defunc_0_m_fun_arg_221368];
                        
                        float y_221400 = x_221394 * y_221399;
                        float x_221401 = x_221393 + y_221400;
                        float y_221402 = 2.0F * u2_221382;
                        float x_221403 = u3_221383 - y_221402;
                        float x_221404 = u_221381 + x_221403;
                        float y_221405;
                        
                        y_221405 = ((float *) ext_mem_212176.mem)[gtid_204649 *
                                                                  (s_n_m_196745 *
                                                                   n_p_196694) +
                                                                  i_221330 *
                                                                  s_n_m_196745 +
                                                                  j_221355];
                        
                        float x_221406 = x_221404 * y_221405;
                        float y_221407 = i64_res_221378 * x_221406;
                        float x_221408 = x_221401 + y_221407;
                        float x_221409 = u3_221383 - u2_221382;
                        float y_221410;
                        
                        y_221410 = ((float *) ext_mem_212176.mem)[gtid_204649 *
                                                                  (s_n_m_196745 *
                                                                   n_p_196694) +
                                                                  i_221330 *
                                                                  s_n_m_196745 +
                                                                  defunc_0_m_fun_arg_221368];
                        
                        float x_221411 = x_221409 * y_221410;
                        float y_221412 = i64_res_221378 * x_221411;
                        float defunc_4_interpolate_proc_res_221413 = x_221408 +
                              y_221412;
                        
                        defunc_0_f_res_f_res_221342 =
                            defunc_4_interpolate_proc_res_221413;
                    }
                    defunc_0_f_res_221336 = defunc_0_f_res_f_res_221342;
                }
                ((float *) mem_212203)[i_221330 * pad_css_len_196741 +
                                       i_221333] = defunc_0_f_res_221336;
            }
        }
        if (n_p_196694 * pad_css_len_196741 * (int64_t) 4 > 0)
            memmove(mem_212248.mem + gtid_204649 * (pad_css_len_196741 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_212203 + (int64_t) 0, n_p_196694 * pad_css_len_196741 *
                    (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212203);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228844_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228844_end -
                 futhark_mc_segmap_parloop_228844_start;
        
        ctx->futhark_mc_segmap_parloop_228844_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228844_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228844_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228842(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204648 = tid;
    int num_tasks_221328 = info.nsubtasks;
    struct futhark_mc_task_228841 *futhark_mc_task_228841 =
                                  (struct futhark_mc_task_228841 *) args;
    struct futhark_context *ctx = futhark_mc_task_228841->ctx;
    uint64_t futhark_mc_segmap_task_228842_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228842_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228841->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228841->free_n_p_196694;
    int64_t jump_s_196701 = futhark_mc_task_228841->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228841->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228841->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228841->free_s_n_m_196745;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_task_228841->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_task_228841->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 = futhark_mc_task_228841->free_bytes_212179;
    int64_t bytes_212198 = futhark_mc_task_228841->free_bytes_212198;
    struct memblock mem_212248 = {.desc ="mem_212248", .mem =
                                  futhark_mc_task_228841->free_mem_212248,
                                  .size =0, .references =NULL};
    int64_t iter_221329;
    struct futhark_mc_segmap_parloop_struct_228843
    futhark_mc_segmap_parloop_struct_228843;
    
    futhark_mc_segmap_parloop_struct_228843.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228843.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228843.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228843.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228843.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228843.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228843.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228843.free_ext_mem_212176 =
        ext_mem_212176.mem;
    futhark_mc_segmap_parloop_struct_228843.free_ext_mem_212177 =
        ext_mem_212177.mem;
    futhark_mc_segmap_parloop_struct_228843.free_bytes_212198 = bytes_212198;
    futhark_mc_segmap_parloop_struct_228843.free_mem_212248 = mem_212248.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228844_task;
    
    futhark_mc_segmap_parloop_228844_task.name =
        "futhark_mc_segmap_parloop_228844";
    futhark_mc_segmap_parloop_228844_task.fn = futhark_mc_segmap_parloop_228844;
    futhark_mc_segmap_parloop_228844_task.args =
        &futhark_mc_segmap_parloop_struct_228843;
    futhark_mc_segmap_parloop_228844_task.iterations = iterations;
    futhark_mc_segmap_parloop_228844_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228844_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228844_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228844_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228844_task);
    
    if (futhark_mc_segmap_parloop_228844_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228844_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228844_total_end -
                 futhark_mc_segmap_parloop_228844_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228844_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228844_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228844_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228842_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228842_end -
                 futhark_mc_segmap_task_228842_start;
        
        ctx->futhark_mc_segmap_task_228842_runs[tid]++;
        ctx->futhark_mc_segmap_task_228842_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228842_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228847 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_bytes_212179;
    int64_t free_bytes_212198;
    unsigned char *free_mem_212248;
};
struct futhark_mc_task_228850 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204746;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_bytes_212179;
    unsigned char *free_mem_212199;
};
struct futhark_mc_segmap_parloop_struct_228852 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204746;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_bytes_212179;
    unsigned char *free_mem_212199;
};
static int futhark_mc_segmap_parloop_228853(void *args, int64_t start,
                                            int64_t end, int flat_tid_221505,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228852
    *futhark_mc_segmap_parloop_struct_228852 =
    (struct futhark_mc_segmap_parloop_struct_228852 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228852->ctx;
    uint64_t futhark_mc_segmap_parloop_228853_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228853_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228852->free_n_p_196694;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228852->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228852->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228852->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228852->free_s_n_m_196745;
    int64_t gtid_204746 =
            futhark_mc_segmap_parloop_struct_228852->free_gtid_204746;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_segmap_parloop_struct_228852->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_segmap_parloop_struct_228852->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 =
            futhark_mc_segmap_parloop_struct_228852->free_bytes_212179;
    struct memblock mem_212199 = {.desc ="mem_212199", .mem =
                                  futhark_mc_segmap_parloop_struct_228852->free_mem_212199,
                                  .size =0, .references =NULL};
    size_t mem_221507_cached_sizze_228854 = 0;
    unsigned char *mem_221507 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221595 = start;
    
    if (mem_221507_cached_sizze_228854 < (size_t) bytes_212179) {
        mem_221507 = realloc(mem_221507, bytes_212179);
        mem_221507_cached_sizze_228854 = bytes_212179;
    }
    for (; iter_221595 < end; iter_221595++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221678 = n_p_196694;
        int64_t gtid_221506 = iter_221595;
        int64_t remnant_221679 = iter_221595 - gtid_221506;
        
        for (int64_t i_221596 = 0; i_221596 < pad_css_len_196741; i_221596++) {
            bool cond_221598 = i_221596 == (int64_t) 0;
            float defunc_0_f_res_221599;
            
            if (cond_221598) {
                bool y_221600 = slt64((int64_t) 0, s_n_m_196745);
                bool index_certs_221601;
                
                if (!y_221600) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) (int64_t) 0,
                                  "] out of bounds for array of shape [",
                                  (long long) s_n_m_196745, "].",
                                  "-> #0  /prelude/array.fut:21:29-32\n   #1  loess.fut:558:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float head_res_221602;
                
                head_res_221602 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                                 (s_n_m_196745 *
                                                                  n_p_196694) +
                                                                 gtid_221506 *
                                                                 s_n_m_196745];
                defunc_0_f_res_221599 = head_res_221602;
            } else {
                int64_t y_221603 = sub64(pad_css_len_196741, (int64_t) 1);
                bool cond_221604 = i_221596 == y_221603;
                float defunc_0_f_res_f_res_221605;
                
                if (cond_221604) {
                    int64_t i_221606 = sub64(s_n_m_196745, (int64_t) 1);
                    bool x_221607 = sle64((int64_t) 0, i_221606);
                    bool y_221608 = slt64(i_221606, s_n_m_196745);
                    bool bounds_check_221609 = x_221607 && y_221608;
                    bool index_certs_221610;
                    
                    if (!bounds_check_221609) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) i_221606,
                                      "] out of bounds for array of shape [",
                                      (long long) s_n_m_196745, "].",
                                      "-> #0  /prelude/array.fut:26:29-34\n   #1  loess.fut:560:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    float last_res_221611;
                    
                    last_res_221611 =
                        ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                       (s_n_m_196745 *
                                                        n_p_196694) +
                                                       gtid_221506 *
                                                       s_n_m_196745 + i_221606];
                    defunc_0_f_res_f_res_221605 = last_res_221611;
                } else {
                    int64_t x_221612 = sub64(i_221596, (int64_t) 1);
                    bool zzero_221613 = jump_s_196701 == (int64_t) 0;
                    bool nonzzero_221614 = !zzero_221613;
                    bool nonzzero_cert_221615;
                    
                    if (!nonzzero_221614) {
                        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                               "division by zero",
                                               "-> #0  loess.fut:562:22-35\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:556:3-565:9\n   #5  stl.fut:220:31-96\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:219:23-221:48\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:218:15-222:44\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t x_221616 = sdiv64(x_221612, jump_s_196701);
                    int64_t m_v_221617 = add64((int64_t) 1, x_221616);
                    int64_t j_221618;
                    
                    if (cond_221598) {
                        j_221618 = (int64_t) 0;
                    } else {
                        int64_t y_221619 = sub64(s_n_m_196745, (int64_t) 1);
                        bool cond_221620 = m_v_221617 == y_221619;
                        int64_t j_f_res_221621;
                        
                        if (cond_221620) {
                            j_f_res_221621 = x_221616;
                        } else {
                            j_f_res_221621 = m_v_221617;
                        }
                        j_221618 = j_f_res_221621;
                    }
                    
                    bool cond_221622 = j_221618 == (int64_t) 0;
                    int64_t defunc_0_m_fun_res_221623;
                    
                    if (cond_221622) {
                        defunc_0_m_fun_res_221623 = (int64_t) 0;
                    } else {
                        int64_t y_221624 = sub64(s_n_m_196745, (int64_t) 1);
                        bool cond_221625 = j_221618 == y_221624;
                        int64_t defunc_0_m_fun_res_f_res_221626;
                        
                        if (cond_221625) {
                            defunc_0_m_fun_res_f_res_221626 = y_221603;
                        } else {
                            int64_t x_221627 = sub64(j_221618, (int64_t) 1);
                            int64_t x_221628 = mul64(jump_s_196701, x_221627);
                            int64_t min_arg_221629 = add64((int64_t) 1,
                                                           x_221628);
                            int64_t min_res_221630 =
                                    smin64(defunc_0_f_res_196740,
                                           min_arg_221629);
                            
                            defunc_0_m_fun_res_f_res_221626 = min_res_221630;
                        }
                        defunc_0_m_fun_res_221623 =
                            defunc_0_m_fun_res_f_res_221626;
                    }
                    
                    int64_t defunc_0_m_fun_arg_221631 = add64((int64_t) 1,
                                                              j_221618);
                    bool cond_221632 = defunc_0_m_fun_arg_221631 == (int64_t) 0;
                    int64_t defunc_0_m_fun_res_221633;
                    
                    if (cond_221632) {
                        defunc_0_m_fun_res_221633 = (int64_t) 0;
                    } else {
                        int64_t y_221634 = sub64(s_n_m_196745, (int64_t) 1);
                        bool cond_221635 = defunc_0_m_fun_arg_221631 ==
                             y_221634;
                        int64_t defunc_0_m_fun_res_f_res_221636;
                        
                        if (cond_221635) {
                            defunc_0_m_fun_res_f_res_221636 = y_221603;
                        } else {
                            int64_t x_221637 = mul64(jump_s_196701, j_221618);
                            int64_t min_arg_221638 = add64((int64_t) 1,
                                                           x_221637);
                            int64_t min_res_221639 =
                                    smin64(defunc_0_f_res_196740,
                                           min_arg_221638);
                            
                            defunc_0_m_fun_res_f_res_221636 = min_res_221639;
                        }
                        defunc_0_m_fun_res_221633 =
                            defunc_0_m_fun_res_f_res_221636;
                    }
                    
                    int64_t i64_arg_221640 = sub64(defunc_0_m_fun_res_221633,
                                                   defunc_0_m_fun_res_221623);
                    float i64_res_221641 = sitofp_i64_f32(i64_arg_221640);
                    int64_t i64_arg_221642 = sub64(i_221596,
                                                   defunc_0_m_fun_res_221623);
                    float i64_res_221643 = sitofp_i64_f32(i64_arg_221642);
                    float u_221644 = i64_res_221643 / i64_res_221641;
                    float u2_221645 = u_221644 * u_221644;
                    float u3_221646 = u_221644 * u2_221645;
                    float x_221647 = 2.0F * u3_221646;
                    float y_221648 = 3.0F * u2_221645;
                    float x_221649 = x_221647 - y_221648;
                    float x_221650 = 1.0F + x_221649;
                    bool x_221651 = sle64((int64_t) 0, j_221618);
                    bool y_221652 = slt64(j_221618, s_n_m_196745);
                    bool bounds_check_221653 = x_221651 && y_221652;
                    bool index_certs_221654;
                    
                    if (!bounds_check_221653) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [", (long long) j_221618,
                                      "] out of bounds for array of shape [",
                                      (long long) s_n_m_196745, "].",
                                      "-> #0  loess.fut:535:27-33\n   #1  loess.fut:564:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    float y_221655;
                    
                    y_221655 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                              (s_n_m_196745 *
                                                               n_p_196694) +
                                                              gtid_221506 *
                                                              s_n_m_196745 +
                                                              j_221618];
                    
                    float x_221656 = x_221650 * y_221655;
                    float x_221657 = y_221648 - x_221647;
                    bool x_221658 = sle64((int64_t) 0,
                                          defunc_0_m_fun_arg_221631);
                    bool y_221659 = slt64(defunc_0_m_fun_arg_221631,
                                          s_n_m_196745);
                    bool bounds_check_221660 = x_221658 && y_221659;
                    bool index_certs_221661;
                    
                    if (!bounds_check_221660) {
                        ctx->error =
                            msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                      "Index [",
                                      (long long) defunc_0_m_fun_arg_221631,
                                      "] out of bounds for array of shape [",
                                      (long long) s_n_m_196745, "].",
                                      "-> #0  loess.fut:536:27-37\n   #1  loess.fut:564:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                        err = 1;
                        goto cleanup;
                    }
                    
                    float y_221662;
                    
                    y_221662 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                              (s_n_m_196745 *
                                                               n_p_196694) +
                                                              gtid_221506 *
                                                              s_n_m_196745 +
                                                              defunc_0_m_fun_arg_221631];
                    
                    float y_221663 = x_221657 * y_221662;
                    float x_221664 = x_221656 + y_221663;
                    float y_221665 = 2.0F * u2_221645;
                    float x_221666 = u3_221646 - y_221665;
                    float x_221667 = u_221644 + x_221666;
                    float y_221668;
                    
                    y_221668 = ((float *) ext_mem_212176.mem)[gtid_204746 *
                                                              (s_n_m_196745 *
                                                               n_p_196694) +
                                                              gtid_221506 *
                                                              s_n_m_196745 +
                                                              j_221618];
                    
                    float x_221669 = x_221667 * y_221668;
                    float y_221670 = i64_res_221641 * x_221669;
                    float x_221671 = x_221664 + y_221670;
                    float x_221672 = u3_221646 - u2_221645;
                    float y_221673;
                    
                    y_221673 = ((float *) ext_mem_212176.mem)[gtid_204746 *
                                                              (s_n_m_196745 *
                                                               n_p_196694) +
                                                              gtid_221506 *
                                                              s_n_m_196745 +
                                                              defunc_0_m_fun_arg_221631];
                    
                    float x_221674 = x_221672 * y_221673;
                    float y_221675 = i64_res_221641 * x_221674;
                    float defunc_4_interpolate_proc_res_221676 = x_221671 +
                          y_221675;
                    
                    defunc_0_f_res_f_res_221605 =
                        defunc_4_interpolate_proc_res_221676;
                }
                defunc_0_f_res_221599 = defunc_0_f_res_f_res_221605;
            }
            ((float *) mem_221507)[i_221596] = defunc_0_f_res_221599;
        }
        if (pad_css_len_196741 * (int64_t) 4 > 0)
            memmove(mem_212199.mem + gtid_221506 * pad_css_len_196741 *
                    (int64_t) 4, mem_221507 + (int64_t) 0, pad_css_len_196741 *
                    (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_221507);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228853_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228853_end -
                 futhark_mc_segmap_parloop_228853_start;
        
        ctx->futhark_mc_segmap_parloop_228853_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228853_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228853_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228851(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221505 = tid;
    int num_tasks_221594 = info.nsubtasks;
    struct futhark_mc_task_228850 *futhark_mc_task_228850 =
                                  (struct futhark_mc_task_228850 *) args;
    struct futhark_context *ctx = futhark_mc_task_228850->ctx;
    uint64_t futhark_mc_segmap_task_228851_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228851_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228850->free_n_p_196694;
    int64_t jump_s_196701 = futhark_mc_task_228850->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228850->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228850->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228850->free_s_n_m_196745;
    int64_t gtid_204746 = futhark_mc_task_228850->free_gtid_204746;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_task_228850->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_task_228850->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 = futhark_mc_task_228850->free_bytes_212179;
    struct memblock mem_212199 = {.desc ="mem_212199", .mem =
                                  futhark_mc_task_228850->free_mem_212199,
                                  .size =0, .references =NULL};
    int64_t iter_221595;
    struct futhark_mc_segmap_parloop_struct_228852
    futhark_mc_segmap_parloop_struct_228852;
    
    futhark_mc_segmap_parloop_struct_228852.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228852.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228852.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228852.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228852.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228852.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228852.free_gtid_204746 = gtid_204746;
    futhark_mc_segmap_parloop_struct_228852.free_ext_mem_212176 =
        ext_mem_212176.mem;
    futhark_mc_segmap_parloop_struct_228852.free_ext_mem_212177 =
        ext_mem_212177.mem;
    futhark_mc_segmap_parloop_struct_228852.free_bytes_212179 = bytes_212179;
    futhark_mc_segmap_parloop_struct_228852.free_mem_212199 = mem_212199.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228853_task;
    
    futhark_mc_segmap_parloop_228853_task.name =
        "futhark_mc_segmap_parloop_228853";
    futhark_mc_segmap_parloop_228853_task.fn = futhark_mc_segmap_parloop_228853;
    futhark_mc_segmap_parloop_228853_task.args =
        &futhark_mc_segmap_parloop_struct_228852;
    futhark_mc_segmap_parloop_228853_task.iterations = iterations;
    futhark_mc_segmap_parloop_228853_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228853_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228853_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228853_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228853_task);
    
    if (futhark_mc_segmap_parloop_228853_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228853_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228853_total_end -
                 futhark_mc_segmap_parloop_228853_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228853_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228853_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228853_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228851_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228851_end -
                 futhark_mc_segmap_task_228851_start;
        
        ctx->futhark_mc_segmap_task_228851_runs[tid]++;
        ctx->futhark_mc_segmap_task_228851_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228851_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228856 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204746;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_bytes_212179;
    unsigned char *free_mem_212199;
};
struct futhark_mc_task_228859 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204746;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_gtid_221421;
    unsigned char *free_mem_221422;
};
struct futhark_mc_segmap_parloop_struct_228861 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_jump_s_196701;
    int64_t free_defunc_0_f_res_196740;
    int64_t free_pad_css_len_196741;
    int64_t free_s_n_m_196745;
    int64_t free_gtid_204746;
    unsigned char *free_ext_mem_212176;
    unsigned char *free_ext_mem_212177;
    int64_t free_gtid_221421;
    unsigned char *free_mem_221422;
};
static int futhark_mc_segmap_parloop_228862(void *args, int64_t start,
                                            int64_t end, int flat_tid_221682,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228861
    *futhark_mc_segmap_parloop_struct_228861 =
    (struct futhark_mc_segmap_parloop_struct_228861 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228861->ctx;
    uint64_t futhark_mc_segmap_parloop_228862_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228862_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228861->free_n_p_196694;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228861->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228861->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228861->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228861->free_s_n_m_196745;
    int64_t gtid_204746 =
            futhark_mc_segmap_parloop_struct_228861->free_gtid_204746;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_segmap_parloop_struct_228861->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_segmap_parloop_struct_228861->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t gtid_221421 =
            futhark_mc_segmap_parloop_struct_228861->free_gtid_221421;
    struct memblock mem_221422 = {.desc ="mem_221422", .mem =
                                  futhark_mc_segmap_parloop_struct_228861->free_mem_221422,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221766 = start;
    
    for (; iter_221766 < end; iter_221766++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221844 = pad_css_len_196741;
        int64_t gtid_221683 = iter_221766;
        int64_t remnant_221845 = iter_221766 - gtid_221683;
        bool cond_221684 = gtid_221683 == (int64_t) 0;
        float defunc_0_f_res_221685;
        
        if (cond_221684) {
            bool y_221767 = slt64((int64_t) 0, s_n_m_196745);
            bool index_certs_221768;
            
            if (!y_221767) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) (int64_t) 0,
                              "] out of bounds for array of shape [",
                              (long long) s_n_m_196745, "].",
                              "-> #0  /prelude/array.fut:21:29-32\n   #1  loess.fut:558:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float head_res_221769;
            
            head_res_221769 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                             (s_n_m_196745 *
                                                              n_p_196694) +
                                                             gtid_221421 *
                                                             s_n_m_196745];
            defunc_0_f_res_221685 = head_res_221769;
        } else {
            int64_t y_221770 = sub64(pad_css_len_196741, (int64_t) 1);
            bool cond_221771 = gtid_221683 == y_221770;
            float defunc_0_f_res_f_res_221772;
            
            if (cond_221771) {
                int64_t i_221773 = sub64(s_n_m_196745, (int64_t) 1);
                bool x_221774 = sle64((int64_t) 0, i_221773);
                bool y_221775 = slt64(i_221773, s_n_m_196745);
                bool bounds_check_221776 = x_221774 && y_221775;
                bool index_certs_221777;
                
                if (!bounds_check_221776) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221773,
                                  "] out of bounds for array of shape [",
                                  (long long) s_n_m_196745, "].",
                                  "-> #0  /prelude/array.fut:26:29-34\n   #1  loess.fut:560:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float last_res_221778;
                
                last_res_221778 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                                 (s_n_m_196745 *
                                                                  n_p_196694) +
                                                                 gtid_221421 *
                                                                 s_n_m_196745 +
                                                                 i_221773];
                defunc_0_f_res_f_res_221772 = last_res_221778;
            } else {
                int64_t x_221779 = sub64(gtid_221683, (int64_t) 1);
                bool zzero_221780 = jump_s_196701 == (int64_t) 0;
                bool nonzzero_221781 = !zzero_221780;
                bool nonzzero_cert_221782;
                
                if (!nonzzero_221781) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:562:22-35\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:556:3-565:9\n   #5  stl.fut:220:31-96\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:219:23-221:48\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:218:15-222:44\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                int64_t x_221783 = sdiv64(x_221779, jump_s_196701);
                int64_t m_v_221784 = add64((int64_t) 1, x_221783);
                int64_t j_221785;
                
                if (cond_221684) {
                    j_221785 = (int64_t) 0;
                } else {
                    int64_t y_221786 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_221787 = m_v_221784 == y_221786;
                    int64_t j_f_res_221788;
                    
                    if (cond_221787) {
                        j_f_res_221788 = x_221783;
                    } else {
                        j_f_res_221788 = m_v_221784;
                    }
                    j_221785 = j_f_res_221788;
                }
                
                bool cond_221789 = j_221785 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_221790;
                
                if (cond_221789) {
                    defunc_0_m_fun_res_221790 = (int64_t) 0;
                } else {
                    int64_t y_221791 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_221792 = j_221785 == y_221791;
                    int64_t defunc_0_m_fun_res_f_res_221793;
                    
                    if (cond_221792) {
                        defunc_0_m_fun_res_f_res_221793 = y_221770;
                    } else {
                        int64_t x_221794 = sub64(j_221785, (int64_t) 1);
                        int64_t x_221795 = mul64(jump_s_196701, x_221794);
                        int64_t min_arg_221796 = add64((int64_t) 1, x_221795);
                        int64_t min_res_221797 = smin64(defunc_0_f_res_196740,
                                                        min_arg_221796);
                        
                        defunc_0_m_fun_res_f_res_221793 = min_res_221797;
                    }
                    defunc_0_m_fun_res_221790 = defunc_0_m_fun_res_f_res_221793;
                }
                
                int64_t defunc_0_m_fun_arg_221798 = add64((int64_t) 1,
                                                          j_221785);
                bool cond_221799 = defunc_0_m_fun_arg_221798 == (int64_t) 0;
                int64_t defunc_0_m_fun_res_221800;
                
                if (cond_221799) {
                    defunc_0_m_fun_res_221800 = (int64_t) 0;
                } else {
                    int64_t y_221801 = sub64(s_n_m_196745, (int64_t) 1);
                    bool cond_221802 = defunc_0_m_fun_arg_221798 == y_221801;
                    int64_t defunc_0_m_fun_res_f_res_221803;
                    
                    if (cond_221802) {
                        defunc_0_m_fun_res_f_res_221803 = y_221770;
                    } else {
                        int64_t x_221804 = mul64(jump_s_196701, j_221785);
                        int64_t min_arg_221805 = add64((int64_t) 1, x_221804);
                        int64_t min_res_221806 = smin64(defunc_0_f_res_196740,
                                                        min_arg_221805);
                        
                        defunc_0_m_fun_res_f_res_221803 = min_res_221806;
                    }
                    defunc_0_m_fun_res_221800 = defunc_0_m_fun_res_f_res_221803;
                }
                
                int64_t i64_arg_221807 = sub64(defunc_0_m_fun_res_221800,
                                               defunc_0_m_fun_res_221790);
                float i64_res_221808 = sitofp_i64_f32(i64_arg_221807);
                int64_t i64_arg_221809 = sub64(gtid_221683,
                                               defunc_0_m_fun_res_221790);
                float i64_res_221810 = sitofp_i64_f32(i64_arg_221809);
                float u_221811 = i64_res_221810 / i64_res_221808;
                float u2_221812 = u_221811 * u_221811;
                float u3_221813 = u_221811 * u2_221812;
                float x_221814 = 2.0F * u3_221813;
                float y_221815 = 3.0F * u2_221812;
                float x_221816 = x_221814 - y_221815;
                float x_221817 = 1.0F + x_221816;
                bool x_221818 = sle64((int64_t) 0, j_221785);
                bool y_221819 = slt64(j_221785, s_n_m_196745);
                bool bounds_check_221820 = x_221818 && y_221819;
                bool index_certs_221821;
                
                if (!bounds_check_221820) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) j_221785,
                                  "] out of bounds for array of shape [",
                                  (long long) s_n_m_196745, "].",
                                  "-> #0  loess.fut:535:27-33\n   #1  loess.fut:564:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_221822;
                
                y_221822 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                          (s_n_m_196745 *
                                                           n_p_196694) +
                                                          gtid_221421 *
                                                          s_n_m_196745 +
                                                          j_221785];
                
                float x_221823 = x_221817 * y_221822;
                float x_221824 = y_221815 - x_221814;
                bool x_221825 = sle64((int64_t) 0, defunc_0_m_fun_arg_221798);
                bool y_221826 = slt64(defunc_0_m_fun_arg_221798, s_n_m_196745);
                bool bounds_check_221827 = x_221825 && y_221826;
                bool index_certs_221828;
                
                if (!bounds_check_221827) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [",
                                  (long long) defunc_0_m_fun_arg_221798,
                                  "] out of bounds for array of shape [",
                                  (long long) s_n_m_196745, "].",
                                  "-> #0  loess.fut:536:27-37\n   #1  loess.fut:564:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:556:3-565:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:401:3-415:29\n   #14 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_221829;
                
                y_221829 = ((float *) ext_mem_212177.mem)[gtid_204746 *
                                                          (s_n_m_196745 *
                                                           n_p_196694) +
                                                          gtid_221421 *
                                                          s_n_m_196745 +
                                                          defunc_0_m_fun_arg_221798];
                
                float y_221830 = x_221824 * y_221829;
                float x_221831 = x_221823 + y_221830;
                float y_221832 = 2.0F * u2_221812;
                float x_221833 = u3_221813 - y_221832;
                float x_221834 = u_221811 + x_221833;
                float y_221835;
                
                y_221835 = ((float *) ext_mem_212176.mem)[gtid_204746 *
                                                          (s_n_m_196745 *
                                                           n_p_196694) +
                                                          gtid_221421 *
                                                          s_n_m_196745 +
                                                          j_221785];
                
                float x_221836 = x_221834 * y_221835;
                float y_221837 = i64_res_221808 * x_221836;
                float x_221838 = x_221831 + y_221837;
                float x_221839 = u3_221813 - u2_221812;
                float y_221840;
                
                y_221840 = ((float *) ext_mem_212176.mem)[gtid_204746 *
                                                          (s_n_m_196745 *
                                                           n_p_196694) +
                                                          gtid_221421 *
                                                          s_n_m_196745 +
                                                          defunc_0_m_fun_arg_221798];
                
                float x_221841 = x_221839 * y_221840;
                float y_221842 = i64_res_221808 * x_221841;
                float defunc_4_interpolate_proc_res_221843 = x_221838 +
                      y_221842;
                
                defunc_0_f_res_f_res_221772 =
                    defunc_4_interpolate_proc_res_221843;
            }
            defunc_0_f_res_221685 = defunc_0_f_res_f_res_221772;
        }
        ((float *) mem_221422.mem)[gtid_221683] = defunc_0_f_res_221685;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228862_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228862_end -
                 futhark_mc_segmap_parloop_228862_start;
        
        ctx->futhark_mc_segmap_parloop_228862_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228862_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228862_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228860(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221682 = tid;
    int num_tasks_221765 = info.nsubtasks;
    struct futhark_mc_task_228859 *futhark_mc_task_228859 =
                                  (struct futhark_mc_task_228859 *) args;
    struct futhark_context *ctx = futhark_mc_task_228859->ctx;
    uint64_t futhark_mc_segmap_task_228860_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228860_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228859->free_n_p_196694;
    int64_t jump_s_196701 = futhark_mc_task_228859->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228859->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228859->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228859->free_s_n_m_196745;
    int64_t gtid_204746 = futhark_mc_task_228859->free_gtid_204746;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_task_228859->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_task_228859->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t gtid_221421 = futhark_mc_task_228859->free_gtid_221421;
    struct memblock mem_221422 = {.desc ="mem_221422", .mem =
                                  futhark_mc_task_228859->free_mem_221422,
                                  .size =0, .references =NULL};
    int64_t iter_221766;
    struct futhark_mc_segmap_parloop_struct_228861
    futhark_mc_segmap_parloop_struct_228861;
    
    futhark_mc_segmap_parloop_struct_228861.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228861.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228861.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228861.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228861.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228861.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228861.free_gtid_204746 = gtid_204746;
    futhark_mc_segmap_parloop_struct_228861.free_ext_mem_212176 =
        ext_mem_212176.mem;
    futhark_mc_segmap_parloop_struct_228861.free_ext_mem_212177 =
        ext_mem_212177.mem;
    futhark_mc_segmap_parloop_struct_228861.free_gtid_221421 = gtid_221421;
    futhark_mc_segmap_parloop_struct_228861.free_mem_221422 = mem_221422.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228862_task;
    
    futhark_mc_segmap_parloop_228862_task.name =
        "futhark_mc_segmap_parloop_228862";
    futhark_mc_segmap_parloop_228862_task.fn = futhark_mc_segmap_parloop_228862;
    futhark_mc_segmap_parloop_228862_task.args =
        &futhark_mc_segmap_parloop_struct_228861;
    futhark_mc_segmap_parloop_228862_task.iterations = iterations;
    futhark_mc_segmap_parloop_228862_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228862_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228862_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228862_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228862_task);
    
    if (futhark_mc_segmap_parloop_228862_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228862_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228862_total_end -
                 futhark_mc_segmap_parloop_228862_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228862_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228862_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228862_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228860_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228860_end -
                 futhark_mc_segmap_task_228860_start;
        
        ctx->futhark_mc_segmap_task_228860_runs[tid]++;
        ctx->futhark_mc_segmap_task_228860_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228860_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228857(void *args, int64_t start,
                                            int64_t end, int flat_tid_221420,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228856
    *futhark_mc_segmap_parloop_struct_228856 =
    (struct futhark_mc_segmap_parloop_struct_228856 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228856->ctx;
    uint64_t futhark_mc_segmap_parloop_228857_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228857_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228856->free_n_p_196694;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228856->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228856->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228856->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228856->free_s_n_m_196745;
    int64_t gtid_204746 =
            futhark_mc_segmap_parloop_struct_228856->free_gtid_204746;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_segmap_parloop_struct_228856->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_segmap_parloop_struct_228856->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 =
            futhark_mc_segmap_parloop_struct_228856->free_bytes_212179;
    struct memblock mem_212199 = {.desc ="mem_212199", .mem =
                                  futhark_mc_segmap_parloop_struct_228856->free_mem_212199,
                                  .size =0, .references =NULL};
    size_t mem_221422_cached_sizze_228858 = 0;
    unsigned char *mem_221422 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221681 = start;
    
    if (mem_221422_cached_sizze_228858 < (size_t) bytes_212179) {
        mem_221422 = realloc(mem_221422, bytes_212179);
        mem_221422_cached_sizze_228858 = bytes_212179;
    }
    for (; iter_221681 < end; iter_221681++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221763 = n_p_196694;
        int64_t gtid_221421 = iter_221681;
        int64_t remnant_221764 = iter_221681 - gtid_221421;
        int64_t flat_tid_221682 = (int64_t) 0;
        int32_t num_tasks_221765;
        struct futhark_mc_task_228859 futhark_mc_task_228859;
        
        futhark_mc_task_228859.ctx = ctx;
        futhark_mc_task_228859.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228859.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228859.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228859.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228859.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228859.free_gtid_204746 = gtid_204746;
        futhark_mc_task_228859.free_ext_mem_212176 = ext_mem_212176.mem;
        futhark_mc_task_228859.free_ext_mem_212177 = ext_mem_212177.mem;
        futhark_mc_task_228859.free_gtid_221421 = gtid_221421;
        futhark_mc_task_228859.free_mem_221422 = mem_221422;
        
        struct scheduler_segop futhark_mc_task_228859_task;
        
        futhark_mc_task_228859_task.args = &futhark_mc_task_228859;
        futhark_mc_task_228859_task.top_level_fn =
            futhark_mc_segmap_task_228860;
        futhark_mc_task_228859_task.name = "futhark_mc_segmap_task_228860";
        futhark_mc_task_228859_task.iterations = pad_css_len_196741;
        futhark_mc_task_228859_task.task_time =
            &ctx->futhark_mc_segmap_task_228860_total_time;
        futhark_mc_task_228859_task.task_iter =
            &ctx->futhark_mc_segmap_task_228860_total_iter;
        futhark_mc_task_228859_task.sched = STATIC;
        futhark_mc_task_228859_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228860_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228859_task);
        
        if (futhark_mc_segmap_task_228860_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (pad_css_len_196741 * (int64_t) 4 > 0)
            memmove(mem_212199.mem + gtid_221421 * pad_css_len_196741 *
                    (int64_t) 4, mem_221422 + (int64_t) 0, pad_css_len_196741 *
                    (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_221422);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228857_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228857_end -
                 futhark_mc_segmap_parloop_228857_start;
        
        ctx->futhark_mc_segmap_parloop_228857_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228857_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228857_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228855(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221420 = tid;
    int num_tasks_221594 = info.nsubtasks;
    struct futhark_mc_task_228850 *futhark_mc_task_228850 =
                                  (struct futhark_mc_task_228850 *) args;
    struct futhark_context *ctx = futhark_mc_task_228850->ctx;
    uint64_t futhark_mc_segmap_nested_task_228855_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228855_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228850->free_n_p_196694;
    int64_t jump_s_196701 = futhark_mc_task_228850->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228850->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228850->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228850->free_s_n_m_196745;
    int64_t gtid_204746 = futhark_mc_task_228850->free_gtid_204746;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_task_228850->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_task_228850->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 = futhark_mc_task_228850->free_bytes_212179;
    struct memblock mem_212199 = {.desc ="mem_212199", .mem =
                                  futhark_mc_task_228850->free_mem_212199,
                                  .size =0, .references =NULL};
    int64_t iter_221681;
    struct futhark_mc_segmap_parloop_struct_228856
    futhark_mc_segmap_parloop_struct_228856;
    
    futhark_mc_segmap_parloop_struct_228856.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228856.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228856.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228856.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228856.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228856.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228856.free_gtid_204746 = gtid_204746;
    futhark_mc_segmap_parloop_struct_228856.free_ext_mem_212176 =
        ext_mem_212176.mem;
    futhark_mc_segmap_parloop_struct_228856.free_ext_mem_212177 =
        ext_mem_212177.mem;
    futhark_mc_segmap_parloop_struct_228856.free_bytes_212179 = bytes_212179;
    futhark_mc_segmap_parloop_struct_228856.free_mem_212199 = mem_212199.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228857_task;
    
    futhark_mc_segmap_parloop_228857_task.name =
        "futhark_mc_segmap_parloop_228857";
    futhark_mc_segmap_parloop_228857_task.fn = futhark_mc_segmap_parloop_228857;
    futhark_mc_segmap_parloop_228857_task.args =
        &futhark_mc_segmap_parloop_struct_228856;
    futhark_mc_segmap_parloop_228857_task.iterations = iterations;
    futhark_mc_segmap_parloop_228857_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228857_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228857_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228857_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228857_task);
    
    if (futhark_mc_segmap_parloop_228857_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228857_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228857_total_end -
                 futhark_mc_segmap_parloop_228857_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228857_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228857_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228857_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228855_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228855_end -
                 futhark_mc_segmap_nested_task_228855_start;
        
        ctx->futhark_mc_segmap_nested_task_228855_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228855_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228855_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228848(void *args, int64_t start,
                                            int64_t end, int flat_tid_204745,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228847
    *futhark_mc_segmap_parloop_struct_228847 =
    (struct futhark_mc_segmap_parloop_struct_228847 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228847->ctx;
    uint64_t futhark_mc_segmap_parloop_228848_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228848_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228847->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228847->free_n_p_196694;
    int64_t jump_s_196701 =
            futhark_mc_segmap_parloop_struct_228847->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_segmap_parloop_struct_228847->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_segmap_parloop_struct_228847->free_pad_css_len_196741;
    int64_t s_n_m_196745 =
            futhark_mc_segmap_parloop_struct_228847->free_s_n_m_196745;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_segmap_parloop_struct_228847->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_segmap_parloop_struct_228847->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 =
            futhark_mc_segmap_parloop_struct_228847->free_bytes_212179;
    int64_t bytes_212198 =
            futhark_mc_segmap_parloop_struct_228847->free_bytes_212198;
    struct memblock mem_212248 = {.desc ="mem_212248", .mem =
                                  futhark_mc_segmap_parloop_struct_228847->free_mem_212248,
                                  .size =0, .references =NULL};
    size_t mem_212199_cached_sizze_228849 = 0;
    unsigned char *mem_212199 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221419 = start;
    
    if (mem_212199_cached_sizze_228849 < (size_t) bytes_212198) {
        mem_212199 = realloc(mem_212199, bytes_212198);
        mem_212199_cached_sizze_228849 = bytes_212198;
    }
    for (; iter_221419 < end; iter_221419++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221592 = m_196691;
        int64_t gtid_204746 = iter_221419;
        int64_t remnant_221593 = iter_221419 - gtid_204746;
        int64_t flat_tid_221505 = (int64_t) 0;
        int32_t num_tasks_221594;
        int64_t flat_tid_221420 = (int64_t) 0;
        struct futhark_mc_task_228850 futhark_mc_task_228850;
        
        futhark_mc_task_228850.ctx = ctx;
        futhark_mc_task_228850.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228850.free_jump_s_196701 = jump_s_196701;
        futhark_mc_task_228850.free_defunc_0_f_res_196740 =
            defunc_0_f_res_196740;
        futhark_mc_task_228850.free_pad_css_len_196741 = pad_css_len_196741;
        futhark_mc_task_228850.free_s_n_m_196745 = s_n_m_196745;
        futhark_mc_task_228850.free_gtid_204746 = gtid_204746;
        futhark_mc_task_228850.free_ext_mem_212176 = ext_mem_212176.mem;
        futhark_mc_task_228850.free_ext_mem_212177 = ext_mem_212177.mem;
        futhark_mc_task_228850.free_bytes_212179 = bytes_212179;
        futhark_mc_task_228850.free_mem_212199 = mem_212199;
        
        struct scheduler_segop futhark_mc_task_228850_task;
        
        futhark_mc_task_228850_task.args = &futhark_mc_task_228850;
        futhark_mc_task_228850_task.top_level_fn =
            futhark_mc_segmap_task_228851;
        futhark_mc_task_228850_task.name = "futhark_mc_segmap_task_228851";
        futhark_mc_task_228850_task.iterations = n_p_196694;
        futhark_mc_task_228850_task.task_time =
            &ctx->futhark_mc_segmap_task_228851_total_time;
        futhark_mc_task_228850_task.task_iter =
            &ctx->futhark_mc_segmap_task_228851_total_iter;
        futhark_mc_task_228850_task.sched = STATIC;
        futhark_mc_task_228850_task.nested_fn =
            futhark_mc_segmap_nested_task_228855;
        
        int futhark_mc_segmap_task_228851_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228850_task);
        
        if (futhark_mc_segmap_task_228851_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_p_196694 * pad_css_len_196741 * (int64_t) 4 > 0)
            memmove(mem_212248.mem + gtid_204746 * (pad_css_len_196741 *
                                                    n_p_196694) * (int64_t) 4,
                    mem_212199 + (int64_t) 0, n_p_196694 * pad_css_len_196741 *
                    (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212199);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228848_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228848_end -
                 futhark_mc_segmap_parloop_228848_start;
        
        ctx->futhark_mc_segmap_parloop_228848_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228848_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228848_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228846(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204745 = tid;
    int num_tasks_221328 = info.nsubtasks;
    struct futhark_mc_task_228841 *futhark_mc_task_228841 =
                                  (struct futhark_mc_task_228841 *) args;
    struct futhark_context *ctx = futhark_mc_task_228841->ctx;
    uint64_t futhark_mc_segmap_nested_task_228846_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228846_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228841->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228841->free_n_p_196694;
    int64_t jump_s_196701 = futhark_mc_task_228841->free_jump_s_196701;
    int64_t defunc_0_f_res_196740 =
            futhark_mc_task_228841->free_defunc_0_f_res_196740;
    int64_t pad_css_len_196741 =
            futhark_mc_task_228841->free_pad_css_len_196741;
    int64_t s_n_m_196745 = futhark_mc_task_228841->free_s_n_m_196745;
    struct memblock ext_mem_212176 = {.desc ="ext_mem_212176", .mem =
                                      futhark_mc_task_228841->free_ext_mem_212176,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212177 = {.desc ="ext_mem_212177", .mem =
                                      futhark_mc_task_228841->free_ext_mem_212177,
                                      .size =0, .references =NULL};
    int64_t bytes_212179 = futhark_mc_task_228841->free_bytes_212179;
    int64_t bytes_212198 = futhark_mc_task_228841->free_bytes_212198;
    struct memblock mem_212248 = {.desc ="mem_212248", .mem =
                                  futhark_mc_task_228841->free_mem_212248,
                                  .size =0, .references =NULL};
    int64_t iter_221419;
    struct futhark_mc_segmap_parloop_struct_228847
    futhark_mc_segmap_parloop_struct_228847;
    
    futhark_mc_segmap_parloop_struct_228847.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228847.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228847.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228847.free_jump_s_196701 = jump_s_196701;
    futhark_mc_segmap_parloop_struct_228847.free_defunc_0_f_res_196740 =
        defunc_0_f_res_196740;
    futhark_mc_segmap_parloop_struct_228847.free_pad_css_len_196741 =
        pad_css_len_196741;
    futhark_mc_segmap_parloop_struct_228847.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_segmap_parloop_struct_228847.free_ext_mem_212176 =
        ext_mem_212176.mem;
    futhark_mc_segmap_parloop_struct_228847.free_ext_mem_212177 =
        ext_mem_212177.mem;
    futhark_mc_segmap_parloop_struct_228847.free_bytes_212179 = bytes_212179;
    futhark_mc_segmap_parloop_struct_228847.free_bytes_212198 = bytes_212198;
    futhark_mc_segmap_parloop_struct_228847.free_mem_212248 = mem_212248.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228848_task;
    
    futhark_mc_segmap_parloop_228848_task.name =
        "futhark_mc_segmap_parloop_228848";
    futhark_mc_segmap_parloop_228848_task.fn = futhark_mc_segmap_parloop_228848;
    futhark_mc_segmap_parloop_228848_task.args =
        &futhark_mc_segmap_parloop_struct_228847;
    futhark_mc_segmap_parloop_228848_task.iterations = iterations;
    futhark_mc_segmap_parloop_228848_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228848_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228848_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228848_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228848_task);
    
    if (futhark_mc_segmap_parloop_228848_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228848_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228848_total_end -
                 futhark_mc_segmap_parloop_228848_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228848_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228848_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228848_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228846_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228846_end -
                 futhark_mc_segmap_nested_task_228846_start;
        
        ctx->futhark_mc_segmap_nested_task_228846_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228846_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228846_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228863 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_css_results_l_197223;
    unsigned char *free_ext_mem_212249;
    int64_t free_bytes_212252;
    unsigned char *free_mem_212272;
};
struct futhark_mc_segmap_parloop_struct_228865 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_css_results_l_197223;
    unsigned char *free_ext_mem_212249;
    int64_t free_bytes_212252;
    unsigned char *free_mem_212272;
};
static int futhark_mc_segmap_parloop_228866(void *args, int64_t start,
                                            int64_t end, int flat_tid_204922,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228865
    *futhark_mc_segmap_parloop_struct_228865 =
    (struct futhark_mc_segmap_parloop_struct_228865 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228865->ctx;
    uint64_t futhark_mc_segmap_parloop_228866_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228866_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228865->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228865->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228865->free_C_len_196743;
    int64_t css_results_l_197223 =
            futhark_mc_segmap_parloop_struct_228865->free_css_results_l_197223;
    struct memblock ext_mem_212249 = {.desc ="ext_mem_212249", .mem =
                                      futhark_mc_segmap_parloop_struct_228865->free_ext_mem_212249,
                                      .size =0, .references =NULL};
    int64_t bytes_212252 =
            futhark_mc_segmap_parloop_struct_228865->free_bytes_212252;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_228865->free_mem_212272,
                                  .size =0, .references =NULL};
    size_t mem_212256_cached_sizze_228867 = 0;
    unsigned char *mem_212256 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221847 = start;
    
    if (mem_212256_cached_sizze_228867 < (size_t) bytes_212252) {
        mem_212256 = realloc(mem_212256, bytes_212252);
        mem_212256_cached_sizze_228867 = bytes_212252;
    }
    for (; iter_221847 < end; iter_221847++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221862 = m_196691;
        int64_t gtid_204923 = iter_221847;
        int64_t remnant_221863 = iter_221847 - gtid_204923;
        
        for (int64_t i_221848 = 0; i_221848 < C_len_196743; i_221848++) {
            int64_t i_221850 = smod64(i_221848, n_p_196694);
            bool x_221851 = sle64((int64_t) 0, i_221850);
            bool y_221852 = slt64(i_221850, n_p_196694);
            bool bounds_check_221853 = x_221851 && y_221852;
            int64_t i_221854 = sdiv64(i_221848, n_p_196694);
            bool x_221855 = sle64((int64_t) 0, i_221854);
            bool y_221856 = slt64(i_221854, css_results_l_197223);
            bool bounds_check_221857 = x_221855 && y_221856;
            bool index_ok_221858 = bounds_check_221853 && bounds_check_221857;
            bool index_certs_221859;
            
            if (!index_ok_221858) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) i_221850, ", ",
                              (long long) i_221854,
                              "] out of bounds for array of shape [",
                              (long long) n_p_196694, "][",
                              (long long) css_results_l_197223, "].",
                              "-> #0  stl.fut:226:39-67\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:401:3-415:29\n   #7  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            if ((int64_t) 4 > 0)
                memmove(mem_212256 + i_221848 * (int64_t) 4,
                        ext_mem_212249.mem + (gtid_204923 *
                                              (css_results_l_197223 *
                                               n_p_196694) + i_221850 *
                                              css_results_l_197223 + i_221854) *
                        (int64_t) 4, (int64_t) 4);
        }
        if (C_len_196743 * (int64_t) 4 > 0)
            memmove(mem_212272.mem + gtid_204923 * C_len_196743 * (int64_t) 4,
                    mem_212256 + (int64_t) 0, C_len_196743 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212256);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228866_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228866_end -
                 futhark_mc_segmap_parloop_228866_start;
        
        ctx->futhark_mc_segmap_parloop_228866_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228866_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228866_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228864(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204922 = tid;
    int num_tasks_221846 = info.nsubtasks;
    struct futhark_mc_task_228863 *futhark_mc_task_228863 =
                                  (struct futhark_mc_task_228863 *) args;
    struct futhark_context *ctx = futhark_mc_task_228863->ctx;
    uint64_t futhark_mc_segmap_task_228864_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228864_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228863->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228863->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_228863->free_C_len_196743;
    int64_t css_results_l_197223 =
            futhark_mc_task_228863->free_css_results_l_197223;
    struct memblock ext_mem_212249 = {.desc ="ext_mem_212249", .mem =
                                      futhark_mc_task_228863->free_ext_mem_212249,
                                      .size =0, .references =NULL};
    int64_t bytes_212252 = futhark_mc_task_228863->free_bytes_212252;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228863->free_mem_212272,
                                  .size =0, .references =NULL};
    int64_t iter_221847;
    struct futhark_mc_segmap_parloop_struct_228865
    futhark_mc_segmap_parloop_struct_228865;
    
    futhark_mc_segmap_parloop_struct_228865.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228865.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228865.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228865.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228865.free_css_results_l_197223 =
        css_results_l_197223;
    futhark_mc_segmap_parloop_struct_228865.free_ext_mem_212249 =
        ext_mem_212249.mem;
    futhark_mc_segmap_parloop_struct_228865.free_bytes_212252 = bytes_212252;
    futhark_mc_segmap_parloop_struct_228865.free_mem_212272 = mem_212272.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228866_task;
    
    futhark_mc_segmap_parloop_228866_task.name =
        "futhark_mc_segmap_parloop_228866";
    futhark_mc_segmap_parloop_228866_task.fn = futhark_mc_segmap_parloop_228866;
    futhark_mc_segmap_parloop_228866_task.args =
        &futhark_mc_segmap_parloop_struct_228865;
    futhark_mc_segmap_parloop_228866_task.iterations = iterations;
    futhark_mc_segmap_parloop_228866_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228866_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228866_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228866_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228866_task);
    
    if (futhark_mc_segmap_parloop_228866_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228866_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228866_total_end -
                 futhark_mc_segmap_parloop_228866_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228866_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228866_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228866_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228864_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228864_end -
                 futhark_mc_segmap_task_228864_start;
        
        ctx->futhark_mc_segmap_task_228864_runs[tid]++;
        ctx->futhark_mc_segmap_task_228864_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228864_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228869 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_css_results_l_197223;
    unsigned char *free_ext_mem_212249;
    int64_t free_bytes_212252;
    unsigned char *free_mem_212272;
};
struct futhark_mc_task_228872 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_css_results_l_197223;
    int64_t free_gtid_204929;
    unsigned char *free_ext_mem_212249;
    unsigned char *free_mem_212253;
};
struct futhark_mc_segmap_parloop_struct_228874 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_css_results_l_197223;
    int64_t free_gtid_204929;
    unsigned char *free_ext_mem_212249;
    unsigned char *free_mem_212253;
};
static int futhark_mc_segmap_parloop_228875(void *args, int64_t start,
                                            int64_t end, int flat_tid_221866,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228874
    *futhark_mc_segmap_parloop_struct_228874 =
    (struct futhark_mc_segmap_parloop_struct_228874 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228874->ctx;
    uint64_t futhark_mc_segmap_parloop_228875_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228875_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228874->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228874->free_C_len_196743;
    int64_t css_results_l_197223 =
            futhark_mc_segmap_parloop_struct_228874->free_css_results_l_197223;
    int64_t gtid_204929 =
            futhark_mc_segmap_parloop_struct_228874->free_gtid_204929;
    struct memblock ext_mem_212249 = {.desc ="ext_mem_212249", .mem =
                                      futhark_mc_segmap_parloop_struct_228874->free_ext_mem_212249,
                                      .size =0, .references =NULL};
    struct memblock mem_212253 = {.desc ="mem_212253", .mem =
                                  futhark_mc_segmap_parloop_struct_228874->free_mem_212253,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221882 = start;
    
    for (; iter_221882 < end; iter_221882++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221883 = C_len_196743;
        int64_t gtid_221867 = iter_221882;
        int64_t remnant_221884 = iter_221882 - gtid_221867;
        int64_t i_221868 = smod64(gtid_221867, n_p_196694);
        bool x_221869 = sle64((int64_t) 0, i_221868);
        bool y_221870 = slt64(i_221868, n_p_196694);
        bool bounds_check_221871 = x_221869 && y_221870;
        int64_t i_221872 = sdiv64(gtid_221867, n_p_196694);
        bool x_221873 = sle64((int64_t) 0, i_221872);
        bool y_221874 = slt64(i_221872, css_results_l_197223);
        bool bounds_check_221875 = x_221873 && y_221874;
        bool index_ok_221876 = bounds_check_221871 && bounds_check_221875;
        bool index_certs_221877;
        
        if (!index_ok_221876) {
            ctx->error =
                msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                          "Index [", (long long) i_221868, ", ",
                          (long long) i_221872,
                          "] out of bounds for array of shape [",
                          (long long) n_p_196694, "][",
                          (long long) css_results_l_197223, "].",
                          "-> #0  stl.fut:226:39-67\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:401:3-415:29\n   #7  stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        float defunc_0_f_res_221878;
        
        defunc_0_f_res_221878 = ((float *) ext_mem_212249.mem)[gtid_204929 *
                                                               (css_results_l_197223 *
                                                                n_p_196694) +
                                                               i_221868 *
                                                               css_results_l_197223 +
                                                               i_221872];
        ((float *) mem_212253.mem)[gtid_221867] = defunc_0_f_res_221878;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228875_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228875_end -
                 futhark_mc_segmap_parloop_228875_start;
        
        ctx->futhark_mc_segmap_parloop_228875_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228875_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228875_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228873(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221866 = tid;
    int num_tasks_221881 = info.nsubtasks;
    struct futhark_mc_task_228872 *futhark_mc_task_228872 =
                                  (struct futhark_mc_task_228872 *) args;
    struct futhark_context *ctx = futhark_mc_task_228872->ctx;
    uint64_t futhark_mc_segmap_task_228873_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228873_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228872->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_228872->free_C_len_196743;
    int64_t css_results_l_197223 =
            futhark_mc_task_228872->free_css_results_l_197223;
    int64_t gtid_204929 = futhark_mc_task_228872->free_gtid_204929;
    struct memblock ext_mem_212249 = {.desc ="ext_mem_212249", .mem =
                                      futhark_mc_task_228872->free_ext_mem_212249,
                                      .size =0, .references =NULL};
    struct memblock mem_212253 = {.desc ="mem_212253", .mem =
                                  futhark_mc_task_228872->free_mem_212253,
                                  .size =0, .references =NULL};
    int64_t iter_221882;
    struct futhark_mc_segmap_parloop_struct_228874
    futhark_mc_segmap_parloop_struct_228874;
    
    futhark_mc_segmap_parloop_struct_228874.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228874.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228874.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228874.free_css_results_l_197223 =
        css_results_l_197223;
    futhark_mc_segmap_parloop_struct_228874.free_gtid_204929 = gtid_204929;
    futhark_mc_segmap_parloop_struct_228874.free_ext_mem_212249 =
        ext_mem_212249.mem;
    futhark_mc_segmap_parloop_struct_228874.free_mem_212253 = mem_212253.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228875_task;
    
    futhark_mc_segmap_parloop_228875_task.name =
        "futhark_mc_segmap_parloop_228875";
    futhark_mc_segmap_parloop_228875_task.fn = futhark_mc_segmap_parloop_228875;
    futhark_mc_segmap_parloop_228875_task.args =
        &futhark_mc_segmap_parloop_struct_228874;
    futhark_mc_segmap_parloop_228875_task.iterations = iterations;
    futhark_mc_segmap_parloop_228875_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228875_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228875_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228875_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228875_task);
    
    if (futhark_mc_segmap_parloop_228875_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228875_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228875_total_end -
                 futhark_mc_segmap_parloop_228875_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228875_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228875_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228875_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228873_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228873_end -
                 futhark_mc_segmap_task_228873_start;
        
        ctx->futhark_mc_segmap_task_228873_runs[tid]++;
        ctx->futhark_mc_segmap_task_228873_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228873_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228870(void *args, int64_t start,
                                            int64_t end, int flat_tid_204928,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228869
    *futhark_mc_segmap_parloop_struct_228869 =
    (struct futhark_mc_segmap_parloop_struct_228869 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228869->ctx;
    uint64_t futhark_mc_segmap_parloop_228870_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228870_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228869->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228869->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228869->free_C_len_196743;
    int64_t css_results_l_197223 =
            futhark_mc_segmap_parloop_struct_228869->free_css_results_l_197223;
    struct memblock ext_mem_212249 = {.desc ="ext_mem_212249", .mem =
                                      futhark_mc_segmap_parloop_struct_228869->free_ext_mem_212249,
                                      .size =0, .references =NULL};
    int64_t bytes_212252 =
            futhark_mc_segmap_parloop_struct_228869->free_bytes_212252;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_228869->free_mem_212272,
                                  .size =0, .references =NULL};
    size_t mem_212253_cached_sizze_228871 = 0;
    unsigned char *mem_212253 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221865 = start;
    
    if (mem_212253_cached_sizze_228871 < (size_t) bytes_212252) {
        mem_212253 = realloc(mem_212253, bytes_212252);
        mem_212253_cached_sizze_228871 = bytes_212252;
    }
    for (; iter_221865 < end; iter_221865++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221879 = m_196691;
        int64_t gtid_204929 = iter_221865;
        int64_t remnant_221880 = iter_221865 - gtid_204929;
        int64_t flat_tid_221866 = (int64_t) 0;
        int32_t num_tasks_221881;
        struct futhark_mc_task_228872 futhark_mc_task_228872;
        
        futhark_mc_task_228872.ctx = ctx;
        futhark_mc_task_228872.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228872.free_C_len_196743 = C_len_196743;
        futhark_mc_task_228872.free_css_results_l_197223 = css_results_l_197223;
        futhark_mc_task_228872.free_gtid_204929 = gtid_204929;
        futhark_mc_task_228872.free_ext_mem_212249 = ext_mem_212249.mem;
        futhark_mc_task_228872.free_mem_212253 = mem_212253;
        
        struct scheduler_segop futhark_mc_task_228872_task;
        
        futhark_mc_task_228872_task.args = &futhark_mc_task_228872;
        futhark_mc_task_228872_task.top_level_fn =
            futhark_mc_segmap_task_228873;
        futhark_mc_task_228872_task.name = "futhark_mc_segmap_task_228873";
        futhark_mc_task_228872_task.iterations = C_len_196743;
        futhark_mc_task_228872_task.task_time =
            &ctx->futhark_mc_segmap_task_228873_total_time;
        futhark_mc_task_228872_task.task_iter =
            &ctx->futhark_mc_segmap_task_228873_total_iter;
        futhark_mc_task_228872_task.sched = STATIC;
        futhark_mc_task_228872_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_228873_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228872_task);
        
        if (futhark_mc_segmap_task_228873_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (C_len_196743 * (int64_t) 4 > 0)
            memmove(mem_212272.mem + gtid_204929 * C_len_196743 * (int64_t) 4,
                    mem_212253 + (int64_t) 0, C_len_196743 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212253);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228870_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228870_end -
                 futhark_mc_segmap_parloop_228870_start;
        
        ctx->futhark_mc_segmap_parloop_228870_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228870_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228870_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228868(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204928 = tid;
    int num_tasks_221846 = info.nsubtasks;
    struct futhark_mc_task_228863 *futhark_mc_task_228863 =
                                  (struct futhark_mc_task_228863 *) args;
    struct futhark_context *ctx = futhark_mc_task_228863->ctx;
    uint64_t futhark_mc_segmap_nested_task_228868_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228868_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228863->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228863->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_228863->free_C_len_196743;
    int64_t css_results_l_197223 =
            futhark_mc_task_228863->free_css_results_l_197223;
    struct memblock ext_mem_212249 = {.desc ="ext_mem_212249", .mem =
                                      futhark_mc_task_228863->free_ext_mem_212249,
                                      .size =0, .references =NULL};
    int64_t bytes_212252 = futhark_mc_task_228863->free_bytes_212252;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228863->free_mem_212272,
                                  .size =0, .references =NULL};
    int64_t iter_221865;
    struct futhark_mc_segmap_parloop_struct_228869
    futhark_mc_segmap_parloop_struct_228869;
    
    futhark_mc_segmap_parloop_struct_228869.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228869.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228869.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228869.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228869.free_css_results_l_197223 =
        css_results_l_197223;
    futhark_mc_segmap_parloop_struct_228869.free_ext_mem_212249 =
        ext_mem_212249.mem;
    futhark_mc_segmap_parloop_struct_228869.free_bytes_212252 = bytes_212252;
    futhark_mc_segmap_parloop_struct_228869.free_mem_212272 = mem_212272.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228870_task;
    
    futhark_mc_segmap_parloop_228870_task.name =
        "futhark_mc_segmap_parloop_228870";
    futhark_mc_segmap_parloop_228870_task.fn = futhark_mc_segmap_parloop_228870;
    futhark_mc_segmap_parloop_228870_task.args =
        &futhark_mc_segmap_parloop_struct_228869;
    futhark_mc_segmap_parloop_228870_task.iterations = iterations;
    futhark_mc_segmap_parloop_228870_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228870_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228870_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228870_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228870_task);
    
    if (futhark_mc_segmap_parloop_228870_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228870_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228870_total_end -
                 futhark_mc_segmap_parloop_228870_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228870_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228870_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228870_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228868_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228868_end -
                 futhark_mc_segmap_nested_task_228868_start;
        
        ctx->futhark_mc_segmap_nested_task_228868_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228868_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228868_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228876 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212275;
};
struct futhark_mc_segmap_parloop_struct_228878 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212275;
};
static int futhark_mc_segmap_parloop_228879(void *args, int64_t start,
                                            int64_t end, int flat_tid_204946,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228878
    *futhark_mc_segmap_parloop_struct_228878 =
    (struct futhark_mc_segmap_parloop_struct_228878 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228878->ctx;
    uint64_t futhark_mc_segmap_parloop_228879_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228879_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228878->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228878->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228878->free_C_len_196743;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_228878->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_segmap_parloop_struct_228878->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221886 = start;
    
    for (; iter_221886 < end; iter_221886++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221891 = m_196691;
        int64_t gtid_204947 = iter_221886;
        int64_t remnant_221892 = iter_221886 - gtid_204947;
        float defunc_2_reduce_res_198196;
        float redout_221888 = 0.0F;
        
        for (int64_t i_221887 = 0; i_221887 < n_p_196694; i_221887++) {
            float x_221889;
            
            x_221889 = ((float *) mem_212272.mem)[gtid_204947 * C_len_196743 +
                                                  i_221887];
            
            float defunc_1_op_res_221890 = x_221889 + redout_221888;
            float redout_tmp_221893 = defunc_1_op_res_221890;
            
            redout_221888 = redout_tmp_221893;
        }
        defunc_2_reduce_res_198196 = redout_221888;
        ((float *) mem_212275.mem)[gtid_204947] = defunc_2_reduce_res_198196;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228879_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228879_end -
                 futhark_mc_segmap_parloop_228879_start;
        
        ctx->futhark_mc_segmap_parloop_228879_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228879_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228879_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228877(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204946 = tid;
    int num_tasks_221885 = info.nsubtasks;
    struct futhark_mc_task_228876 *futhark_mc_task_228876 =
                                  (struct futhark_mc_task_228876 *) args;
    struct futhark_context *ctx = futhark_mc_task_228876->ctx;
    uint64_t futhark_mc_segmap_task_228877_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228877_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228876->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228876->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_228876->free_C_len_196743;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228876->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_task_228876->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t iter_221886;
    struct futhark_mc_segmap_parloop_struct_228878
    futhark_mc_segmap_parloop_struct_228878;
    
    futhark_mc_segmap_parloop_struct_228878.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228878.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228878.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228878.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228878.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_228878.free_mem_212275 = mem_212275.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228879_task;
    
    futhark_mc_segmap_parloop_228879_task.name =
        "futhark_mc_segmap_parloop_228879";
    futhark_mc_segmap_parloop_228879_task.fn = futhark_mc_segmap_parloop_228879;
    futhark_mc_segmap_parloop_228879_task.args =
        &futhark_mc_segmap_parloop_struct_228878;
    futhark_mc_segmap_parloop_228879_task.iterations = iterations;
    futhark_mc_segmap_parloop_228879_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228879_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228879_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228879_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228879_task);
    
    if (futhark_mc_segmap_parloop_228879_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228879_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228879_total_end -
                 futhark_mc_segmap_parloop_228879_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228879_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228879_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228879_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228877_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228877_end -
                 futhark_mc_segmap_task_228877_start;
        
        ctx->futhark_mc_segmap_task_228877_runs[tid]++;
        ctx->futhark_mc_segmap_task_228877_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228877_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228881 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212275;
};
struct futhark_mc_task_228883 {
    struct futhark_context *ctx;
    int64_t free_C_len_196743;
    int64_t free_gtid_204953;
    unsigned char *free_mem_212272;
    float *retval_defunc_2_reduce_res_204955;
};
struct futhark_mc_segred_stage_1_parloop_struct_228886 {
    struct futhark_context *ctx;
    int64_t free_C_len_196743;
    int64_t free_gtid_204953;
    unsigned char *free_mem_212272;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_221904;
};
static int futhark_mc_segred_stage_1_parloop_228887(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_221895,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228886
    *futhark_mc_segred_stage_1_parloop_struct_228886 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228886 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228886->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228887_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228887_start = get_wall_time();
    
    int64_t C_len_196743 =
            futhark_mc_segred_stage_1_parloop_struct_228886->free_C_len_196743;
    int64_t gtid_204953 =
            futhark_mc_segred_stage_1_parloop_struct_228886->free_gtid_204953;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228886->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_221904 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_221904",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228886->free_reduce_stage_1_tid_res_arr_mem_221904,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221906 = start;
    float x_221897;
    float x_221898;
    float local_acc_221907 = 0.0F;
    
    for (; iter_221906 < end; iter_221906++) {
        int64_t gtid_221896 = iter_221906;
        float x_221900;
        
        x_221900 = ((float *) mem_212272.mem)[gtid_204953 * C_len_196743 +
                                              gtid_221896];
        // save map-out results
        { }
        // Load accum params
        {
            x_221897 = local_acc_221907;
        }
        // Load next params
        {
            x_221898 = x_221900;
        }
        // Red body
        {
            float defunc_1_op_res_221899 = x_221897 + x_221898;
            
            local_acc_221907 = defunc_1_op_res_221899;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_221904.mem)[flat_tid_221895] =
        local_acc_221907;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228887_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228887_end -
                 futhark_mc_segred_stage_1_parloop_228887_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228887_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228887_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228887_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228884(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221895 = tid;
    int num_tasks_221903 = info.nsubtasks;
    struct futhark_mc_task_228883 *futhark_mc_task_228883 =
                                  (struct futhark_mc_task_228883 *) args;
    struct futhark_context *ctx = futhark_mc_task_228883->ctx;
    uint64_t futhark_mc_segred_task_228884_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228884_start = get_wall_time();
    
    int64_t C_len_196743 = futhark_mc_task_228883->free_C_len_196743;
    int64_t gtid_204953 = futhark_mc_task_228883->free_gtid_204953;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228883->free_mem_212272,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_204955 =
          *futhark_mc_task_228883->retval_defunc_2_reduce_res_204955;
    size_t reduce_stage_1_tid_res_arr_mem_221904_cached_sizze_228885 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_221904 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_221904_cached_sizze_228885 <
        (size_t) ((int64_t) 4 * num_tasks_221903)) {
        reduce_stage_1_tid_res_arr_mem_221904 =
            realloc(reduce_stage_1_tid_res_arr_mem_221904, (int64_t) 4 *
                    num_tasks_221903);
        reduce_stage_1_tid_res_arr_mem_221904_cached_sizze_228885 =
            (int64_t) 4 * num_tasks_221903;
    }
    
    int64_t iter_221906;
    struct futhark_mc_segred_stage_1_parloop_struct_228886
    futhark_mc_segred_stage_1_parloop_struct_228886;
    
    futhark_mc_segred_stage_1_parloop_struct_228886.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228886.free_C_len_196743 =
        C_len_196743;
    futhark_mc_segred_stage_1_parloop_struct_228886.free_gtid_204953 =
        gtid_204953;
    futhark_mc_segred_stage_1_parloop_struct_228886.free_mem_212272 =
        mem_212272.mem;
    futhark_mc_segred_stage_1_parloop_struct_228886.free_reduce_stage_1_tid_res_arr_mem_221904 =
        reduce_stage_1_tid_res_arr_mem_221904;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228887_task;
    
    futhark_mc_segred_stage_1_parloop_228887_task.name =
        "futhark_mc_segred_stage_1_parloop_228887";
    futhark_mc_segred_stage_1_parloop_228887_task.fn =
        futhark_mc_segred_stage_1_parloop_228887;
    futhark_mc_segred_stage_1_parloop_228887_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228886;
    futhark_mc_segred_stage_1_parloop_228887_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228887_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228887_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228887_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228887_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228887_task);
    
    if (futhark_mc_segred_stage_1_parloop_228887_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228887_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228887_total_end -
                 futhark_mc_segred_stage_1_parloop_228887_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228887_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228887_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228887_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_204955 = 0.0F;
    }
    
    float x_221908;
    float x_221909;
    
    for (int32_t i_221911 = 0; i_221911 < num_tasks_221903; i_221911++) {
        flat_tid_221895 = i_221911;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_221908 = defunc_2_reduce_res_204955;
            }
            // load next params
            {
                x_221909 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_221904)[flat_tid_221895];
            }
            // red body
            {
                float defunc_1_op_res_221910 = x_221908 + x_221909;
                
                defunc_2_reduce_res_204955 = defunc_1_op_res_221910;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_221904);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228884_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228884_end -
                 futhark_mc_segred_task_228884_start;
        
        ctx->futhark_mc_segred_task_228884_runs[tid]++;
        ctx->futhark_mc_segred_task_228884_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228884_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228883->retval_defunc_2_reduce_res_204955 =
            defunc_2_reduce_res_204955;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228882(void *args, int64_t start,
                                            int64_t end, int flat_tid_204952,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228881
    *futhark_mc_segmap_parloop_struct_228881 =
    (struct futhark_mc_segmap_parloop_struct_228881 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228881->ctx;
    uint64_t futhark_mc_segmap_parloop_228882_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228882_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228881->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228881->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228881->free_C_len_196743;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_228881->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_segmap_parloop_struct_228881->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221894 = start;
    
    for (; iter_221894 < end; iter_221894++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221901 = m_196691;
        int64_t gtid_204953 = iter_221894;
        int64_t remnant_221902 = iter_221894 - gtid_204953;
        float defunc_2_reduce_res_204955;
        int64_t flat_tid_221895 = (int64_t) 0;
        int32_t num_tasks_221903;
        
        defunc_2_reduce_res_204955 = 0.0F;
        
        struct futhark_mc_task_228883 futhark_mc_task_228883;
        
        futhark_mc_task_228883.ctx = ctx;
        futhark_mc_task_228883.free_C_len_196743 = C_len_196743;
        futhark_mc_task_228883.free_gtid_204953 = gtid_204953;
        futhark_mc_task_228883.free_mem_212272 = mem_212272.mem;
        futhark_mc_task_228883.retval_defunc_2_reduce_res_204955 =
            &defunc_2_reduce_res_204955;
        
        struct scheduler_segop futhark_mc_task_228883_task;
        
        futhark_mc_task_228883_task.args = &futhark_mc_task_228883;
        futhark_mc_task_228883_task.top_level_fn =
            futhark_mc_segred_task_228884;
        futhark_mc_task_228883_task.name = "futhark_mc_segred_task_228884";
        futhark_mc_task_228883_task.iterations = n_p_196694;
        futhark_mc_task_228883_task.task_time =
            &ctx->futhark_mc_segred_task_228884_total_time;
        futhark_mc_task_228883_task.task_iter =
            &ctx->futhark_mc_segred_task_228884_total_iter;
        futhark_mc_task_228883_task.sched = STATIC;
        futhark_mc_task_228883_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228884_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228883_task);
        
        if (futhark_mc_segred_task_228884_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212275.mem)[gtid_204953] = defunc_2_reduce_res_204955;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228882_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228882_end -
                 futhark_mc_segmap_parloop_228882_start;
        
        ctx->futhark_mc_segmap_parloop_228882_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228882_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228882_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228880(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204952 = tid;
    int num_tasks_221885 = info.nsubtasks;
    struct futhark_mc_task_228876 *futhark_mc_task_228876 =
                                  (struct futhark_mc_task_228876 *) args;
    struct futhark_context *ctx = futhark_mc_task_228876->ctx;
    uint64_t futhark_mc_segmap_nested_task_228880_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228880_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228876->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228876->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_228876->free_C_len_196743;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228876->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_task_228876->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t iter_221894;
    struct futhark_mc_segmap_parloop_struct_228881
    futhark_mc_segmap_parloop_struct_228881;
    
    futhark_mc_segmap_parloop_struct_228881.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228881.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228881.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228881.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228881.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_228881.free_mem_212275 = mem_212275.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228882_task;
    
    futhark_mc_segmap_parloop_228882_task.name =
        "futhark_mc_segmap_parloop_228882";
    futhark_mc_segmap_parloop_228882_task.fn = futhark_mc_segmap_parloop_228882;
    futhark_mc_segmap_parloop_228882_task.args =
        &futhark_mc_segmap_parloop_struct_228881;
    futhark_mc_segmap_parloop_228882_task.iterations = iterations;
    futhark_mc_segmap_parloop_228882_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228882_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228882_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228882_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228882_task);
    
    if (futhark_mc_segmap_parloop_228882_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228882_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228882_total_end -
                 futhark_mc_segmap_parloop_228882_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228882_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228882_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228882_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228880_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228880_end -
                 futhark_mc_segmap_nested_task_228880_start;
        
        ctx->futhark_mc_segmap_nested_task_228880_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228880_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228880_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228888 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_C_len_196743;
    int64_t free_lifted_single_ma_l_arg_197247;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212275;
    int64_t free_bytes_212277;
    unsigned char *free_mem_212297;
};
struct futhark_mc_segmap_parloop_struct_228890 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_C_len_196743;
    int64_t free_lifted_single_ma_l_arg_197247;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212275;
    int64_t free_bytes_212277;
    unsigned char *free_mem_212297;
};
static int futhark_mc_segmap_parloop_228891(void *args, int64_t start,
                                            int64_t end, int flat_tid_204962,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228890
    *futhark_mc_segmap_parloop_struct_228890 =
    (struct futhark_mc_segmap_parloop_struct_228890 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228890->ctx;
    uint64_t futhark_mc_segmap_parloop_228891_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228891_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228890->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228890->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_segmap_parloop_struct_228890->free_i64_res_196737;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228890->free_C_len_196743;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segmap_parloop_struct_228890->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_228890->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_segmap_parloop_struct_228890->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t bytes_212277 =
            futhark_mc_segmap_parloop_struct_228890->free_bytes_212277;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segmap_parloop_struct_228890->free_mem_212297,
                                  .size =0, .references =NULL};
    size_t mem_212281_cached_sizze_228892 = 0;
    unsigned char *mem_212281 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221913 = start;
    
    if (mem_212281_cached_sizze_228892 < (size_t) bytes_212277) {
        mem_212281 = realloc(mem_212281, bytes_212277);
        mem_212281_cached_sizze_228892 = bytes_212277;
    }
    for (; iter_221913 < end; iter_221913++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221937 = m_196691;
        int64_t gtid_204963 = iter_221913;
        int64_t remnant_221938 = iter_221913 - gtid_204963;
        float x_198204;
        
        x_198204 = ((float *) mem_212275.mem)[gtid_204963];
        
        float discard_209540;
        float scanacc_221915 = 0.0F;
        
        for (int64_t i_221914 = 0; i_221914 < lifted_single_ma_l_arg_197247;
             i_221914++) {
            bool cond_221917 = i_221914 == (int64_t) 0;
            float defunc_0_f_res_221918;
            
            if (cond_221917) {
                float defunc_0_f_res_t_res_221919 = x_198204 / i64_res_196737;
                
                defunc_0_f_res_221918 = defunc_0_f_res_t_res_221919;
            } else {
                int64_t x_221920 = add64(n_p_196694, i_221914);
                int64_t i_221921 = sub64(x_221920, (int64_t) 1);
                bool x_221922 = sle64((int64_t) 0, i_221921);
                bool y_221923 = slt64(i_221921, C_len_196743);
                bool bounds_check_221924 = x_221922 && y_221923;
                bool index_certs_221925;
                
                if (!bounds_check_221924) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221921,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_221926;
                
                x_221926 = ((float *) mem_212272.mem)[gtid_204963 *
                                                      C_len_196743 + i_221921];
                
                int64_t i_221927 = sub64(i_221914, (int64_t) 1);
                bool x_221928 = sle64((int64_t) 0, i_221927);
                bool y_221929 = slt64(i_221927, C_len_196743);
                bool bounds_check_221930 = x_221928 && y_221929;
                bool index_certs_221931;
                
                if (!bounds_check_221930) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221927,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_221932;
                
                y_221932 = ((float *) mem_212272.mem)[gtid_204963 *
                                                      C_len_196743 + i_221927];
                
                float x_221933 = x_221926 - y_221932;
                float defunc_0_f_res_f_res_221934 = x_221933 / i64_res_196737;
                
                defunc_0_f_res_221918 = defunc_0_f_res_f_res_221934;
            }
            
            float defunc_1_op_res_221935 = defunc_0_f_res_221918 +
                  scanacc_221915;
            
            ((float *) mem_212281)[i_221914] = defunc_1_op_res_221935;
            
            float scanacc_tmp_221939 = defunc_1_op_res_221935;
            
            scanacc_221915 = scanacc_tmp_221939;
        }
        discard_209540 = scanacc_221915;
        if (lifted_single_ma_l_arg_197247 * (int64_t) 4 > 0)
            memmove(mem_212297.mem + gtid_204963 *
                    lifted_single_ma_l_arg_197247 * (int64_t) 4, mem_212281 +
                    (int64_t) 0, lifted_single_ma_l_arg_197247 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212281);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228891_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228891_end -
                 futhark_mc_segmap_parloop_228891_start;
        
        ctx->futhark_mc_segmap_parloop_228891_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228891_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228891_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228889(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204962 = tid;
    int num_tasks_221912 = info.nsubtasks;
    struct futhark_mc_task_228888 *futhark_mc_task_228888 =
                                  (struct futhark_mc_task_228888 *) args;
    struct futhark_context *ctx = futhark_mc_task_228888->ctx;
    uint64_t futhark_mc_segmap_task_228889_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228889_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228888->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228888->free_n_p_196694;
    float i64_res_196737 = futhark_mc_task_228888->free_i64_res_196737;
    int64_t C_len_196743 = futhark_mc_task_228888->free_C_len_196743;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228888->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228888->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_task_228888->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t bytes_212277 = futhark_mc_task_228888->free_bytes_212277;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228888->free_mem_212297,
                                  .size =0, .references =NULL};
    int64_t iter_221913;
    struct futhark_mc_segmap_parloop_struct_228890
    futhark_mc_segmap_parloop_struct_228890;
    
    futhark_mc_segmap_parloop_struct_228890.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228890.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228890.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228890.free_i64_res_196737 =
        i64_res_196737;
    futhark_mc_segmap_parloop_struct_228890.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228890.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segmap_parloop_struct_228890.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_228890.free_mem_212275 = mem_212275.mem;
    futhark_mc_segmap_parloop_struct_228890.free_bytes_212277 = bytes_212277;
    futhark_mc_segmap_parloop_struct_228890.free_mem_212297 = mem_212297.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228891_task;
    
    futhark_mc_segmap_parloop_228891_task.name =
        "futhark_mc_segmap_parloop_228891";
    futhark_mc_segmap_parloop_228891_task.fn = futhark_mc_segmap_parloop_228891;
    futhark_mc_segmap_parloop_228891_task.args =
        &futhark_mc_segmap_parloop_struct_228890;
    futhark_mc_segmap_parloop_228891_task.iterations = iterations;
    futhark_mc_segmap_parloop_228891_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228891_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228891_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228891_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228891_task);
    
    if (futhark_mc_segmap_parloop_228891_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228891_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228891_total_end -
                 futhark_mc_segmap_parloop_228891_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228891_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228891_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228891_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228889_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228889_end -
                 futhark_mc_segmap_task_228889_start;
        
        ctx->futhark_mc_segmap_task_228889_runs[tid]++;
        ctx->futhark_mc_segmap_task_228889_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228889_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228894 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_C_len_196743;
    int64_t free_lifted_single_ma_l_arg_197247;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212275;
    int64_t free_bytes_212277;
    unsigned char *free_mem_212297;
};
struct futhark_mc_task_228897 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_C_len_196743;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_gtid_204969;
    float free_x_204971;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212278;
};
struct futhark_mc_scan_stage_1_parloop_struct_228900 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_C_len_196743;
    int64_t free_gtid_204969;
    float free_x_204971;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212278;
};
static int futhark_mc_scan_stage_1_parloop_228901(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_221942, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_1_parloop_struct_228900
    *futhark_mc_scan_stage_1_parloop_struct_228900 =
    (struct futhark_mc_scan_stage_1_parloop_struct_228900 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_1_parloop_struct_228900->ctx;
    uint64_t futhark_mc_scan_stage_1_parloop_228901_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228901_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_scan_stage_1_parloop_struct_228900->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_scan_stage_1_parloop_struct_228900->free_i64_res_196737;
    int64_t C_len_196743 =
            futhark_mc_scan_stage_1_parloop_struct_228900->free_C_len_196743;
    int64_t gtid_204969 =
            futhark_mc_scan_stage_1_parloop_struct_228900->free_gtid_204969;
    float x_204971 =
          futhark_mc_scan_stage_1_parloop_struct_228900->free_x_204971;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228900->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212278 = {.desc ="mem_212278", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228900->free_mem_212278,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221968 = start;
    float x_221944;
    float x_221945;
    
    x_221944 = 0.0F;
    for (; iter_221968 < end; iter_221968++) {
        int64_t gtid_221943 = iter_221968;
        
        // stage 1 scan body
        {
            bool cond_221947 = gtid_221943 == (int64_t) 0;
            float defunc_0_f_res_221948;
            
            if (cond_221947) {
                float defunc_0_f_res_t_res_221949 = x_204971 / i64_res_196737;
                
                defunc_0_f_res_221948 = defunc_0_f_res_t_res_221949;
            } else {
                int64_t x_221950 = add64(n_p_196694, gtid_221943);
                int64_t i_221951 = sub64(x_221950, (int64_t) 1);
                bool x_221952 = sle64((int64_t) 0, i_221951);
                bool y_221953 = slt64(i_221951, C_len_196743);
                bool bounds_check_221954 = x_221952 && y_221953;
                bool index_certs_221955;
                
                if (!bounds_check_221954) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221951,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_221956;
                
                x_221956 = ((float *) mem_212272.mem)[gtid_204969 *
                                                      C_len_196743 + i_221951];
                
                int64_t i_221957 = sub64(gtid_221943, (int64_t) 1);
                bool x_221958 = sle64((int64_t) 0, i_221957);
                bool y_221959 = slt64(i_221957, C_len_196743);
                bool bounds_check_221960 = x_221958 && y_221959;
                bool index_certs_221961;
                
                if (!bounds_check_221960) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221957,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_221962;
                
                y_221962 = ((float *) mem_212272.mem)[gtid_204969 *
                                                      C_len_196743 + i_221957];
                
                float x_221963 = x_221956 - y_221962;
                float defunc_0_f_res_f_res_221964 = x_221963 / i64_res_196737;
                
                defunc_0_f_res_221948 = defunc_0_f_res_f_res_221964;
            }
            // write mapped values results to memory
            { }
            x_221944 = x_221944;
            // Read next values
            {
                x_221945 = defunc_0_f_res_221948;
            }
            
            float defunc_1_op_res_221946 = x_221944 + x_221945;
            
            ((float *) mem_212278.mem)[gtid_221943] = defunc_1_op_res_221946;
            x_221944 = defunc_1_op_res_221946;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228901_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228901_end -
                 futhark_mc_scan_stage_1_parloop_228901_start;
        
        ctx->futhark_mc_scan_stage_1_parloop_228901_runs[tid]++;
        ctx->futhark_mc_scan_stage_1_parloop_228901_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_1_parloop_228901_iter[tid] += iterations;
    }
    return err;
}
struct futhark_mc_scan_stage_3_parloop_struct_228902 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_C_len_196743;
    int64_t free_gtid_204969;
    float free_x_204971;
    unsigned char *free_mem_212272;
    unsigned char *free_mem_212278;
};
static int futhark_mc_scan_stage_3_parloop_228903(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_221942, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_3_parloop_struct_228902
    *futhark_mc_scan_stage_3_parloop_struct_228902 =
    (struct futhark_mc_scan_stage_3_parloop_struct_228902 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_3_parloop_struct_228902->ctx;
    uint64_t futhark_mc_scan_stage_3_parloop_228903_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_3_parloop_228903_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_scan_stage_3_parloop_struct_228902->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_scan_stage_3_parloop_struct_228902->free_i64_res_196737;
    int64_t C_len_196743 =
            futhark_mc_scan_stage_3_parloop_struct_228902->free_C_len_196743;
    int64_t gtid_204969 =
            futhark_mc_scan_stage_3_parloop_struct_228902->free_gtid_204969;
    float x_204971 =
          futhark_mc_scan_stage_3_parloop_struct_228902->free_x_204971;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228902->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212278 = {.desc ="mem_212278", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228902->free_mem_212278,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221980 = start;
    float x_221977;
    float x_221978;
    
    if (iter_221980 == (int64_t) 0) {
        x_221977 = 0.0F;
    } else {
        x_221977 = ((float *) mem_212278.mem)[iter_221980 - (int64_t) 1];
    }
    for (; iter_221980 < end; iter_221980++) {
        int64_t gtid_221943 = iter_221980;
        
        // stage 3 scan body
        {
            bool cond_221947 = gtid_221943 == (int64_t) 0;
            float defunc_0_f_res_221948;
            
            if (cond_221947) {
                float defunc_0_f_res_t_res_221949 = x_204971 / i64_res_196737;
                
                defunc_0_f_res_221948 = defunc_0_f_res_t_res_221949;
            } else {
                int64_t x_221950 = add64(n_p_196694, gtid_221943);
                int64_t i_221951 = sub64(x_221950, (int64_t) 1);
                bool x_221952 = sle64((int64_t) 0, i_221951);
                bool y_221953 = slt64(i_221951, C_len_196743);
                bool bounds_check_221954 = x_221952 && y_221953;
                bool index_certs_221955;
                
                if (!bounds_check_221954) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221951,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_221956;
                
                x_221956 = ((float *) mem_212272.mem)[gtid_204969 *
                                                      C_len_196743 + i_221951];
                
                int64_t i_221957 = sub64(gtid_221943, (int64_t) 1);
                bool x_221958 = sle64((int64_t) 0, i_221957);
                bool y_221959 = slt64(i_221957, C_len_196743);
                bool bounds_check_221960 = x_221958 && y_221959;
                bool index_certs_221961;
                
                if (!bounds_check_221960) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221957,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_221962;
                
                y_221962 = ((float *) mem_212272.mem)[gtid_204969 *
                                                      C_len_196743 + i_221957];
                
                float x_221963 = x_221956 - y_221962;
                float defunc_0_f_res_f_res_221964 = x_221963 / i64_res_196737;
                
                defunc_0_f_res_221948 = defunc_0_f_res_f_res_221964;
            }
            x_221977 = x_221977;
            x_221978 = defunc_0_f_res_221948;
            
            float defunc_1_op_res_221979 = x_221977 + x_221978;
            
            ((float *) mem_212278.mem)[gtid_221943] = defunc_1_op_res_221979;
            x_221977 = defunc_1_op_res_221979;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_3_parloop_228903_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_3_parloop_228903_end -
                 futhark_mc_scan_stage_3_parloop_228903_start;
        
        ctx->futhark_mc_scan_stage_3_parloop_228903_runs[tid]++;
        ctx->futhark_mc_scan_stage_3_parloop_228903_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_3_parloop_228903_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segscan_task_228898(void *args, int64_t iterations, int tid,
                                   struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221942 = tid;
    int num_tasks_221967 = info.nsubtasks;
    struct futhark_mc_task_228897 *futhark_mc_task_228897 =
                                  (struct futhark_mc_task_228897 *) args;
    struct futhark_context *ctx = futhark_mc_task_228897->ctx;
    uint64_t futhark_mc_segscan_task_228898_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segscan_task_228898_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228897->free_n_p_196694;
    float i64_res_196737 = futhark_mc_task_228897->free_i64_res_196737;
    int64_t C_len_196743 = futhark_mc_task_228897->free_C_len_196743;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228897->free_lifted_single_ma_l_arg_197247;
    int64_t gtid_204969 = futhark_mc_task_228897->free_gtid_204969;
    float x_204971 = futhark_mc_task_228897->free_x_204971;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228897->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212278 = {.desc ="mem_212278", .mem =
                                  futhark_mc_task_228897->free_mem_212278,
                                  .size =0, .references =NULL};
    size_t scan_stage_2_accum_mem_221974_cached_sizze_228899 = 0;
    unsigned char *scan_stage_2_accum_mem_221974 = NULL;
    int64_t iter_221968;
    struct futhark_mc_scan_stage_1_parloop_struct_228900
    futhark_mc_scan_stage_1_parloop_struct_228900;
    
    futhark_mc_scan_stage_1_parloop_struct_228900.ctx = ctx;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_n_p_196694 = n_p_196694;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_i64_res_196737 =
        i64_res_196737;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_C_len_196743 =
        C_len_196743;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_gtid_204969 =
        gtid_204969;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_x_204971 = x_204971;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_mem_212272 =
        mem_212272.mem;
    futhark_mc_scan_stage_1_parloop_struct_228900.free_mem_212278 =
        mem_212278.mem;
    
    struct scheduler_parloop futhark_mc_scan_stage_1_parloop_228901_task;
    
    futhark_mc_scan_stage_1_parloop_228901_task.name =
        "futhark_mc_scan_stage_1_parloop_228901";
    futhark_mc_scan_stage_1_parloop_228901_task.fn =
        futhark_mc_scan_stage_1_parloop_228901;
    futhark_mc_scan_stage_1_parloop_228901_task.args =
        &futhark_mc_scan_stage_1_parloop_struct_228900;
    futhark_mc_scan_stage_1_parloop_228901_task.iterations = iterations;
    futhark_mc_scan_stage_1_parloop_228901_task.info = info;
    
    uint64_t futhark_mc_scan_stage_1_parloop_228901_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228901_total_start = get_wall_time();
    
    int futhark_mc_scan_stage_1_parloop_228901_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_scan_stage_1_parloop_228901_task);
    
    if (futhark_mc_scan_stage_1_parloop_228901_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228901_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228901_total_end -
                 futhark_mc_scan_stage_1_parloop_228901_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228901_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228901_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228901_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    if (slt32(1, num_tasks_221967)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmentedScan stage 2");
        
        float x_221969;
        float x_221970;
        int64_t offset_221972 = (int64_t) 0;
        int64_t offset_index_221973 = (int64_t) 0;
        
        if (scan_stage_2_accum_mem_221974_cached_sizze_228899 <
            (size_t) (int64_t) 4) {
            scan_stage_2_accum_mem_221974 =
                realloc(scan_stage_2_accum_mem_221974, (int64_t) 4);
            scan_stage_2_accum_mem_221974_cached_sizze_228899 = (int64_t) 4;
        }
        ((float *) scan_stage_2_accum_mem_221974)[(int64_t) 0] = 0.0F;
        for (int32_t i_221976 = 0; i_221976 < num_tasks_221967 - 1;
             i_221976++) {
            offset_221972 = squot64(lifted_single_ma_l_arg_197247,
                                    sext_i32_i64(num_tasks_221967));
            if (slt64(sext_i32_i64(i_221976),
                      srem64(lifted_single_ma_l_arg_197247,
                             sext_i32_i64(num_tasks_221967)))) {
                offset_221972 += (int64_t) 1;
            }
            offset_index_221973 += offset_221972;
            
            int64_t gtid_221943 = offset_index_221973;
            bool cond_221947 = gtid_221943 == (int64_t) 0;
            float defunc_0_f_res_221948;
            
            if (cond_221947) {
                float defunc_0_f_res_t_res_221949 = x_204971 / i64_res_196737;
                
                defunc_0_f_res_221948 = defunc_0_f_res_t_res_221949;
            } else {
                int64_t x_221950 = add64(n_p_196694, gtid_221943);
                int64_t i_221951 = sub64(x_221950, (int64_t) 1);
                bool x_221952 = sle64((int64_t) 0, i_221951);
                bool y_221953 = slt64(i_221951, C_len_196743);
                bool bounds_check_221954 = x_221952 && y_221953;
                bool index_certs_221955;
                
                if (!bounds_check_221954) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221951,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_221956;
                
                x_221956 = ((float *) mem_212272.mem)[gtid_204969 *
                                                      C_len_196743 + i_221951];
                
                int64_t i_221957 = sub64(gtid_221943, (int64_t) 1);
                bool x_221958 = sle64((int64_t) 0, i_221957);
                bool y_221959 = slt64(i_221957, C_len_196743);
                bool bounds_check_221960 = x_221958 && y_221959;
                bool index_certs_221961;
                
                if (!bounds_check_221960) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_221957,
                                  "] out of bounds for array of shape [",
                                  (long long) C_len_196743, "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_221962;
                
                y_221962 = ((float *) mem_212272.mem)[gtid_204969 *
                                                      C_len_196743 + i_221957];
                
                float x_221963 = x_221956 - y_221962;
                float defunc_0_f_res_f_res_221964 = x_221963 / i64_res_196737;
                
                defunc_0_f_res_221948 = defunc_0_f_res_f_res_221964;
            }
            // Read carry in
            {
                x_221969 =
                    ((float *) scan_stage_2_accum_mem_221974)[(int64_t) 0];
            }
            // Read next values
            {
                x_221970 = ((float *) mem_212278.mem)[offset_index_221973 -
                                                      (int64_t) 1];
            }
            
            float defunc_1_op_res_221971 = x_221969 + x_221970;
            
            ((float *) mem_212278.mem)[offset_index_221973 - (int64_t) 1] =
                defunc_1_op_res_221971;
            ((float *) scan_stage_2_accum_mem_221974)[(int64_t) 0] =
                defunc_1_op_res_221971;
        }
        
        int64_t iter_221980 = (int64_t) 0;
        struct futhark_mc_scan_stage_3_parloop_struct_228902
        futhark_mc_scan_stage_3_parloop_struct_228902;
        
        futhark_mc_scan_stage_3_parloop_struct_228902.ctx = ctx;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_n_p_196694 =
            n_p_196694;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_i64_res_196737 =
            i64_res_196737;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_C_len_196743 =
            C_len_196743;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_gtid_204969 =
            gtid_204969;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_x_204971 = x_204971;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_mem_212272 =
            mem_212272.mem;
        futhark_mc_scan_stage_3_parloop_struct_228902.free_mem_212278 =
            mem_212278.mem;
        
        struct scheduler_parloop futhark_mc_scan_stage_3_parloop_228903_task;
        
        futhark_mc_scan_stage_3_parloop_228903_task.name =
            "futhark_mc_scan_stage_3_parloop_228903";
        futhark_mc_scan_stage_3_parloop_228903_task.fn =
            futhark_mc_scan_stage_3_parloop_228903;
        futhark_mc_scan_stage_3_parloop_228903_task.args =
            &futhark_mc_scan_stage_3_parloop_struct_228902;
        futhark_mc_scan_stage_3_parloop_228903_task.iterations = iterations;
        futhark_mc_scan_stage_3_parloop_228903_task.info = info;
        
        uint64_t futhark_mc_scan_stage_3_parloop_228903_total_start = 0;
        
        if (ctx->profiling && !ctx->profiling_paused)
            futhark_mc_scan_stage_3_parloop_228903_total_start =
                get_wall_time();
        
        int futhark_mc_scan_stage_3_parloop_228903_err =
            scheduler_execute_task(&ctx->scheduler,
                                   &futhark_mc_scan_stage_3_parloop_228903_task);
        
        if (futhark_mc_scan_stage_3_parloop_228903_err != 0) {
            err = 1;
            goto cleanup;
        }
        if (ctx->profiling && !ctx->profiling_paused) {
            uint64_t futhark_mc_scan_stage_3_parloop_228903_total_end =
                     get_wall_time();
            uint64_t elapsed =
                     futhark_mc_scan_stage_3_parloop_228903_total_end -
                     futhark_mc_scan_stage_3_parloop_228903_total_start;
            
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228903_total_runs,
                               1, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228903_total_total_runtime,
                               elapsed, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228903_total_iter,
                               iterations, __ATOMIC_RELAXED);
        }
    }
    
  cleanup:
    {
        free(scan_stage_2_accum_mem_221974);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segscan_task_228898_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segscan_task_228898_end -
                 futhark_mc_segscan_task_228898_start;
        
        ctx->futhark_mc_segscan_task_228898_runs[tid]++;
        ctx->futhark_mc_segscan_task_228898_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segscan_task_228898_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228895(void *args, int64_t start,
                                            int64_t end, int flat_tid_204968,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228894
    *futhark_mc_segmap_parloop_struct_228894 =
    (struct futhark_mc_segmap_parloop_struct_228894 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228894->ctx;
    uint64_t futhark_mc_segmap_parloop_228895_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228895_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228894->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228894->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_segmap_parloop_struct_228894->free_i64_res_196737;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_228894->free_C_len_196743;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segmap_parloop_struct_228894->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_228894->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_segmap_parloop_struct_228894->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t bytes_212277 =
            futhark_mc_segmap_parloop_struct_228894->free_bytes_212277;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segmap_parloop_struct_228894->free_mem_212297,
                                  .size =0, .references =NULL};
    size_t mem_212278_cached_sizze_228896 = 0;
    unsigned char *mem_212278 = NULL;
    int64_t iterations = end - start;
    int64_t iter_221941 = start;
    
    if (mem_212278_cached_sizze_228896 < (size_t) bytes_212277) {
        mem_212278 = realloc(mem_212278, bytes_212277);
        mem_212278_cached_sizze_228896 = bytes_212277;
    }
    for (; iter_221941 < end; iter_221941++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221965 = m_196691;
        int64_t gtid_204969 = iter_221941;
        int64_t remnant_221966 = iter_221941 - gtid_204969;
        float x_204971;
        
        x_204971 = ((float *) mem_212275.mem)[gtid_204969];
        
        int64_t flat_tid_221942 = (int64_t) 0;
        int32_t num_tasks_221967;
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmented segScan");
        
        struct futhark_mc_task_228897 futhark_mc_task_228897;
        
        futhark_mc_task_228897.ctx = ctx;
        futhark_mc_task_228897.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228897.free_i64_res_196737 = i64_res_196737;
        futhark_mc_task_228897.free_C_len_196743 = C_len_196743;
        futhark_mc_task_228897.free_lifted_single_ma_l_arg_197247 =
            lifted_single_ma_l_arg_197247;
        futhark_mc_task_228897.free_gtid_204969 = gtid_204969;
        futhark_mc_task_228897.free_x_204971 = x_204971;
        futhark_mc_task_228897.free_mem_212272 = mem_212272.mem;
        futhark_mc_task_228897.free_mem_212278 = mem_212278;
        
        struct scheduler_segop futhark_mc_task_228897_task;
        
        futhark_mc_task_228897_task.args = &futhark_mc_task_228897;
        futhark_mc_task_228897_task.top_level_fn =
            futhark_mc_segscan_task_228898;
        futhark_mc_task_228897_task.name = "futhark_mc_segscan_task_228898";
        futhark_mc_task_228897_task.iterations = lifted_single_ma_l_arg_197247;
        futhark_mc_task_228897_task.task_time =
            &ctx->futhark_mc_segscan_task_228898_total_time;
        futhark_mc_task_228897_task.task_iter =
            &ctx->futhark_mc_segscan_task_228898_total_iter;
        futhark_mc_task_228897_task.sched = STATIC;
        futhark_mc_task_228897_task.nested_fn = NULL;
        
        int futhark_mc_segscan_task_228898_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228897_task);
        
        if (futhark_mc_segscan_task_228898_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (lifted_single_ma_l_arg_197247 * (int64_t) 4 > 0)
            memmove(mem_212297.mem + gtid_204969 *
                    lifted_single_ma_l_arg_197247 * (int64_t) 4, mem_212278 +
                    (int64_t) 0, lifted_single_ma_l_arg_197247 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212278);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228895_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228895_end -
                 futhark_mc_segmap_parloop_228895_start;
        
        ctx->futhark_mc_segmap_parloop_228895_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228895_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228895_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228893(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204968 = tid;
    int num_tasks_221912 = info.nsubtasks;
    struct futhark_mc_task_228888 *futhark_mc_task_228888 =
                                  (struct futhark_mc_task_228888 *) args;
    struct futhark_context *ctx = futhark_mc_task_228888->ctx;
    uint64_t futhark_mc_segmap_nested_task_228893_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228893_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228888->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228888->free_n_p_196694;
    float i64_res_196737 = futhark_mc_task_228888->free_i64_res_196737;
    int64_t C_len_196743 = futhark_mc_task_228888->free_C_len_196743;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228888->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_228888->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock mem_212275 = {.desc ="mem_212275", .mem =
                                  futhark_mc_task_228888->free_mem_212275,
                                  .size =0, .references =NULL};
    int64_t bytes_212277 = futhark_mc_task_228888->free_bytes_212277;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228888->free_mem_212297,
                                  .size =0, .references =NULL};
    int64_t iter_221941;
    struct futhark_mc_segmap_parloop_struct_228894
    futhark_mc_segmap_parloop_struct_228894;
    
    futhark_mc_segmap_parloop_struct_228894.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228894.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228894.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228894.free_i64_res_196737 =
        i64_res_196737;
    futhark_mc_segmap_parloop_struct_228894.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_228894.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segmap_parloop_struct_228894.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_228894.free_mem_212275 = mem_212275.mem;
    futhark_mc_segmap_parloop_struct_228894.free_bytes_212277 = bytes_212277;
    futhark_mc_segmap_parloop_struct_228894.free_mem_212297 = mem_212297.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228895_task;
    
    futhark_mc_segmap_parloop_228895_task.name =
        "futhark_mc_segmap_parloop_228895";
    futhark_mc_segmap_parloop_228895_task.fn = futhark_mc_segmap_parloop_228895;
    futhark_mc_segmap_parloop_228895_task.args =
        &futhark_mc_segmap_parloop_struct_228894;
    futhark_mc_segmap_parloop_228895_task.iterations = iterations;
    futhark_mc_segmap_parloop_228895_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228895_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228895_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228895_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228895_task);
    
    if (futhark_mc_segmap_parloop_228895_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228895_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228895_total_end -
                 futhark_mc_segmap_parloop_228895_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228895_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228895_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228895_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228893_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228893_end -
                 futhark_mc_segmap_nested_task_228893_start;
        
        ctx->futhark_mc_segmap_nested_task_228893_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228893_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228893_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228904 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_lifted_single_ma_l_arg_197247;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212300;
};
struct futhark_mc_segmap_parloop_struct_228906 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_lifted_single_ma_l_arg_197247;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212300;
};
static int futhark_mc_segmap_parloop_228907(void *args, int64_t start,
                                            int64_t end, int flat_tid_204997,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228906
    *futhark_mc_segmap_parloop_struct_228906 =
    (struct futhark_mc_segmap_parloop_struct_228906 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228906->ctx;
    uint64_t futhark_mc_segmap_parloop_228907_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228907_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228906->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228906->free_n_p_196694;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segmap_parloop_struct_228906->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segmap_parloop_struct_228906->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_segmap_parloop_struct_228906->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221982 = start;
    
    for (; iter_221982 < end; iter_221982++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221987 = m_196691;
        int64_t gtid_204998 = iter_221982;
        int64_t remnant_221988 = iter_221982 - gtid_204998;
        float defunc_2_reduce_res_198232;
        float redout_221984 = 0.0F;
        
        for (int64_t i_221983 = 0; i_221983 < n_p_196694; i_221983++) {
            float x_221985;
            
            x_221985 = ((float *) mem_212297.mem)[gtid_204998 *
                                                  lifted_single_ma_l_arg_197247 +
                                                  i_221983];
            
            float defunc_1_op_res_221986 = x_221985 + redout_221984;
            float redout_tmp_221989 = defunc_1_op_res_221986;
            
            redout_221984 = redout_tmp_221989;
        }
        defunc_2_reduce_res_198232 = redout_221984;
        ((float *) mem_212300.mem)[gtid_204998] = defunc_2_reduce_res_198232;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228907_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228907_end -
                 futhark_mc_segmap_parloop_228907_start;
        
        ctx->futhark_mc_segmap_parloop_228907_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228907_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228907_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228905(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_204997 = tid;
    int num_tasks_221981 = info.nsubtasks;
    struct futhark_mc_task_228904 *futhark_mc_task_228904 =
                                  (struct futhark_mc_task_228904 *) args;
    struct futhark_context *ctx = futhark_mc_task_228904->ctx;
    uint64_t futhark_mc_segmap_task_228905_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228905_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228904->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228904->free_n_p_196694;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228904->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228904->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_task_228904->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t iter_221982;
    struct futhark_mc_segmap_parloop_struct_228906
    futhark_mc_segmap_parloop_struct_228906;
    
    futhark_mc_segmap_parloop_struct_228906.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228906.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228906.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228906.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segmap_parloop_struct_228906.free_mem_212297 = mem_212297.mem;
    futhark_mc_segmap_parloop_struct_228906.free_mem_212300 = mem_212300.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228907_task;
    
    futhark_mc_segmap_parloop_228907_task.name =
        "futhark_mc_segmap_parloop_228907";
    futhark_mc_segmap_parloop_228907_task.fn = futhark_mc_segmap_parloop_228907;
    futhark_mc_segmap_parloop_228907_task.args =
        &futhark_mc_segmap_parloop_struct_228906;
    futhark_mc_segmap_parloop_228907_task.iterations = iterations;
    futhark_mc_segmap_parloop_228907_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228907_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228907_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228907_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228907_task);
    
    if (futhark_mc_segmap_parloop_228907_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228907_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228907_total_end -
                 futhark_mc_segmap_parloop_228907_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228907_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228907_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228907_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228905_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228905_end -
                 futhark_mc_segmap_task_228905_start;
        
        ctx->futhark_mc_segmap_task_228905_runs[tid]++;
        ctx->futhark_mc_segmap_task_228905_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228905_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228909 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    int64_t free_lifted_single_ma_l_arg_197247;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212300;
};
struct futhark_mc_task_228911 {
    struct futhark_context *ctx;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_gtid_205004;
    unsigned char *free_mem_212297;
    float *retval_defunc_2_reduce_res_205006;
};
struct futhark_mc_segred_stage_1_parloop_struct_228914 {
    struct futhark_context *ctx;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_gtid_205004;
    unsigned char *free_mem_212297;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222000;
};
static int futhark_mc_segred_stage_1_parloop_228915(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_221991,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228914
    *futhark_mc_segred_stage_1_parloop_struct_228914 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228914 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228914->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228915_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228915_start = get_wall_time();
    
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segred_stage_1_parloop_struct_228914->free_lifted_single_ma_l_arg_197247;
    int64_t gtid_205004 =
            futhark_mc_segred_stage_1_parloop_struct_228914->free_gtid_205004;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228914->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_222000 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222000",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228914->free_reduce_stage_1_tid_res_arr_mem_222000,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222002 = start;
    float x_221993;
    float x_221994;
    float local_acc_222003 = 0.0F;
    
    for (; iter_222002 < end; iter_222002++) {
        int64_t gtid_221992 = iter_222002;
        float x_221996;
        
        x_221996 = ((float *) mem_212297.mem)[gtid_205004 *
                                              lifted_single_ma_l_arg_197247 +
                                              gtid_221992];
        // save map-out results
        { }
        // Load accum params
        {
            x_221993 = local_acc_222003;
        }
        // Load next params
        {
            x_221994 = x_221996;
        }
        // Red body
        {
            float defunc_1_op_res_221995 = x_221993 + x_221994;
            
            local_acc_222003 = defunc_1_op_res_221995;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_222000.mem)[flat_tid_221991] =
        local_acc_222003;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228915_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228915_end -
                 futhark_mc_segred_stage_1_parloop_228915_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228915_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228915_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228915_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228912(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_221991 = tid;
    int num_tasks_221999 = info.nsubtasks;
    struct futhark_mc_task_228911 *futhark_mc_task_228911 =
                                  (struct futhark_mc_task_228911 *) args;
    struct futhark_context *ctx = futhark_mc_task_228911->ctx;
    uint64_t futhark_mc_segred_task_228912_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228912_start = get_wall_time();
    
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228911->free_lifted_single_ma_l_arg_197247;
    int64_t gtid_205004 = futhark_mc_task_228911->free_gtid_205004;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228911->free_mem_212297,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_205006 =
          *futhark_mc_task_228911->retval_defunc_2_reduce_res_205006;
    size_t reduce_stage_1_tid_res_arr_mem_222000_cached_sizze_228913 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222000 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_222000_cached_sizze_228913 <
        (size_t) ((int64_t) 4 * num_tasks_221999)) {
        reduce_stage_1_tid_res_arr_mem_222000 =
            realloc(reduce_stage_1_tid_res_arr_mem_222000, (int64_t) 4 *
                    num_tasks_221999);
        reduce_stage_1_tid_res_arr_mem_222000_cached_sizze_228913 =
            (int64_t) 4 * num_tasks_221999;
    }
    
    int64_t iter_222002;
    struct futhark_mc_segred_stage_1_parloop_struct_228914
    futhark_mc_segred_stage_1_parloop_struct_228914;
    
    futhark_mc_segred_stage_1_parloop_struct_228914.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228914.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segred_stage_1_parloop_struct_228914.free_gtid_205004 =
        gtid_205004;
    futhark_mc_segred_stage_1_parloop_struct_228914.free_mem_212297 =
        mem_212297.mem;
    futhark_mc_segred_stage_1_parloop_struct_228914.free_reduce_stage_1_tid_res_arr_mem_222000 =
        reduce_stage_1_tid_res_arr_mem_222000;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228915_task;
    
    futhark_mc_segred_stage_1_parloop_228915_task.name =
        "futhark_mc_segred_stage_1_parloop_228915";
    futhark_mc_segred_stage_1_parloop_228915_task.fn =
        futhark_mc_segred_stage_1_parloop_228915;
    futhark_mc_segred_stage_1_parloop_228915_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228914;
    futhark_mc_segred_stage_1_parloop_228915_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228915_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228915_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228915_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228915_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228915_task);
    
    if (futhark_mc_segred_stage_1_parloop_228915_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228915_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228915_total_end -
                 futhark_mc_segred_stage_1_parloop_228915_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228915_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228915_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228915_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_205006 = 0.0F;
    }
    
    float x_222004;
    float x_222005;
    
    for (int32_t i_222007 = 0; i_222007 < num_tasks_221999; i_222007++) {
        flat_tid_221991 = i_222007;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_222004 = defunc_2_reduce_res_205006;
            }
            // load next params
            {
                x_222005 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222000)[flat_tid_221991];
            }
            // red body
            {
                float defunc_1_op_res_222006 = x_222004 + x_222005;
                
                defunc_2_reduce_res_205006 = defunc_1_op_res_222006;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_222000);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228912_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228912_end -
                 futhark_mc_segred_task_228912_start;
        
        ctx->futhark_mc_segred_task_228912_runs[tid]++;
        ctx->futhark_mc_segred_task_228912_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228912_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228911->retval_defunc_2_reduce_res_205006 =
            defunc_2_reduce_res_205006;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228910(void *args, int64_t start,
                                            int64_t end, int flat_tid_205003,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228909
    *futhark_mc_segmap_parloop_struct_228909 =
    (struct futhark_mc_segmap_parloop_struct_228909 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228909->ctx;
    uint64_t futhark_mc_segmap_parloop_228910_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228910_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228909->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228909->free_n_p_196694;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segmap_parloop_struct_228909->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segmap_parloop_struct_228909->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_segmap_parloop_struct_228909->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_221990 = start;
    
    for (; iter_221990 < end; iter_221990++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_221997 = m_196691;
        int64_t gtid_205004 = iter_221990;
        int64_t remnant_221998 = iter_221990 - gtid_205004;
        float defunc_2_reduce_res_205006;
        int64_t flat_tid_221991 = (int64_t) 0;
        int32_t num_tasks_221999;
        
        defunc_2_reduce_res_205006 = 0.0F;
        
        struct futhark_mc_task_228911 futhark_mc_task_228911;
        
        futhark_mc_task_228911.ctx = ctx;
        futhark_mc_task_228911.free_lifted_single_ma_l_arg_197247 =
            lifted_single_ma_l_arg_197247;
        futhark_mc_task_228911.free_gtid_205004 = gtid_205004;
        futhark_mc_task_228911.free_mem_212297 = mem_212297.mem;
        futhark_mc_task_228911.retval_defunc_2_reduce_res_205006 =
            &defunc_2_reduce_res_205006;
        
        struct scheduler_segop futhark_mc_task_228911_task;
        
        futhark_mc_task_228911_task.args = &futhark_mc_task_228911;
        futhark_mc_task_228911_task.top_level_fn =
            futhark_mc_segred_task_228912;
        futhark_mc_task_228911_task.name = "futhark_mc_segred_task_228912";
        futhark_mc_task_228911_task.iterations = n_p_196694;
        futhark_mc_task_228911_task.task_time =
            &ctx->futhark_mc_segred_task_228912_total_time;
        futhark_mc_task_228911_task.task_iter =
            &ctx->futhark_mc_segred_task_228912_total_iter;
        futhark_mc_task_228911_task.sched = STATIC;
        futhark_mc_task_228911_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228912_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228911_task);
        
        if (futhark_mc_segred_task_228912_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212300.mem)[gtid_205004] = defunc_2_reduce_res_205006;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228910_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228910_end -
                 futhark_mc_segmap_parloop_228910_start;
        
        ctx->futhark_mc_segmap_parloop_228910_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228910_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228910_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228908(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205003 = tid;
    int num_tasks_221981 = info.nsubtasks;
    struct futhark_mc_task_228904 *futhark_mc_task_228904 =
                                  (struct futhark_mc_task_228904 *) args;
    struct futhark_context *ctx = futhark_mc_task_228904->ctx;
    uint64_t futhark_mc_segmap_nested_task_228908_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228908_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228904->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228904->free_n_p_196694;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228904->free_lifted_single_ma_l_arg_197247;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228904->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_task_228904->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t iter_221990;
    struct futhark_mc_segmap_parloop_struct_228909
    futhark_mc_segmap_parloop_struct_228909;
    
    futhark_mc_segmap_parloop_struct_228909.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228909.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228909.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228909.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segmap_parloop_struct_228909.free_mem_212297 = mem_212297.mem;
    futhark_mc_segmap_parloop_struct_228909.free_mem_212300 = mem_212300.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228910_task;
    
    futhark_mc_segmap_parloop_228910_task.name =
        "futhark_mc_segmap_parloop_228910";
    futhark_mc_segmap_parloop_228910_task.fn = futhark_mc_segmap_parloop_228910;
    futhark_mc_segmap_parloop_228910_task.args =
        &futhark_mc_segmap_parloop_struct_228909;
    futhark_mc_segmap_parloop_228910_task.iterations = iterations;
    futhark_mc_segmap_parloop_228910_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228910_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228910_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228910_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228910_task);
    
    if (futhark_mc_segmap_parloop_228910_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228910_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228910_total_end -
                 futhark_mc_segmap_parloop_228910_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228910_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228910_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228910_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228908_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228908_end -
                 futhark_mc_segmap_nested_task_228908_start;
        
        ctx->futhark_mc_segmap_nested_task_228908_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228908_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228908_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228916 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212300;
    int64_t free_bytes_212302;
    unsigned char *free_mem_212322;
};
struct futhark_mc_segmap_parloop_struct_228918 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212300;
    int64_t free_bytes_212302;
    unsigned char *free_mem_212322;
};
static int futhark_mc_segmap_parloop_228919(void *args, int64_t start,
                                            int64_t end, int flat_tid_205013,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228918
    *futhark_mc_segmap_parloop_struct_228918 =
    (struct futhark_mc_segmap_parloop_struct_228918 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228918->ctx;
    uint64_t futhark_mc_segmap_parloop_228919_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228919_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228918->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228918->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_segmap_parloop_struct_228918->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segmap_parloop_struct_228918->free_lifted_single_ma_l_arg_197247;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segmap_parloop_struct_228918->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segmap_parloop_struct_228918->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_segmap_parloop_struct_228918->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t bytes_212302 =
            futhark_mc_segmap_parloop_struct_228918->free_bytes_212302;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segmap_parloop_struct_228918->free_mem_212322,
                                  .size =0, .references =NULL};
    size_t mem_212306_cached_sizze_228920 = 0;
    unsigned char *mem_212306 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222009 = start;
    
    if (mem_212306_cached_sizze_228920 < (size_t) bytes_212302) {
        mem_212306 = realloc(mem_212306, bytes_212302);
        mem_212306_cached_sizze_228920 = bytes_212302;
    }
    for (; iter_222009 < end; iter_222009++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222033 = m_196691;
        int64_t gtid_205014 = iter_222009;
        int64_t remnant_222034 = iter_222009 - gtid_205014;
        float x_198240;
        
        x_198240 = ((float *) mem_212300.mem)[gtid_205014];
        
        float discard_209548;
        float scanacc_222011 = 0.0F;
        
        for (int64_t i_222010 = 0; i_222010 < dyn_lifted_single_ma_l_arg_197257;
             i_222010++) {
            bool cond_222013 = i_222010 == (int64_t) 0;
            float defunc_0_f_res_222014;
            
            if (cond_222013) {
                float defunc_0_f_res_t_res_222015 = x_198240 / i64_res_196737;
                
                defunc_0_f_res_222014 = defunc_0_f_res_t_res_222015;
            } else {
                int64_t x_222016 = add64(n_p_196694, i_222010);
                int64_t i_222017 = sub64(x_222016, (int64_t) 1);
                bool x_222018 = sle64((int64_t) 0, i_222017);
                bool y_222019 = slt64(i_222017, lifted_single_ma_l_arg_197247);
                bool bounds_check_222020 = x_222018 && y_222019;
                bool index_certs_222021;
                
                if (!bounds_check_222020) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222017,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222022;
                
                x_222022 = ((float *) mem_212297.mem)[gtid_205014 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222017];
                
                int64_t i_222023 = sub64(i_222010, (int64_t) 1);
                bool x_222024 = sle64((int64_t) 0, i_222023);
                bool y_222025 = slt64(i_222023, lifted_single_ma_l_arg_197247);
                bool bounds_check_222026 = x_222024 && y_222025;
                bool index_certs_222027;
                
                if (!bounds_check_222026) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222023,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222028;
                
                y_222028 = ((float *) mem_212297.mem)[gtid_205014 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222023];
                
                float x_222029 = x_222022 - y_222028;
                float defunc_0_f_res_f_res_222030 = x_222029 / i64_res_196737;
                
                defunc_0_f_res_222014 = defunc_0_f_res_f_res_222030;
            }
            
            float defunc_1_op_res_222031 = defunc_0_f_res_222014 +
                  scanacc_222011;
            
            ((float *) mem_212306)[i_222010] = defunc_1_op_res_222031;
            
            float scanacc_tmp_222035 = defunc_1_op_res_222031;
            
            scanacc_222011 = scanacc_tmp_222035;
        }
        discard_209548 = scanacc_222011;
        if (dyn_lifted_single_ma_l_arg_197257 * (int64_t) 4 > 0)
            memmove(mem_212322.mem + gtid_205014 *
                    dyn_lifted_single_ma_l_arg_197257 * (int64_t) 4,
                    mem_212306 + (int64_t) 0,
                    dyn_lifted_single_ma_l_arg_197257 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212306);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228919_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228919_end -
                 futhark_mc_segmap_parloop_228919_start;
        
        ctx->futhark_mc_segmap_parloop_228919_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228919_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228919_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228917(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205013 = tid;
    int num_tasks_222008 = info.nsubtasks;
    struct futhark_mc_task_228916 *futhark_mc_task_228916 =
                                  (struct futhark_mc_task_228916 *) args;
    struct futhark_context *ctx = futhark_mc_task_228916->ctx;
    uint64_t futhark_mc_segmap_task_228917_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228917_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228916->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228916->free_n_p_196694;
    float i64_res_196737 = futhark_mc_task_228916->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228916->free_lifted_single_ma_l_arg_197247;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228916->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228916->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_task_228916->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t bytes_212302 = futhark_mc_task_228916->free_bytes_212302;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228916->free_mem_212322,
                                  .size =0, .references =NULL};
    int64_t iter_222009;
    struct futhark_mc_segmap_parloop_struct_228918
    futhark_mc_segmap_parloop_struct_228918;
    
    futhark_mc_segmap_parloop_struct_228918.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228918.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228918.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228918.free_i64_res_196737 =
        i64_res_196737;
    futhark_mc_segmap_parloop_struct_228918.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segmap_parloop_struct_228918.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segmap_parloop_struct_228918.free_mem_212297 = mem_212297.mem;
    futhark_mc_segmap_parloop_struct_228918.free_mem_212300 = mem_212300.mem;
    futhark_mc_segmap_parloop_struct_228918.free_bytes_212302 = bytes_212302;
    futhark_mc_segmap_parloop_struct_228918.free_mem_212322 = mem_212322.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228919_task;
    
    futhark_mc_segmap_parloop_228919_task.name =
        "futhark_mc_segmap_parloop_228919";
    futhark_mc_segmap_parloop_228919_task.fn = futhark_mc_segmap_parloop_228919;
    futhark_mc_segmap_parloop_228919_task.args =
        &futhark_mc_segmap_parloop_struct_228918;
    futhark_mc_segmap_parloop_228919_task.iterations = iterations;
    futhark_mc_segmap_parloop_228919_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228919_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228919_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228919_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228919_task);
    
    if (futhark_mc_segmap_parloop_228919_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228919_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228919_total_end -
                 futhark_mc_segmap_parloop_228919_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228919_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228919_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228919_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228917_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228917_end -
                 futhark_mc_segmap_task_228917_start;
        
        ctx->futhark_mc_segmap_task_228917_runs[tid]++;
        ctx->futhark_mc_segmap_task_228917_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228917_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228922 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212300;
    int64_t free_bytes_212302;
    unsigned char *free_mem_212322;
};
struct futhark_mc_task_228925 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_gtid_205020;
    float free_x_205022;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212303;
};
struct futhark_mc_scan_stage_1_parloop_struct_228928 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_gtid_205020;
    float free_x_205022;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212303;
};
static int futhark_mc_scan_stage_1_parloop_228929(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_222038, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_1_parloop_struct_228928
    *futhark_mc_scan_stage_1_parloop_struct_228928 =
    (struct futhark_mc_scan_stage_1_parloop_struct_228928 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_1_parloop_struct_228928->ctx;
    uint64_t futhark_mc_scan_stage_1_parloop_228929_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228929_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_scan_stage_1_parloop_struct_228928->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_scan_stage_1_parloop_struct_228928->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_scan_stage_1_parloop_struct_228928->free_lifted_single_ma_l_arg_197247;
    int64_t gtid_205020 =
            futhark_mc_scan_stage_1_parloop_struct_228928->free_gtid_205020;
    float x_205022 =
          futhark_mc_scan_stage_1_parloop_struct_228928->free_x_205022;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228928->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212303 = {.desc ="mem_212303", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228928->free_mem_212303,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222064 = start;
    float x_222040;
    float x_222041;
    
    x_222040 = 0.0F;
    for (; iter_222064 < end; iter_222064++) {
        int64_t gtid_222039 = iter_222064;
        
        // stage 1 scan body
        {
            bool cond_222043 = gtid_222039 == (int64_t) 0;
            float defunc_0_f_res_222044;
            
            if (cond_222043) {
                float defunc_0_f_res_t_res_222045 = x_205022 / i64_res_196737;
                
                defunc_0_f_res_222044 = defunc_0_f_res_t_res_222045;
            } else {
                int64_t x_222046 = add64(n_p_196694, gtid_222039);
                int64_t i_222047 = sub64(x_222046, (int64_t) 1);
                bool x_222048 = sle64((int64_t) 0, i_222047);
                bool y_222049 = slt64(i_222047, lifted_single_ma_l_arg_197247);
                bool bounds_check_222050 = x_222048 && y_222049;
                bool index_certs_222051;
                
                if (!bounds_check_222050) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222047,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222052;
                
                x_222052 = ((float *) mem_212297.mem)[gtid_205020 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222047];
                
                int64_t i_222053 = sub64(gtid_222039, (int64_t) 1);
                bool x_222054 = sle64((int64_t) 0, i_222053);
                bool y_222055 = slt64(i_222053, lifted_single_ma_l_arg_197247);
                bool bounds_check_222056 = x_222054 && y_222055;
                bool index_certs_222057;
                
                if (!bounds_check_222056) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222053,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222058;
                
                y_222058 = ((float *) mem_212297.mem)[gtid_205020 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222053];
                
                float x_222059 = x_222052 - y_222058;
                float defunc_0_f_res_f_res_222060 = x_222059 / i64_res_196737;
                
                defunc_0_f_res_222044 = defunc_0_f_res_f_res_222060;
            }
            // write mapped values results to memory
            { }
            x_222040 = x_222040;
            // Read next values
            {
                x_222041 = defunc_0_f_res_222044;
            }
            
            float defunc_1_op_res_222042 = x_222040 + x_222041;
            
            ((float *) mem_212303.mem)[gtid_222039] = defunc_1_op_res_222042;
            x_222040 = defunc_1_op_res_222042;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228929_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228929_end -
                 futhark_mc_scan_stage_1_parloop_228929_start;
        
        ctx->futhark_mc_scan_stage_1_parloop_228929_runs[tid]++;
        ctx->futhark_mc_scan_stage_1_parloop_228929_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_1_parloop_228929_iter[tid] += iterations;
    }
    return err;
}
struct futhark_mc_scan_stage_3_parloop_struct_228930 {
    struct futhark_context *ctx;
    int64_t free_n_p_196694;
    float free_i64_res_196737;
    int64_t free_lifted_single_ma_l_arg_197247;
    int64_t free_gtid_205020;
    float free_x_205022;
    unsigned char *free_mem_212297;
    unsigned char *free_mem_212303;
};
static int futhark_mc_scan_stage_3_parloop_228931(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_222038, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_3_parloop_struct_228930
    *futhark_mc_scan_stage_3_parloop_struct_228930 =
    (struct futhark_mc_scan_stage_3_parloop_struct_228930 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_3_parloop_struct_228930->ctx;
    uint64_t futhark_mc_scan_stage_3_parloop_228931_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_3_parloop_228931_start = get_wall_time();
    
    int64_t n_p_196694 =
            futhark_mc_scan_stage_3_parloop_struct_228930->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_scan_stage_3_parloop_struct_228930->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_scan_stage_3_parloop_struct_228930->free_lifted_single_ma_l_arg_197247;
    int64_t gtid_205020 =
            futhark_mc_scan_stage_3_parloop_struct_228930->free_gtid_205020;
    float x_205022 =
          futhark_mc_scan_stage_3_parloop_struct_228930->free_x_205022;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228930->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212303 = {.desc ="mem_212303", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228930->free_mem_212303,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222076 = start;
    float x_222073;
    float x_222074;
    
    if (iter_222076 == (int64_t) 0) {
        x_222073 = 0.0F;
    } else {
        x_222073 = ((float *) mem_212303.mem)[iter_222076 - (int64_t) 1];
    }
    for (; iter_222076 < end; iter_222076++) {
        int64_t gtid_222039 = iter_222076;
        
        // stage 3 scan body
        {
            bool cond_222043 = gtid_222039 == (int64_t) 0;
            float defunc_0_f_res_222044;
            
            if (cond_222043) {
                float defunc_0_f_res_t_res_222045 = x_205022 / i64_res_196737;
                
                defunc_0_f_res_222044 = defunc_0_f_res_t_res_222045;
            } else {
                int64_t x_222046 = add64(n_p_196694, gtid_222039);
                int64_t i_222047 = sub64(x_222046, (int64_t) 1);
                bool x_222048 = sle64((int64_t) 0, i_222047);
                bool y_222049 = slt64(i_222047, lifted_single_ma_l_arg_197247);
                bool bounds_check_222050 = x_222048 && y_222049;
                bool index_certs_222051;
                
                if (!bounds_check_222050) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222047,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222052;
                
                x_222052 = ((float *) mem_212297.mem)[gtid_205020 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222047];
                
                int64_t i_222053 = sub64(gtid_222039, (int64_t) 1);
                bool x_222054 = sle64((int64_t) 0, i_222053);
                bool y_222055 = slt64(i_222053, lifted_single_ma_l_arg_197247);
                bool bounds_check_222056 = x_222054 && y_222055;
                bool index_certs_222057;
                
                if (!bounds_check_222056) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222053,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222058;
                
                y_222058 = ((float *) mem_212297.mem)[gtid_205020 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222053];
                
                float x_222059 = x_222052 - y_222058;
                float defunc_0_f_res_f_res_222060 = x_222059 / i64_res_196737;
                
                defunc_0_f_res_222044 = defunc_0_f_res_f_res_222060;
            }
            x_222073 = x_222073;
            x_222074 = defunc_0_f_res_222044;
            
            float defunc_1_op_res_222075 = x_222073 + x_222074;
            
            ((float *) mem_212303.mem)[gtid_222039] = defunc_1_op_res_222075;
            x_222073 = defunc_1_op_res_222075;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_3_parloop_228931_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_3_parloop_228931_end -
                 futhark_mc_scan_stage_3_parloop_228931_start;
        
        ctx->futhark_mc_scan_stage_3_parloop_228931_runs[tid]++;
        ctx->futhark_mc_scan_stage_3_parloop_228931_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_3_parloop_228931_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segscan_task_228926(void *args, int64_t iterations, int tid,
                                   struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222038 = tid;
    int num_tasks_222063 = info.nsubtasks;
    struct futhark_mc_task_228925 *futhark_mc_task_228925 =
                                  (struct futhark_mc_task_228925 *) args;
    struct futhark_context *ctx = futhark_mc_task_228925->ctx;
    uint64_t futhark_mc_segscan_task_228926_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segscan_task_228926_start = get_wall_time();
    
    int64_t n_p_196694 = futhark_mc_task_228925->free_n_p_196694;
    float i64_res_196737 = futhark_mc_task_228925->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228925->free_lifted_single_ma_l_arg_197247;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228925->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t gtid_205020 = futhark_mc_task_228925->free_gtid_205020;
    float x_205022 = futhark_mc_task_228925->free_x_205022;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228925->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212303 = {.desc ="mem_212303", .mem =
                                  futhark_mc_task_228925->free_mem_212303,
                                  .size =0, .references =NULL};
    size_t scan_stage_2_accum_mem_222070_cached_sizze_228927 = 0;
    unsigned char *scan_stage_2_accum_mem_222070 = NULL;
    int64_t iter_222064;
    struct futhark_mc_scan_stage_1_parloop_struct_228928
    futhark_mc_scan_stage_1_parloop_struct_228928;
    
    futhark_mc_scan_stage_1_parloop_struct_228928.ctx = ctx;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_n_p_196694 = n_p_196694;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_i64_res_196737 =
        i64_res_196737;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_gtid_205020 =
        gtid_205020;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_x_205022 = x_205022;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_mem_212297 =
        mem_212297.mem;
    futhark_mc_scan_stage_1_parloop_struct_228928.free_mem_212303 =
        mem_212303.mem;
    
    struct scheduler_parloop futhark_mc_scan_stage_1_parloop_228929_task;
    
    futhark_mc_scan_stage_1_parloop_228929_task.name =
        "futhark_mc_scan_stage_1_parloop_228929";
    futhark_mc_scan_stage_1_parloop_228929_task.fn =
        futhark_mc_scan_stage_1_parloop_228929;
    futhark_mc_scan_stage_1_parloop_228929_task.args =
        &futhark_mc_scan_stage_1_parloop_struct_228928;
    futhark_mc_scan_stage_1_parloop_228929_task.iterations = iterations;
    futhark_mc_scan_stage_1_parloop_228929_task.info = info;
    
    uint64_t futhark_mc_scan_stage_1_parloop_228929_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228929_total_start = get_wall_time();
    
    int futhark_mc_scan_stage_1_parloop_228929_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_scan_stage_1_parloop_228929_task);
    
    if (futhark_mc_scan_stage_1_parloop_228929_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228929_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228929_total_end -
                 futhark_mc_scan_stage_1_parloop_228929_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228929_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228929_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228929_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    if (slt32(1, num_tasks_222063)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmentedScan stage 2");
        
        float x_222065;
        float x_222066;
        int64_t offset_222068 = (int64_t) 0;
        int64_t offset_index_222069 = (int64_t) 0;
        
        if (scan_stage_2_accum_mem_222070_cached_sizze_228927 <
            (size_t) (int64_t) 4) {
            scan_stage_2_accum_mem_222070 =
                realloc(scan_stage_2_accum_mem_222070, (int64_t) 4);
            scan_stage_2_accum_mem_222070_cached_sizze_228927 = (int64_t) 4;
        }
        ((float *) scan_stage_2_accum_mem_222070)[(int64_t) 0] = 0.0F;
        for (int32_t i_222072 = 0; i_222072 < num_tasks_222063 - 1;
             i_222072++) {
            offset_222068 = squot64(dyn_lifted_single_ma_l_arg_197257,
                                    sext_i32_i64(num_tasks_222063));
            if (slt64(sext_i32_i64(i_222072),
                      srem64(dyn_lifted_single_ma_l_arg_197257,
                             sext_i32_i64(num_tasks_222063)))) {
                offset_222068 += (int64_t) 1;
            }
            offset_index_222069 += offset_222068;
            
            int64_t gtid_222039 = offset_index_222069;
            bool cond_222043 = gtid_222039 == (int64_t) 0;
            float defunc_0_f_res_222044;
            
            if (cond_222043) {
                float defunc_0_f_res_t_res_222045 = x_205022 / i64_res_196737;
                
                defunc_0_f_res_222044 = defunc_0_f_res_t_res_222045;
            } else {
                int64_t x_222046 = add64(n_p_196694, gtid_222039);
                int64_t i_222047 = sub64(x_222046, (int64_t) 1);
                bool x_222048 = sle64((int64_t) 0, i_222047);
                bool y_222049 = slt64(i_222047, lifted_single_ma_l_arg_197247);
                bool bounds_check_222050 = x_222048 && y_222049;
                bool index_certs_222051;
                
                if (!bounds_check_222050) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222047,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222052;
                
                x_222052 = ((float *) mem_212297.mem)[gtid_205020 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222047];
                
                int64_t i_222053 = sub64(gtid_222039, (int64_t) 1);
                bool x_222054 = sle64((int64_t) 0, i_222053);
                bool y_222055 = slt64(i_222053, lifted_single_ma_l_arg_197247);
                bool bounds_check_222056 = x_222054 && y_222055;
                bool index_certs_222057;
                
                if (!bounds_check_222056) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222053,
                                  "] out of bounds for array of shape [",
                                  (long long) lifted_single_ma_l_arg_197247,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222058;
                
                y_222058 = ((float *) mem_212297.mem)[gtid_205020 *
                                                      lifted_single_ma_l_arg_197247 +
                                                      i_222053];
                
                float x_222059 = x_222052 - y_222058;
                float defunc_0_f_res_f_res_222060 = x_222059 / i64_res_196737;
                
                defunc_0_f_res_222044 = defunc_0_f_res_f_res_222060;
            }
            // Read carry in
            {
                x_222065 =
                    ((float *) scan_stage_2_accum_mem_222070)[(int64_t) 0];
            }
            // Read next values
            {
                x_222066 = ((float *) mem_212303.mem)[offset_index_222069 -
                                                      (int64_t) 1];
            }
            
            float defunc_1_op_res_222067 = x_222065 + x_222066;
            
            ((float *) mem_212303.mem)[offset_index_222069 - (int64_t) 1] =
                defunc_1_op_res_222067;
            ((float *) scan_stage_2_accum_mem_222070)[(int64_t) 0] =
                defunc_1_op_res_222067;
        }
        
        int64_t iter_222076 = (int64_t) 0;
        struct futhark_mc_scan_stage_3_parloop_struct_228930
        futhark_mc_scan_stage_3_parloop_struct_228930;
        
        futhark_mc_scan_stage_3_parloop_struct_228930.ctx = ctx;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_n_p_196694 =
            n_p_196694;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_i64_res_196737 =
            i64_res_196737;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_lifted_single_ma_l_arg_197247 =
            lifted_single_ma_l_arg_197247;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_gtid_205020 =
            gtid_205020;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_x_205022 = x_205022;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_mem_212297 =
            mem_212297.mem;
        futhark_mc_scan_stage_3_parloop_struct_228930.free_mem_212303 =
            mem_212303.mem;
        
        struct scheduler_parloop futhark_mc_scan_stage_3_parloop_228931_task;
        
        futhark_mc_scan_stage_3_parloop_228931_task.name =
            "futhark_mc_scan_stage_3_parloop_228931";
        futhark_mc_scan_stage_3_parloop_228931_task.fn =
            futhark_mc_scan_stage_3_parloop_228931;
        futhark_mc_scan_stage_3_parloop_228931_task.args =
            &futhark_mc_scan_stage_3_parloop_struct_228930;
        futhark_mc_scan_stage_3_parloop_228931_task.iterations = iterations;
        futhark_mc_scan_stage_3_parloop_228931_task.info = info;
        
        uint64_t futhark_mc_scan_stage_3_parloop_228931_total_start = 0;
        
        if (ctx->profiling && !ctx->profiling_paused)
            futhark_mc_scan_stage_3_parloop_228931_total_start =
                get_wall_time();
        
        int futhark_mc_scan_stage_3_parloop_228931_err =
            scheduler_execute_task(&ctx->scheduler,
                                   &futhark_mc_scan_stage_3_parloop_228931_task);
        
        if (futhark_mc_scan_stage_3_parloop_228931_err != 0) {
            err = 1;
            goto cleanup;
        }
        if (ctx->profiling && !ctx->profiling_paused) {
            uint64_t futhark_mc_scan_stage_3_parloop_228931_total_end =
                     get_wall_time();
            uint64_t elapsed =
                     futhark_mc_scan_stage_3_parloop_228931_total_end -
                     futhark_mc_scan_stage_3_parloop_228931_total_start;
            
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228931_total_runs,
                               1, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228931_total_total_runtime,
                               elapsed, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228931_total_iter,
                               iterations, __ATOMIC_RELAXED);
        }
    }
    
  cleanup:
    {
        free(scan_stage_2_accum_mem_222070);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segscan_task_228926_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segscan_task_228926_end -
                 futhark_mc_segscan_task_228926_start;
        
        ctx->futhark_mc_segscan_task_228926_runs[tid]++;
        ctx->futhark_mc_segscan_task_228926_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segscan_task_228926_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228923(void *args, int64_t start,
                                            int64_t end, int flat_tid_205019,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228922
    *futhark_mc_segmap_parloop_struct_228922 =
    (struct futhark_mc_segmap_parloop_struct_228922 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228922->ctx;
    uint64_t futhark_mc_segmap_parloop_228923_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228923_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228922->free_m_196691;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_228922->free_n_p_196694;
    float i64_res_196737 =
          futhark_mc_segmap_parloop_struct_228922->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_segmap_parloop_struct_228922->free_lifted_single_ma_l_arg_197247;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segmap_parloop_struct_228922->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_segmap_parloop_struct_228922->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_segmap_parloop_struct_228922->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t bytes_212302 =
            futhark_mc_segmap_parloop_struct_228922->free_bytes_212302;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segmap_parloop_struct_228922->free_mem_212322,
                                  .size =0, .references =NULL};
    size_t mem_212303_cached_sizze_228924 = 0;
    unsigned char *mem_212303 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222037 = start;
    
    if (mem_212303_cached_sizze_228924 < (size_t) bytes_212302) {
        mem_212303 = realloc(mem_212303, bytes_212302);
        mem_212303_cached_sizze_228924 = bytes_212302;
    }
    for (; iter_222037 < end; iter_222037++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222061 = m_196691;
        int64_t gtid_205020 = iter_222037;
        int64_t remnant_222062 = iter_222037 - gtid_205020;
        float x_205022;
        
        x_205022 = ((float *) mem_212300.mem)[gtid_205020];
        
        int64_t flat_tid_222038 = (int64_t) 0;
        int32_t num_tasks_222063;
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmented segScan");
        
        struct futhark_mc_task_228925 futhark_mc_task_228925;
        
        futhark_mc_task_228925.ctx = ctx;
        futhark_mc_task_228925.free_n_p_196694 = n_p_196694;
        futhark_mc_task_228925.free_i64_res_196737 = i64_res_196737;
        futhark_mc_task_228925.free_lifted_single_ma_l_arg_197247 =
            lifted_single_ma_l_arg_197247;
        futhark_mc_task_228925.free_dyn_lifted_single_ma_l_arg_197257 =
            dyn_lifted_single_ma_l_arg_197257;
        futhark_mc_task_228925.free_gtid_205020 = gtid_205020;
        futhark_mc_task_228925.free_x_205022 = x_205022;
        futhark_mc_task_228925.free_mem_212297 = mem_212297.mem;
        futhark_mc_task_228925.free_mem_212303 = mem_212303;
        
        struct scheduler_segop futhark_mc_task_228925_task;
        
        futhark_mc_task_228925_task.args = &futhark_mc_task_228925;
        futhark_mc_task_228925_task.top_level_fn =
            futhark_mc_segscan_task_228926;
        futhark_mc_task_228925_task.name = "futhark_mc_segscan_task_228926";
        futhark_mc_task_228925_task.iterations =
            dyn_lifted_single_ma_l_arg_197257;
        futhark_mc_task_228925_task.task_time =
            &ctx->futhark_mc_segscan_task_228926_total_time;
        futhark_mc_task_228925_task.task_iter =
            &ctx->futhark_mc_segscan_task_228926_total_iter;
        futhark_mc_task_228925_task.sched = STATIC;
        futhark_mc_task_228925_task.nested_fn = NULL;
        
        int futhark_mc_segscan_task_228926_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228925_task);
        
        if (futhark_mc_segscan_task_228926_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (dyn_lifted_single_ma_l_arg_197257 * (int64_t) 4 > 0)
            memmove(mem_212322.mem + gtid_205020 *
                    dyn_lifted_single_ma_l_arg_197257 * (int64_t) 4,
                    mem_212303 + (int64_t) 0,
                    dyn_lifted_single_ma_l_arg_197257 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212303);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228923_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228923_end -
                 futhark_mc_segmap_parloop_228923_start;
        
        ctx->futhark_mc_segmap_parloop_228923_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228923_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228923_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228921(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205019 = tid;
    int num_tasks_222008 = info.nsubtasks;
    struct futhark_mc_task_228916 *futhark_mc_task_228916 =
                                  (struct futhark_mc_task_228916 *) args;
    struct futhark_context *ctx = futhark_mc_task_228916->ctx;
    uint64_t futhark_mc_segmap_nested_task_228921_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228921_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228916->free_m_196691;
    int64_t n_p_196694 = futhark_mc_task_228916->free_n_p_196694;
    float i64_res_196737 = futhark_mc_task_228916->free_i64_res_196737;
    int64_t lifted_single_ma_l_arg_197247 =
            futhark_mc_task_228916->free_lifted_single_ma_l_arg_197247;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228916->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212297 = {.desc ="mem_212297", .mem =
                                  futhark_mc_task_228916->free_mem_212297,
                                  .size =0, .references =NULL};
    struct memblock mem_212300 = {.desc ="mem_212300", .mem =
                                  futhark_mc_task_228916->free_mem_212300,
                                  .size =0, .references =NULL};
    int64_t bytes_212302 = futhark_mc_task_228916->free_bytes_212302;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228916->free_mem_212322,
                                  .size =0, .references =NULL};
    int64_t iter_222037;
    struct futhark_mc_segmap_parloop_struct_228922
    futhark_mc_segmap_parloop_struct_228922;
    
    futhark_mc_segmap_parloop_struct_228922.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228922.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228922.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_228922.free_i64_res_196737 =
        i64_res_196737;
    futhark_mc_segmap_parloop_struct_228922.free_lifted_single_ma_l_arg_197247 =
        lifted_single_ma_l_arg_197247;
    futhark_mc_segmap_parloop_struct_228922.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segmap_parloop_struct_228922.free_mem_212297 = mem_212297.mem;
    futhark_mc_segmap_parloop_struct_228922.free_mem_212300 = mem_212300.mem;
    futhark_mc_segmap_parloop_struct_228922.free_bytes_212302 = bytes_212302;
    futhark_mc_segmap_parloop_struct_228922.free_mem_212322 = mem_212322.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228923_task;
    
    futhark_mc_segmap_parloop_228923_task.name =
        "futhark_mc_segmap_parloop_228923";
    futhark_mc_segmap_parloop_228923_task.fn = futhark_mc_segmap_parloop_228923;
    futhark_mc_segmap_parloop_228923_task.args =
        &futhark_mc_segmap_parloop_struct_228922;
    futhark_mc_segmap_parloop_228923_task.iterations = iterations;
    futhark_mc_segmap_parloop_228923_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228923_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228923_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228923_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228923_task);
    
    if (futhark_mc_segmap_parloop_228923_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228923_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228923_total_end -
                 futhark_mc_segmap_parloop_228923_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228923_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228923_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228923_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228921_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228921_end -
                 futhark_mc_segmap_nested_task_228921_start;
        
        ctx->futhark_mc_segmap_nested_task_228921_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228921_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228921_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228932 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212325;
};
struct futhark_mc_segmap_parloop_struct_228934 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212325;
};
static int futhark_mc_segmap_parloop_228935(void *args, int64_t start,
                                            int64_t end, int flat_tid_205048,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228934
    *futhark_mc_segmap_parloop_struct_228934 =
    (struct futhark_mc_segmap_parloop_struct_228934 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228934->ctx;
    uint64_t futhark_mc_segmap_parloop_228935_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228935_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228934->free_m_196691;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segmap_parloop_struct_228934->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segmap_parloop_struct_228934->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_segmap_parloop_struct_228934->free_mem_212325,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222078 = start;
    
    for (; iter_222078 < end; iter_222078++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222084 = m_196691;
        int64_t gtid_205049 = iter_222078;
        int64_t remnant_222085 = iter_222078 - gtid_205049;
        float defunc_2_reduce_res_198268;
        float redout_222080 = 0.0F;
        
        for (int32_t i_222079 = 0; i_222079 < 3; i_222079++) {
            int64_t i_222081 = sext_i32_i64(i_222079);
            float x_222082;
            
            x_222082 = ((float *) mem_212322.mem)[gtid_205049 *
                                                  dyn_lifted_single_ma_l_arg_197257 +
                                                  i_222081];
            
            float defunc_1_op_res_222083 = x_222082 + redout_222080;
            float redout_tmp_222086 = defunc_1_op_res_222083;
            
            redout_222080 = redout_tmp_222086;
        }
        defunc_2_reduce_res_198268 = redout_222080;
        ((float *) mem_212325.mem)[gtid_205049] = defunc_2_reduce_res_198268;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228935_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228935_end -
                 futhark_mc_segmap_parloop_228935_start;
        
        ctx->futhark_mc_segmap_parloop_228935_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228935_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228935_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228933(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205048 = tid;
    int num_tasks_222077 = info.nsubtasks;
    struct futhark_mc_task_228932 *futhark_mc_task_228932 =
                                  (struct futhark_mc_task_228932 *) args;
    struct futhark_context *ctx = futhark_mc_task_228932->ctx;
    uint64_t futhark_mc_segmap_task_228933_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228933_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228932->free_m_196691;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228932->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228932->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_task_228932->free_mem_212325,
                                  .size =0, .references =NULL};
    int64_t iter_222078;
    struct futhark_mc_segmap_parloop_struct_228934
    futhark_mc_segmap_parloop_struct_228934;
    
    futhark_mc_segmap_parloop_struct_228934.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228934.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228934.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segmap_parloop_struct_228934.free_mem_212322 = mem_212322.mem;
    futhark_mc_segmap_parloop_struct_228934.free_mem_212325 = mem_212325.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228935_task;
    
    futhark_mc_segmap_parloop_228935_task.name =
        "futhark_mc_segmap_parloop_228935";
    futhark_mc_segmap_parloop_228935_task.fn = futhark_mc_segmap_parloop_228935;
    futhark_mc_segmap_parloop_228935_task.args =
        &futhark_mc_segmap_parloop_struct_228934;
    futhark_mc_segmap_parloop_228935_task.iterations = iterations;
    futhark_mc_segmap_parloop_228935_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228935_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228935_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228935_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228935_task);
    
    if (futhark_mc_segmap_parloop_228935_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228935_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228935_total_end -
                 futhark_mc_segmap_parloop_228935_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228935_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228935_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228935_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228933_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228933_end -
                 futhark_mc_segmap_task_228933_start;
        
        ctx->futhark_mc_segmap_task_228933_runs[tid]++;
        ctx->futhark_mc_segmap_task_228933_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228933_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228937 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212325;
};
struct futhark_mc_task_228939 {
    struct futhark_context *ctx;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_gtid_205055;
    unsigned char *free_mem_212322;
    float *retval_defunc_2_reduce_res_205057;
};
struct futhark_mc_segred_stage_1_parloop_struct_228942 {
    struct futhark_context *ctx;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_gtid_205055;
    unsigned char *free_mem_212322;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222097;
};
static int futhark_mc_segred_stage_1_parloop_228943(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_222088,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228942
    *futhark_mc_segred_stage_1_parloop_struct_228942 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228942 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228942->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228943_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228943_start = get_wall_time();
    
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segred_stage_1_parloop_struct_228942->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t gtid_205055 =
            futhark_mc_segred_stage_1_parloop_struct_228942->free_gtid_205055;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228942->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_222097 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222097",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228942->free_reduce_stage_1_tid_res_arr_mem_222097,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222099 = start;
    float x_222090;
    float x_222091;
    float local_acc_222100 = 0.0F;
    
    for (; iter_222099 < end; iter_222099++) {
        int64_t gtid_222089 = iter_222099;
        float x_222093;
        
        x_222093 = ((float *) mem_212322.mem)[gtid_205055 *
                                              dyn_lifted_single_ma_l_arg_197257 +
                                              gtid_222089];
        // save map-out results
        { }
        // Load accum params
        {
            x_222090 = local_acc_222100;
        }
        // Load next params
        {
            x_222091 = x_222093;
        }
        // Red body
        {
            float defunc_1_op_res_222092 = x_222090 + x_222091;
            
            local_acc_222100 = defunc_1_op_res_222092;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_222097.mem)[flat_tid_222088] =
        local_acc_222100;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228943_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228943_end -
                 futhark_mc_segred_stage_1_parloop_228943_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228943_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228943_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228943_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228940(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222088 = tid;
    int num_tasks_222096 = info.nsubtasks;
    struct futhark_mc_task_228939 *futhark_mc_task_228939 =
                                  (struct futhark_mc_task_228939 *) args;
    struct futhark_context *ctx = futhark_mc_task_228939->ctx;
    uint64_t futhark_mc_segred_task_228940_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228940_start = get_wall_time();
    
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228939->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t gtid_205055 = futhark_mc_task_228939->free_gtid_205055;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228939->free_mem_212322,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_205057 =
          *futhark_mc_task_228939->retval_defunc_2_reduce_res_205057;
    size_t reduce_stage_1_tid_res_arr_mem_222097_cached_sizze_228941 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222097 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_222097_cached_sizze_228941 <
        (size_t) ((int64_t) 4 * num_tasks_222096)) {
        reduce_stage_1_tid_res_arr_mem_222097 =
            realloc(reduce_stage_1_tid_res_arr_mem_222097, (int64_t) 4 *
                    num_tasks_222096);
        reduce_stage_1_tid_res_arr_mem_222097_cached_sizze_228941 =
            (int64_t) 4 * num_tasks_222096;
    }
    
    int64_t iter_222099;
    struct futhark_mc_segred_stage_1_parloop_struct_228942
    futhark_mc_segred_stage_1_parloop_struct_228942;
    
    futhark_mc_segred_stage_1_parloop_struct_228942.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228942.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segred_stage_1_parloop_struct_228942.free_gtid_205055 =
        gtid_205055;
    futhark_mc_segred_stage_1_parloop_struct_228942.free_mem_212322 =
        mem_212322.mem;
    futhark_mc_segred_stage_1_parloop_struct_228942.free_reduce_stage_1_tid_res_arr_mem_222097 =
        reduce_stage_1_tid_res_arr_mem_222097;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228943_task;
    
    futhark_mc_segred_stage_1_parloop_228943_task.name =
        "futhark_mc_segred_stage_1_parloop_228943";
    futhark_mc_segred_stage_1_parloop_228943_task.fn =
        futhark_mc_segred_stage_1_parloop_228943;
    futhark_mc_segred_stage_1_parloop_228943_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228942;
    futhark_mc_segred_stage_1_parloop_228943_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228943_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228943_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228943_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228943_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228943_task);
    
    if (futhark_mc_segred_stage_1_parloop_228943_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228943_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228943_total_end -
                 futhark_mc_segred_stage_1_parloop_228943_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228943_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228943_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228943_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_205057 = 0.0F;
    }
    
    float x_222101;
    float x_222102;
    
    for (int32_t i_222104 = 0; i_222104 < num_tasks_222096; i_222104++) {
        flat_tid_222088 = i_222104;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_222101 = defunc_2_reduce_res_205057;
            }
            // load next params
            {
                x_222102 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222097)[flat_tid_222088];
            }
            // red body
            {
                float defunc_1_op_res_222103 = x_222101 + x_222102;
                
                defunc_2_reduce_res_205057 = defunc_1_op_res_222103;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_222097);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228940_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228940_end -
                 futhark_mc_segred_task_228940_start;
        
        ctx->futhark_mc_segred_task_228940_runs[tid]++;
        ctx->futhark_mc_segred_task_228940_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228940_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228939->retval_defunc_2_reduce_res_205057 =
            defunc_2_reduce_res_205057;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228938(void *args, int64_t start,
                                            int64_t end, int flat_tid_205054,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228937
    *futhark_mc_segmap_parloop_struct_228937 =
    (struct futhark_mc_segmap_parloop_struct_228937 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228937->ctx;
    uint64_t futhark_mc_segmap_parloop_228938_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228938_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228937->free_m_196691;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segmap_parloop_struct_228937->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segmap_parloop_struct_228937->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_segmap_parloop_struct_228937->free_mem_212325,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222087 = start;
    
    for (; iter_222087 < end; iter_222087++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222094 = m_196691;
        int64_t gtid_205055 = iter_222087;
        int64_t remnant_222095 = iter_222087 - gtid_205055;
        float defunc_2_reduce_res_205057;
        int64_t flat_tid_222088 = (int64_t) 0;
        int32_t num_tasks_222096;
        
        defunc_2_reduce_res_205057 = 0.0F;
        
        struct futhark_mc_task_228939 futhark_mc_task_228939;
        
        futhark_mc_task_228939.ctx = ctx;
        futhark_mc_task_228939.free_dyn_lifted_single_ma_l_arg_197257 =
            dyn_lifted_single_ma_l_arg_197257;
        futhark_mc_task_228939.free_gtid_205055 = gtid_205055;
        futhark_mc_task_228939.free_mem_212322 = mem_212322.mem;
        futhark_mc_task_228939.retval_defunc_2_reduce_res_205057 =
            &defunc_2_reduce_res_205057;
        
        struct scheduler_segop futhark_mc_task_228939_task;
        
        futhark_mc_task_228939_task.args = &futhark_mc_task_228939;
        futhark_mc_task_228939_task.top_level_fn =
            futhark_mc_segred_task_228940;
        futhark_mc_task_228939_task.name = "futhark_mc_segred_task_228940";
        futhark_mc_task_228939_task.iterations = (int64_t) 3;
        futhark_mc_task_228939_task.task_time =
            &ctx->futhark_mc_segred_task_228940_total_time;
        futhark_mc_task_228939_task.task_iter =
            &ctx->futhark_mc_segred_task_228940_total_iter;
        futhark_mc_task_228939_task.sched = STATIC;
        futhark_mc_task_228939_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228940_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228939_task);
        
        if (futhark_mc_segred_task_228940_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212325.mem)[gtid_205055] = defunc_2_reduce_res_205057;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228938_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228938_end -
                 futhark_mc_segmap_parloop_228938_start;
        
        ctx->futhark_mc_segmap_parloop_228938_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228938_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228938_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228936(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205054 = tid;
    int num_tasks_222077 = info.nsubtasks;
    struct futhark_mc_task_228932 *futhark_mc_task_228932 =
                                  (struct futhark_mc_task_228932 *) args;
    struct futhark_context *ctx = futhark_mc_task_228932->ctx;
    uint64_t futhark_mc_segmap_nested_task_228936_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228936_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228932->free_m_196691;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228932->free_dyn_lifted_single_ma_l_arg_197257;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228932->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_task_228932->free_mem_212325,
                                  .size =0, .references =NULL};
    int64_t iter_222087;
    struct futhark_mc_segmap_parloop_struct_228937
    futhark_mc_segmap_parloop_struct_228937;
    
    futhark_mc_segmap_parloop_struct_228937.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228937.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228937.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segmap_parloop_struct_228937.free_mem_212322 = mem_212322.mem;
    futhark_mc_segmap_parloop_struct_228937.free_mem_212325 = mem_212325.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228938_task;
    
    futhark_mc_segmap_parloop_228938_task.name =
        "futhark_mc_segmap_parloop_228938";
    futhark_mc_segmap_parloop_228938_task.fn = futhark_mc_segmap_parloop_228938;
    futhark_mc_segmap_parloop_228938_task.args =
        &futhark_mc_segmap_parloop_struct_228937;
    futhark_mc_segmap_parloop_228938_task.iterations = iterations;
    futhark_mc_segmap_parloop_228938_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228938_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228938_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228938_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228938_task);
    
    if (futhark_mc_segmap_parloop_228938_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228938_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228938_total_end -
                 futhark_mc_segmap_parloop_228938_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228938_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228938_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228938_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228936_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228936_end -
                 futhark_mc_segmap_nested_task_228936_start;
        
        ctx->futhark_mc_segmap_nested_task_228936_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228936_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228936_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228944 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212325;
    unsigned char *free_mem_212347;
};
struct futhark_mc_segmap_parloop_struct_228946 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212325;
    unsigned char *free_mem_212347;
};
static int futhark_mc_segmap_parloop_228947(void *args, int64_t start,
                                            int64_t end, int flat_tid_205064,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228946
    *futhark_mc_segmap_parloop_struct_228946 =
    (struct futhark_mc_segmap_parloop_struct_228946 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228946->ctx;
    uint64_t futhark_mc_segmap_parloop_228947_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228947_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228946->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228946->free_n_196692;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segmap_parloop_struct_228946->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_228946->free_bytes_210949;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segmap_parloop_struct_228946->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_segmap_parloop_struct_228946->free_mem_212325,
                                  .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228946->free_mem_212347,
                                  .size =0, .references =NULL};
    size_t mem_212331_cached_sizze_228948 = 0;
    unsigned char *mem_212331 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222106 = start;
    
    if (mem_212331_cached_sizze_228948 < (size_t) bytes_210949) {
        mem_212331 = realloc(mem_212331, bytes_210949);
        mem_212331_cached_sizze_228948 = bytes_210949;
    }
    for (; iter_222106 < end; iter_222106++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222130 = m_196691;
        int64_t gtid_205065 = iter_222106;
        int64_t remnant_222131 = iter_222106 - gtid_205065;
        float x_198276;
        
        x_198276 = ((float *) mem_212325.mem)[gtid_205065];
        
        float discard_209556;
        float scanacc_222108 = 0.0F;
        
        for (int64_t i_222107 = 0; i_222107 < n_196692; i_222107++) {
            bool cond_222110 = i_222107 == (int64_t) 0;
            float defunc_0_f_res_222111;
            
            if (cond_222110) {
                float defunc_0_f_res_t_res_222112 = x_198276 / 3.0F;
                
                defunc_0_f_res_222111 = defunc_0_f_res_t_res_222112;
            } else {
                int64_t x_222113 = add64((int64_t) 3, i_222107);
                int64_t i_222114 = sub64(x_222113, (int64_t) 1);
                bool x_222115 = sle64((int64_t) 0, i_222114);
                bool y_222116 = slt64(i_222114,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222117 = x_222115 && y_222116;
                bool index_certs_222118;
                
                if (!bounds_check_222117) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222114,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222119;
                
                x_222119 = ((float *) mem_212322.mem)[gtid_205065 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222114];
                
                int64_t i_222120 = sub64(i_222107, (int64_t) 1);
                bool x_222121 = sle64((int64_t) 0, i_222120);
                bool y_222122 = slt64(i_222120,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222123 = x_222121 && y_222122;
                bool index_certs_222124;
                
                if (!bounds_check_222123) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222120,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222125;
                
                y_222125 = ((float *) mem_212322.mem)[gtid_205065 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222120];
                
                float x_222126 = x_222119 - y_222125;
                float defunc_0_f_res_f_res_222127 = x_222126 / 3.0F;
                
                defunc_0_f_res_222111 = defunc_0_f_res_f_res_222127;
            }
            
            float defunc_1_op_res_222128 = defunc_0_f_res_222111 +
                  scanacc_222108;
            
            ((float *) mem_212331)[i_222107] = defunc_1_op_res_222128;
            
            float scanacc_tmp_222132 = defunc_1_op_res_222128;
            
            scanacc_222108 = scanacc_tmp_222132;
        }
        discard_209556 = scanacc_222108;
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_212347.mem + gtid_205065 * n_196692 * (int64_t) 4,
                    mem_212331 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212331);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228947_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228947_end -
                 futhark_mc_segmap_parloop_228947_start;
        
        ctx->futhark_mc_segmap_parloop_228947_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228947_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228947_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228945(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205064 = tid;
    int num_tasks_222105 = info.nsubtasks;
    struct futhark_mc_task_228944 *futhark_mc_task_228944 =
                                  (struct futhark_mc_task_228944 *) args;
    struct futhark_context *ctx = futhark_mc_task_228944->ctx;
    uint64_t futhark_mc_segmap_task_228945_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228945_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228944->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228944->free_n_196692;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228944->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t bytes_210949 = futhark_mc_task_228944->free_bytes_210949;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228944->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_task_228944->free_mem_212325,
                                  .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228944->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t iter_222106;
    struct futhark_mc_segmap_parloop_struct_228946
    futhark_mc_segmap_parloop_struct_228946;
    
    futhark_mc_segmap_parloop_struct_228946.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228946.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228946.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228946.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segmap_parloop_struct_228946.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_228946.free_mem_212322 = mem_212322.mem;
    futhark_mc_segmap_parloop_struct_228946.free_mem_212325 = mem_212325.mem;
    futhark_mc_segmap_parloop_struct_228946.free_mem_212347 = mem_212347.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228947_task;
    
    futhark_mc_segmap_parloop_228947_task.name =
        "futhark_mc_segmap_parloop_228947";
    futhark_mc_segmap_parloop_228947_task.fn = futhark_mc_segmap_parloop_228947;
    futhark_mc_segmap_parloop_228947_task.args =
        &futhark_mc_segmap_parloop_struct_228946;
    futhark_mc_segmap_parloop_228947_task.iterations = iterations;
    futhark_mc_segmap_parloop_228947_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228947_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228947_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228947_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228947_task);
    
    if (futhark_mc_segmap_parloop_228947_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228947_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228947_total_end -
                 futhark_mc_segmap_parloop_228947_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228947_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228947_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228947_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228945_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228945_end -
                 futhark_mc_segmap_task_228945_start;
        
        ctx->futhark_mc_segmap_task_228945_runs[tid]++;
        ctx->futhark_mc_segmap_task_228945_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228945_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228950 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212325;
    unsigned char *free_mem_212347;
};
struct futhark_mc_task_228953 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_gtid_205071;
    float free_x_205073;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212328;
};
struct futhark_mc_scan_stage_1_parloop_struct_228956 {
    struct futhark_context *ctx;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_gtid_205071;
    float free_x_205073;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212328;
};
static int futhark_mc_scan_stage_1_parloop_228957(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_222135, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_1_parloop_struct_228956
    *futhark_mc_scan_stage_1_parloop_struct_228956 =
    (struct futhark_mc_scan_stage_1_parloop_struct_228956 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_1_parloop_struct_228956->ctx;
    uint64_t futhark_mc_scan_stage_1_parloop_228957_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228957_start = get_wall_time();
    
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_scan_stage_1_parloop_struct_228956->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t gtid_205071 =
            futhark_mc_scan_stage_1_parloop_struct_228956->free_gtid_205071;
    float x_205073 =
          futhark_mc_scan_stage_1_parloop_struct_228956->free_x_205073;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228956->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212328 = {.desc ="mem_212328", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_228956->free_mem_212328,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222161 = start;
    float x_222137;
    float x_222138;
    
    x_222137 = 0.0F;
    for (; iter_222161 < end; iter_222161++) {
        int64_t gtid_222136 = iter_222161;
        
        // stage 1 scan body
        {
            bool cond_222140 = gtid_222136 == (int64_t) 0;
            float defunc_0_f_res_222141;
            
            if (cond_222140) {
                float defunc_0_f_res_t_res_222142 = x_205073 / 3.0F;
                
                defunc_0_f_res_222141 = defunc_0_f_res_t_res_222142;
            } else {
                int64_t x_222143 = add64((int64_t) 3, gtid_222136);
                int64_t i_222144 = sub64(x_222143, (int64_t) 1);
                bool x_222145 = sle64((int64_t) 0, i_222144);
                bool y_222146 = slt64(i_222144,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222147 = x_222145 && y_222146;
                bool index_certs_222148;
                
                if (!bounds_check_222147) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222144,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222149;
                
                x_222149 = ((float *) mem_212322.mem)[gtid_205071 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222144];
                
                int64_t i_222150 = sub64(gtid_222136, (int64_t) 1);
                bool x_222151 = sle64((int64_t) 0, i_222150);
                bool y_222152 = slt64(i_222150,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222153 = x_222151 && y_222152;
                bool index_certs_222154;
                
                if (!bounds_check_222153) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222150,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222155;
                
                y_222155 = ((float *) mem_212322.mem)[gtid_205071 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222150];
                
                float x_222156 = x_222149 - y_222155;
                float defunc_0_f_res_f_res_222157 = x_222156 / 3.0F;
                
                defunc_0_f_res_222141 = defunc_0_f_res_f_res_222157;
            }
            // write mapped values results to memory
            { }
            x_222137 = x_222137;
            // Read next values
            {
                x_222138 = defunc_0_f_res_222141;
            }
            
            float defunc_1_op_res_222139 = x_222137 + x_222138;
            
            ((float *) mem_212328.mem)[gtid_222136] = defunc_1_op_res_222139;
            x_222137 = defunc_1_op_res_222139;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228957_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228957_end -
                 futhark_mc_scan_stage_1_parloop_228957_start;
        
        ctx->futhark_mc_scan_stage_1_parloop_228957_runs[tid]++;
        ctx->futhark_mc_scan_stage_1_parloop_228957_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_1_parloop_228957_iter[tid] += iterations;
    }
    return err;
}
struct futhark_mc_scan_stage_3_parloop_struct_228958 {
    struct futhark_context *ctx;
    int64_t free_dyn_lifted_single_ma_l_arg_197257;
    int64_t free_gtid_205071;
    float free_x_205073;
    unsigned char *free_mem_212322;
    unsigned char *free_mem_212328;
};
static int futhark_mc_scan_stage_3_parloop_228959(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_222135, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_3_parloop_struct_228958
    *futhark_mc_scan_stage_3_parloop_struct_228958 =
    (struct futhark_mc_scan_stage_3_parloop_struct_228958 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_3_parloop_struct_228958->ctx;
    uint64_t futhark_mc_scan_stage_3_parloop_228959_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_3_parloop_228959_start = get_wall_time();
    
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_scan_stage_3_parloop_struct_228958->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t gtid_205071 =
            futhark_mc_scan_stage_3_parloop_struct_228958->free_gtid_205071;
    float x_205073 =
          futhark_mc_scan_stage_3_parloop_struct_228958->free_x_205073;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228958->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212328 = {.desc ="mem_212328", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_228958->free_mem_212328,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222173 = start;
    float x_222170;
    float x_222171;
    
    if (iter_222173 == (int64_t) 0) {
        x_222170 = 0.0F;
    } else {
        x_222170 = ((float *) mem_212328.mem)[iter_222173 - (int64_t) 1];
    }
    for (; iter_222173 < end; iter_222173++) {
        int64_t gtid_222136 = iter_222173;
        
        // stage 3 scan body
        {
            bool cond_222140 = gtid_222136 == (int64_t) 0;
            float defunc_0_f_res_222141;
            
            if (cond_222140) {
                float defunc_0_f_res_t_res_222142 = x_205073 / 3.0F;
                
                defunc_0_f_res_222141 = defunc_0_f_res_t_res_222142;
            } else {
                int64_t x_222143 = add64((int64_t) 3, gtid_222136);
                int64_t i_222144 = sub64(x_222143, (int64_t) 1);
                bool x_222145 = sle64((int64_t) 0, i_222144);
                bool y_222146 = slt64(i_222144,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222147 = x_222145 && y_222146;
                bool index_certs_222148;
                
                if (!bounds_check_222147) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222144,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222149;
                
                x_222149 = ((float *) mem_212322.mem)[gtid_205071 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222144];
                
                int64_t i_222150 = sub64(gtid_222136, (int64_t) 1);
                bool x_222151 = sle64((int64_t) 0, i_222150);
                bool y_222152 = slt64(i_222150,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222153 = x_222151 && y_222152;
                bool index_certs_222154;
                
                if (!bounds_check_222153) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222150,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222155;
                
                y_222155 = ((float *) mem_212322.mem)[gtid_205071 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222150];
                
                float x_222156 = x_222149 - y_222155;
                float defunc_0_f_res_f_res_222157 = x_222156 / 3.0F;
                
                defunc_0_f_res_222141 = defunc_0_f_res_f_res_222157;
            }
            x_222170 = x_222170;
            x_222171 = defunc_0_f_res_222141;
            
            float defunc_1_op_res_222172 = x_222170 + x_222171;
            
            ((float *) mem_212328.mem)[gtid_222136] = defunc_1_op_res_222172;
            x_222170 = defunc_1_op_res_222172;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_3_parloop_228959_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_3_parloop_228959_end -
                 futhark_mc_scan_stage_3_parloop_228959_start;
        
        ctx->futhark_mc_scan_stage_3_parloop_228959_runs[tid]++;
        ctx->futhark_mc_scan_stage_3_parloop_228959_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_3_parloop_228959_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segscan_task_228954(void *args, int64_t iterations, int tid,
                                   struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222135 = tid;
    int num_tasks_222160 = info.nsubtasks;
    struct futhark_mc_task_228953 *futhark_mc_task_228953 =
                                  (struct futhark_mc_task_228953 *) args;
    struct futhark_context *ctx = futhark_mc_task_228953->ctx;
    uint64_t futhark_mc_segscan_task_228954_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segscan_task_228954_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228953->free_n_196692;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228953->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t gtid_205071 = futhark_mc_task_228953->free_gtid_205071;
    float x_205073 = futhark_mc_task_228953->free_x_205073;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228953->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212328 = {.desc ="mem_212328", .mem =
                                  futhark_mc_task_228953->free_mem_212328,
                                  .size =0, .references =NULL};
    size_t scan_stage_2_accum_mem_222167_cached_sizze_228955 = 0;
    unsigned char *scan_stage_2_accum_mem_222167 = NULL;
    int64_t iter_222161;
    struct futhark_mc_scan_stage_1_parloop_struct_228956
    futhark_mc_scan_stage_1_parloop_struct_228956;
    
    futhark_mc_scan_stage_1_parloop_struct_228956.ctx = ctx;
    futhark_mc_scan_stage_1_parloop_struct_228956.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_scan_stage_1_parloop_struct_228956.free_gtid_205071 =
        gtid_205071;
    futhark_mc_scan_stage_1_parloop_struct_228956.free_x_205073 = x_205073;
    futhark_mc_scan_stage_1_parloop_struct_228956.free_mem_212322 =
        mem_212322.mem;
    futhark_mc_scan_stage_1_parloop_struct_228956.free_mem_212328 =
        mem_212328.mem;
    
    struct scheduler_parloop futhark_mc_scan_stage_1_parloop_228957_task;
    
    futhark_mc_scan_stage_1_parloop_228957_task.name =
        "futhark_mc_scan_stage_1_parloop_228957";
    futhark_mc_scan_stage_1_parloop_228957_task.fn =
        futhark_mc_scan_stage_1_parloop_228957;
    futhark_mc_scan_stage_1_parloop_228957_task.args =
        &futhark_mc_scan_stage_1_parloop_struct_228956;
    futhark_mc_scan_stage_1_parloop_228957_task.iterations = iterations;
    futhark_mc_scan_stage_1_parloop_228957_task.info = info;
    
    uint64_t futhark_mc_scan_stage_1_parloop_228957_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_228957_total_start = get_wall_time();
    
    int futhark_mc_scan_stage_1_parloop_228957_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_scan_stage_1_parloop_228957_task);
    
    if (futhark_mc_scan_stage_1_parloop_228957_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_228957_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_228957_total_end -
                 futhark_mc_scan_stage_1_parloop_228957_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228957_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228957_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_228957_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    if (slt32(1, num_tasks_222160)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmentedScan stage 2");
        
        float x_222162;
        float x_222163;
        int64_t offset_222165 = (int64_t) 0;
        int64_t offset_index_222166 = (int64_t) 0;
        
        if (scan_stage_2_accum_mem_222167_cached_sizze_228955 <
            (size_t) (int64_t) 4) {
            scan_stage_2_accum_mem_222167 =
                realloc(scan_stage_2_accum_mem_222167, (int64_t) 4);
            scan_stage_2_accum_mem_222167_cached_sizze_228955 = (int64_t) 4;
        }
        ((float *) scan_stage_2_accum_mem_222167)[(int64_t) 0] = 0.0F;
        for (int32_t i_222169 = 0; i_222169 < num_tasks_222160 - 1;
             i_222169++) {
            offset_222165 = squot64(n_196692, sext_i32_i64(num_tasks_222160));
            if (slt64(sext_i32_i64(i_222169), srem64(n_196692,
                                                     sext_i32_i64(num_tasks_222160)))) {
                offset_222165 += (int64_t) 1;
            }
            offset_index_222166 += offset_222165;
            
            int64_t gtid_222136 = offset_index_222166;
            bool cond_222140 = gtid_222136 == (int64_t) 0;
            float defunc_0_f_res_222141;
            
            if (cond_222140) {
                float defunc_0_f_res_t_res_222142 = x_205073 / 3.0F;
                
                defunc_0_f_res_222141 = defunc_0_f_res_t_res_222142;
            } else {
                int64_t x_222143 = add64((int64_t) 3, gtid_222136);
                int64_t i_222144 = sub64(x_222143, (int64_t) 1);
                bool x_222145 = sle64((int64_t) 0, i_222144);
                bool y_222146 = slt64(i_222144,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222147 = x_222145 && y_222146;
                bool index_certs_222148;
                
                if (!bounds_check_222147) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222144,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float x_222149;
                
                x_222149 = ((float *) mem_212322.mem)[gtid_205071 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222144];
                
                int64_t i_222150 = sub64(gtid_222136, (int64_t) 1);
                bool x_222151 = sle64((int64_t) 0, i_222150);
                bool y_222152 = slt64(i_222150,
                                      dyn_lifted_single_ma_l_arg_197257);
                bool bounds_check_222153 = x_222151 && y_222152;
                bool index_certs_222154;
                
                if (!bounds_check_222153) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) i_222150,
                                  "] out of bounds for array of shape [",
                                  (long long) dyn_lifted_single_ma_l_arg_197257,
                                  "].",
                                  "-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float y_222155;
                
                y_222155 = ((float *) mem_212322.mem)[gtid_205071 *
                                                      dyn_lifted_single_ma_l_arg_197257 +
                                                      i_222150];
                
                float x_222156 = x_222149 - y_222155;
                float defunc_0_f_res_f_res_222157 = x_222156 / 3.0F;
                
                defunc_0_f_res_222141 = defunc_0_f_res_f_res_222157;
            }
            // Read carry in
            {
                x_222162 =
                    ((float *) scan_stage_2_accum_mem_222167)[(int64_t) 0];
            }
            // Read next values
            {
                x_222163 = ((float *) mem_212328.mem)[offset_index_222166 -
                                                      (int64_t) 1];
            }
            
            float defunc_1_op_res_222164 = x_222162 + x_222163;
            
            ((float *) mem_212328.mem)[offset_index_222166 - (int64_t) 1] =
                defunc_1_op_res_222164;
            ((float *) scan_stage_2_accum_mem_222167)[(int64_t) 0] =
                defunc_1_op_res_222164;
        }
        
        int64_t iter_222173 = (int64_t) 0;
        struct futhark_mc_scan_stage_3_parloop_struct_228958
        futhark_mc_scan_stage_3_parloop_struct_228958;
        
        futhark_mc_scan_stage_3_parloop_struct_228958.ctx = ctx;
        futhark_mc_scan_stage_3_parloop_struct_228958.free_dyn_lifted_single_ma_l_arg_197257 =
            dyn_lifted_single_ma_l_arg_197257;
        futhark_mc_scan_stage_3_parloop_struct_228958.free_gtid_205071 =
            gtid_205071;
        futhark_mc_scan_stage_3_parloop_struct_228958.free_x_205073 = x_205073;
        futhark_mc_scan_stage_3_parloop_struct_228958.free_mem_212322 =
            mem_212322.mem;
        futhark_mc_scan_stage_3_parloop_struct_228958.free_mem_212328 =
            mem_212328.mem;
        
        struct scheduler_parloop futhark_mc_scan_stage_3_parloop_228959_task;
        
        futhark_mc_scan_stage_3_parloop_228959_task.name =
            "futhark_mc_scan_stage_3_parloop_228959";
        futhark_mc_scan_stage_3_parloop_228959_task.fn =
            futhark_mc_scan_stage_3_parloop_228959;
        futhark_mc_scan_stage_3_parloop_228959_task.args =
            &futhark_mc_scan_stage_3_parloop_struct_228958;
        futhark_mc_scan_stage_3_parloop_228959_task.iterations = iterations;
        futhark_mc_scan_stage_3_parloop_228959_task.info = info;
        
        uint64_t futhark_mc_scan_stage_3_parloop_228959_total_start = 0;
        
        if (ctx->profiling && !ctx->profiling_paused)
            futhark_mc_scan_stage_3_parloop_228959_total_start =
                get_wall_time();
        
        int futhark_mc_scan_stage_3_parloop_228959_err =
            scheduler_execute_task(&ctx->scheduler,
                                   &futhark_mc_scan_stage_3_parloop_228959_task);
        
        if (futhark_mc_scan_stage_3_parloop_228959_err != 0) {
            err = 1;
            goto cleanup;
        }
        if (ctx->profiling && !ctx->profiling_paused) {
            uint64_t futhark_mc_scan_stage_3_parloop_228959_total_end =
                     get_wall_time();
            uint64_t elapsed =
                     futhark_mc_scan_stage_3_parloop_228959_total_end -
                     futhark_mc_scan_stage_3_parloop_228959_total_start;
            
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228959_total_runs,
                               1, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228959_total_total_runtime,
                               elapsed, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_228959_total_iter,
                               iterations, __ATOMIC_RELAXED);
        }
    }
    
  cleanup:
    {
        free(scan_stage_2_accum_mem_222167);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segscan_task_228954_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segscan_task_228954_end -
                 futhark_mc_segscan_task_228954_start;
        
        ctx->futhark_mc_segscan_task_228954_runs[tid]++;
        ctx->futhark_mc_segscan_task_228954_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segscan_task_228954_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228951(void *args, int64_t start,
                                            int64_t end, int flat_tid_205070,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228950
    *futhark_mc_segmap_parloop_struct_228950 =
    (struct futhark_mc_segmap_parloop_struct_228950 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228950->ctx;
    uint64_t futhark_mc_segmap_parloop_228951_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228951_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228950->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228950->free_n_196692;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_segmap_parloop_struct_228950->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_228950->free_bytes_210949;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_segmap_parloop_struct_228950->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_segmap_parloop_struct_228950->free_mem_212325,
                                  .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228950->free_mem_212347,
                                  .size =0, .references =NULL};
    size_t mem_212328_cached_sizze_228952 = 0;
    unsigned char *mem_212328 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222134 = start;
    
    if (mem_212328_cached_sizze_228952 < (size_t) bytes_210949) {
        mem_212328 = realloc(mem_212328, bytes_210949);
        mem_212328_cached_sizze_228952 = bytes_210949;
    }
    for (; iter_222134 < end; iter_222134++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222158 = m_196691;
        int64_t gtid_205071 = iter_222134;
        int64_t remnant_222159 = iter_222134 - gtid_205071;
        float x_205073;
        
        x_205073 = ((float *) mem_212325.mem)[gtid_205071];
        
        int64_t flat_tid_222135 = (int64_t) 0;
        int32_t num_tasks_222160;
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmented segScan");
        
        struct futhark_mc_task_228953 futhark_mc_task_228953;
        
        futhark_mc_task_228953.ctx = ctx;
        futhark_mc_task_228953.free_n_196692 = n_196692;
        futhark_mc_task_228953.free_dyn_lifted_single_ma_l_arg_197257 =
            dyn_lifted_single_ma_l_arg_197257;
        futhark_mc_task_228953.free_gtid_205071 = gtid_205071;
        futhark_mc_task_228953.free_x_205073 = x_205073;
        futhark_mc_task_228953.free_mem_212322 = mem_212322.mem;
        futhark_mc_task_228953.free_mem_212328 = mem_212328;
        
        struct scheduler_segop futhark_mc_task_228953_task;
        
        futhark_mc_task_228953_task.args = &futhark_mc_task_228953;
        futhark_mc_task_228953_task.top_level_fn =
            futhark_mc_segscan_task_228954;
        futhark_mc_task_228953_task.name = "futhark_mc_segscan_task_228954";
        futhark_mc_task_228953_task.iterations = n_196692;
        futhark_mc_task_228953_task.task_time =
            &ctx->futhark_mc_segscan_task_228954_total_time;
        futhark_mc_task_228953_task.task_iter =
            &ctx->futhark_mc_segscan_task_228954_total_iter;
        futhark_mc_task_228953_task.sched = STATIC;
        futhark_mc_task_228953_task.nested_fn = NULL;
        
        int futhark_mc_segscan_task_228954_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228953_task);
        
        if (futhark_mc_segscan_task_228954_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_212347.mem + gtid_205071 * n_196692 * (int64_t) 4,
                    mem_212328 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212328);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228951_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228951_end -
                 futhark_mc_segmap_parloop_228951_start;
        
        ctx->futhark_mc_segmap_parloop_228951_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228951_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228951_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228949(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205070 = tid;
    int num_tasks_222105 = info.nsubtasks;
    struct futhark_mc_task_228944 *futhark_mc_task_228944 =
                                  (struct futhark_mc_task_228944 *) args;
    struct futhark_context *ctx = futhark_mc_task_228944->ctx;
    uint64_t futhark_mc_segmap_nested_task_228949_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228949_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228944->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228944->free_n_196692;
    int64_t dyn_lifted_single_ma_l_arg_197257 =
            futhark_mc_task_228944->free_dyn_lifted_single_ma_l_arg_197257;
    int64_t bytes_210949 = futhark_mc_task_228944->free_bytes_210949;
    struct memblock mem_212322 = {.desc ="mem_212322", .mem =
                                  futhark_mc_task_228944->free_mem_212322,
                                  .size =0, .references =NULL};
    struct memblock mem_212325 = {.desc ="mem_212325", .mem =
                                  futhark_mc_task_228944->free_mem_212325,
                                  .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228944->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t iter_222134;
    struct futhark_mc_segmap_parloop_struct_228950
    futhark_mc_segmap_parloop_struct_228950;
    
    futhark_mc_segmap_parloop_struct_228950.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228950.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228950.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228950.free_dyn_lifted_single_ma_l_arg_197257 =
        dyn_lifted_single_ma_l_arg_197257;
    futhark_mc_segmap_parloop_struct_228950.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_228950.free_mem_212322 = mem_212322.mem;
    futhark_mc_segmap_parloop_struct_228950.free_mem_212325 = mem_212325.mem;
    futhark_mc_segmap_parloop_struct_228950.free_mem_212347 = mem_212347.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228951_task;
    
    futhark_mc_segmap_parloop_228951_task.name =
        "futhark_mc_segmap_parloop_228951";
    futhark_mc_segmap_parloop_228951_task.fn = futhark_mc_segmap_parloop_228951;
    futhark_mc_segmap_parloop_228951_task.args =
        &futhark_mc_segmap_parloop_struct_228950;
    futhark_mc_segmap_parloop_228951_task.iterations = iterations;
    futhark_mc_segmap_parloop_228951_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228951_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228951_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228951_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228951_task);
    
    if (futhark_mc_segmap_parloop_228951_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228951_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228951_total_end -
                 futhark_mc_segmap_parloop_228951_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228951_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228951_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228951_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228949_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228949_end -
                 futhark_mc_segmap_nested_task_228949_start;
        
        ctx->futhark_mc_segmap_nested_task_228949_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228949_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228949_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228960 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212373;
};
struct futhark_mc_segmap_parloop_struct_228962 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212373;
};
static int futhark_mc_segmap_parloop_228963(void *args, int64_t start,
                                            int64_t end, int flat_tid_205099,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228962
    *futhark_mc_segmap_parloop_struct_228962 =
    (struct futhark_mc_segmap_parloop_struct_228962 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228962->ctx;
    uint64_t futhark_mc_segmap_parloop_228963_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228963_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228962->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228962->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228962->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228962->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228962->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228962->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_228962->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228962->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228962->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228962->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228962->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228962->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228962->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228962->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212373 = {.desc ="mem_212373", .mem =
                                  futhark_mc_segmap_parloop_struct_228962->free_mem_212373,
                                  .size =0, .references =NULL};
    size_t mem_212357_cached_sizze_228964 = 0;
    unsigned char *mem_212357 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222177 = start;
    
    if (mem_212357_cached_sizze_228964 < (size_t) bytes_210774) {
        mem_212357 = realloc(mem_212357, bytes_210774);
        mem_212357_cached_sizze_228964 = bytes_210774;
    }
    for (; iter_222177 < end; iter_222177++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222234 = m_196691;
        int64_t gtid_205100 = iter_222177;
        int64_t remnant_222235 = iter_222177 - gtid_205100;
        
        for (int64_t i_222178 = 0; i_222178 < l_n_m_196752; i_222178++) {
            int64_t x_222180;
            
            x_222180 = ((int64_t *) mem_210827.mem)[gtid_205100 * l_n_m_196752 +
                                                    i_222178];
            
            float x_222181;
            
            x_222181 = ((float *) mem_210831.mem)[gtid_205100 * l_n_m_196752 +
                                                  i_222178];
            
            int64_t min_arg_222182 = mul64(jump_t_196702, i_222178);
            int64_t min_res_222183 = smin64(i_196779, min_arg_222182);
            int64_t defunc_0_g_res_222184 = add64((int64_t) 1, min_res_222183);
            float defunc_2_reduce_res_222185;
            float redout_222187 = 0.0F;
            
            for (int64_t i_222186 = 0; i_222186 < q_l_196697; i_222186++) {
                bool cond_222188 = sle64(n_196692, i_222186);
                int64_t defunc_0_f_res_222189;
                
                if (cond_222188) {
                    defunc_0_f_res_222189 = (int64_t) 0;
                } else {
                    int64_t i_222190 = add64(x_222180, i_222186);
                    int64_t defunc_1_add_res_222191 = add64((int64_t) 1,
                                                            i_222190);
                    
                    defunc_0_f_res_222189 = defunc_1_add_res_222191;
                }
                
                float defunc_0_f_res_222192;
                
                if (cond_222188) {
                    defunc_0_f_res_222192 = 0.0F;
                } else {
                    int64_t i_222193 = add64(x_222180, i_222186);
                    float defunc_0_add_arg_222194;
                    
                    defunc_0_add_arg_222194 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205100 *
                                                          ctx_param_ext_210921 +
                                                          i_222193 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_222192 = defunc_0_add_arg_222194;
                }
                
                int64_t binop_p_222195 = sub64(defunc_0_f_res_222189,
                                               defunc_0_g_res_222184);
                float defunc_0_f_res_222196 = sitofp_i64_f32(binop_p_222195);
                float abs_res_222197 = (float) fabs(defunc_0_f_res_222196);
                float tmp1_222198 = abs_res_222197 / x_222181;
                float x_222199 = tmp1_222198 * tmp1_222198;
                float y_222200 = tmp1_222198 * x_222199;
                float tmp2_222201 = 1.0F - y_222200;
                float x_222202 = tmp2_222201 * tmp2_222201;
                float tmp3_222203 = tmp2_222201 * x_222202;
                float w_j_222204 = defunc_0_f_res_222192 * tmp3_222203;
                float defunc_1_op_res_222205 = w_j_222204 + redout_222187;
                float redout_tmp_222237 = defunc_1_op_res_222205;
                
                redout_222187 = redout_tmp_222237;
            }
            defunc_2_reduce_res_222185 = redout_222187;
            
            float a0_222206 = 1.0F / defunc_2_reduce_res_222185;
            float defunc_2_reduce_res_222207;
            float redout_222209 = 0.0F;
            
            for (int64_t i_222208 = 0; i_222208 < q_l_196697; i_222208++) {
                bool cond_222210 = sle64(n_196692, i_222208);
                int64_t defunc_0_f_res_222211;
                
                if (cond_222210) {
                    defunc_0_f_res_222211 = (int64_t) 0;
                } else {
                    int64_t i_222212 = add64(x_222180, i_222208);
                    int64_t defunc_1_add_res_222213 = add64((int64_t) 1,
                                                            i_222212);
                    
                    defunc_0_f_res_222211 = defunc_1_add_res_222213;
                }
                
                float defunc_0_f_res_222214;
                
                if (cond_222210) {
                    defunc_0_f_res_222214 = 0.0F;
                } else {
                    int64_t i_222215 = add64(x_222180, i_222208);
                    float defunc_0_add_arg_222216;
                    
                    defunc_0_add_arg_222216 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205100 *
                                                          ctx_param_ext_210921 +
                                                          i_222215 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_222214 = defunc_0_add_arg_222216;
                }
                
                int64_t binop_p_222217 = sub64(defunc_0_f_res_222211,
                                               defunc_0_g_res_222184);
                float defunc_0_f_res_222218 = sitofp_i64_f32(binop_p_222217);
                float abs_res_222219 = (float) fabs(defunc_0_f_res_222218);
                float tmp1_222220 = abs_res_222219 / x_222181;
                float x_222221 = tmp1_222220 * tmp1_222220;
                float y_222222 = tmp1_222220 * x_222221;
                float tmp2_222223 = 1.0F - y_222222;
                float x_222224 = tmp2_222223 * tmp2_222223;
                float tmp3_222225 = tmp2_222223 * x_222224;
                float tmp4_222226 = defunc_0_f_res_222214 * tmp3_222225;
                float defunc_0_f_res_222227;
                
                if (cond_222210) {
                    defunc_0_f_res_222227 = 0.0F;
                } else {
                    int64_t i_222228 = add64(x_222180, i_222208);
                    float defunc_0_add_arg_222229;
                    
                    defunc_0_add_arg_222229 =
                        ((float *) mem_212347.mem)[gtid_205100 * n_196692 +
                                                   i_222228];
                    defunc_0_f_res_222227 = defunc_0_add_arg_222229;
                }
                
                float x_222230 = a0_222206 * tmp4_222226;
                float defunc_9_fit_fun_res_222231 = defunc_0_f_res_222227 *
                      x_222230;
                float defunc_1_op_res_222232 = defunc_9_fit_fun_res_222231 +
                      redout_222209;
                float redout_tmp_222238 = defunc_1_op_res_222232;
                
                redout_222209 = redout_tmp_222238;
            }
            defunc_2_reduce_res_222207 = redout_222209;
            ((float *) mem_212357)[i_222178] = defunc_2_reduce_res_222207;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212373.mem + gtid_205100 * l_n_m_196752 * (int64_t) 4,
                    mem_212357 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212357);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228963_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228963_end -
                 futhark_mc_segmap_parloop_228963_start;
        
        ctx->futhark_mc_segmap_parloop_228963_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228963_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228963_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228961(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205099 = tid;
    int num_tasks_222176 = info.nsubtasks;
    struct futhark_mc_task_228960 *futhark_mc_task_228960 =
                                  (struct futhark_mc_task_228960 *) args;
    struct futhark_context *ctx = futhark_mc_task_228960->ctx;
    uint64_t futhark_mc_segmap_task_228961_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228961_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228960->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228960->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228960->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228960->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228960->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228960->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_228960->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228960->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228960->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228960->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228960->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228960->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228960->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228960->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212373 = {.desc ="mem_212373", .mem =
                                  futhark_mc_task_228960->free_mem_212373,
                                  .size =0, .references =NULL};
    int64_t iter_222177;
    struct futhark_mc_segmap_parloop_struct_228962
    futhark_mc_segmap_parloop_struct_228962;
    
    futhark_mc_segmap_parloop_struct_228962.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228962.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228962.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228962.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228962.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228962.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228962.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228962.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_228962.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228962.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228962.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228962.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228962.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228962.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228962.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228962.free_mem_212373 = mem_212373.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228963_task;
    
    futhark_mc_segmap_parloop_228963_task.name =
        "futhark_mc_segmap_parloop_228963";
    futhark_mc_segmap_parloop_228963_task.fn = futhark_mc_segmap_parloop_228963;
    futhark_mc_segmap_parloop_228963_task.args =
        &futhark_mc_segmap_parloop_struct_228962;
    futhark_mc_segmap_parloop_228963_task.iterations = iterations;
    futhark_mc_segmap_parloop_228963_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228963_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228963_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228963_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228963_task);
    
    if (futhark_mc_segmap_parloop_228963_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228963_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228963_total_end -
                 futhark_mc_segmap_parloop_228963_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228963_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228963_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228963_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228961_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228961_end -
                 futhark_mc_segmap_task_228961_start;
        
        ctx->futhark_mc_segmap_task_228961_runs[tid]++;
        ctx->futhark_mc_segmap_task_228961_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228961_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228966 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212373;
};
struct futhark_mc_task_228969 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205174;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212354;
};
struct futhark_mc_segmap_parloop_struct_228971 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205174;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212354;
};
static int futhark_mc_segmap_parloop_228972(void *args, int64_t start,
                                            int64_t end, int flat_tid_222299,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228971
    *futhark_mc_segmap_parloop_struct_228971 =
    (struct futhark_mc_segmap_parloop_struct_228971 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228971->ctx;
    uint64_t futhark_mc_segmap_parloop_228972_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228972_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228971->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228971->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228971->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228971->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228971->free_i_196779;
    int64_t gtid_205174 =
            futhark_mc_segmap_parloop_struct_228971->free_gtid_205174;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228971->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228971->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228971->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228971->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228971->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228971->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228971->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212354 = {.desc ="mem_212354", .mem =
                                  futhark_mc_segmap_parloop_struct_228971->free_mem_212354,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222357 = start;
    
    for (; iter_222357 < end; iter_222357++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222403 = l_n_m_196752;
        int64_t gtid_222300 = iter_222357;
        int64_t remnant_222404 = iter_222357 - gtid_222300;
        int64_t x_222301;
        
        x_222301 = ((int64_t *) mem_210827.mem)[gtid_205174 * l_n_m_196752 +
                                                gtid_222300];
        
        float x_222302;
        
        x_222302 = ((float *) mem_210831.mem)[gtid_205174 * l_n_m_196752 +
                                              gtid_222300];
        
        int64_t min_arg_222303 = mul64(jump_t_196702, gtid_222300);
        int64_t min_res_222304 = smin64(i_196779, min_arg_222303);
        int64_t defunc_0_g_res_222305 = add64((int64_t) 1, min_res_222304);
        float defunc_2_reduce_res_222306;
        float redout_222359 = 0.0F;
        
        for (int64_t i_222358 = 0; i_222358 < q_l_196697; i_222358++) {
            bool cond_222360 = sle64(n_196692, i_222358);
            int64_t defunc_0_f_res_222361;
            
            if (cond_222360) {
                defunc_0_f_res_222361 = (int64_t) 0;
            } else {
                int64_t i_222362 = add64(x_222301, i_222358);
                int64_t defunc_1_add_res_222363 = add64((int64_t) 1, i_222362);
                
                defunc_0_f_res_222361 = defunc_1_add_res_222363;
            }
            
            float defunc_0_f_res_222364;
            
            if (cond_222360) {
                defunc_0_f_res_222364 = 0.0F;
            } else {
                int64_t i_222365 = add64(x_222301, i_222358);
                float defunc_0_add_arg_222366;
                
                defunc_0_add_arg_222366 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_205174 *
                                                      ctx_param_ext_210921 +
                                                      i_222365 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_222364 = defunc_0_add_arg_222366;
            }
            
            int64_t binop_p_222367 = sub64(defunc_0_f_res_222361,
                                           defunc_0_g_res_222305);
            float defunc_0_f_res_222368 = sitofp_i64_f32(binop_p_222367);
            float abs_res_222369 = (float) fabs(defunc_0_f_res_222368);
            float tmp1_222370 = abs_res_222369 / x_222302;
            float x_222371 = tmp1_222370 * tmp1_222370;
            float y_222372 = tmp1_222370 * x_222371;
            float tmp2_222373 = 1.0F - y_222372;
            float x_222374 = tmp2_222373 * tmp2_222373;
            float tmp3_222375 = tmp2_222373 * x_222374;
            float w_j_222376 = defunc_0_f_res_222364 * tmp3_222375;
            float defunc_1_op_res_222377 = w_j_222376 + redout_222359;
            float redout_tmp_222405 = defunc_1_op_res_222377;
            
            redout_222359 = redout_tmp_222405;
        }
        defunc_2_reduce_res_222306 = redout_222359;
        
        float a0_222327 = 1.0F / defunc_2_reduce_res_222306;
        float defunc_2_reduce_res_222328;
        float redout_222379 = 0.0F;
        
        for (int64_t i_222378 = 0; i_222378 < q_l_196697; i_222378++) {
            bool cond_222380 = sle64(n_196692, i_222378);
            int64_t defunc_0_f_res_222381;
            
            if (cond_222380) {
                defunc_0_f_res_222381 = (int64_t) 0;
            } else {
                int64_t i_222382 = add64(x_222301, i_222378);
                int64_t defunc_1_add_res_222383 = add64((int64_t) 1, i_222382);
                
                defunc_0_f_res_222381 = defunc_1_add_res_222383;
            }
            
            float defunc_0_f_res_222384;
            
            if (cond_222380) {
                defunc_0_f_res_222384 = 0.0F;
            } else {
                int64_t i_222385 = add64(x_222301, i_222378);
                float defunc_0_add_arg_222386;
                
                defunc_0_add_arg_222386 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_205174 *
                                                      ctx_param_ext_210921 +
                                                      i_222385 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_222384 = defunc_0_add_arg_222386;
            }
            
            int64_t binop_p_222387 = sub64(defunc_0_f_res_222381,
                                           defunc_0_g_res_222305);
            float defunc_0_f_res_222388 = sitofp_i64_f32(binop_p_222387);
            float abs_res_222389 = (float) fabs(defunc_0_f_res_222388);
            float tmp1_222390 = abs_res_222389 / x_222302;
            float x_222391 = tmp1_222390 * tmp1_222390;
            float y_222392 = tmp1_222390 * x_222391;
            float tmp2_222393 = 1.0F - y_222392;
            float x_222394 = tmp2_222393 * tmp2_222393;
            float tmp3_222395 = tmp2_222393 * x_222394;
            float tmp4_222396 = defunc_0_f_res_222384 * tmp3_222395;
            float defunc_0_f_res_222397;
            
            if (cond_222380) {
                defunc_0_f_res_222397 = 0.0F;
            } else {
                int64_t i_222398 = add64(x_222301, i_222378);
                float defunc_0_add_arg_222399;
                
                defunc_0_add_arg_222399 =
                    ((float *) mem_212347.mem)[gtid_205174 * n_196692 +
                                               i_222398];
                defunc_0_f_res_222397 = defunc_0_add_arg_222399;
            }
            
            float x_222400 = a0_222327 * tmp4_222396;
            float defunc_9_fit_fun_res_222401 = defunc_0_f_res_222397 *
                  x_222400;
            float defunc_1_op_res_222402 = defunc_9_fit_fun_res_222401 +
                  redout_222379;
            float redout_tmp_222406 = defunc_1_op_res_222402;
            
            redout_222379 = redout_tmp_222406;
        }
        defunc_2_reduce_res_222328 = redout_222379;
        ((float *) mem_212354.mem)[gtid_222300] = defunc_2_reduce_res_222328;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228972_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228972_end -
                 futhark_mc_segmap_parloop_228972_start;
        
        ctx->futhark_mc_segmap_parloop_228972_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228972_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228972_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228970(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222299 = tid;
    int num_tasks_222356 = info.nsubtasks;
    struct futhark_mc_task_228969 *futhark_mc_task_228969 =
                                  (struct futhark_mc_task_228969 *) args;
    struct futhark_context *ctx = futhark_mc_task_228969->ctx;
    uint64_t futhark_mc_segmap_task_228970_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228970_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228969->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228969->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228969->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228969->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228969->free_i_196779;
    int64_t gtid_205174 = futhark_mc_task_228969->free_gtid_205174;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228969->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228969->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228969->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228969->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228969->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228969->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228969->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212354 = {.desc ="mem_212354", .mem =
                                  futhark_mc_task_228969->free_mem_212354,
                                  .size =0, .references =NULL};
    int64_t iter_222357;
    struct futhark_mc_segmap_parloop_struct_228971
    futhark_mc_segmap_parloop_struct_228971;
    
    futhark_mc_segmap_parloop_struct_228971.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228971.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228971.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228971.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228971.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228971.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228971.free_gtid_205174 = gtid_205174;
    futhark_mc_segmap_parloop_struct_228971.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228971.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228971.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228971.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228971.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228971.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228971.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228971.free_mem_212354 = mem_212354.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228972_task;
    
    futhark_mc_segmap_parloop_228972_task.name =
        "futhark_mc_segmap_parloop_228972";
    futhark_mc_segmap_parloop_228972_task.fn = futhark_mc_segmap_parloop_228972;
    futhark_mc_segmap_parloop_228972_task.args =
        &futhark_mc_segmap_parloop_struct_228971;
    futhark_mc_segmap_parloop_228972_task.iterations = iterations;
    futhark_mc_segmap_parloop_228972_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228972_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228972_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228972_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228972_task);
    
    if (futhark_mc_segmap_parloop_228972_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228972_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228972_total_end -
                 futhark_mc_segmap_parloop_228972_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228972_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228972_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228972_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228970_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228970_end -
                 futhark_mc_segmap_task_228970_start;
        
        ctx->futhark_mc_segmap_task_228970_runs[tid]++;
        ctx->futhark_mc_segmap_task_228970_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228970_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228974 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205174;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212354;
};
struct futhark_mc_task_228976 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205174;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_222242;
    float free_x_222243;
    int64_t free_defunc_0_g_res_222246;
    float *retval_defunc_2_reduce_res_222247;
};
struct futhark_mc_segred_stage_1_parloop_struct_228979 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205174;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_222242;
    float free_x_222243;
    int64_t free_defunc_0_g_res_222246;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222460;
};
static int futhark_mc_segred_stage_1_parloop_228980(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_222408,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228979
    *futhark_mc_segred_stage_1_parloop_struct_228979 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228979 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228979->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228980_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228980_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_n_196692;
    int64_t gtid_205174 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_gtid_205174;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_228979->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_222242 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_x_222242;
    float x_222243 =
          futhark_mc_segred_stage_1_parloop_struct_228979->free_x_222243;
    int64_t defunc_0_g_res_222246 =
            futhark_mc_segred_stage_1_parloop_struct_228979->free_defunc_0_g_res_222246;
    struct memblock reduce_stage_1_tid_res_arr_mem_222460 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222460",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228979->free_reduce_stage_1_tid_res_arr_mem_222460,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222462 = start;
    float x_222410;
    float x_222411;
    float local_acc_222463 = 0.0F;
    
    for (; iter_222462 < end; iter_222462++) {
        int64_t gtid_222409 = iter_222462;
        bool cond_222413 = sle64(n_196692, gtid_222409);
        int64_t defunc_0_f_res_222414;
        
        if (cond_222413) {
            defunc_0_f_res_222414 = (int64_t) 0;
        } else {
            int64_t i_222415 = add64(x_222242, gtid_222409);
            int64_t defunc_1_add_res_222416 = add64((int64_t) 1, i_222415);
            
            defunc_0_f_res_222414 = defunc_1_add_res_222416;
        }
        
        float defunc_0_f_res_222417;
        
        if (cond_222413) {
            defunc_0_f_res_222417 = 0.0F;
        } else {
            int64_t i_222418 = add64(x_222242, gtid_222409);
            float defunc_0_add_arg_222419;
            
            defunc_0_add_arg_222419 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_205174 *
                                                  ctx_param_ext_210921 +
                                                  i_222418 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_222417 = defunc_0_add_arg_222419;
        }
        
        int64_t binop_p_222420 = sub64(defunc_0_f_res_222414,
                                       defunc_0_g_res_222246);
        float defunc_0_f_res_222421 = sitofp_i64_f32(binop_p_222420);
        float abs_res_222422 = (float) fabs(defunc_0_f_res_222421);
        float tmp1_222423 = abs_res_222422 / x_222243;
        float x_222424 = tmp1_222423 * tmp1_222423;
        float y_222425 = tmp1_222423 * x_222424;
        float tmp2_222426 = 1.0F - y_222425;
        float x_222427 = tmp2_222426 * tmp2_222426;
        float tmp3_222428 = tmp2_222426 * x_222427;
        float w_j_222429 = defunc_0_f_res_222417 * tmp3_222428;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_222410 = local_acc_222463;
        }
        // Load next params
        {
            x_222411 = w_j_222429;
        }
        // Red body
        {
            float defunc_1_op_res_222412 = x_222410 + x_222411;
            
            local_acc_222463 = defunc_1_op_res_222412;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_222460.mem)[flat_tid_222408] =
        local_acc_222463;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228980_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228980_end -
                 futhark_mc_segred_stage_1_parloop_228980_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228980_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228980_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228980_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228977(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222408 = tid;
    int num_tasks_222459 = info.nsubtasks;
    struct futhark_mc_task_228976 *futhark_mc_task_228976 =
                                  (struct futhark_mc_task_228976 *) args;
    struct futhark_context *ctx = futhark_mc_task_228976->ctx;
    uint64_t futhark_mc_segred_task_228977_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228977_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228976->free_n_196692;
    int64_t gtid_205174 = futhark_mc_task_228976->free_gtid_205174;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228976->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228976->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228976->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228976->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_222242 = futhark_mc_task_228976->free_x_222242;
    float x_222243 = futhark_mc_task_228976->free_x_222243;
    int64_t defunc_0_g_res_222246 =
            futhark_mc_task_228976->free_defunc_0_g_res_222246;
    float defunc_2_reduce_res_222247 =
          *futhark_mc_task_228976->retval_defunc_2_reduce_res_222247;
    size_t reduce_stage_1_tid_res_arr_mem_222460_cached_sizze_228978 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222460 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_222460_cached_sizze_228978 <
        (size_t) ((int64_t) 4 * num_tasks_222459)) {
        reduce_stage_1_tid_res_arr_mem_222460 =
            realloc(reduce_stage_1_tid_res_arr_mem_222460, (int64_t) 4 *
                    num_tasks_222459);
        reduce_stage_1_tid_res_arr_mem_222460_cached_sizze_228978 =
            (int64_t) 4 * num_tasks_222459;
    }
    
    int64_t iter_222462;
    struct futhark_mc_segred_stage_1_parloop_struct_228979
    futhark_mc_segred_stage_1_parloop_struct_228979;
    
    futhark_mc_segred_stage_1_parloop_struct_228979.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_gtid_205174 =
        gtid_205174;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_x_222242 = x_222242;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_x_222243 = x_222243;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_defunc_0_g_res_222246 =
        defunc_0_g_res_222246;
    futhark_mc_segred_stage_1_parloop_struct_228979.free_reduce_stage_1_tid_res_arr_mem_222460 =
        reduce_stage_1_tid_res_arr_mem_222460;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228980_task;
    
    futhark_mc_segred_stage_1_parloop_228980_task.name =
        "futhark_mc_segred_stage_1_parloop_228980";
    futhark_mc_segred_stage_1_parloop_228980_task.fn =
        futhark_mc_segred_stage_1_parloop_228980;
    futhark_mc_segred_stage_1_parloop_228980_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228979;
    futhark_mc_segred_stage_1_parloop_228980_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228980_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228980_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228980_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228980_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228980_task);
    
    if (futhark_mc_segred_stage_1_parloop_228980_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228980_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228980_total_end -
                 futhark_mc_segred_stage_1_parloop_228980_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228980_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228980_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228980_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_222247 = 0.0F;
    }
    
    float x_222464;
    float x_222465;
    
    for (int32_t i_222467 = 0; i_222467 < num_tasks_222459; i_222467++) {
        flat_tid_222408 = i_222467;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_222464 = defunc_2_reduce_res_222247;
            }
            // load next params
            {
                x_222465 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222460)[flat_tid_222408];
            }
            // red body
            {
                float defunc_1_op_res_222466 = x_222464 + x_222465;
                
                defunc_2_reduce_res_222247 = defunc_1_op_res_222466;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_222460);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228977_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228977_end -
                 futhark_mc_segred_task_228977_start;
        
        ctx->futhark_mc_segred_task_228977_runs[tid]++;
        ctx->futhark_mc_segred_task_228977_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228977_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228976->retval_defunc_2_reduce_res_222247 =
            defunc_2_reduce_res_222247;
    }
    return err;
}
struct futhark_mc_task_228981 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205174;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_x_222242;
    float free_x_222243;
    int64_t free_defunc_0_g_res_222246;
    float free_a0_222270;
    float *retval_defunc_2_reduce_res_222271;
};
struct futhark_mc_segred_stage_1_parloop_struct_228984 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205174;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_x_222242;
    float free_x_222243;
    int64_t free_defunc_0_g_res_222246;
    float free_a0_222270;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222469;
};
static int futhark_mc_segred_stage_1_parloop_228985(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_222430,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_228984
    *futhark_mc_segred_stage_1_parloop_struct_228984 =
    (struct futhark_mc_segred_stage_1_parloop_struct_228984 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_228984->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_228985_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228985_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_n_196692;
    int64_t gtid_205174 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_gtid_205174;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_228984->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_228984->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_222242 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_x_222242;
    float x_222243 =
          futhark_mc_segred_stage_1_parloop_struct_228984->free_x_222243;
    int64_t defunc_0_g_res_222246 =
            futhark_mc_segred_stage_1_parloop_struct_228984->free_defunc_0_g_res_222246;
    float a0_222270 =
          futhark_mc_segred_stage_1_parloop_struct_228984->free_a0_222270;
    struct memblock reduce_stage_1_tid_res_arr_mem_222469 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222469",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_228984->free_reduce_stage_1_tid_res_arr_mem_222469,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222471 = start;
    float x_222432;
    float x_222433;
    float local_acc_222472 = 0.0F;
    
    for (; iter_222471 < end; iter_222471++) {
        int64_t gtid_222431 = iter_222471;
        bool cond_222435 = sle64(n_196692, gtid_222431);
        int64_t defunc_0_f_res_222436;
        
        if (cond_222435) {
            defunc_0_f_res_222436 = (int64_t) 0;
        } else {
            int64_t i_222437 = add64(x_222242, gtid_222431);
            int64_t defunc_1_add_res_222438 = add64((int64_t) 1, i_222437);
            
            defunc_0_f_res_222436 = defunc_1_add_res_222438;
        }
        
        float defunc_0_f_res_222439;
        
        if (cond_222435) {
            defunc_0_f_res_222439 = 0.0F;
        } else {
            int64_t i_222440 = add64(x_222242, gtid_222431);
            float defunc_0_add_arg_222441;
            
            defunc_0_add_arg_222441 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_205174 *
                                                  ctx_param_ext_210921 +
                                                  i_222440 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_222439 = defunc_0_add_arg_222441;
        }
        
        int64_t binop_p_222442 = sub64(defunc_0_f_res_222436,
                                       defunc_0_g_res_222246);
        float defunc_0_f_res_222443 = sitofp_i64_f32(binop_p_222442);
        float abs_res_222444 = (float) fabs(defunc_0_f_res_222443);
        float tmp1_222445 = abs_res_222444 / x_222243;
        float x_222446 = tmp1_222445 * tmp1_222445;
        float y_222447 = tmp1_222445 * x_222446;
        float tmp2_222448 = 1.0F - y_222447;
        float x_222449 = tmp2_222448 * tmp2_222448;
        float tmp3_222450 = tmp2_222448 * x_222449;
        float tmp4_222451 = defunc_0_f_res_222439 * tmp3_222450;
        float defunc_0_f_res_222452;
        
        if (cond_222435) {
            defunc_0_f_res_222452 = 0.0F;
        } else {
            int64_t i_222453 = add64(x_222242, gtid_222431);
            float defunc_0_add_arg_222454;
            
            defunc_0_add_arg_222454 = ((float *) mem_212347.mem)[gtid_205174 *
                                                                 n_196692 +
                                                                 i_222453];
            defunc_0_f_res_222452 = defunc_0_add_arg_222454;
        }
        
        float x_222455 = a0_222270 * tmp4_222451;
        float defunc_9_fit_fun_res_222456 = defunc_0_f_res_222452 * x_222455;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_222432 = local_acc_222472;
        }
        // Load next params
        {
            x_222433 = defunc_9_fit_fun_res_222456;
        }
        // Red body
        {
            float defunc_1_op_res_222434 = x_222432 + x_222433;
            
            local_acc_222472 = defunc_1_op_res_222434;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_222469.mem)[flat_tid_222430] =
        local_acc_222472;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228985_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228985_end -
                 futhark_mc_segred_stage_1_parloop_228985_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_228985_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_228985_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_228985_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_228982(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222430 = tid;
    int num_tasks_222468 = info.nsubtasks;
    struct futhark_mc_task_228981 *futhark_mc_task_228981 =
                                  (struct futhark_mc_task_228981 *) args;
    struct futhark_context *ctx = futhark_mc_task_228981->ctx;
    uint64_t futhark_mc_segred_task_228982_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_228982_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228981->free_n_196692;
    int64_t gtid_205174 = futhark_mc_task_228981->free_gtid_205174;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228981->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228981->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228981->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228981->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228981->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_222242 = futhark_mc_task_228981->free_x_222242;
    float x_222243 = futhark_mc_task_228981->free_x_222243;
    int64_t defunc_0_g_res_222246 =
            futhark_mc_task_228981->free_defunc_0_g_res_222246;
    float a0_222270 = futhark_mc_task_228981->free_a0_222270;
    float defunc_2_reduce_res_222271 =
          *futhark_mc_task_228981->retval_defunc_2_reduce_res_222271;
    size_t reduce_stage_1_tid_res_arr_mem_222469_cached_sizze_228983 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222469 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_222469_cached_sizze_228983 <
        (size_t) ((int64_t) 4 * num_tasks_222468)) {
        reduce_stage_1_tid_res_arr_mem_222469 =
            realloc(reduce_stage_1_tid_res_arr_mem_222469, (int64_t) 4 *
                    num_tasks_222468);
        reduce_stage_1_tid_res_arr_mem_222469_cached_sizze_228983 =
            (int64_t) 4 * num_tasks_222468;
    }
    
    int64_t iter_222471;
    struct futhark_mc_segred_stage_1_parloop_struct_228984
    futhark_mc_segred_stage_1_parloop_struct_228984;
    
    futhark_mc_segred_stage_1_parloop_struct_228984.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_gtid_205174 =
        gtid_205174;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_mem_212347 =
        mem_212347.mem;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_x_222242 = x_222242;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_x_222243 = x_222243;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_defunc_0_g_res_222246 =
        defunc_0_g_res_222246;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_a0_222270 = a0_222270;
    futhark_mc_segred_stage_1_parloop_struct_228984.free_reduce_stage_1_tid_res_arr_mem_222469 =
        reduce_stage_1_tid_res_arr_mem_222469;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_228985_task;
    
    futhark_mc_segred_stage_1_parloop_228985_task.name =
        "futhark_mc_segred_stage_1_parloop_228985";
    futhark_mc_segred_stage_1_parloop_228985_task.fn =
        futhark_mc_segred_stage_1_parloop_228985;
    futhark_mc_segred_stage_1_parloop_228985_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_228984;
    futhark_mc_segred_stage_1_parloop_228985_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_228985_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_228985_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_228985_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_228985_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_228985_task);
    
    if (futhark_mc_segred_stage_1_parloop_228985_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_228985_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_228985_total_end -
                 futhark_mc_segred_stage_1_parloop_228985_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228985_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228985_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_228985_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_222271 = 0.0F;
    }
    
    float x_222473;
    float x_222474;
    
    for (int32_t i_222476 = 0; i_222476 < num_tasks_222468; i_222476++) {
        flat_tid_222430 = i_222476;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_222473 = defunc_2_reduce_res_222271;
            }
            // load next params
            {
                x_222474 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222469)[flat_tid_222430];
            }
            // red body
            {
                float defunc_1_op_res_222475 = x_222473 + x_222474;
                
                defunc_2_reduce_res_222271 = defunc_1_op_res_222475;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_222469);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_228982_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_228982_end -
                 futhark_mc_segred_task_228982_start;
        
        ctx->futhark_mc_segred_task_228982_runs[tid]++;
        ctx->futhark_mc_segred_task_228982_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_228982_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_228981->retval_defunc_2_reduce_res_222271 =
            defunc_2_reduce_res_222271;
    }
    return err;
}
static int futhark_mc_segmap_parloop_228975(void *args, int64_t start,
                                            int64_t end, int flat_tid_222240,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228974
    *futhark_mc_segmap_parloop_struct_228974 =
    (struct futhark_mc_segmap_parloop_struct_228974 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228974->ctx;
    uint64_t futhark_mc_segmap_parloop_228975_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228975_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228974->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228974->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228974->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228974->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228974->free_i_196779;
    int64_t gtid_205174 =
            futhark_mc_segmap_parloop_struct_228974->free_gtid_205174;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228974->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228974->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228974->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228974->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228974->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228974->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228974->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212354 = {.desc ="mem_212354", .mem =
                                  futhark_mc_segmap_parloop_struct_228974->free_mem_212354,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222407 = start;
    
    for (; iter_222407 < end; iter_222407++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222457 = l_n_m_196752;
        int64_t gtid_222241 = iter_222407;
        int64_t remnant_222458 = iter_222407 - gtid_222241;
        int64_t x_222242;
        
        x_222242 = ((int64_t *) mem_210827.mem)[gtid_205174 * l_n_m_196752 +
                                                gtid_222241];
        
        float x_222243;
        
        x_222243 = ((float *) mem_210831.mem)[gtid_205174 * l_n_m_196752 +
                                              gtid_222241];
        
        int64_t min_arg_222244 = mul64(jump_t_196702, gtid_222241);
        int64_t min_res_222245 = smin64(i_196779, min_arg_222244);
        int64_t defunc_0_g_res_222246 = add64((int64_t) 1, min_res_222245);
        float defunc_2_reduce_res_222247;
        int64_t flat_tid_222408 = (int64_t) 0;
        int32_t num_tasks_222459;
        
        defunc_2_reduce_res_222247 = 0.0F;
        
        struct futhark_mc_task_228976 futhark_mc_task_228976;
        
        futhark_mc_task_228976.ctx = ctx;
        futhark_mc_task_228976.free_n_196692 = n_196692;
        futhark_mc_task_228976.free_gtid_205174 = gtid_205174;
        futhark_mc_task_228976.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_228976.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_228976.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_228976.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_228976.free_x_222242 = x_222242;
        futhark_mc_task_228976.free_x_222243 = x_222243;
        futhark_mc_task_228976.free_defunc_0_g_res_222246 =
            defunc_0_g_res_222246;
        futhark_mc_task_228976.retval_defunc_2_reduce_res_222247 =
            &defunc_2_reduce_res_222247;
        
        struct scheduler_segop futhark_mc_task_228976_task;
        
        futhark_mc_task_228976_task.args = &futhark_mc_task_228976;
        futhark_mc_task_228976_task.top_level_fn =
            futhark_mc_segred_task_228977;
        futhark_mc_task_228976_task.name = "futhark_mc_segred_task_228977";
        futhark_mc_task_228976_task.iterations = q_l_196697;
        futhark_mc_task_228976_task.task_time =
            &ctx->futhark_mc_segred_task_228977_total_time;
        futhark_mc_task_228976_task.task_iter =
            &ctx->futhark_mc_segred_task_228977_total_iter;
        futhark_mc_task_228976_task.sched = STATIC;
        futhark_mc_task_228976_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228977_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228976_task);
        
        if (futhark_mc_segred_task_228977_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float a0_222270 = 1.0F / defunc_2_reduce_res_222247;
        float defunc_2_reduce_res_222271;
        int64_t flat_tid_222430 = (int64_t) 0;
        int32_t num_tasks_222468;
        
        defunc_2_reduce_res_222271 = 0.0F;
        
        struct futhark_mc_task_228981 futhark_mc_task_228981;
        
        futhark_mc_task_228981.ctx = ctx;
        futhark_mc_task_228981.free_n_196692 = n_196692;
        futhark_mc_task_228981.free_gtid_205174 = gtid_205174;
        futhark_mc_task_228981.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_228981.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_228981.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_228981.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_228981.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_228981.free_x_222242 = x_222242;
        futhark_mc_task_228981.free_x_222243 = x_222243;
        futhark_mc_task_228981.free_defunc_0_g_res_222246 =
            defunc_0_g_res_222246;
        futhark_mc_task_228981.free_a0_222270 = a0_222270;
        futhark_mc_task_228981.retval_defunc_2_reduce_res_222271 =
            &defunc_2_reduce_res_222271;
        
        struct scheduler_segop futhark_mc_task_228981_task;
        
        futhark_mc_task_228981_task.args = &futhark_mc_task_228981;
        futhark_mc_task_228981_task.top_level_fn =
            futhark_mc_segred_task_228982;
        futhark_mc_task_228981_task.name = "futhark_mc_segred_task_228982";
        futhark_mc_task_228981_task.iterations = q_l_196697;
        futhark_mc_task_228981_task.task_time =
            &ctx->futhark_mc_segred_task_228982_total_time;
        futhark_mc_task_228981_task.task_iter =
            &ctx->futhark_mc_segred_task_228982_total_iter;
        futhark_mc_task_228981_task.sched = STATIC;
        futhark_mc_task_228981_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_228982_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228981_task);
        
        if (futhark_mc_segred_task_228982_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212354.mem)[gtid_222241] = defunc_2_reduce_res_222271;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228975_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228975_end -
                 futhark_mc_segmap_parloop_228975_start;
        
        ctx->futhark_mc_segmap_parloop_228975_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228975_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228975_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228973(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222240 = tid;
    int num_tasks_222356 = info.nsubtasks;
    struct futhark_mc_task_228969 *futhark_mc_task_228969 =
                                  (struct futhark_mc_task_228969 *) args;
    struct futhark_context *ctx = futhark_mc_task_228969->ctx;
    uint64_t futhark_mc_segmap_nested_task_228973_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228973_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228969->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228969->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228969->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228969->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228969->free_i_196779;
    int64_t gtid_205174 = futhark_mc_task_228969->free_gtid_205174;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228969->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228969->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228969->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228969->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228969->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228969->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228969->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212354 = {.desc ="mem_212354", .mem =
                                  futhark_mc_task_228969->free_mem_212354,
                                  .size =0, .references =NULL};
    int64_t iter_222407;
    struct futhark_mc_segmap_parloop_struct_228974
    futhark_mc_segmap_parloop_struct_228974;
    
    futhark_mc_segmap_parloop_struct_228974.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228974.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228974.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228974.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228974.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228974.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228974.free_gtid_205174 = gtid_205174;
    futhark_mc_segmap_parloop_struct_228974.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228974.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228974.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228974.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228974.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228974.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228974.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228974.free_mem_212354 = mem_212354.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228975_task;
    
    futhark_mc_segmap_parloop_228975_task.name =
        "futhark_mc_segmap_parloop_228975";
    futhark_mc_segmap_parloop_228975_task.fn = futhark_mc_segmap_parloop_228975;
    futhark_mc_segmap_parloop_228975_task.args =
        &futhark_mc_segmap_parloop_struct_228974;
    futhark_mc_segmap_parloop_228975_task.iterations = iterations;
    futhark_mc_segmap_parloop_228975_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228975_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228975_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228975_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228975_task);
    
    if (futhark_mc_segmap_parloop_228975_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228975_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228975_total_end -
                 futhark_mc_segmap_parloop_228975_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228975_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228975_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228975_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228973_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228973_end -
                 futhark_mc_segmap_nested_task_228973_start;
        
        ctx->futhark_mc_segmap_nested_task_228973_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228973_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228973_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228967(void *args, int64_t start,
                                            int64_t end, int flat_tid_205173,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228966
    *futhark_mc_segmap_parloop_struct_228966 =
    (struct futhark_mc_segmap_parloop_struct_228966 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228966->ctx;
    uint64_t futhark_mc_segmap_parloop_228967_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228967_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228966->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228966->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228966->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228966->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228966->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228966->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_228966->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228966->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228966->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228966->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228966->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228966->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228966->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228966->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212373 = {.desc ="mem_212373", .mem =
                                  futhark_mc_segmap_parloop_struct_228966->free_mem_212373,
                                  .size =0, .references =NULL};
    size_t mem_212354_cached_sizze_228968 = 0;
    unsigned char *mem_212354 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222239 = start;
    
    if (mem_212354_cached_sizze_228968 < (size_t) bytes_210774) {
        mem_212354 = realloc(mem_212354, bytes_210774);
        mem_212354_cached_sizze_228968 = bytes_210774;
    }
    for (; iter_222239 < end; iter_222239++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222354 = m_196691;
        int64_t gtid_205174 = iter_222239;
        int64_t remnant_222355 = iter_222239 - gtid_205174;
        int64_t flat_tid_222299 = (int64_t) 0;
        int32_t num_tasks_222356;
        int64_t flat_tid_222240 = (int64_t) 0;
        struct futhark_mc_task_228969 futhark_mc_task_228969;
        
        futhark_mc_task_228969.ctx = ctx;
        futhark_mc_task_228969.free_n_196692 = n_196692;
        futhark_mc_task_228969.free_q_l_196697 = q_l_196697;
        futhark_mc_task_228969.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_228969.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_228969.free_i_196779 = i_196779;
        futhark_mc_task_228969.free_gtid_205174 = gtid_205174;
        futhark_mc_task_228969.free_mem_210827 = mem_210827.mem;
        futhark_mc_task_228969.free_mem_210831 = mem_210831.mem;
        futhark_mc_task_228969.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_228969.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_228969.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_228969.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_228969.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_228969.free_mem_212354 = mem_212354;
        
        struct scheduler_segop futhark_mc_task_228969_task;
        
        futhark_mc_task_228969_task.args = &futhark_mc_task_228969;
        futhark_mc_task_228969_task.top_level_fn =
            futhark_mc_segmap_task_228970;
        futhark_mc_task_228969_task.name = "futhark_mc_segmap_task_228970";
        futhark_mc_task_228969_task.iterations = l_n_m_196752;
        futhark_mc_task_228969_task.task_time =
            &ctx->futhark_mc_segmap_task_228970_total_time;
        futhark_mc_task_228969_task.task_iter =
            &ctx->futhark_mc_segmap_task_228970_total_iter;
        futhark_mc_task_228969_task.sched = STATIC;
        futhark_mc_task_228969_task.nested_fn =
            futhark_mc_segmap_nested_task_228973;
        
        int futhark_mc_segmap_task_228970_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228969_task);
        
        if (futhark_mc_segmap_task_228970_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212373.mem + gtid_205174 * l_n_m_196752 * (int64_t) 4,
                    mem_212354 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212354);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228967_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228967_end -
                 futhark_mc_segmap_parloop_228967_start;
        
        ctx->futhark_mc_segmap_parloop_228967_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228967_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228967_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228965(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205173 = tid;
    int num_tasks_222176 = info.nsubtasks;
    struct futhark_mc_task_228960 *futhark_mc_task_228960 =
                                  (struct futhark_mc_task_228960 *) args;
    struct futhark_context *ctx = futhark_mc_task_228960->ctx;
    uint64_t futhark_mc_segmap_nested_task_228965_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228965_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228960->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228960->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228960->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228960->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228960->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228960->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_228960->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228960->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228960->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228960->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228960->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228960->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228960->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228960->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212373 = {.desc ="mem_212373", .mem =
                                  futhark_mc_task_228960->free_mem_212373,
                                  .size =0, .references =NULL};
    int64_t iter_222239;
    struct futhark_mc_segmap_parloop_struct_228966
    futhark_mc_segmap_parloop_struct_228966;
    
    futhark_mc_segmap_parloop_struct_228966.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228966.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228966.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228966.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228966.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228966.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228966.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228966.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_228966.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228966.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228966.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228966.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228966.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228966.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228966.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228966.free_mem_212373 = mem_212373.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228967_task;
    
    futhark_mc_segmap_parloop_228967_task.name =
        "futhark_mc_segmap_parloop_228967";
    futhark_mc_segmap_parloop_228967_task.fn = futhark_mc_segmap_parloop_228967;
    futhark_mc_segmap_parloop_228967_task.args =
        &futhark_mc_segmap_parloop_struct_228966;
    futhark_mc_segmap_parloop_228967_task.iterations = iterations;
    futhark_mc_segmap_parloop_228967_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228967_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228967_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228967_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228967_task);
    
    if (futhark_mc_segmap_parloop_228967_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228967_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228967_total_end -
                 futhark_mc_segmap_parloop_228967_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228967_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228967_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228967_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228965_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228965_end -
                 futhark_mc_segmap_nested_task_228965_start;
        
        ctx->futhark_mc_segmap_nested_task_228965_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228965_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228965_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_228986 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212413;
    unsigned char *free_mem_212417;
};
struct futhark_mc_segmap_parloop_struct_228988 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212413;
    unsigned char *free_mem_212417;
};
static int futhark_mc_segmap_parloop_228989(void *args, int64_t start,
                                            int64_t end, int flat_tid_205300,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228988
    *futhark_mc_segmap_parloop_struct_228988 =
    (struct futhark_mc_segmap_parloop_struct_228988 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228988->ctx;
    uint64_t futhark_mc_segmap_parloop_228989_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228989_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228988->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228988->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228988->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228988->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228988->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228988->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_228988->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228988->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228988->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228988->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228988->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228988->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228988->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228988->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212413 = {.desc ="mem_212413", .mem =
                                  futhark_mc_segmap_parloop_struct_228988->free_mem_212413,
                                  .size =0, .references =NULL};
    struct memblock mem_212417 = {.desc ="mem_212417", .mem =
                                  futhark_mc_segmap_parloop_struct_228988->free_mem_212417,
                                  .size =0, .references =NULL};
    size_t mem_212382_cached_sizze_228990 = 0;
    unsigned char *mem_212382 = NULL;
    size_t mem_212385_cached_sizze_228991 = 0;
    unsigned char *mem_212385 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222478 = start;
    
    if (mem_212382_cached_sizze_228990 < (size_t) bytes_210774) {
        mem_212382 = realloc(mem_212382, bytes_210774);
        mem_212382_cached_sizze_228990 = bytes_210774;
    }
    if (mem_212385_cached_sizze_228991 < (size_t) bytes_210774) {
        mem_212385 = realloc(mem_212385, bytes_210774);
        mem_212385_cached_sizze_228991 = bytes_210774;
    }
    for (; iter_222478 < end; iter_222478++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222562 = m_196691;
        int64_t gtid_205301 = iter_222478;
        int64_t remnant_222563 = iter_222478 - gtid_205301;
        
        for (int64_t i_222479 = 0; i_222479 < l_n_m_196752; i_222479++) {
            int64_t x_222482;
            
            x_222482 = ((int64_t *) mem_210827.mem)[gtid_205301 * l_n_m_196752 +
                                                    i_222479];
            
            float x_222483;
            
            x_222483 = ((float *) mem_210831.mem)[gtid_205301 * l_n_m_196752 +
                                                  i_222479];
            
            int64_t min_arg_222484 = mul64(jump_t_196702, i_222479);
            int64_t min_res_222485 = smin64(i_196779, min_arg_222484);
            int64_t defunc_0_g_res_222486 = add64((int64_t) 1, min_res_222485);
            float defunc_2_reduce_res_222487;
            float defunc_2_reduce_res_222488;
            float defunc_2_reduce_res_222489;
            float redout_222491;
            float redout_222492;
            float redout_222493;
            
            redout_222491 = 0.0F;
            redout_222492 = 0.0F;
            redout_222493 = 0.0F;
            for (int64_t i_222490 = 0; i_222490 < q_l_196697; i_222490++) {
                bool cond_222494 = sle64(n_196692, i_222490);
                int64_t defunc_0_f_res_222495;
                
                if (cond_222494) {
                    defunc_0_f_res_222495 = (int64_t) 0;
                } else {
                    int64_t i_222496 = add64(x_222482, i_222490);
                    int64_t defunc_1_add_res_222497 = add64((int64_t) 1,
                                                            i_222496);
                    
                    defunc_0_f_res_222495 = defunc_1_add_res_222497;
                }
                
                float defunc_0_f_res_222498;
                
                if (cond_222494) {
                    defunc_0_f_res_222498 = 0.0F;
                } else {
                    int64_t i_222499 = add64(x_222482, i_222490);
                    float defunc_0_add_arg_222500;
                    
                    defunc_0_add_arg_222500 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205301 *
                                                          ctx_param_ext_210921 +
                                                          i_222499 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_222498 = defunc_0_add_arg_222500;
                }
                
                int64_t binop_p_222501 = sub64(defunc_0_f_res_222495,
                                               defunc_0_g_res_222486);
                float defunc_0_f_res_222502 = sitofp_i64_f32(binop_p_222501);
                float abs_res_222503 = (float) fabs(defunc_0_f_res_222502);
                float tmp1_222504 = abs_res_222503 / x_222483;
                float x_222505 = tmp1_222504 * tmp1_222504;
                float y_222506 = tmp1_222504 * x_222505;
                float tmp2_222507 = 1.0F - y_222506;
                float x_222508 = tmp2_222507 * tmp2_222507;
                float tmp3_222509 = tmp2_222507 * x_222508;
                float w_j_222510 = defunc_0_f_res_222498 * tmp3_222509;
                float xw_j_222511 = defunc_0_f_res_222502 * w_j_222510;
                float x2w_j_222512 = defunc_0_f_res_222502 * xw_j_222511;
                float defunc_1_op_res_222513 = w_j_222510 + redout_222491;
                float defunc_1_op_res_222514 = xw_j_222511 + redout_222492;
                float defunc_1_op_res_222515 = x2w_j_222512 + redout_222493;
                float redout_tmp_222566 = defunc_1_op_res_222513;
                float redout_tmp_222567 = defunc_1_op_res_222514;
                float redout_tmp_222568 = defunc_1_op_res_222515;
                
                redout_222491 = redout_tmp_222566;
                redout_222492 = redout_tmp_222567;
                redout_222493 = redout_tmp_222568;
            }
            defunc_2_reduce_res_222487 = redout_222491;
            defunc_2_reduce_res_222488 = redout_222492;
            defunc_2_reduce_res_222489 = redout_222493;
            
            float x_222516 = defunc_2_reduce_res_222487 *
                  defunc_2_reduce_res_222489;
            float y_222517 = defunc_2_reduce_res_222488 *
                  defunc_2_reduce_res_222488;
            float y_222518 = x_222516 - y_222517;
            float det1_222519 = 1.0F / y_222518;
            float a11_222520 = defunc_2_reduce_res_222489 * det1_222519;
            float x_222521 = 0.0F - defunc_2_reduce_res_222488;
            float b11_222522 = det1_222519 * x_222521;
            float c11_222523 = defunc_2_reduce_res_222487 * det1_222519;
            float defunc_2_reduce_res_222524;
            float defunc_2_reduce_res_222525;
            float redout_222527;
            float redout_222528;
            
            redout_222527 = 0.0F;
            redout_222528 = 0.0F;
            for (int64_t i_222526 = 0; i_222526 < q_l_196697; i_222526++) {
                bool cond_222529 = sle64(n_196692, i_222526);
                int64_t defunc_0_f_res_222530;
                
                if (cond_222529) {
                    defunc_0_f_res_222530 = (int64_t) 0;
                } else {
                    int64_t i_222531 = add64(x_222482, i_222526);
                    int64_t defunc_1_add_res_222532 = add64((int64_t) 1,
                                                            i_222531);
                    
                    defunc_0_f_res_222530 = defunc_1_add_res_222532;
                }
                
                float defunc_0_f_res_222533;
                
                if (cond_222529) {
                    defunc_0_f_res_222533 = 0.0F;
                } else {
                    int64_t i_222534 = add64(x_222482, i_222526);
                    float defunc_0_add_arg_222535;
                    
                    defunc_0_add_arg_222535 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205301 *
                                                          ctx_param_ext_210921 +
                                                          i_222534 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_222533 = defunc_0_add_arg_222535;
                }
                
                int64_t binop_p_222536 = sub64(defunc_0_f_res_222530,
                                               defunc_0_g_res_222486);
                float defunc_0_f_res_222537 = sitofp_i64_f32(binop_p_222536);
                float abs_res_222538 = (float) fabs(defunc_0_f_res_222537);
                float tmp1_222539 = abs_res_222538 / x_222483;
                float x_222540 = tmp1_222539 * tmp1_222539;
                float y_222541 = tmp1_222539 * x_222540;
                float tmp2_222542 = 1.0F - y_222541;
                float x_222543 = tmp2_222542 * tmp2_222542;
                float tmp3_222544 = tmp2_222542 * x_222543;
                float tmp4_222545 = defunc_0_f_res_222533 * tmp3_222544;
                float defunc_1_f_res_222546 = defunc_0_f_res_222537 *
                      tmp4_222545;
                float defunc_0_f_res_222547;
                
                if (cond_222529) {
                    defunc_0_f_res_222547 = 0.0F;
                } else {
                    int64_t i_222548 = add64(x_222482, i_222526);
                    float defunc_0_add_arg_222549;
                    
                    defunc_0_add_arg_222549 =
                        ((float *) mem_212347.mem)[gtid_205301 * n_196692 +
                                                   i_222548];
                    defunc_0_f_res_222547 = defunc_0_add_arg_222549;
                }
                
                float x_222550 = a11_222520 * tmp4_222545;
                float y_222551 = b11_222522 * defunc_1_f_res_222546;
                float x_222552 = x_222550 + y_222551;
                float defunc_9_fit_fun_res_222553 = defunc_0_f_res_222547 *
                      x_222552;
                float x_222554 = b11_222522 * tmp4_222545;
                float y_222555 = c11_222523 * defunc_1_f_res_222546;
                float x_222556 = x_222554 + y_222555;
                float defunc_9_slope_fun_res_222557 = defunc_0_f_res_222547 *
                      x_222556;
                float defunc_1_op_res_222558 = defunc_9_fit_fun_res_222553 +
                      redout_222527;
                float defunc_1_op_res_222559 = defunc_9_slope_fun_res_222557 +
                      redout_222528;
                float redout_tmp_222569 = defunc_1_op_res_222558;
                float redout_tmp_222570 = defunc_1_op_res_222559;
                
                redout_222527 = redout_tmp_222569;
                redout_222528 = redout_tmp_222570;
            }
            defunc_2_reduce_res_222524 = redout_222527;
            defunc_2_reduce_res_222525 = redout_222528;
            ((float *) mem_212382)[i_222479] = defunc_2_reduce_res_222524;
            ((float *) mem_212385)[i_222479] = defunc_2_reduce_res_222525;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212413.mem + gtid_205301 * l_n_m_196752 * (int64_t) 4,
                    mem_212382 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212417.mem + gtid_205301 * l_n_m_196752 * (int64_t) 4,
                    mem_212385 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212382);
    free(mem_212385);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228989_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228989_end -
                 futhark_mc_segmap_parloop_228989_start;
        
        ctx->futhark_mc_segmap_parloop_228989_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228989_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228989_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228987(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205300 = tid;
    int num_tasks_222477 = info.nsubtasks;
    struct futhark_mc_task_228986 *futhark_mc_task_228986 =
                                  (struct futhark_mc_task_228986 *) args;
    struct futhark_context *ctx = futhark_mc_task_228986->ctx;
    uint64_t futhark_mc_segmap_task_228987_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228987_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228986->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228986->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228986->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228986->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228986->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228986->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_228986->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228986->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228986->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228986->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228986->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228986->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228986->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228986->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212413 = {.desc ="mem_212413", .mem =
                                  futhark_mc_task_228986->free_mem_212413,
                                  .size =0, .references =NULL};
    struct memblock mem_212417 = {.desc ="mem_212417", .mem =
                                  futhark_mc_task_228986->free_mem_212417,
                                  .size =0, .references =NULL};
    int64_t iter_222478;
    struct futhark_mc_segmap_parloop_struct_228988
    futhark_mc_segmap_parloop_struct_228988;
    
    futhark_mc_segmap_parloop_struct_228988.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228988.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228988.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228988.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228988.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228988.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228988.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228988.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_228988.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228988.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228988.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228988.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228988.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228988.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228988.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228988.free_mem_212413 = mem_212413.mem;
    futhark_mc_segmap_parloop_struct_228988.free_mem_212417 = mem_212417.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228989_task;
    
    futhark_mc_segmap_parloop_228989_task.name =
        "futhark_mc_segmap_parloop_228989";
    futhark_mc_segmap_parloop_228989_task.fn = futhark_mc_segmap_parloop_228989;
    futhark_mc_segmap_parloop_228989_task.args =
        &futhark_mc_segmap_parloop_struct_228988;
    futhark_mc_segmap_parloop_228989_task.iterations = iterations;
    futhark_mc_segmap_parloop_228989_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228989_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228989_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228989_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228989_task);
    
    if (futhark_mc_segmap_parloop_228989_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228989_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228989_total_end -
                 futhark_mc_segmap_parloop_228989_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228989_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228989_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228989_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228987_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228987_end -
                 futhark_mc_segmap_task_228987_start;
        
        ctx->futhark_mc_segmap_task_228987_runs[tid]++;
        ctx->futhark_mc_segmap_task_228987_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228987_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_228993 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212413;
    unsigned char *free_mem_212417;
};
struct futhark_mc_task_228997 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205403;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212376;
    unsigned char *free_mem_212379;
};
struct futhark_mc_segmap_parloop_struct_228999 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205403;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212376;
    unsigned char *free_mem_212379;
};
static int futhark_mc_segmap_parloop_229000(void *args, int64_t start,
                                            int64_t end, int flat_tid_222659,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228999
    *futhark_mc_segmap_parloop_struct_228999 =
    (struct futhark_mc_segmap_parloop_struct_228999 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228999->ctx;
    uint64_t futhark_mc_segmap_parloop_229000_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229000_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228999->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228999->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228999->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228999->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228999->free_i_196779;
    int64_t gtid_205403 =
            futhark_mc_segmap_parloop_struct_228999->free_gtid_205403;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228999->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228999->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228999->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228999->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228999->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228999->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228999->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212376 = {.desc ="mem_212376", .mem =
                                  futhark_mc_segmap_parloop_struct_228999->free_mem_212376,
                                  .size =0, .references =NULL};
    struct memblock mem_212379 = {.desc ="mem_212379", .mem =
                                  futhark_mc_segmap_parloop_struct_228999->free_mem_212379,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222742 = start;
    
    for (; iter_222742 < end; iter_222742++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222803 = l_n_m_196752;
        int64_t gtid_222660 = iter_222742;
        int64_t remnant_222804 = iter_222742 - gtid_222660;
        int64_t x_222661;
        
        x_222661 = ((int64_t *) mem_210827.mem)[gtid_205403 * l_n_m_196752 +
                                                gtid_222660];
        
        float x_222662;
        
        x_222662 = ((float *) mem_210831.mem)[gtid_205403 * l_n_m_196752 +
                                              gtid_222660];
        
        int64_t min_arg_222663 = mul64(jump_t_196702, gtid_222660);
        int64_t min_res_222664 = smin64(i_196779, min_arg_222663);
        int64_t defunc_0_g_res_222665 = add64((int64_t) 1, min_res_222664);
        float defunc_2_reduce_res_222666;
        float defunc_2_reduce_res_222667;
        float defunc_2_reduce_res_222668;
        float redout_222744;
        float redout_222745;
        float redout_222746;
        
        redout_222744 = 0.0F;
        redout_222745 = 0.0F;
        redout_222746 = 0.0F;
        for (int64_t i_222743 = 0; i_222743 < q_l_196697; i_222743++) {
            bool cond_222747 = sle64(n_196692, i_222743);
            int64_t defunc_0_f_res_222748;
            
            if (cond_222747) {
                defunc_0_f_res_222748 = (int64_t) 0;
            } else {
                int64_t i_222749 = add64(x_222661, i_222743);
                int64_t defunc_1_add_res_222750 = add64((int64_t) 1, i_222749);
                
                defunc_0_f_res_222748 = defunc_1_add_res_222750;
            }
            
            float defunc_0_f_res_222751;
            
            if (cond_222747) {
                defunc_0_f_res_222751 = 0.0F;
            } else {
                int64_t i_222752 = add64(x_222661, i_222743);
                float defunc_0_add_arg_222753;
                
                defunc_0_add_arg_222753 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_205403 *
                                                      ctx_param_ext_210921 +
                                                      i_222752 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_222751 = defunc_0_add_arg_222753;
            }
            
            int64_t binop_p_222754 = sub64(defunc_0_f_res_222748,
                                           defunc_0_g_res_222665);
            float defunc_0_f_res_222755 = sitofp_i64_f32(binop_p_222754);
            float abs_res_222756 = (float) fabs(defunc_0_f_res_222755);
            float tmp1_222757 = abs_res_222756 / x_222662;
            float x_222758 = tmp1_222757 * tmp1_222757;
            float y_222759 = tmp1_222757 * x_222758;
            float tmp2_222760 = 1.0F - y_222759;
            float x_222761 = tmp2_222760 * tmp2_222760;
            float tmp3_222762 = tmp2_222760 * x_222761;
            float w_j_222763 = defunc_0_f_res_222751 * tmp3_222762;
            float xw_j_222764 = defunc_0_f_res_222755 * w_j_222763;
            float x2w_j_222765 = defunc_0_f_res_222755 * xw_j_222764;
            float defunc_1_op_res_222766 = w_j_222763 + redout_222744;
            float defunc_1_op_res_222767 = xw_j_222764 + redout_222745;
            float defunc_1_op_res_222768 = x2w_j_222765 + redout_222746;
            float redout_tmp_222805 = defunc_1_op_res_222766;
            float redout_tmp_222806 = defunc_1_op_res_222767;
            float redout_tmp_222807 = defunc_1_op_res_222768;
            
            redout_222744 = redout_tmp_222805;
            redout_222745 = redout_tmp_222806;
            redout_222746 = redout_tmp_222807;
        }
        defunc_2_reduce_res_222666 = redout_222744;
        defunc_2_reduce_res_222667 = redout_222745;
        defunc_2_reduce_res_222668 = redout_222746;
        
        float x_222695 = defunc_2_reduce_res_222666 *
              defunc_2_reduce_res_222668;
        float y_222696 = defunc_2_reduce_res_222667 *
              defunc_2_reduce_res_222667;
        float y_222697 = x_222695 - y_222696;
        float det1_222698 = 1.0F / y_222697;
        float a11_222699 = defunc_2_reduce_res_222668 * det1_222698;
        float x_222700 = 0.0F - defunc_2_reduce_res_222667;
        float b11_222701 = det1_222698 * x_222700;
        float c11_222702 = defunc_2_reduce_res_222666 * det1_222698;
        float defunc_2_reduce_res_222703;
        float defunc_2_reduce_res_222704;
        float redout_222770;
        float redout_222771;
        
        redout_222770 = 0.0F;
        redout_222771 = 0.0F;
        for (int64_t i_222769 = 0; i_222769 < q_l_196697; i_222769++) {
            bool cond_222772 = sle64(n_196692, i_222769);
            int64_t defunc_0_f_res_222773;
            
            if (cond_222772) {
                defunc_0_f_res_222773 = (int64_t) 0;
            } else {
                int64_t i_222774 = add64(x_222661, i_222769);
                int64_t defunc_1_add_res_222775 = add64((int64_t) 1, i_222774);
                
                defunc_0_f_res_222773 = defunc_1_add_res_222775;
            }
            
            float defunc_0_f_res_222776;
            
            if (cond_222772) {
                defunc_0_f_res_222776 = 0.0F;
            } else {
                int64_t i_222777 = add64(x_222661, i_222769);
                float defunc_0_add_arg_222778;
                
                defunc_0_add_arg_222778 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_205403 *
                                                      ctx_param_ext_210921 +
                                                      i_222777 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_222776 = defunc_0_add_arg_222778;
            }
            
            int64_t binop_p_222779 = sub64(defunc_0_f_res_222773,
                                           defunc_0_g_res_222665);
            float defunc_0_f_res_222780 = sitofp_i64_f32(binop_p_222779);
            float abs_res_222781 = (float) fabs(defunc_0_f_res_222780);
            float tmp1_222782 = abs_res_222781 / x_222662;
            float x_222783 = tmp1_222782 * tmp1_222782;
            float y_222784 = tmp1_222782 * x_222783;
            float tmp2_222785 = 1.0F - y_222784;
            float x_222786 = tmp2_222785 * tmp2_222785;
            float tmp3_222787 = tmp2_222785 * x_222786;
            float tmp4_222788 = defunc_0_f_res_222776 * tmp3_222787;
            float defunc_1_f_res_222789 = defunc_0_f_res_222780 * tmp4_222788;
            float defunc_0_f_res_222790;
            
            if (cond_222772) {
                defunc_0_f_res_222790 = 0.0F;
            } else {
                int64_t i_222791 = add64(x_222661, i_222769);
                float defunc_0_add_arg_222792;
                
                defunc_0_add_arg_222792 =
                    ((float *) mem_212347.mem)[gtid_205403 * n_196692 +
                                               i_222791];
                defunc_0_f_res_222790 = defunc_0_add_arg_222792;
            }
            
            float x_222793 = a11_222699 * tmp4_222788;
            float y_222794 = b11_222701 * defunc_1_f_res_222789;
            float x_222795 = x_222793 + y_222794;
            float defunc_9_fit_fun_res_222796 = defunc_0_f_res_222790 *
                  x_222795;
            float x_222797 = b11_222701 * tmp4_222788;
            float y_222798 = c11_222702 * defunc_1_f_res_222789;
            float x_222799 = x_222797 + y_222798;
            float defunc_9_slope_fun_res_222800 = defunc_0_f_res_222790 *
                  x_222799;
            float defunc_1_op_res_222801 = defunc_9_fit_fun_res_222796 +
                  redout_222770;
            float defunc_1_op_res_222802 = defunc_9_slope_fun_res_222800 +
                  redout_222771;
            float redout_tmp_222808 = defunc_1_op_res_222801;
            float redout_tmp_222809 = defunc_1_op_res_222802;
            
            redout_222770 = redout_tmp_222808;
            redout_222771 = redout_tmp_222809;
        }
        defunc_2_reduce_res_222703 = redout_222770;
        defunc_2_reduce_res_222704 = redout_222771;
        ((float *) mem_212376.mem)[gtid_222660] = defunc_2_reduce_res_222703;
        ((float *) mem_212379.mem)[gtid_222660] = defunc_2_reduce_res_222704;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229000_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229000_end -
                 futhark_mc_segmap_parloop_229000_start;
        
        ctx->futhark_mc_segmap_parloop_229000_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229000_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229000_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_228998(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222659 = tid;
    int num_tasks_222741 = info.nsubtasks;
    struct futhark_mc_task_228997 *futhark_mc_task_228997 =
                                  (struct futhark_mc_task_228997 *) args;
    struct futhark_context *ctx = futhark_mc_task_228997->ctx;
    uint64_t futhark_mc_segmap_task_228998_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_228998_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228997->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228997->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228997->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228997->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228997->free_i_196779;
    int64_t gtid_205403 = futhark_mc_task_228997->free_gtid_205403;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228997->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228997->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228997->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228997->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228997->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228997->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228997->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212376 = {.desc ="mem_212376", .mem =
                                  futhark_mc_task_228997->free_mem_212376,
                                  .size =0, .references =NULL};
    struct memblock mem_212379 = {.desc ="mem_212379", .mem =
                                  futhark_mc_task_228997->free_mem_212379,
                                  .size =0, .references =NULL};
    int64_t iter_222742;
    struct futhark_mc_segmap_parloop_struct_228999
    futhark_mc_segmap_parloop_struct_228999;
    
    futhark_mc_segmap_parloop_struct_228999.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228999.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228999.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228999.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228999.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228999.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228999.free_gtid_205403 = gtid_205403;
    futhark_mc_segmap_parloop_struct_228999.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228999.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228999.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228999.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228999.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228999.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228999.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228999.free_mem_212376 = mem_212376.mem;
    futhark_mc_segmap_parloop_struct_228999.free_mem_212379 = mem_212379.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229000_task;
    
    futhark_mc_segmap_parloop_229000_task.name =
        "futhark_mc_segmap_parloop_229000";
    futhark_mc_segmap_parloop_229000_task.fn = futhark_mc_segmap_parloop_229000;
    futhark_mc_segmap_parloop_229000_task.args =
        &futhark_mc_segmap_parloop_struct_228999;
    futhark_mc_segmap_parloop_229000_task.iterations = iterations;
    futhark_mc_segmap_parloop_229000_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229000_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229000_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229000_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229000_task);
    
    if (futhark_mc_segmap_parloop_229000_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229000_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229000_total_end -
                 futhark_mc_segmap_parloop_229000_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229000_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229000_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229000_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_228998_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_228998_end -
                 futhark_mc_segmap_task_228998_start;
        
        ctx->futhark_mc_segmap_task_228998_runs[tid]++;
        ctx->futhark_mc_segmap_task_228998_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_228998_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229002 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205403;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212376;
    unsigned char *free_mem_212379;
};
struct futhark_mc_task_229004 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205403;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_222574;
    float free_x_222575;
    int64_t free_defunc_0_g_res_222578;
    float *retval_defunc_2_reduce_res_222579;
    float *retval_defunc_2_reduce_res_222580;
    float *retval_defunc_2_reduce_res_222581;
};
struct futhark_mc_segred_stage_1_parloop_struct_229009 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205403;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_222574;
    float free_x_222575;
    int64_t free_defunc_0_g_res_222578;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222881;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222883;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222885;
};
static int futhark_mc_segred_stage_1_parloop_229010(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_222811,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229009
    *futhark_mc_segred_stage_1_parloop_struct_229009 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229009 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229009->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229010_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229010_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_n_196692;
    int64_t gtid_205403 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_gtid_205403;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_229009->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_222574 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_x_222574;
    float x_222575 =
          futhark_mc_segred_stage_1_parloop_struct_229009->free_x_222575;
    int64_t defunc_0_g_res_222578 =
            futhark_mc_segred_stage_1_parloop_struct_229009->free_defunc_0_g_res_222578;
    struct memblock reduce_stage_1_tid_res_arr_mem_222881 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222881",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229009->free_reduce_stage_1_tid_res_arr_mem_222881,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_222883 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222883",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229009->free_reduce_stage_1_tid_res_arr_mem_222883,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_222885 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222885",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229009->free_reduce_stage_1_tid_res_arr_mem_222885,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222887 = start;
    float x_222813;
    float x_222814;
    float x_222816;
    float x_222817;
    float x_222819;
    float x_222820;
    float local_acc_222888 = 0.0F;
    float local_acc_222889 = 0.0F;
    float local_acc_222890 = 0.0F;
    
    for (; iter_222887 < end; iter_222887++) {
        int64_t gtid_222812 = iter_222887;
        bool cond_222822 = sle64(n_196692, gtid_222812);
        int64_t defunc_0_f_res_222823;
        
        if (cond_222822) {
            defunc_0_f_res_222823 = (int64_t) 0;
        } else {
            int64_t i_222824 = add64(x_222574, gtid_222812);
            int64_t defunc_1_add_res_222825 = add64((int64_t) 1, i_222824);
            
            defunc_0_f_res_222823 = defunc_1_add_res_222825;
        }
        
        float defunc_0_f_res_222826;
        
        if (cond_222822) {
            defunc_0_f_res_222826 = 0.0F;
        } else {
            int64_t i_222827 = add64(x_222574, gtid_222812);
            float defunc_0_add_arg_222828;
            
            defunc_0_add_arg_222828 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_205403 *
                                                  ctx_param_ext_210921 +
                                                  i_222827 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_222826 = defunc_0_add_arg_222828;
        }
        
        int64_t binop_p_222829 = sub64(defunc_0_f_res_222823,
                                       defunc_0_g_res_222578);
        float defunc_0_f_res_222830 = sitofp_i64_f32(binop_p_222829);
        float abs_res_222831 = (float) fabs(defunc_0_f_res_222830);
        float tmp1_222832 = abs_res_222831 / x_222575;
        float x_222833 = tmp1_222832 * tmp1_222832;
        float y_222834 = tmp1_222832 * x_222833;
        float tmp2_222835 = 1.0F - y_222834;
        float x_222836 = tmp2_222835 * tmp2_222835;
        float tmp3_222837 = tmp2_222835 * x_222836;
        float w_j_222838 = defunc_0_f_res_222826 * tmp3_222837;
        float xw_j_222839 = defunc_0_f_res_222830 * w_j_222838;
        float x2w_j_222840 = defunc_0_f_res_222830 * xw_j_222839;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_222813 = local_acc_222888;
        }
        // Load next params
        {
            x_222814 = w_j_222838;
        }
        // Red body
        {
            float defunc_1_op_res_222815 = x_222813 + x_222814;
            
            local_acc_222888 = defunc_1_op_res_222815;
        }
        // Load accum params
        {
            x_222816 = local_acc_222889;
        }
        // Load next params
        {
            x_222817 = xw_j_222839;
        }
        // Red body
        {
            float defunc_1_op_res_222818 = x_222816 + x_222817;
            
            local_acc_222889 = defunc_1_op_res_222818;
        }
        // Load accum params
        {
            x_222819 = local_acc_222890;
        }
        // Load next params
        {
            x_222820 = x2w_j_222840;
        }
        // Red body
        {
            float defunc_1_op_res_222821 = x_222819 + x_222820;
            
            local_acc_222890 = defunc_1_op_res_222821;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_222881.mem)[flat_tid_222811] =
        local_acc_222888;
    ((float *) reduce_stage_1_tid_res_arr_mem_222883.mem)[flat_tid_222811] =
        local_acc_222889;
    ((float *) reduce_stage_1_tid_res_arr_mem_222885.mem)[flat_tid_222811] =
        local_acc_222890;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229010_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229010_end -
                 futhark_mc_segred_stage_1_parloop_229010_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229010_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229010_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229010_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229005(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222811 = tid;
    int num_tasks_222880 = info.nsubtasks;
    struct futhark_mc_task_229004 *futhark_mc_task_229004 =
                                  (struct futhark_mc_task_229004 *) args;
    struct futhark_context *ctx = futhark_mc_task_229004->ctx;
    uint64_t futhark_mc_segred_task_229005_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229005_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229004->free_n_196692;
    int64_t gtid_205403 = futhark_mc_task_229004->free_gtid_205403;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229004->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229004->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229004->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229004->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_222574 = futhark_mc_task_229004->free_x_222574;
    float x_222575 = futhark_mc_task_229004->free_x_222575;
    int64_t defunc_0_g_res_222578 =
            futhark_mc_task_229004->free_defunc_0_g_res_222578;
    float defunc_2_reduce_res_222579 =
          *futhark_mc_task_229004->retval_defunc_2_reduce_res_222579;
    float defunc_2_reduce_res_222580 =
          *futhark_mc_task_229004->retval_defunc_2_reduce_res_222580;
    float defunc_2_reduce_res_222581 =
          *futhark_mc_task_229004->retval_defunc_2_reduce_res_222581;
    size_t reduce_stage_1_tid_res_arr_mem_222881_cached_sizze_229006 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222881 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_222883_cached_sizze_229007 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222883 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_222885_cached_sizze_229008 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222885 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_222881_cached_sizze_229006 <
        (size_t) ((int64_t) 4 * num_tasks_222880)) {
        reduce_stage_1_tid_res_arr_mem_222881 =
            realloc(reduce_stage_1_tid_res_arr_mem_222881, (int64_t) 4 *
                    num_tasks_222880);
        reduce_stage_1_tid_res_arr_mem_222881_cached_sizze_229006 =
            (int64_t) 4 * num_tasks_222880;
    }
    if (reduce_stage_1_tid_res_arr_mem_222883_cached_sizze_229007 <
        (size_t) ((int64_t) 4 * num_tasks_222880)) {
        reduce_stage_1_tid_res_arr_mem_222883 =
            realloc(reduce_stage_1_tid_res_arr_mem_222883, (int64_t) 4 *
                    num_tasks_222880);
        reduce_stage_1_tid_res_arr_mem_222883_cached_sizze_229007 =
            (int64_t) 4 * num_tasks_222880;
    }
    if (reduce_stage_1_tid_res_arr_mem_222885_cached_sizze_229008 <
        (size_t) ((int64_t) 4 * num_tasks_222880)) {
        reduce_stage_1_tid_res_arr_mem_222885 =
            realloc(reduce_stage_1_tid_res_arr_mem_222885, (int64_t) 4 *
                    num_tasks_222880);
        reduce_stage_1_tid_res_arr_mem_222885_cached_sizze_229008 =
            (int64_t) 4 * num_tasks_222880;
    }
    
    int64_t iter_222887;
    struct futhark_mc_segred_stage_1_parloop_struct_229009
    futhark_mc_segred_stage_1_parloop_struct_229009;
    
    futhark_mc_segred_stage_1_parloop_struct_229009.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_gtid_205403 =
        gtid_205403;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_x_222574 = x_222574;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_x_222575 = x_222575;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_defunc_0_g_res_222578 =
        defunc_0_g_res_222578;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_reduce_stage_1_tid_res_arr_mem_222881 =
        reduce_stage_1_tid_res_arr_mem_222881;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_reduce_stage_1_tid_res_arr_mem_222883 =
        reduce_stage_1_tid_res_arr_mem_222883;
    futhark_mc_segred_stage_1_parloop_struct_229009.free_reduce_stage_1_tid_res_arr_mem_222885 =
        reduce_stage_1_tid_res_arr_mem_222885;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229010_task;
    
    futhark_mc_segred_stage_1_parloop_229010_task.name =
        "futhark_mc_segred_stage_1_parloop_229010";
    futhark_mc_segred_stage_1_parloop_229010_task.fn =
        futhark_mc_segred_stage_1_parloop_229010;
    futhark_mc_segred_stage_1_parloop_229010_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229009;
    futhark_mc_segred_stage_1_parloop_229010_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229010_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229010_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229010_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229010_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229010_task);
    
    if (futhark_mc_segred_stage_1_parloop_229010_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229010_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229010_total_end -
                 futhark_mc_segred_stage_1_parloop_229010_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229010_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229010_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229010_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_222579 = 0.0F;
        defunc_2_reduce_res_222580 = 0.0F;
        defunc_2_reduce_res_222581 = 0.0F;
    }
    
    float x_222891;
    float x_222892;
    float x_222894;
    float x_222895;
    float x_222897;
    float x_222898;
    
    for (int32_t i_222900 = 0; i_222900 < num_tasks_222880; i_222900++) {
        flat_tid_222811 = i_222900;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_222891 = defunc_2_reduce_res_222579;
            }
            // load next params
            {
                x_222892 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222881)[flat_tid_222811];
            }
            // red body
            {
                float defunc_1_op_res_222893 = x_222891 + x_222892;
                
                defunc_2_reduce_res_222579 = defunc_1_op_res_222893;
            }
            // load acc params
            {
                x_222894 = defunc_2_reduce_res_222580;
            }
            // load next params
            {
                x_222895 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222883)[flat_tid_222811];
            }
            // red body
            {
                float defunc_1_op_res_222896 = x_222894 + x_222895;
                
                defunc_2_reduce_res_222580 = defunc_1_op_res_222896;
            }
            // load acc params
            {
                x_222897 = defunc_2_reduce_res_222581;
            }
            // load next params
            {
                x_222898 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222885)[flat_tid_222811];
            }
            // red body
            {
                float defunc_1_op_res_222899 = x_222897 + x_222898;
                
                defunc_2_reduce_res_222581 = defunc_1_op_res_222899;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_222881);
        free(reduce_stage_1_tid_res_arr_mem_222883);
        free(reduce_stage_1_tid_res_arr_mem_222885);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229005_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229005_end -
                 futhark_mc_segred_task_229005_start;
        
        ctx->futhark_mc_segred_task_229005_runs[tid]++;
        ctx->futhark_mc_segred_task_229005_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229005_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229004->retval_defunc_2_reduce_res_222579 =
            defunc_2_reduce_res_222579;
        *futhark_mc_task_229004->retval_defunc_2_reduce_res_222580 =
            defunc_2_reduce_res_222580;
        *futhark_mc_task_229004->retval_defunc_2_reduce_res_222581 =
            defunc_2_reduce_res_222581;
    }
    return err;
}
struct futhark_mc_task_229011 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205403;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_x_222574;
    float free_x_222575;
    int64_t free_defunc_0_g_res_222578;
    float free_a11_222616;
    float free_b11_222618;
    float free_c11_222619;
    float *retval_defunc_2_reduce_res_222620;
    float *retval_defunc_2_reduce_res_222621;
};
struct futhark_mc_segred_stage_1_parloop_struct_229015 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205403;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_x_222574;
    float free_x_222575;
    int64_t free_defunc_0_g_res_222578;
    float free_a11_222616;
    float free_b11_222618;
    float free_c11_222619;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222902;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_222904;
};
static int futhark_mc_segred_stage_1_parloop_229016(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_222841,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229015
    *futhark_mc_segred_stage_1_parloop_struct_229015 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229015 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229015->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229016_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229016_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_n_196692;
    int64_t gtid_205403 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_gtid_205403;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_229015->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229015->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_222574 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_x_222574;
    float x_222575 =
          futhark_mc_segred_stage_1_parloop_struct_229015->free_x_222575;
    int64_t defunc_0_g_res_222578 =
            futhark_mc_segred_stage_1_parloop_struct_229015->free_defunc_0_g_res_222578;
    float a11_222616 =
          futhark_mc_segred_stage_1_parloop_struct_229015->free_a11_222616;
    float b11_222618 =
          futhark_mc_segred_stage_1_parloop_struct_229015->free_b11_222618;
    float c11_222619 =
          futhark_mc_segred_stage_1_parloop_struct_229015->free_c11_222619;
    struct memblock reduce_stage_1_tid_res_arr_mem_222902 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222902",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229015->free_reduce_stage_1_tid_res_arr_mem_222902,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_222904 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_222904",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229015->free_reduce_stage_1_tid_res_arr_mem_222904,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222906 = start;
    float x_222843;
    float x_222844;
    float x_222846;
    float x_222847;
    float local_acc_222907 = 0.0F;
    float local_acc_222908 = 0.0F;
    
    for (; iter_222906 < end; iter_222906++) {
        int64_t gtid_222842 = iter_222906;
        bool cond_222849 = sle64(n_196692, gtid_222842);
        int64_t defunc_0_f_res_222850;
        
        if (cond_222849) {
            defunc_0_f_res_222850 = (int64_t) 0;
        } else {
            int64_t i_222851 = add64(x_222574, gtid_222842);
            int64_t defunc_1_add_res_222852 = add64((int64_t) 1, i_222851);
            
            defunc_0_f_res_222850 = defunc_1_add_res_222852;
        }
        
        float defunc_0_f_res_222853;
        
        if (cond_222849) {
            defunc_0_f_res_222853 = 0.0F;
        } else {
            int64_t i_222854 = add64(x_222574, gtid_222842);
            float defunc_0_add_arg_222855;
            
            defunc_0_add_arg_222855 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_205403 *
                                                  ctx_param_ext_210921 +
                                                  i_222854 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_222853 = defunc_0_add_arg_222855;
        }
        
        int64_t binop_p_222856 = sub64(defunc_0_f_res_222850,
                                       defunc_0_g_res_222578);
        float defunc_0_f_res_222857 = sitofp_i64_f32(binop_p_222856);
        float abs_res_222858 = (float) fabs(defunc_0_f_res_222857);
        float tmp1_222859 = abs_res_222858 / x_222575;
        float x_222860 = tmp1_222859 * tmp1_222859;
        float y_222861 = tmp1_222859 * x_222860;
        float tmp2_222862 = 1.0F - y_222861;
        float x_222863 = tmp2_222862 * tmp2_222862;
        float tmp3_222864 = tmp2_222862 * x_222863;
        float tmp4_222865 = defunc_0_f_res_222853 * tmp3_222864;
        float defunc_1_f_res_222866 = defunc_0_f_res_222857 * tmp4_222865;
        float defunc_0_f_res_222867;
        
        if (cond_222849) {
            defunc_0_f_res_222867 = 0.0F;
        } else {
            int64_t i_222868 = add64(x_222574, gtid_222842);
            float defunc_0_add_arg_222869;
            
            defunc_0_add_arg_222869 = ((float *) mem_212347.mem)[gtid_205403 *
                                                                 n_196692 +
                                                                 i_222868];
            defunc_0_f_res_222867 = defunc_0_add_arg_222869;
        }
        
        float x_222870 = a11_222616 * tmp4_222865;
        float y_222871 = b11_222618 * defunc_1_f_res_222866;
        float x_222872 = x_222870 + y_222871;
        float defunc_9_fit_fun_res_222873 = defunc_0_f_res_222867 * x_222872;
        float x_222874 = b11_222618 * tmp4_222865;
        float y_222875 = c11_222619 * defunc_1_f_res_222866;
        float x_222876 = x_222874 + y_222875;
        float defunc_9_slope_fun_res_222877 = defunc_0_f_res_222867 * x_222876;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_222843 = local_acc_222907;
        }
        // Load next params
        {
            x_222844 = defunc_9_fit_fun_res_222873;
        }
        // Red body
        {
            float defunc_1_op_res_222845 = x_222843 + x_222844;
            
            local_acc_222907 = defunc_1_op_res_222845;
        }
        // Load accum params
        {
            x_222846 = local_acc_222908;
        }
        // Load next params
        {
            x_222847 = defunc_9_slope_fun_res_222877;
        }
        // Red body
        {
            float defunc_1_op_res_222848 = x_222846 + x_222847;
            
            local_acc_222908 = defunc_1_op_res_222848;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_222902.mem)[flat_tid_222841] =
        local_acc_222907;
    ((float *) reduce_stage_1_tid_res_arr_mem_222904.mem)[flat_tid_222841] =
        local_acc_222908;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229016_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229016_end -
                 futhark_mc_segred_stage_1_parloop_229016_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229016_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229016_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229016_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229012(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222841 = tid;
    int num_tasks_222901 = info.nsubtasks;
    struct futhark_mc_task_229011 *futhark_mc_task_229011 =
                                  (struct futhark_mc_task_229011 *) args;
    struct futhark_context *ctx = futhark_mc_task_229011->ctx;
    uint64_t futhark_mc_segred_task_229012_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229012_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229011->free_n_196692;
    int64_t gtid_205403 = futhark_mc_task_229011->free_gtid_205403;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229011->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229011->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229011->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229011->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229011->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_222574 = futhark_mc_task_229011->free_x_222574;
    float x_222575 = futhark_mc_task_229011->free_x_222575;
    int64_t defunc_0_g_res_222578 =
            futhark_mc_task_229011->free_defunc_0_g_res_222578;
    float a11_222616 = futhark_mc_task_229011->free_a11_222616;
    float b11_222618 = futhark_mc_task_229011->free_b11_222618;
    float c11_222619 = futhark_mc_task_229011->free_c11_222619;
    float defunc_2_reduce_res_222620 =
          *futhark_mc_task_229011->retval_defunc_2_reduce_res_222620;
    float defunc_2_reduce_res_222621 =
          *futhark_mc_task_229011->retval_defunc_2_reduce_res_222621;
    size_t reduce_stage_1_tid_res_arr_mem_222902_cached_sizze_229013 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222902 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_222904_cached_sizze_229014 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_222904 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_222902_cached_sizze_229013 <
        (size_t) ((int64_t) 4 * num_tasks_222901)) {
        reduce_stage_1_tid_res_arr_mem_222902 =
            realloc(reduce_stage_1_tid_res_arr_mem_222902, (int64_t) 4 *
                    num_tasks_222901);
        reduce_stage_1_tid_res_arr_mem_222902_cached_sizze_229013 =
            (int64_t) 4 * num_tasks_222901;
    }
    if (reduce_stage_1_tid_res_arr_mem_222904_cached_sizze_229014 <
        (size_t) ((int64_t) 4 * num_tasks_222901)) {
        reduce_stage_1_tid_res_arr_mem_222904 =
            realloc(reduce_stage_1_tid_res_arr_mem_222904, (int64_t) 4 *
                    num_tasks_222901);
        reduce_stage_1_tid_res_arr_mem_222904_cached_sizze_229014 =
            (int64_t) 4 * num_tasks_222901;
    }
    
    int64_t iter_222906;
    struct futhark_mc_segred_stage_1_parloop_struct_229015
    futhark_mc_segred_stage_1_parloop_struct_229015;
    
    futhark_mc_segred_stage_1_parloop_struct_229015.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_gtid_205403 =
        gtid_205403;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_mem_212347 =
        mem_212347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_x_222574 = x_222574;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_x_222575 = x_222575;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_defunc_0_g_res_222578 =
        defunc_0_g_res_222578;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_a11_222616 =
        a11_222616;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_b11_222618 =
        b11_222618;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_c11_222619 =
        c11_222619;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_reduce_stage_1_tid_res_arr_mem_222902 =
        reduce_stage_1_tid_res_arr_mem_222902;
    futhark_mc_segred_stage_1_parloop_struct_229015.free_reduce_stage_1_tid_res_arr_mem_222904 =
        reduce_stage_1_tid_res_arr_mem_222904;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229016_task;
    
    futhark_mc_segred_stage_1_parloop_229016_task.name =
        "futhark_mc_segred_stage_1_parloop_229016";
    futhark_mc_segred_stage_1_parloop_229016_task.fn =
        futhark_mc_segred_stage_1_parloop_229016;
    futhark_mc_segred_stage_1_parloop_229016_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229015;
    futhark_mc_segred_stage_1_parloop_229016_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229016_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229016_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229016_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229016_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229016_task);
    
    if (futhark_mc_segred_stage_1_parloop_229016_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229016_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229016_total_end -
                 futhark_mc_segred_stage_1_parloop_229016_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229016_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229016_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229016_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_222620 = 0.0F;
        defunc_2_reduce_res_222621 = 0.0F;
    }
    
    float x_222909;
    float x_222910;
    float x_222912;
    float x_222913;
    
    for (int32_t i_222915 = 0; i_222915 < num_tasks_222901; i_222915++) {
        flat_tid_222841 = i_222915;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_222909 = defunc_2_reduce_res_222620;
            }
            // load next params
            {
                x_222910 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222902)[flat_tid_222841];
            }
            // red body
            {
                float defunc_1_op_res_222911 = x_222909 + x_222910;
                
                defunc_2_reduce_res_222620 = defunc_1_op_res_222911;
            }
            // load acc params
            {
                x_222912 = defunc_2_reduce_res_222621;
            }
            // load next params
            {
                x_222913 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_222904)[flat_tid_222841];
            }
            // red body
            {
                float defunc_1_op_res_222914 = x_222912 + x_222913;
                
                defunc_2_reduce_res_222621 = defunc_1_op_res_222914;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_222902);
        free(reduce_stage_1_tid_res_arr_mem_222904);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229012_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229012_end -
                 futhark_mc_segred_task_229012_start;
        
        ctx->futhark_mc_segred_task_229012_runs[tid]++;
        ctx->futhark_mc_segred_task_229012_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229012_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229011->retval_defunc_2_reduce_res_222620 =
            defunc_2_reduce_res_222620;
        *futhark_mc_task_229011->retval_defunc_2_reduce_res_222621 =
            defunc_2_reduce_res_222621;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229003(void *args, int64_t start,
                                            int64_t end, int flat_tid_222572,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229002
    *futhark_mc_segmap_parloop_struct_229002 =
    (struct futhark_mc_segmap_parloop_struct_229002 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229002->ctx;
    uint64_t futhark_mc_segmap_parloop_229003_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229003_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229002->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229002->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229002->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229002->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229002->free_i_196779;
    int64_t gtid_205403 =
            futhark_mc_segmap_parloop_struct_229002->free_gtid_205403;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229002->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229002->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229002->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229002->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229002->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229002->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229002->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212376 = {.desc ="mem_212376", .mem =
                                  futhark_mc_segmap_parloop_struct_229002->free_mem_212376,
                                  .size =0, .references =NULL};
    struct memblock mem_212379 = {.desc ="mem_212379", .mem =
                                  futhark_mc_segmap_parloop_struct_229002->free_mem_212379,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_222810 = start;
    
    for (; iter_222810 < end; iter_222810++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222878 = l_n_m_196752;
        int64_t gtid_222573 = iter_222810;
        int64_t remnant_222879 = iter_222810 - gtid_222573;
        int64_t x_222574;
        
        x_222574 = ((int64_t *) mem_210827.mem)[gtid_205403 * l_n_m_196752 +
                                                gtid_222573];
        
        float x_222575;
        
        x_222575 = ((float *) mem_210831.mem)[gtid_205403 * l_n_m_196752 +
                                              gtid_222573];
        
        int64_t min_arg_222576 = mul64(jump_t_196702, gtid_222573);
        int64_t min_res_222577 = smin64(i_196779, min_arg_222576);
        int64_t defunc_0_g_res_222578 = add64((int64_t) 1, min_res_222577);
        float defunc_2_reduce_res_222579;
        float defunc_2_reduce_res_222580;
        float defunc_2_reduce_res_222581;
        int64_t flat_tid_222811 = (int64_t) 0;
        int32_t num_tasks_222880;
        
        defunc_2_reduce_res_222579 = 0.0F;
        defunc_2_reduce_res_222580 = 0.0F;
        defunc_2_reduce_res_222581 = 0.0F;
        
        struct futhark_mc_task_229004 futhark_mc_task_229004;
        
        futhark_mc_task_229004.ctx = ctx;
        futhark_mc_task_229004.free_n_196692 = n_196692;
        futhark_mc_task_229004.free_gtid_205403 = gtid_205403;
        futhark_mc_task_229004.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229004.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229004.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229004.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229004.free_x_222574 = x_222574;
        futhark_mc_task_229004.free_x_222575 = x_222575;
        futhark_mc_task_229004.free_defunc_0_g_res_222578 =
            defunc_0_g_res_222578;
        futhark_mc_task_229004.retval_defunc_2_reduce_res_222579 =
            &defunc_2_reduce_res_222579;
        futhark_mc_task_229004.retval_defunc_2_reduce_res_222580 =
            &defunc_2_reduce_res_222580;
        futhark_mc_task_229004.retval_defunc_2_reduce_res_222581 =
            &defunc_2_reduce_res_222581;
        
        struct scheduler_segop futhark_mc_task_229004_task;
        
        futhark_mc_task_229004_task.args = &futhark_mc_task_229004;
        futhark_mc_task_229004_task.top_level_fn =
            futhark_mc_segred_task_229005;
        futhark_mc_task_229004_task.name = "futhark_mc_segred_task_229005";
        futhark_mc_task_229004_task.iterations = q_l_196697;
        futhark_mc_task_229004_task.task_time =
            &ctx->futhark_mc_segred_task_229005_total_time;
        futhark_mc_task_229004_task.task_iter =
            &ctx->futhark_mc_segred_task_229005_total_iter;
        futhark_mc_task_229004_task.sched = STATIC;
        futhark_mc_task_229004_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229005_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229004_task);
        
        if (futhark_mc_segred_task_229005_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_222612 = defunc_2_reduce_res_222579 *
              defunc_2_reduce_res_222581;
        float y_222613 = defunc_2_reduce_res_222580 *
              defunc_2_reduce_res_222580;
        float y_222614 = x_222612 - y_222613;
        float det1_222615 = 1.0F / y_222614;
        float a11_222616 = defunc_2_reduce_res_222581 * det1_222615;
        float x_222617 = 0.0F - defunc_2_reduce_res_222580;
        float b11_222618 = det1_222615 * x_222617;
        float c11_222619 = defunc_2_reduce_res_222579 * det1_222615;
        float defunc_2_reduce_res_222620;
        float defunc_2_reduce_res_222621;
        int64_t flat_tid_222841 = (int64_t) 0;
        int32_t num_tasks_222901;
        
        defunc_2_reduce_res_222620 = 0.0F;
        defunc_2_reduce_res_222621 = 0.0F;
        
        struct futhark_mc_task_229011 futhark_mc_task_229011;
        
        futhark_mc_task_229011.ctx = ctx;
        futhark_mc_task_229011.free_n_196692 = n_196692;
        futhark_mc_task_229011.free_gtid_205403 = gtid_205403;
        futhark_mc_task_229011.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229011.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229011.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229011.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229011.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229011.free_x_222574 = x_222574;
        futhark_mc_task_229011.free_x_222575 = x_222575;
        futhark_mc_task_229011.free_defunc_0_g_res_222578 =
            defunc_0_g_res_222578;
        futhark_mc_task_229011.free_a11_222616 = a11_222616;
        futhark_mc_task_229011.free_b11_222618 = b11_222618;
        futhark_mc_task_229011.free_c11_222619 = c11_222619;
        futhark_mc_task_229011.retval_defunc_2_reduce_res_222620 =
            &defunc_2_reduce_res_222620;
        futhark_mc_task_229011.retval_defunc_2_reduce_res_222621 =
            &defunc_2_reduce_res_222621;
        
        struct scheduler_segop futhark_mc_task_229011_task;
        
        futhark_mc_task_229011_task.args = &futhark_mc_task_229011;
        futhark_mc_task_229011_task.top_level_fn =
            futhark_mc_segred_task_229012;
        futhark_mc_task_229011_task.name = "futhark_mc_segred_task_229012";
        futhark_mc_task_229011_task.iterations = q_l_196697;
        futhark_mc_task_229011_task.task_time =
            &ctx->futhark_mc_segred_task_229012_total_time;
        futhark_mc_task_229011_task.task_iter =
            &ctx->futhark_mc_segred_task_229012_total_iter;
        futhark_mc_task_229011_task.sched = STATIC;
        futhark_mc_task_229011_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229012_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229011_task);
        
        if (futhark_mc_segred_task_229012_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212376.mem)[gtid_222573] = defunc_2_reduce_res_222620;
        ((float *) mem_212379.mem)[gtid_222573] = defunc_2_reduce_res_222621;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229003_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229003_end -
                 futhark_mc_segmap_parloop_229003_start;
        
        ctx->futhark_mc_segmap_parloop_229003_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229003_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229003_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229001(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_222572 = tid;
    int num_tasks_222741 = info.nsubtasks;
    struct futhark_mc_task_228997 *futhark_mc_task_228997 =
                                  (struct futhark_mc_task_228997 *) args;
    struct futhark_context *ctx = futhark_mc_task_228997->ctx;
    uint64_t futhark_mc_segmap_nested_task_229001_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229001_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_228997->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228997->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228997->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228997->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228997->free_i_196779;
    int64_t gtid_205403 = futhark_mc_task_228997->free_gtid_205403;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228997->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228997->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228997->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228997->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228997->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228997->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228997->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212376 = {.desc ="mem_212376", .mem =
                                  futhark_mc_task_228997->free_mem_212376,
                                  .size =0, .references =NULL};
    struct memblock mem_212379 = {.desc ="mem_212379", .mem =
                                  futhark_mc_task_228997->free_mem_212379,
                                  .size =0, .references =NULL};
    int64_t iter_222810;
    struct futhark_mc_segmap_parloop_struct_229002
    futhark_mc_segmap_parloop_struct_229002;
    
    futhark_mc_segmap_parloop_struct_229002.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229002.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229002.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229002.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229002.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229002.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229002.free_gtid_205403 = gtid_205403;
    futhark_mc_segmap_parloop_struct_229002.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229002.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229002.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229002.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229002.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229002.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229002.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229002.free_mem_212376 = mem_212376.mem;
    futhark_mc_segmap_parloop_struct_229002.free_mem_212379 = mem_212379.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229003_task;
    
    futhark_mc_segmap_parloop_229003_task.name =
        "futhark_mc_segmap_parloop_229003";
    futhark_mc_segmap_parloop_229003_task.fn = futhark_mc_segmap_parloop_229003;
    futhark_mc_segmap_parloop_229003_task.args =
        &futhark_mc_segmap_parloop_struct_229002;
    futhark_mc_segmap_parloop_229003_task.iterations = iterations;
    futhark_mc_segmap_parloop_229003_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229003_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229003_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229003_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229003_task);
    
    if (futhark_mc_segmap_parloop_229003_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229003_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229003_total_end -
                 futhark_mc_segmap_parloop_229003_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229003_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229003_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229003_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229001_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229001_end -
                 futhark_mc_segmap_nested_task_229001_start;
        
        ctx->futhark_mc_segmap_nested_task_229001_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229001_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229001_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_228994(void *args, int64_t start,
                                            int64_t end, int flat_tid_205402,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_228993
    *futhark_mc_segmap_parloop_struct_228993 =
    (struct futhark_mc_segmap_parloop_struct_228993 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_228993->ctx;
    uint64_t futhark_mc_segmap_parloop_228994_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228994_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_228993->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_228993->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_228993->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_228993->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_228993->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_228993->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_228993->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_228993->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_228993->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_228993->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_228993->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_228993->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_228993->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_228993->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212413 = {.desc ="mem_212413", .mem =
                                  futhark_mc_segmap_parloop_struct_228993->free_mem_212413,
                                  .size =0, .references =NULL};
    struct memblock mem_212417 = {.desc ="mem_212417", .mem =
                                  futhark_mc_segmap_parloop_struct_228993->free_mem_212417,
                                  .size =0, .references =NULL};
    size_t mem_212376_cached_sizze_228995 = 0;
    unsigned char *mem_212376 = NULL;
    size_t mem_212379_cached_sizze_228996 = 0;
    unsigned char *mem_212379 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222571 = start;
    
    if (mem_212376_cached_sizze_228995 < (size_t) bytes_210774) {
        mem_212376 = realloc(mem_212376, bytes_210774);
        mem_212376_cached_sizze_228995 = bytes_210774;
    }
    if (mem_212379_cached_sizze_228996 < (size_t) bytes_210774) {
        mem_212379 = realloc(mem_212379, bytes_210774);
        mem_212379_cached_sizze_228996 = bytes_210774;
    }
    for (; iter_222571 < end; iter_222571++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_222739 = m_196691;
        int64_t gtid_205403 = iter_222571;
        int64_t remnant_222740 = iter_222571 - gtid_205403;
        int64_t flat_tid_222659 = (int64_t) 0;
        int32_t num_tasks_222741;
        int64_t flat_tid_222572 = (int64_t) 0;
        struct futhark_mc_task_228997 futhark_mc_task_228997;
        
        futhark_mc_task_228997.ctx = ctx;
        futhark_mc_task_228997.free_n_196692 = n_196692;
        futhark_mc_task_228997.free_q_l_196697 = q_l_196697;
        futhark_mc_task_228997.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_228997.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_228997.free_i_196779 = i_196779;
        futhark_mc_task_228997.free_gtid_205403 = gtid_205403;
        futhark_mc_task_228997.free_mem_210827 = mem_210827.mem;
        futhark_mc_task_228997.free_mem_210831 = mem_210831.mem;
        futhark_mc_task_228997.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_228997.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_228997.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_228997.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_228997.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_228997.free_mem_212376 = mem_212376;
        futhark_mc_task_228997.free_mem_212379 = mem_212379;
        
        struct scheduler_segop futhark_mc_task_228997_task;
        
        futhark_mc_task_228997_task.args = &futhark_mc_task_228997;
        futhark_mc_task_228997_task.top_level_fn =
            futhark_mc_segmap_task_228998;
        futhark_mc_task_228997_task.name = "futhark_mc_segmap_task_228998";
        futhark_mc_task_228997_task.iterations = l_n_m_196752;
        futhark_mc_task_228997_task.task_time =
            &ctx->futhark_mc_segmap_task_228998_total_time;
        futhark_mc_task_228997_task.task_iter =
            &ctx->futhark_mc_segmap_task_228998_total_iter;
        futhark_mc_task_228997_task.sched = STATIC;
        futhark_mc_task_228997_task.nested_fn =
            futhark_mc_segmap_nested_task_229001;
        
        int futhark_mc_segmap_task_228998_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_228997_task);
        
        if (futhark_mc_segmap_task_228998_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212413.mem + gtid_205403 * l_n_m_196752 * (int64_t) 4,
                    mem_212376 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212417.mem + gtid_205403 * l_n_m_196752 * (int64_t) 4,
                    mem_212379 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212376);
    free(mem_212379);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228994_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228994_end -
                 futhark_mc_segmap_parloop_228994_start;
        
        ctx->futhark_mc_segmap_parloop_228994_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_228994_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_228994_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_228992(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205402 = tid;
    int num_tasks_222477 = info.nsubtasks;
    struct futhark_mc_task_228986 *futhark_mc_task_228986 =
                                  (struct futhark_mc_task_228986 *) args;
    struct futhark_context *ctx = futhark_mc_task_228986->ctx;
    uint64_t futhark_mc_segmap_nested_task_228992_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_228992_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_228986->free_m_196691;
    int64_t n_196692 = futhark_mc_task_228986->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_228986->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_228986->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_228986->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_228986->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_228986->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_228986->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_228986->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_228986->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_228986->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_228986->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_228986->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_228986->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212413 = {.desc ="mem_212413", .mem =
                                  futhark_mc_task_228986->free_mem_212413,
                                  .size =0, .references =NULL};
    struct memblock mem_212417 = {.desc ="mem_212417", .mem =
                                  futhark_mc_task_228986->free_mem_212417,
                                  .size =0, .references =NULL};
    int64_t iter_222571;
    struct futhark_mc_segmap_parloop_struct_228993
    futhark_mc_segmap_parloop_struct_228993;
    
    futhark_mc_segmap_parloop_struct_228993.ctx = ctx;
    futhark_mc_segmap_parloop_struct_228993.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_228993.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_228993.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_228993.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_228993.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_228993.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_228993.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_228993.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_228993.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_228993.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_228993.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_228993.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_228993.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_228993.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_228993.free_mem_212413 = mem_212413.mem;
    futhark_mc_segmap_parloop_struct_228993.free_mem_212417 = mem_212417.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_228994_task;
    
    futhark_mc_segmap_parloop_228994_task.name =
        "futhark_mc_segmap_parloop_228994";
    futhark_mc_segmap_parloop_228994_task.fn = futhark_mc_segmap_parloop_228994;
    futhark_mc_segmap_parloop_228994_task.args =
        &futhark_mc_segmap_parloop_struct_228993;
    futhark_mc_segmap_parloop_228994_task.iterations = iterations;
    futhark_mc_segmap_parloop_228994_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_228994_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_228994_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_228994_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_228994_task);
    
    if (futhark_mc_segmap_parloop_228994_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_228994_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_228994_total_end -
                 futhark_mc_segmap_parloop_228994_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228994_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228994_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_228994_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_228992_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_228992_end -
                 futhark_mc_segmap_nested_task_228992_start;
        
        ctx->futhark_mc_segmap_nested_task_228992_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_228992_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_228992_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229017 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212457;
    unsigned char *free_mem_212461;
};
struct futhark_mc_segmap_parloop_struct_229019 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212457;
    unsigned char *free_mem_212461;
};
static int futhark_mc_segmap_parloop_229020(void *args, int64_t start,
                                            int64_t end, int flat_tid_205586,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229019
    *futhark_mc_segmap_parloop_struct_229019 =
    (struct futhark_mc_segmap_parloop_struct_229019 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229019->ctx;
    uint64_t futhark_mc_segmap_parloop_229020_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229020_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229019->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229019->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229019->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229019->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229019->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229019->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229019->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229019->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229019->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229019->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229019->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229019->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229019->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229019->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212457 = {.desc ="mem_212457", .mem =
                                  futhark_mc_segmap_parloop_struct_229019->free_mem_212457,
                                  .size =0, .references =NULL};
    struct memblock mem_212461 = {.desc ="mem_212461", .mem =
                                  futhark_mc_segmap_parloop_struct_229019->free_mem_212461,
                                  .size =0, .references =NULL};
    size_t mem_212426_cached_sizze_229021 = 0;
    unsigned char *mem_212426 = NULL;
    size_t mem_212429_cached_sizze_229022 = 0;
    unsigned char *mem_212429 = NULL;
    int64_t iterations = end - start;
    int64_t iter_222917 = start;
    
    if (mem_212426_cached_sizze_229021 < (size_t) bytes_210774) {
        mem_212426 = realloc(mem_212426, bytes_210774);
        mem_212426_cached_sizze_229021 = bytes_210774;
    }
    if (mem_212429_cached_sizze_229022 < (size_t) bytes_210774) {
        mem_212429 = realloc(mem_212429, bytes_210774);
        mem_212429_cached_sizze_229022 = bytes_210774;
    }
    for (; iter_222917 < end; iter_222917++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223031 = m_196691;
        int64_t gtid_205587 = iter_222917;
        int64_t remnant_223032 = iter_222917 - gtid_205587;
        
        for (int64_t i_222918 = 0; i_222918 < l_n_m_196752; i_222918++) {
            int64_t x_222921;
            
            x_222921 = ((int64_t *) mem_210827.mem)[gtid_205587 * l_n_m_196752 +
                                                    i_222918];
            
            float x_222922;
            
            x_222922 = ((float *) mem_210831.mem)[gtid_205587 * l_n_m_196752 +
                                                  i_222918];
            
            int64_t min_arg_222923 = mul64(jump_t_196702, i_222918);
            int64_t min_res_222924 = smin64(i_196779, min_arg_222923);
            int64_t defunc_0_g_res_222925 = add64((int64_t) 1, min_res_222924);
            float defunc_2_reduce_res_222926;
            float defunc_2_reduce_res_222927;
            float defunc_2_reduce_res_222928;
            float defunc_2_reduce_res_222929;
            float defunc_2_reduce_res_222930;
            float redout_222932;
            float redout_222933;
            float redout_222934;
            float redout_222935;
            float redout_222936;
            
            redout_222932 = 0.0F;
            redout_222933 = 0.0F;
            redout_222934 = 0.0F;
            redout_222935 = 0.0F;
            redout_222936 = 0.0F;
            for (int64_t i_222931 = 0; i_222931 < q_l_196697; i_222931++) {
                bool cond_222937 = sle64(n_196692, i_222931);
                int64_t defunc_0_f_res_222938;
                
                if (cond_222937) {
                    defunc_0_f_res_222938 = (int64_t) 0;
                } else {
                    int64_t i_222939 = add64(x_222921, i_222931);
                    int64_t defunc_1_add_res_222940 = add64((int64_t) 1,
                                                            i_222939);
                    
                    defunc_0_f_res_222938 = defunc_1_add_res_222940;
                }
                
                float defunc_0_f_res_222941;
                
                if (cond_222937) {
                    defunc_0_f_res_222941 = 0.0F;
                } else {
                    int64_t i_222942 = add64(x_222921, i_222931);
                    float defunc_0_add_arg_222943;
                    
                    defunc_0_add_arg_222943 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205587 *
                                                          ctx_param_ext_210921 +
                                                          i_222942 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_222941 = defunc_0_add_arg_222943;
                }
                
                int64_t binop_p_222944 = sub64(defunc_0_f_res_222938,
                                               defunc_0_g_res_222925);
                float defunc_0_f_res_222945 = sitofp_i64_f32(binop_p_222944);
                float abs_res_222946 = (float) fabs(defunc_0_f_res_222945);
                float tmp1_222947 = abs_res_222946 / x_222922;
                float x_222948 = tmp1_222947 * tmp1_222947;
                float y_222949 = tmp1_222947 * x_222948;
                float tmp2_222950 = 1.0F - y_222949;
                float x_222951 = tmp2_222950 * tmp2_222950;
                float tmp3_222952 = tmp2_222950 * x_222951;
                float w_j_222953 = defunc_0_f_res_222941 * tmp3_222952;
                float xw_j_222954 = defunc_0_f_res_222945 * w_j_222953;
                float x2w_j_222955 = defunc_0_f_res_222945 * xw_j_222954;
                float x3w_j_222956 = defunc_0_f_res_222945 * x2w_j_222955;
                float x4w_j_222957 = defunc_0_f_res_222945 * x3w_j_222956;
                float defunc_1_op_res_222958 = w_j_222953 + redout_222932;
                float defunc_1_op_res_222959 = xw_j_222954 + redout_222933;
                float defunc_1_op_res_222960 = x2w_j_222955 + redout_222934;
                float defunc_1_op_res_222961 = x3w_j_222956 + redout_222935;
                float defunc_1_op_res_222962 = x4w_j_222957 + redout_222936;
                float redout_tmp_223035 = defunc_1_op_res_222958;
                float redout_tmp_223036 = defunc_1_op_res_222959;
                float redout_tmp_223037 = defunc_1_op_res_222960;
                float redout_tmp_223038 = defunc_1_op_res_222961;
                float redout_tmp_223039 = defunc_1_op_res_222962;
                
                redout_222932 = redout_tmp_223035;
                redout_222933 = redout_tmp_223036;
                redout_222934 = redout_tmp_223037;
                redout_222935 = redout_tmp_223038;
                redout_222936 = redout_tmp_223039;
            }
            defunc_2_reduce_res_222926 = redout_222932;
            defunc_2_reduce_res_222927 = redout_222933;
            defunc_2_reduce_res_222928 = redout_222934;
            defunc_2_reduce_res_222929 = redout_222935;
            defunc_2_reduce_res_222930 = redout_222936;
            
            float x_222963 = defunc_2_reduce_res_222928 *
                  defunc_2_reduce_res_222930;
            float y_222964 = defunc_2_reduce_res_222929 *
                  defunc_2_reduce_res_222929;
            float a12_222965 = x_222963 - y_222964;
            float x_222966 = defunc_2_reduce_res_222928 *
                  defunc_2_reduce_res_222929;
            float y_222967 = defunc_2_reduce_res_222927 *
                  defunc_2_reduce_res_222930;
            float b12_222968 = x_222966 - y_222967;
            float x_222969 = defunc_2_reduce_res_222927 *
                  defunc_2_reduce_res_222929;
            float y_222970 = defunc_2_reduce_res_222928 *
                  defunc_2_reduce_res_222928;
            float c12_222971 = x_222969 - y_222970;
            float x_222972 = defunc_2_reduce_res_222926 *
                  defunc_2_reduce_res_222930;
            float b2_222973 = x_222972 - y_222970;
            float x_222974 = defunc_2_reduce_res_222927 *
                  defunc_2_reduce_res_222928;
            float y_222975 = defunc_2_reduce_res_222926 *
                  defunc_2_reduce_res_222929;
            float c2_222976 = x_222974 - y_222975;
            float x_222977 = defunc_2_reduce_res_222926 * a12_222965;
            float y_222978 = defunc_2_reduce_res_222927 * b12_222968;
            float x_222979 = x_222977 + y_222978;
            float y_222980 = defunc_2_reduce_res_222928 * c12_222971;
            float y_222981 = x_222979 + y_222980;
            float det_222982 = 1.0F / y_222981;
            float a12_222983 = a12_222965 * det_222982;
            float b12_222984 = b12_222968 * det_222982;
            float c12_222985 = c12_222971 * det_222982;
            float b2_222986 = b2_222973 * det_222982;
            float c2_222987 = c2_222976 * det_222982;
            float defunc_2_reduce_res_222988;
            float defunc_2_reduce_res_222989;
            float redout_222991;
            float redout_222992;
            
            redout_222991 = 0.0F;
            redout_222992 = 0.0F;
            for (int64_t i_222990 = 0; i_222990 < q_l_196697; i_222990++) {
                bool cond_222993 = sle64(n_196692, i_222990);
                int64_t defunc_0_f_res_222994;
                
                if (cond_222993) {
                    defunc_0_f_res_222994 = (int64_t) 0;
                } else {
                    int64_t i_222995 = add64(x_222921, i_222990);
                    int64_t defunc_1_add_res_222996 = add64((int64_t) 1,
                                                            i_222995);
                    
                    defunc_0_f_res_222994 = defunc_1_add_res_222996;
                }
                
                float defunc_0_f_res_222997;
                
                if (cond_222993) {
                    defunc_0_f_res_222997 = 0.0F;
                } else {
                    int64_t i_222998 = add64(x_222921, i_222990);
                    float defunc_0_add_arg_222999;
                    
                    defunc_0_add_arg_222999 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205587 *
                                                          ctx_param_ext_210921 +
                                                          i_222998 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_222997 = defunc_0_add_arg_222999;
                }
                
                int64_t binop_p_223000 = sub64(defunc_0_f_res_222994,
                                               defunc_0_g_res_222925);
                float defunc_0_f_res_223001 = sitofp_i64_f32(binop_p_223000);
                float abs_res_223002 = (float) fabs(defunc_0_f_res_223001);
                float tmp1_223003 = abs_res_223002 / x_222922;
                float x_223004 = tmp1_223003 * tmp1_223003;
                float y_223005 = tmp1_223003 * x_223004;
                float tmp2_223006 = 1.0F - y_223005;
                float x_223007 = tmp2_223006 * tmp2_223006;
                float tmp3_223008 = tmp2_223006 * x_223007;
                float tmp4_223009 = defunc_0_f_res_222997 * tmp3_223008;
                float defunc_1_f_res_223010 = defunc_0_f_res_223001 *
                      tmp4_223009;
                float defunc_1_f_res_223011 = defunc_0_f_res_223001 *
                      defunc_1_f_res_223010;
                float defunc_0_f_res_223012;
                
                if (cond_222993) {
                    defunc_0_f_res_223012 = 0.0F;
                } else {
                    int64_t i_223013 = add64(x_222921, i_222990);
                    float defunc_0_add_arg_223014;
                    
                    defunc_0_add_arg_223014 =
                        ((float *) mem_212347.mem)[gtid_205587 * n_196692 +
                                                   i_223013];
                    defunc_0_f_res_223012 = defunc_0_add_arg_223014;
                }
                
                float x_223015 = a12_222983 * tmp4_223009;
                float y_223016 = b12_222984 * defunc_1_f_res_223010;
                float x_223017 = x_223015 + y_223016;
                float y_223018 = c12_222985 * defunc_1_f_res_223011;
                float x_223019 = x_223017 + y_223018;
                float defunc_9_fit_fun_res_223020 = defunc_0_f_res_223012 *
                      x_223019;
                float x_223021 = b12_222984 * tmp4_223009;
                float y_223022 = b2_222986 * defunc_1_f_res_223010;
                float x_223023 = x_223021 + y_223022;
                float y_223024 = c2_222987 * defunc_1_f_res_223011;
                float x_223025 = x_223023 + y_223024;
                float defunc_9_slope_fun_res_223026 = defunc_0_f_res_223012 *
                      x_223025;
                float defunc_1_op_res_223027 = defunc_9_fit_fun_res_223020 +
                      redout_222991;
                float defunc_1_op_res_223028 = defunc_9_slope_fun_res_223026 +
                      redout_222992;
                float redout_tmp_223040 = defunc_1_op_res_223027;
                float redout_tmp_223041 = defunc_1_op_res_223028;
                
                redout_222991 = redout_tmp_223040;
                redout_222992 = redout_tmp_223041;
            }
            defunc_2_reduce_res_222988 = redout_222991;
            defunc_2_reduce_res_222989 = redout_222992;
            ((float *) mem_212426)[i_222918] = defunc_2_reduce_res_222988;
            ((float *) mem_212429)[i_222918] = defunc_2_reduce_res_222989;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212457.mem + gtid_205587 * l_n_m_196752 * (int64_t) 4,
                    mem_212426 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212461.mem + gtid_205587 * l_n_m_196752 * (int64_t) 4,
                    mem_212429 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212426);
    free(mem_212429);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229020_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229020_end -
                 futhark_mc_segmap_parloop_229020_start;
        
        ctx->futhark_mc_segmap_parloop_229020_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229020_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229020_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229018(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205586 = tid;
    int num_tasks_222916 = info.nsubtasks;
    struct futhark_mc_task_229017 *futhark_mc_task_229017 =
                                  (struct futhark_mc_task_229017 *) args;
    struct futhark_context *ctx = futhark_mc_task_229017->ctx;
    uint64_t futhark_mc_segmap_task_229018_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229018_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229017->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229017->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229017->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229017->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229017->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229017->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229017->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229017->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229017->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229017->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229017->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229017->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229017->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229017->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212457 = {.desc ="mem_212457", .mem =
                                  futhark_mc_task_229017->free_mem_212457,
                                  .size =0, .references =NULL};
    struct memblock mem_212461 = {.desc ="mem_212461", .mem =
                                  futhark_mc_task_229017->free_mem_212461,
                                  .size =0, .references =NULL};
    int64_t iter_222917;
    struct futhark_mc_segmap_parloop_struct_229019
    futhark_mc_segmap_parloop_struct_229019;
    
    futhark_mc_segmap_parloop_struct_229019.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229019.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229019.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229019.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229019.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229019.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229019.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229019.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229019.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229019.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229019.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229019.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229019.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229019.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229019.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229019.free_mem_212457 = mem_212457.mem;
    futhark_mc_segmap_parloop_struct_229019.free_mem_212461 = mem_212461.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229020_task;
    
    futhark_mc_segmap_parloop_229020_task.name =
        "futhark_mc_segmap_parloop_229020";
    futhark_mc_segmap_parloop_229020_task.fn = futhark_mc_segmap_parloop_229020;
    futhark_mc_segmap_parloop_229020_task.args =
        &futhark_mc_segmap_parloop_struct_229019;
    futhark_mc_segmap_parloop_229020_task.iterations = iterations;
    futhark_mc_segmap_parloop_229020_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229020_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229020_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229020_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229020_task);
    
    if (futhark_mc_segmap_parloop_229020_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229020_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229020_total_end -
                 futhark_mc_segmap_parloop_229020_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229020_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229020_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229020_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229018_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229018_end -
                 futhark_mc_segmap_task_229018_start;
        
        ctx->futhark_mc_segmap_task_229018_runs[tid]++;
        ctx->futhark_mc_segmap_task_229018_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229018_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229024 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212457;
    unsigned char *free_mem_212461;
};
struct futhark_mc_task_229028 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205721;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212420;
    unsigned char *free_mem_212423;
};
struct futhark_mc_segmap_parloop_struct_229030 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205721;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212420;
    unsigned char *free_mem_212423;
};
static int futhark_mc_segmap_parloop_229031(void *args, int64_t start,
                                            int64_t end, int flat_tid_223162,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229030
    *futhark_mc_segmap_parloop_struct_229030 =
    (struct futhark_mc_segmap_parloop_struct_229030 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229030->ctx;
    uint64_t futhark_mc_segmap_parloop_229031_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229031_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229030->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229030->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229030->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229030->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229030->free_i_196779;
    int64_t gtid_205721 =
            futhark_mc_segmap_parloop_struct_229030->free_gtid_205721;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229030->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229030->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229030->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229030->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229030->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229030->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229030->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212420 = {.desc ="mem_212420", .mem =
                                  futhark_mc_segmap_parloop_struct_229030->free_mem_212420,
                                  .size =0, .references =NULL};
    struct memblock mem_212423 = {.desc ="mem_212423", .mem =
                                  futhark_mc_segmap_parloop_struct_229030->free_mem_212423,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_223275 = start;
    
    for (; iter_223275 < end; iter_223275++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223347 = l_n_m_196752;
        int64_t gtid_223163 = iter_223275;
        int64_t remnant_223348 = iter_223275 - gtid_223163;
        int64_t x_223164;
        
        x_223164 = ((int64_t *) mem_210827.mem)[gtid_205721 * l_n_m_196752 +
                                                gtid_223163];
        
        float x_223165;
        
        x_223165 = ((float *) mem_210831.mem)[gtid_205721 * l_n_m_196752 +
                                              gtid_223163];
        
        int64_t min_arg_223166 = mul64(jump_t_196702, gtid_223163);
        int64_t min_res_223167 = smin64(i_196779, min_arg_223166);
        int64_t defunc_0_g_res_223168 = add64((int64_t) 1, min_res_223167);
        float defunc_2_reduce_res_223169;
        float defunc_2_reduce_res_223170;
        float defunc_2_reduce_res_223171;
        float defunc_2_reduce_res_223172;
        float defunc_2_reduce_res_223173;
        float redout_223277;
        float redout_223278;
        float redout_223279;
        float redout_223280;
        float redout_223281;
        
        redout_223277 = 0.0F;
        redout_223278 = 0.0F;
        redout_223279 = 0.0F;
        redout_223280 = 0.0F;
        redout_223281 = 0.0F;
        for (int64_t i_223276 = 0; i_223276 < q_l_196697; i_223276++) {
            bool cond_223282 = sle64(n_196692, i_223276);
            int64_t defunc_0_f_res_223283;
            
            if (cond_223282) {
                defunc_0_f_res_223283 = (int64_t) 0;
            } else {
                int64_t i_223284 = add64(x_223164, i_223276);
                int64_t defunc_1_add_res_223285 = add64((int64_t) 1, i_223284);
                
                defunc_0_f_res_223283 = defunc_1_add_res_223285;
            }
            
            float defunc_0_f_res_223286;
            
            if (cond_223282) {
                defunc_0_f_res_223286 = 0.0F;
            } else {
                int64_t i_223287 = add64(x_223164, i_223276);
                float defunc_0_add_arg_223288;
                
                defunc_0_add_arg_223288 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_205721 *
                                                      ctx_param_ext_210921 +
                                                      i_223287 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_223286 = defunc_0_add_arg_223288;
            }
            
            int64_t binop_p_223289 = sub64(defunc_0_f_res_223283,
                                           defunc_0_g_res_223168);
            float defunc_0_f_res_223290 = sitofp_i64_f32(binop_p_223289);
            float abs_res_223291 = (float) fabs(defunc_0_f_res_223290);
            float tmp1_223292 = abs_res_223291 / x_223165;
            float x_223293 = tmp1_223292 * tmp1_223292;
            float y_223294 = tmp1_223292 * x_223293;
            float tmp2_223295 = 1.0F - y_223294;
            float x_223296 = tmp2_223295 * tmp2_223295;
            float tmp3_223297 = tmp2_223295 * x_223296;
            float w_j_223298 = defunc_0_f_res_223286 * tmp3_223297;
            float xw_j_223299 = defunc_0_f_res_223290 * w_j_223298;
            float x2w_j_223300 = defunc_0_f_res_223290 * xw_j_223299;
            float x3w_j_223301 = defunc_0_f_res_223290 * x2w_j_223300;
            float x4w_j_223302 = defunc_0_f_res_223290 * x3w_j_223301;
            float defunc_1_op_res_223303 = w_j_223298 + redout_223277;
            float defunc_1_op_res_223304 = xw_j_223299 + redout_223278;
            float defunc_1_op_res_223305 = x2w_j_223300 + redout_223279;
            float defunc_1_op_res_223306 = x3w_j_223301 + redout_223280;
            float defunc_1_op_res_223307 = x4w_j_223302 + redout_223281;
            float redout_tmp_223349 = defunc_1_op_res_223303;
            float redout_tmp_223350 = defunc_1_op_res_223304;
            float redout_tmp_223351 = defunc_1_op_res_223305;
            float redout_tmp_223352 = defunc_1_op_res_223306;
            float redout_tmp_223353 = defunc_1_op_res_223307;
            
            redout_223277 = redout_tmp_223349;
            redout_223278 = redout_tmp_223350;
            redout_223279 = redout_tmp_223351;
            redout_223280 = redout_tmp_223352;
            redout_223281 = redout_tmp_223353;
        }
        defunc_2_reduce_res_223169 = redout_223277;
        defunc_2_reduce_res_223170 = redout_223278;
        defunc_2_reduce_res_223171 = redout_223279;
        defunc_2_reduce_res_223172 = redout_223280;
        defunc_2_reduce_res_223173 = redout_223281;
        
        float x_223206 = defunc_2_reduce_res_223171 *
              defunc_2_reduce_res_223173;
        float y_223207 = defunc_2_reduce_res_223172 *
              defunc_2_reduce_res_223172;
        float a12_223208 = x_223206 - y_223207;
        float x_223209 = defunc_2_reduce_res_223171 *
              defunc_2_reduce_res_223172;
        float y_223210 = defunc_2_reduce_res_223170 *
              defunc_2_reduce_res_223173;
        float b12_223211 = x_223209 - y_223210;
        float x_223212 = defunc_2_reduce_res_223170 *
              defunc_2_reduce_res_223172;
        float y_223213 = defunc_2_reduce_res_223171 *
              defunc_2_reduce_res_223171;
        float c12_223214 = x_223212 - y_223213;
        float x_223215 = defunc_2_reduce_res_223169 *
              defunc_2_reduce_res_223173;
        float b2_223216 = x_223215 - y_223213;
        float x_223217 = defunc_2_reduce_res_223170 *
              defunc_2_reduce_res_223171;
        float y_223218 = defunc_2_reduce_res_223169 *
              defunc_2_reduce_res_223172;
        float c2_223219 = x_223217 - y_223218;
        float x_223220 = defunc_2_reduce_res_223169 * a12_223208;
        float y_223221 = defunc_2_reduce_res_223170 * b12_223211;
        float x_223222 = x_223220 + y_223221;
        float y_223223 = defunc_2_reduce_res_223171 * c12_223214;
        float y_223224 = x_223222 + y_223223;
        float det_223225 = 1.0F / y_223224;
        float a12_223226 = a12_223208 * det_223225;
        float b12_223227 = b12_223211 * det_223225;
        float c12_223228 = c12_223214 * det_223225;
        float b2_223229 = b2_223216 * det_223225;
        float c2_223230 = c2_223219 * det_223225;
        float defunc_2_reduce_res_223231;
        float defunc_2_reduce_res_223232;
        float redout_223309;
        float redout_223310;
        
        redout_223309 = 0.0F;
        redout_223310 = 0.0F;
        for (int64_t i_223308 = 0; i_223308 < q_l_196697; i_223308++) {
            bool cond_223311 = sle64(n_196692, i_223308);
            int64_t defunc_0_f_res_223312;
            
            if (cond_223311) {
                defunc_0_f_res_223312 = (int64_t) 0;
            } else {
                int64_t i_223313 = add64(x_223164, i_223308);
                int64_t defunc_1_add_res_223314 = add64((int64_t) 1, i_223313);
                
                defunc_0_f_res_223312 = defunc_1_add_res_223314;
            }
            
            float defunc_0_f_res_223315;
            
            if (cond_223311) {
                defunc_0_f_res_223315 = 0.0F;
            } else {
                int64_t i_223316 = add64(x_223164, i_223308);
                float defunc_0_add_arg_223317;
                
                defunc_0_add_arg_223317 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_205721 *
                                                      ctx_param_ext_210921 +
                                                      i_223316 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_223315 = defunc_0_add_arg_223317;
            }
            
            int64_t binop_p_223318 = sub64(defunc_0_f_res_223312,
                                           defunc_0_g_res_223168);
            float defunc_0_f_res_223319 = sitofp_i64_f32(binop_p_223318);
            float abs_res_223320 = (float) fabs(defunc_0_f_res_223319);
            float tmp1_223321 = abs_res_223320 / x_223165;
            float x_223322 = tmp1_223321 * tmp1_223321;
            float y_223323 = tmp1_223321 * x_223322;
            float tmp2_223324 = 1.0F - y_223323;
            float x_223325 = tmp2_223324 * tmp2_223324;
            float tmp3_223326 = tmp2_223324 * x_223325;
            float tmp4_223327 = defunc_0_f_res_223315 * tmp3_223326;
            float defunc_1_f_res_223328 = defunc_0_f_res_223319 * tmp4_223327;
            float defunc_1_f_res_223329 = defunc_0_f_res_223319 *
                  defunc_1_f_res_223328;
            float defunc_0_f_res_223330;
            
            if (cond_223311) {
                defunc_0_f_res_223330 = 0.0F;
            } else {
                int64_t i_223331 = add64(x_223164, i_223308);
                float defunc_0_add_arg_223332;
                
                defunc_0_add_arg_223332 =
                    ((float *) mem_212347.mem)[gtid_205721 * n_196692 +
                                               i_223331];
                defunc_0_f_res_223330 = defunc_0_add_arg_223332;
            }
            
            float x_223333 = a12_223226 * tmp4_223327;
            float y_223334 = b12_223227 * defunc_1_f_res_223328;
            float x_223335 = x_223333 + y_223334;
            float y_223336 = c12_223228 * defunc_1_f_res_223329;
            float x_223337 = x_223335 + y_223336;
            float defunc_9_fit_fun_res_223338 = defunc_0_f_res_223330 *
                  x_223337;
            float x_223339 = b12_223227 * tmp4_223327;
            float y_223340 = b2_223229 * defunc_1_f_res_223328;
            float x_223341 = x_223339 + y_223340;
            float y_223342 = c2_223230 * defunc_1_f_res_223329;
            float x_223343 = x_223341 + y_223342;
            float defunc_9_slope_fun_res_223344 = defunc_0_f_res_223330 *
                  x_223343;
            float defunc_1_op_res_223345 = defunc_9_fit_fun_res_223338 +
                  redout_223309;
            float defunc_1_op_res_223346 = defunc_9_slope_fun_res_223344 +
                  redout_223310;
            float redout_tmp_223354 = defunc_1_op_res_223345;
            float redout_tmp_223355 = defunc_1_op_res_223346;
            
            redout_223309 = redout_tmp_223354;
            redout_223310 = redout_tmp_223355;
        }
        defunc_2_reduce_res_223231 = redout_223309;
        defunc_2_reduce_res_223232 = redout_223310;
        ((float *) mem_212420.mem)[gtid_223163] = defunc_2_reduce_res_223231;
        ((float *) mem_212423.mem)[gtid_223163] = defunc_2_reduce_res_223232;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229031_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229031_end -
                 futhark_mc_segmap_parloop_229031_start;
        
        ctx->futhark_mc_segmap_parloop_229031_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229031_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229031_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229029(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223162 = tid;
    int num_tasks_223274 = info.nsubtasks;
    struct futhark_mc_task_229028 *futhark_mc_task_229028 =
                                  (struct futhark_mc_task_229028 *) args;
    struct futhark_context *ctx = futhark_mc_task_229028->ctx;
    uint64_t futhark_mc_segmap_task_229029_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229029_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229028->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229028->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229028->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229028->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229028->free_i_196779;
    int64_t gtid_205721 = futhark_mc_task_229028->free_gtid_205721;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229028->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229028->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229028->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229028->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229028->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229028->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229028->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212420 = {.desc ="mem_212420", .mem =
                                  futhark_mc_task_229028->free_mem_212420,
                                  .size =0, .references =NULL};
    struct memblock mem_212423 = {.desc ="mem_212423", .mem =
                                  futhark_mc_task_229028->free_mem_212423,
                                  .size =0, .references =NULL};
    int64_t iter_223275;
    struct futhark_mc_segmap_parloop_struct_229030
    futhark_mc_segmap_parloop_struct_229030;
    
    futhark_mc_segmap_parloop_struct_229030.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229030.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229030.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229030.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229030.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229030.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229030.free_gtid_205721 = gtid_205721;
    futhark_mc_segmap_parloop_struct_229030.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229030.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229030.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229030.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229030.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229030.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229030.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229030.free_mem_212420 = mem_212420.mem;
    futhark_mc_segmap_parloop_struct_229030.free_mem_212423 = mem_212423.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229031_task;
    
    futhark_mc_segmap_parloop_229031_task.name =
        "futhark_mc_segmap_parloop_229031";
    futhark_mc_segmap_parloop_229031_task.fn = futhark_mc_segmap_parloop_229031;
    futhark_mc_segmap_parloop_229031_task.args =
        &futhark_mc_segmap_parloop_struct_229030;
    futhark_mc_segmap_parloop_229031_task.iterations = iterations;
    futhark_mc_segmap_parloop_229031_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229031_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229031_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229031_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229031_task);
    
    if (futhark_mc_segmap_parloop_229031_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229031_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229031_total_end -
                 futhark_mc_segmap_parloop_229031_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229031_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229031_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229031_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229029_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229029_end -
                 futhark_mc_segmap_task_229029_start;
        
        ctx->futhark_mc_segmap_task_229029_runs[tid]++;
        ctx->futhark_mc_segmap_task_229029_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229029_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229033 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_205721;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    unsigned char *free_mem_212420;
    unsigned char *free_mem_212423;
};
struct futhark_mc_task_229035 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205721;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_223045;
    float free_x_223046;
    int64_t free_defunc_0_g_res_223049;
    float *retval_defunc_2_reduce_res_223050;
    float *retval_defunc_2_reduce_res_223051;
    float *retval_defunc_2_reduce_res_223052;
    float *retval_defunc_2_reduce_res_223053;
    float *retval_defunc_2_reduce_res_223054;
};
struct futhark_mc_segred_stage_1_parloop_struct_229042 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205721;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_223045;
    float free_x_223046;
    int64_t free_defunc_0_g_res_223049;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223440;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223442;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223444;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223446;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223448;
};
static int futhark_mc_segred_stage_1_parloop_229043(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_223357,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229042
    *futhark_mc_segred_stage_1_parloop_struct_229042 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229042 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229042->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229043_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229043_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_n_196692;
    int64_t gtid_205721 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_gtid_205721;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_229042->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_223045 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_x_223045;
    float x_223046 =
          futhark_mc_segred_stage_1_parloop_struct_229042->free_x_223046;
    int64_t defunc_0_g_res_223049 =
            futhark_mc_segred_stage_1_parloop_struct_229042->free_defunc_0_g_res_223049;
    struct memblock reduce_stage_1_tid_res_arr_mem_223440 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223440",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229042->free_reduce_stage_1_tid_res_arr_mem_223440,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_223442 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223442",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229042->free_reduce_stage_1_tid_res_arr_mem_223442,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_223444 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223444",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229042->free_reduce_stage_1_tid_res_arr_mem_223444,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_223446 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223446",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229042->free_reduce_stage_1_tid_res_arr_mem_223446,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_223448 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223448",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229042->free_reduce_stage_1_tid_res_arr_mem_223448,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_223450 = start;
    float x_223359;
    float x_223360;
    float x_223362;
    float x_223363;
    float x_223365;
    float x_223366;
    float x_223368;
    float x_223369;
    float x_223371;
    float x_223372;
    float local_acc_223451 = 0.0F;
    float local_acc_223452 = 0.0F;
    float local_acc_223453 = 0.0F;
    float local_acc_223454 = 0.0F;
    float local_acc_223455 = 0.0F;
    
    for (; iter_223450 < end; iter_223450++) {
        int64_t gtid_223358 = iter_223450;
        bool cond_223374 = sle64(n_196692, gtid_223358);
        int64_t defunc_0_f_res_223375;
        
        if (cond_223374) {
            defunc_0_f_res_223375 = (int64_t) 0;
        } else {
            int64_t i_223376 = add64(x_223045, gtid_223358);
            int64_t defunc_1_add_res_223377 = add64((int64_t) 1, i_223376);
            
            defunc_0_f_res_223375 = defunc_1_add_res_223377;
        }
        
        float defunc_0_f_res_223378;
        
        if (cond_223374) {
            defunc_0_f_res_223378 = 0.0F;
        } else {
            int64_t i_223379 = add64(x_223045, gtid_223358);
            float defunc_0_add_arg_223380;
            
            defunc_0_add_arg_223380 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_205721 *
                                                  ctx_param_ext_210921 +
                                                  i_223379 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_223378 = defunc_0_add_arg_223380;
        }
        
        int64_t binop_p_223381 = sub64(defunc_0_f_res_223375,
                                       defunc_0_g_res_223049);
        float defunc_0_f_res_223382 = sitofp_i64_f32(binop_p_223381);
        float abs_res_223383 = (float) fabs(defunc_0_f_res_223382);
        float tmp1_223384 = abs_res_223383 / x_223046;
        float x_223385 = tmp1_223384 * tmp1_223384;
        float y_223386 = tmp1_223384 * x_223385;
        float tmp2_223387 = 1.0F - y_223386;
        float x_223388 = tmp2_223387 * tmp2_223387;
        float tmp3_223389 = tmp2_223387 * x_223388;
        float w_j_223390 = defunc_0_f_res_223378 * tmp3_223389;
        float xw_j_223391 = defunc_0_f_res_223382 * w_j_223390;
        float x2w_j_223392 = defunc_0_f_res_223382 * xw_j_223391;
        float x3w_j_223393 = defunc_0_f_res_223382 * x2w_j_223392;
        float x4w_j_223394 = defunc_0_f_res_223382 * x3w_j_223393;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_223359 = local_acc_223451;
        }
        // Load next params
        {
            x_223360 = w_j_223390;
        }
        // Red body
        {
            float defunc_1_op_res_223361 = x_223359 + x_223360;
            
            local_acc_223451 = defunc_1_op_res_223361;
        }
        // Load accum params
        {
            x_223362 = local_acc_223452;
        }
        // Load next params
        {
            x_223363 = xw_j_223391;
        }
        // Red body
        {
            float defunc_1_op_res_223364 = x_223362 + x_223363;
            
            local_acc_223452 = defunc_1_op_res_223364;
        }
        // Load accum params
        {
            x_223365 = local_acc_223453;
        }
        // Load next params
        {
            x_223366 = x2w_j_223392;
        }
        // Red body
        {
            float defunc_1_op_res_223367 = x_223365 + x_223366;
            
            local_acc_223453 = defunc_1_op_res_223367;
        }
        // Load accum params
        {
            x_223368 = local_acc_223454;
        }
        // Load next params
        {
            x_223369 = x3w_j_223393;
        }
        // Red body
        {
            float defunc_1_op_res_223370 = x_223368 + x_223369;
            
            local_acc_223454 = defunc_1_op_res_223370;
        }
        // Load accum params
        {
            x_223371 = local_acc_223455;
        }
        // Load next params
        {
            x_223372 = x4w_j_223394;
        }
        // Red body
        {
            float defunc_1_op_res_223373 = x_223371 + x_223372;
            
            local_acc_223455 = defunc_1_op_res_223373;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_223440.mem)[flat_tid_223357] =
        local_acc_223451;
    ((float *) reduce_stage_1_tid_res_arr_mem_223442.mem)[flat_tid_223357] =
        local_acc_223452;
    ((float *) reduce_stage_1_tid_res_arr_mem_223444.mem)[flat_tid_223357] =
        local_acc_223453;
    ((float *) reduce_stage_1_tid_res_arr_mem_223446.mem)[flat_tid_223357] =
        local_acc_223454;
    ((float *) reduce_stage_1_tid_res_arr_mem_223448.mem)[flat_tid_223357] =
        local_acc_223455;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229043_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229043_end -
                 futhark_mc_segred_stage_1_parloop_229043_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229043_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229043_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229043_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229036(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223357 = tid;
    int num_tasks_223439 = info.nsubtasks;
    struct futhark_mc_task_229035 *futhark_mc_task_229035 =
                                  (struct futhark_mc_task_229035 *) args;
    struct futhark_context *ctx = futhark_mc_task_229035->ctx;
    uint64_t futhark_mc_segred_task_229036_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229036_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229035->free_n_196692;
    int64_t gtid_205721 = futhark_mc_task_229035->free_gtid_205721;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229035->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229035->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229035->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229035->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_223045 = futhark_mc_task_229035->free_x_223045;
    float x_223046 = futhark_mc_task_229035->free_x_223046;
    int64_t defunc_0_g_res_223049 =
            futhark_mc_task_229035->free_defunc_0_g_res_223049;
    float defunc_2_reduce_res_223050 =
          *futhark_mc_task_229035->retval_defunc_2_reduce_res_223050;
    float defunc_2_reduce_res_223051 =
          *futhark_mc_task_229035->retval_defunc_2_reduce_res_223051;
    float defunc_2_reduce_res_223052 =
          *futhark_mc_task_229035->retval_defunc_2_reduce_res_223052;
    float defunc_2_reduce_res_223053 =
          *futhark_mc_task_229035->retval_defunc_2_reduce_res_223053;
    float defunc_2_reduce_res_223054 =
          *futhark_mc_task_229035->retval_defunc_2_reduce_res_223054;
    size_t reduce_stage_1_tid_res_arr_mem_223440_cached_sizze_229037 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223440 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_223442_cached_sizze_229038 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223442 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_223444_cached_sizze_229039 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223444 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_223446_cached_sizze_229040 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223446 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_223448_cached_sizze_229041 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223448 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_223440_cached_sizze_229037 <
        (size_t) ((int64_t) 4 * num_tasks_223439)) {
        reduce_stage_1_tid_res_arr_mem_223440 =
            realloc(reduce_stage_1_tid_res_arr_mem_223440, (int64_t) 4 *
                    num_tasks_223439);
        reduce_stage_1_tid_res_arr_mem_223440_cached_sizze_229037 =
            (int64_t) 4 * num_tasks_223439;
    }
    if (reduce_stage_1_tid_res_arr_mem_223442_cached_sizze_229038 <
        (size_t) ((int64_t) 4 * num_tasks_223439)) {
        reduce_stage_1_tid_res_arr_mem_223442 =
            realloc(reduce_stage_1_tid_res_arr_mem_223442, (int64_t) 4 *
                    num_tasks_223439);
        reduce_stage_1_tid_res_arr_mem_223442_cached_sizze_229038 =
            (int64_t) 4 * num_tasks_223439;
    }
    if (reduce_stage_1_tid_res_arr_mem_223444_cached_sizze_229039 <
        (size_t) ((int64_t) 4 * num_tasks_223439)) {
        reduce_stage_1_tid_res_arr_mem_223444 =
            realloc(reduce_stage_1_tid_res_arr_mem_223444, (int64_t) 4 *
                    num_tasks_223439);
        reduce_stage_1_tid_res_arr_mem_223444_cached_sizze_229039 =
            (int64_t) 4 * num_tasks_223439;
    }
    if (reduce_stage_1_tid_res_arr_mem_223446_cached_sizze_229040 <
        (size_t) ((int64_t) 4 * num_tasks_223439)) {
        reduce_stage_1_tid_res_arr_mem_223446 =
            realloc(reduce_stage_1_tid_res_arr_mem_223446, (int64_t) 4 *
                    num_tasks_223439);
        reduce_stage_1_tid_res_arr_mem_223446_cached_sizze_229040 =
            (int64_t) 4 * num_tasks_223439;
    }
    if (reduce_stage_1_tid_res_arr_mem_223448_cached_sizze_229041 <
        (size_t) ((int64_t) 4 * num_tasks_223439)) {
        reduce_stage_1_tid_res_arr_mem_223448 =
            realloc(reduce_stage_1_tid_res_arr_mem_223448, (int64_t) 4 *
                    num_tasks_223439);
        reduce_stage_1_tid_res_arr_mem_223448_cached_sizze_229041 =
            (int64_t) 4 * num_tasks_223439;
    }
    
    int64_t iter_223450;
    struct futhark_mc_segred_stage_1_parloop_struct_229042
    futhark_mc_segred_stage_1_parloop_struct_229042;
    
    futhark_mc_segred_stage_1_parloop_struct_229042.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_gtid_205721 =
        gtid_205721;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_x_223045 = x_223045;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_x_223046 = x_223046;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_defunc_0_g_res_223049 =
        defunc_0_g_res_223049;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_reduce_stage_1_tid_res_arr_mem_223440 =
        reduce_stage_1_tid_res_arr_mem_223440;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_reduce_stage_1_tid_res_arr_mem_223442 =
        reduce_stage_1_tid_res_arr_mem_223442;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_reduce_stage_1_tid_res_arr_mem_223444 =
        reduce_stage_1_tid_res_arr_mem_223444;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_reduce_stage_1_tid_res_arr_mem_223446 =
        reduce_stage_1_tid_res_arr_mem_223446;
    futhark_mc_segred_stage_1_parloop_struct_229042.free_reduce_stage_1_tid_res_arr_mem_223448 =
        reduce_stage_1_tid_res_arr_mem_223448;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229043_task;
    
    futhark_mc_segred_stage_1_parloop_229043_task.name =
        "futhark_mc_segred_stage_1_parloop_229043";
    futhark_mc_segred_stage_1_parloop_229043_task.fn =
        futhark_mc_segred_stage_1_parloop_229043;
    futhark_mc_segred_stage_1_parloop_229043_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229042;
    futhark_mc_segred_stage_1_parloop_229043_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229043_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229043_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229043_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229043_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229043_task);
    
    if (futhark_mc_segred_stage_1_parloop_229043_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229043_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229043_total_end -
                 futhark_mc_segred_stage_1_parloop_229043_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229043_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229043_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229043_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_223050 = 0.0F;
        defunc_2_reduce_res_223051 = 0.0F;
        defunc_2_reduce_res_223052 = 0.0F;
        defunc_2_reduce_res_223053 = 0.0F;
        defunc_2_reduce_res_223054 = 0.0F;
    }
    
    float x_223456;
    float x_223457;
    float x_223459;
    float x_223460;
    float x_223462;
    float x_223463;
    float x_223465;
    float x_223466;
    float x_223468;
    float x_223469;
    
    for (int32_t i_223471 = 0; i_223471 < num_tasks_223439; i_223471++) {
        flat_tid_223357 = i_223471;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_223456 = defunc_2_reduce_res_223050;
            }
            // load next params
            {
                x_223457 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223440)[flat_tid_223357];
            }
            // red body
            {
                float defunc_1_op_res_223458 = x_223456 + x_223457;
                
                defunc_2_reduce_res_223050 = defunc_1_op_res_223458;
            }
            // load acc params
            {
                x_223459 = defunc_2_reduce_res_223051;
            }
            // load next params
            {
                x_223460 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223442)[flat_tid_223357];
            }
            // red body
            {
                float defunc_1_op_res_223461 = x_223459 + x_223460;
                
                defunc_2_reduce_res_223051 = defunc_1_op_res_223461;
            }
            // load acc params
            {
                x_223462 = defunc_2_reduce_res_223052;
            }
            // load next params
            {
                x_223463 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223444)[flat_tid_223357];
            }
            // red body
            {
                float defunc_1_op_res_223464 = x_223462 + x_223463;
                
                defunc_2_reduce_res_223052 = defunc_1_op_res_223464;
            }
            // load acc params
            {
                x_223465 = defunc_2_reduce_res_223053;
            }
            // load next params
            {
                x_223466 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223446)[flat_tid_223357];
            }
            // red body
            {
                float defunc_1_op_res_223467 = x_223465 + x_223466;
                
                defunc_2_reduce_res_223053 = defunc_1_op_res_223467;
            }
            // load acc params
            {
                x_223468 = defunc_2_reduce_res_223054;
            }
            // load next params
            {
                x_223469 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223448)[flat_tid_223357];
            }
            // red body
            {
                float defunc_1_op_res_223470 = x_223468 + x_223469;
                
                defunc_2_reduce_res_223054 = defunc_1_op_res_223470;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_223440);
        free(reduce_stage_1_tid_res_arr_mem_223442);
        free(reduce_stage_1_tid_res_arr_mem_223444);
        free(reduce_stage_1_tid_res_arr_mem_223446);
        free(reduce_stage_1_tid_res_arr_mem_223448);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229036_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229036_end -
                 futhark_mc_segred_task_229036_start;
        
        ctx->futhark_mc_segred_task_229036_runs[tid]++;
        ctx->futhark_mc_segred_task_229036_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229036_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229035->retval_defunc_2_reduce_res_223050 =
            defunc_2_reduce_res_223050;
        *futhark_mc_task_229035->retval_defunc_2_reduce_res_223051 =
            defunc_2_reduce_res_223051;
        *futhark_mc_task_229035->retval_defunc_2_reduce_res_223052 =
            defunc_2_reduce_res_223052;
        *futhark_mc_task_229035->retval_defunc_2_reduce_res_223053 =
            defunc_2_reduce_res_223053;
        *futhark_mc_task_229035->retval_defunc_2_reduce_res_223054 =
            defunc_2_reduce_res_223054;
    }
    return err;
}
struct futhark_mc_task_229044 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205721;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_x_223045;
    float free_x_223046;
    int64_t free_defunc_0_g_res_223049;
    float free_a12_223113;
    float free_b12_223114;
    float free_c12_223115;
    float free_b2_223116;
    float free_c2_223117;
    float *retval_defunc_2_reduce_res_223118;
    float *retval_defunc_2_reduce_res_223119;
};
struct futhark_mc_segred_stage_1_parloop_struct_229048 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_205721;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_x_223045;
    float free_x_223046;
    int64_t free_defunc_0_g_res_223049;
    float free_a12_223113;
    float free_b12_223114;
    float free_c12_223115;
    float free_b2_223116;
    float free_c2_223117;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223473;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223475;
};
static int futhark_mc_segred_stage_1_parloop_229049(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_223395,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229048
    *futhark_mc_segred_stage_1_parloop_struct_229048 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229048 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229048->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229049_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229049_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_n_196692;
    int64_t gtid_205721 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_gtid_205721;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_229048->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229048->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_223045 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_x_223045;
    float x_223046 =
          futhark_mc_segred_stage_1_parloop_struct_229048->free_x_223046;
    int64_t defunc_0_g_res_223049 =
            futhark_mc_segred_stage_1_parloop_struct_229048->free_defunc_0_g_res_223049;
    float a12_223113 =
          futhark_mc_segred_stage_1_parloop_struct_229048->free_a12_223113;
    float b12_223114 =
          futhark_mc_segred_stage_1_parloop_struct_229048->free_b12_223114;
    float c12_223115 =
          futhark_mc_segred_stage_1_parloop_struct_229048->free_c12_223115;
    float b2_223116 =
          futhark_mc_segred_stage_1_parloop_struct_229048->free_b2_223116;
    float c2_223117 =
          futhark_mc_segred_stage_1_parloop_struct_229048->free_c2_223117;
    struct memblock reduce_stage_1_tid_res_arr_mem_223473 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223473",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229048->free_reduce_stage_1_tid_res_arr_mem_223473,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_223475 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223475",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229048->free_reduce_stage_1_tid_res_arr_mem_223475,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_223477 = start;
    float x_223397;
    float x_223398;
    float x_223400;
    float x_223401;
    float local_acc_223478 = 0.0F;
    float local_acc_223479 = 0.0F;
    
    for (; iter_223477 < end; iter_223477++) {
        int64_t gtid_223396 = iter_223477;
        bool cond_223403 = sle64(n_196692, gtid_223396);
        int64_t defunc_0_f_res_223404;
        
        if (cond_223403) {
            defunc_0_f_res_223404 = (int64_t) 0;
        } else {
            int64_t i_223405 = add64(x_223045, gtid_223396);
            int64_t defunc_1_add_res_223406 = add64((int64_t) 1, i_223405);
            
            defunc_0_f_res_223404 = defunc_1_add_res_223406;
        }
        
        float defunc_0_f_res_223407;
        
        if (cond_223403) {
            defunc_0_f_res_223407 = 0.0F;
        } else {
            int64_t i_223408 = add64(x_223045, gtid_223396);
            float defunc_0_add_arg_223409;
            
            defunc_0_add_arg_223409 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_205721 *
                                                  ctx_param_ext_210921 +
                                                  i_223408 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_223407 = defunc_0_add_arg_223409;
        }
        
        int64_t binop_p_223410 = sub64(defunc_0_f_res_223404,
                                       defunc_0_g_res_223049);
        float defunc_0_f_res_223411 = sitofp_i64_f32(binop_p_223410);
        float abs_res_223412 = (float) fabs(defunc_0_f_res_223411);
        float tmp1_223413 = abs_res_223412 / x_223046;
        float x_223414 = tmp1_223413 * tmp1_223413;
        float y_223415 = tmp1_223413 * x_223414;
        float tmp2_223416 = 1.0F - y_223415;
        float x_223417 = tmp2_223416 * tmp2_223416;
        float tmp3_223418 = tmp2_223416 * x_223417;
        float tmp4_223419 = defunc_0_f_res_223407 * tmp3_223418;
        float defunc_1_f_res_223420 = defunc_0_f_res_223411 * tmp4_223419;
        float defunc_1_f_res_223421 = defunc_0_f_res_223411 *
              defunc_1_f_res_223420;
        float defunc_0_f_res_223422;
        
        if (cond_223403) {
            defunc_0_f_res_223422 = 0.0F;
        } else {
            int64_t i_223423 = add64(x_223045, gtid_223396);
            float defunc_0_add_arg_223424;
            
            defunc_0_add_arg_223424 = ((float *) mem_212347.mem)[gtid_205721 *
                                                                 n_196692 +
                                                                 i_223423];
            defunc_0_f_res_223422 = defunc_0_add_arg_223424;
        }
        
        float x_223425 = a12_223113 * tmp4_223419;
        float y_223426 = b12_223114 * defunc_1_f_res_223420;
        float x_223427 = x_223425 + y_223426;
        float y_223428 = c12_223115 * defunc_1_f_res_223421;
        float x_223429 = x_223427 + y_223428;
        float defunc_9_fit_fun_res_223430 = defunc_0_f_res_223422 * x_223429;
        float x_223431 = b12_223114 * tmp4_223419;
        float y_223432 = b2_223116 * defunc_1_f_res_223420;
        float x_223433 = x_223431 + y_223432;
        float y_223434 = c2_223117 * defunc_1_f_res_223421;
        float x_223435 = x_223433 + y_223434;
        float defunc_9_slope_fun_res_223436 = defunc_0_f_res_223422 * x_223435;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_223397 = local_acc_223478;
        }
        // Load next params
        {
            x_223398 = defunc_9_fit_fun_res_223430;
        }
        // Red body
        {
            float defunc_1_op_res_223399 = x_223397 + x_223398;
            
            local_acc_223478 = defunc_1_op_res_223399;
        }
        // Load accum params
        {
            x_223400 = local_acc_223479;
        }
        // Load next params
        {
            x_223401 = defunc_9_slope_fun_res_223436;
        }
        // Red body
        {
            float defunc_1_op_res_223402 = x_223400 + x_223401;
            
            local_acc_223479 = defunc_1_op_res_223402;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_223473.mem)[flat_tid_223395] =
        local_acc_223478;
    ((float *) reduce_stage_1_tid_res_arr_mem_223475.mem)[flat_tid_223395] =
        local_acc_223479;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229049_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229049_end -
                 futhark_mc_segred_stage_1_parloop_229049_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229049_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229049_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229049_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229045(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223395 = tid;
    int num_tasks_223472 = info.nsubtasks;
    struct futhark_mc_task_229044 *futhark_mc_task_229044 =
                                  (struct futhark_mc_task_229044 *) args;
    struct futhark_context *ctx = futhark_mc_task_229044->ctx;
    uint64_t futhark_mc_segred_task_229045_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229045_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229044->free_n_196692;
    int64_t gtid_205721 = futhark_mc_task_229044->free_gtid_205721;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229044->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229044->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229044->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229044->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229044->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_223045 = futhark_mc_task_229044->free_x_223045;
    float x_223046 = futhark_mc_task_229044->free_x_223046;
    int64_t defunc_0_g_res_223049 =
            futhark_mc_task_229044->free_defunc_0_g_res_223049;
    float a12_223113 = futhark_mc_task_229044->free_a12_223113;
    float b12_223114 = futhark_mc_task_229044->free_b12_223114;
    float c12_223115 = futhark_mc_task_229044->free_c12_223115;
    float b2_223116 = futhark_mc_task_229044->free_b2_223116;
    float c2_223117 = futhark_mc_task_229044->free_c2_223117;
    float defunc_2_reduce_res_223118 =
          *futhark_mc_task_229044->retval_defunc_2_reduce_res_223118;
    float defunc_2_reduce_res_223119 =
          *futhark_mc_task_229044->retval_defunc_2_reduce_res_223119;
    size_t reduce_stage_1_tid_res_arr_mem_223473_cached_sizze_229046 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223473 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_223475_cached_sizze_229047 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223475 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_223473_cached_sizze_229046 <
        (size_t) ((int64_t) 4 * num_tasks_223472)) {
        reduce_stage_1_tid_res_arr_mem_223473 =
            realloc(reduce_stage_1_tid_res_arr_mem_223473, (int64_t) 4 *
                    num_tasks_223472);
        reduce_stage_1_tid_res_arr_mem_223473_cached_sizze_229046 =
            (int64_t) 4 * num_tasks_223472;
    }
    if (reduce_stage_1_tid_res_arr_mem_223475_cached_sizze_229047 <
        (size_t) ((int64_t) 4 * num_tasks_223472)) {
        reduce_stage_1_tid_res_arr_mem_223475 =
            realloc(reduce_stage_1_tid_res_arr_mem_223475, (int64_t) 4 *
                    num_tasks_223472);
        reduce_stage_1_tid_res_arr_mem_223475_cached_sizze_229047 =
            (int64_t) 4 * num_tasks_223472;
    }
    
    int64_t iter_223477;
    struct futhark_mc_segred_stage_1_parloop_struct_229048
    futhark_mc_segred_stage_1_parloop_struct_229048;
    
    futhark_mc_segred_stage_1_parloop_struct_229048.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_gtid_205721 =
        gtid_205721;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_mem_212347 =
        mem_212347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_x_223045 = x_223045;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_x_223046 = x_223046;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_defunc_0_g_res_223049 =
        defunc_0_g_res_223049;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_a12_223113 =
        a12_223113;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_b12_223114 =
        b12_223114;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_c12_223115 =
        c12_223115;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_b2_223116 = b2_223116;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_c2_223117 = c2_223117;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_reduce_stage_1_tid_res_arr_mem_223473 =
        reduce_stage_1_tid_res_arr_mem_223473;
    futhark_mc_segred_stage_1_parloop_struct_229048.free_reduce_stage_1_tid_res_arr_mem_223475 =
        reduce_stage_1_tid_res_arr_mem_223475;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229049_task;
    
    futhark_mc_segred_stage_1_parloop_229049_task.name =
        "futhark_mc_segred_stage_1_parloop_229049";
    futhark_mc_segred_stage_1_parloop_229049_task.fn =
        futhark_mc_segred_stage_1_parloop_229049;
    futhark_mc_segred_stage_1_parloop_229049_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229048;
    futhark_mc_segred_stage_1_parloop_229049_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229049_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229049_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229049_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229049_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229049_task);
    
    if (futhark_mc_segred_stage_1_parloop_229049_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229049_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229049_total_end -
                 futhark_mc_segred_stage_1_parloop_229049_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229049_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229049_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229049_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_223118 = 0.0F;
        defunc_2_reduce_res_223119 = 0.0F;
    }
    
    float x_223480;
    float x_223481;
    float x_223483;
    float x_223484;
    
    for (int32_t i_223486 = 0; i_223486 < num_tasks_223472; i_223486++) {
        flat_tid_223395 = i_223486;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_223480 = defunc_2_reduce_res_223118;
            }
            // load next params
            {
                x_223481 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223473)[flat_tid_223395];
            }
            // red body
            {
                float defunc_1_op_res_223482 = x_223480 + x_223481;
                
                defunc_2_reduce_res_223118 = defunc_1_op_res_223482;
            }
            // load acc params
            {
                x_223483 = defunc_2_reduce_res_223119;
            }
            // load next params
            {
                x_223484 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223475)[flat_tid_223395];
            }
            // red body
            {
                float defunc_1_op_res_223485 = x_223483 + x_223484;
                
                defunc_2_reduce_res_223119 = defunc_1_op_res_223485;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_223473);
        free(reduce_stage_1_tid_res_arr_mem_223475);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229045_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229045_end -
                 futhark_mc_segred_task_229045_start;
        
        ctx->futhark_mc_segred_task_229045_runs[tid]++;
        ctx->futhark_mc_segred_task_229045_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229045_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229044->retval_defunc_2_reduce_res_223118 =
            defunc_2_reduce_res_223118;
        *futhark_mc_task_229044->retval_defunc_2_reduce_res_223119 =
            defunc_2_reduce_res_223119;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229034(void *args, int64_t start,
                                            int64_t end, int flat_tid_223043,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229033
    *futhark_mc_segmap_parloop_struct_229033 =
    (struct futhark_mc_segmap_parloop_struct_229033 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229033->ctx;
    uint64_t futhark_mc_segmap_parloop_229034_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229034_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229033->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229033->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229033->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229033->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229033->free_i_196779;
    int64_t gtid_205721 =
            futhark_mc_segmap_parloop_struct_229033->free_gtid_205721;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229033->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229033->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229033->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229033->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229033->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229033->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229033->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212420 = {.desc ="mem_212420", .mem =
                                  futhark_mc_segmap_parloop_struct_229033->free_mem_212420,
                                  .size =0, .references =NULL};
    struct memblock mem_212423 = {.desc ="mem_212423", .mem =
                                  futhark_mc_segmap_parloop_struct_229033->free_mem_212423,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_223356 = start;
    
    for (; iter_223356 < end; iter_223356++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223437 = l_n_m_196752;
        int64_t gtid_223044 = iter_223356;
        int64_t remnant_223438 = iter_223356 - gtid_223044;
        int64_t x_223045;
        
        x_223045 = ((int64_t *) mem_210827.mem)[gtid_205721 * l_n_m_196752 +
                                                gtid_223044];
        
        float x_223046;
        
        x_223046 = ((float *) mem_210831.mem)[gtid_205721 * l_n_m_196752 +
                                              gtid_223044];
        
        int64_t min_arg_223047 = mul64(jump_t_196702, gtid_223044);
        int64_t min_res_223048 = smin64(i_196779, min_arg_223047);
        int64_t defunc_0_g_res_223049 = add64((int64_t) 1, min_res_223048);
        float defunc_2_reduce_res_223050;
        float defunc_2_reduce_res_223051;
        float defunc_2_reduce_res_223052;
        float defunc_2_reduce_res_223053;
        float defunc_2_reduce_res_223054;
        int64_t flat_tid_223357 = (int64_t) 0;
        int32_t num_tasks_223439;
        
        defunc_2_reduce_res_223050 = 0.0F;
        defunc_2_reduce_res_223051 = 0.0F;
        defunc_2_reduce_res_223052 = 0.0F;
        defunc_2_reduce_res_223053 = 0.0F;
        defunc_2_reduce_res_223054 = 0.0F;
        
        struct futhark_mc_task_229035 futhark_mc_task_229035;
        
        futhark_mc_task_229035.ctx = ctx;
        futhark_mc_task_229035.free_n_196692 = n_196692;
        futhark_mc_task_229035.free_gtid_205721 = gtid_205721;
        futhark_mc_task_229035.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229035.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229035.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229035.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229035.free_x_223045 = x_223045;
        futhark_mc_task_229035.free_x_223046 = x_223046;
        futhark_mc_task_229035.free_defunc_0_g_res_223049 =
            defunc_0_g_res_223049;
        futhark_mc_task_229035.retval_defunc_2_reduce_res_223050 =
            &defunc_2_reduce_res_223050;
        futhark_mc_task_229035.retval_defunc_2_reduce_res_223051 =
            &defunc_2_reduce_res_223051;
        futhark_mc_task_229035.retval_defunc_2_reduce_res_223052 =
            &defunc_2_reduce_res_223052;
        futhark_mc_task_229035.retval_defunc_2_reduce_res_223053 =
            &defunc_2_reduce_res_223053;
        futhark_mc_task_229035.retval_defunc_2_reduce_res_223054 =
            &defunc_2_reduce_res_223054;
        
        struct scheduler_segop futhark_mc_task_229035_task;
        
        futhark_mc_task_229035_task.args = &futhark_mc_task_229035;
        futhark_mc_task_229035_task.top_level_fn =
            futhark_mc_segred_task_229036;
        futhark_mc_task_229035_task.name = "futhark_mc_segred_task_229036";
        futhark_mc_task_229035_task.iterations = q_l_196697;
        futhark_mc_task_229035_task.task_time =
            &ctx->futhark_mc_segred_task_229036_total_time;
        futhark_mc_task_229035_task.task_iter =
            &ctx->futhark_mc_segred_task_229036_total_iter;
        futhark_mc_task_229035_task.sched = STATIC;
        futhark_mc_task_229035_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229036_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229035_task);
        
        if (futhark_mc_segred_task_229036_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_223093 = defunc_2_reduce_res_223052 *
              defunc_2_reduce_res_223054;
        float y_223094 = defunc_2_reduce_res_223053 *
              defunc_2_reduce_res_223053;
        float a12_223095 = x_223093 - y_223094;
        float x_223096 = defunc_2_reduce_res_223052 *
              defunc_2_reduce_res_223053;
        float y_223097 = defunc_2_reduce_res_223051 *
              defunc_2_reduce_res_223054;
        float b12_223098 = x_223096 - y_223097;
        float x_223099 = defunc_2_reduce_res_223051 *
              defunc_2_reduce_res_223053;
        float y_223100 = defunc_2_reduce_res_223052 *
              defunc_2_reduce_res_223052;
        float c12_223101 = x_223099 - y_223100;
        float x_223102 = defunc_2_reduce_res_223050 *
              defunc_2_reduce_res_223054;
        float b2_223103 = x_223102 - y_223100;
        float x_223104 = defunc_2_reduce_res_223051 *
              defunc_2_reduce_res_223052;
        float y_223105 = defunc_2_reduce_res_223050 *
              defunc_2_reduce_res_223053;
        float c2_223106 = x_223104 - y_223105;
        float x_223107 = defunc_2_reduce_res_223050 * a12_223095;
        float y_223108 = defunc_2_reduce_res_223051 * b12_223098;
        float x_223109 = x_223107 + y_223108;
        float y_223110 = defunc_2_reduce_res_223052 * c12_223101;
        float y_223111 = x_223109 + y_223110;
        float det_223112 = 1.0F / y_223111;
        float a12_223113 = a12_223095 * det_223112;
        float b12_223114 = b12_223098 * det_223112;
        float c12_223115 = c12_223101 * det_223112;
        float b2_223116 = b2_223103 * det_223112;
        float c2_223117 = c2_223106 * det_223112;
        float defunc_2_reduce_res_223118;
        float defunc_2_reduce_res_223119;
        int64_t flat_tid_223395 = (int64_t) 0;
        int32_t num_tasks_223472;
        
        defunc_2_reduce_res_223118 = 0.0F;
        defunc_2_reduce_res_223119 = 0.0F;
        
        struct futhark_mc_task_229044 futhark_mc_task_229044;
        
        futhark_mc_task_229044.ctx = ctx;
        futhark_mc_task_229044.free_n_196692 = n_196692;
        futhark_mc_task_229044.free_gtid_205721 = gtid_205721;
        futhark_mc_task_229044.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229044.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229044.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229044.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229044.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229044.free_x_223045 = x_223045;
        futhark_mc_task_229044.free_x_223046 = x_223046;
        futhark_mc_task_229044.free_defunc_0_g_res_223049 =
            defunc_0_g_res_223049;
        futhark_mc_task_229044.free_a12_223113 = a12_223113;
        futhark_mc_task_229044.free_b12_223114 = b12_223114;
        futhark_mc_task_229044.free_c12_223115 = c12_223115;
        futhark_mc_task_229044.free_b2_223116 = b2_223116;
        futhark_mc_task_229044.free_c2_223117 = c2_223117;
        futhark_mc_task_229044.retval_defunc_2_reduce_res_223118 =
            &defunc_2_reduce_res_223118;
        futhark_mc_task_229044.retval_defunc_2_reduce_res_223119 =
            &defunc_2_reduce_res_223119;
        
        struct scheduler_segop futhark_mc_task_229044_task;
        
        futhark_mc_task_229044_task.args = &futhark_mc_task_229044;
        futhark_mc_task_229044_task.top_level_fn =
            futhark_mc_segred_task_229045;
        futhark_mc_task_229044_task.name = "futhark_mc_segred_task_229045";
        futhark_mc_task_229044_task.iterations = q_l_196697;
        futhark_mc_task_229044_task.task_time =
            &ctx->futhark_mc_segred_task_229045_total_time;
        futhark_mc_task_229044_task.task_iter =
            &ctx->futhark_mc_segred_task_229045_total_iter;
        futhark_mc_task_229044_task.sched = STATIC;
        futhark_mc_task_229044_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229045_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229044_task);
        
        if (futhark_mc_segred_task_229045_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212420.mem)[gtid_223044] = defunc_2_reduce_res_223118;
        ((float *) mem_212423.mem)[gtid_223044] = defunc_2_reduce_res_223119;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229034_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229034_end -
                 futhark_mc_segmap_parloop_229034_start;
        
        ctx->futhark_mc_segmap_parloop_229034_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229034_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229034_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229032(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223043 = tid;
    int num_tasks_223274 = info.nsubtasks;
    struct futhark_mc_task_229028 *futhark_mc_task_229028 =
                                  (struct futhark_mc_task_229028 *) args;
    struct futhark_context *ctx = futhark_mc_task_229028->ctx;
    uint64_t futhark_mc_segmap_nested_task_229032_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229032_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229028->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229028->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229028->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229028->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229028->free_i_196779;
    int64_t gtid_205721 = futhark_mc_task_229028->free_gtid_205721;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229028->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229028->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229028->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229028->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229028->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229028->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229028->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212420 = {.desc ="mem_212420", .mem =
                                  futhark_mc_task_229028->free_mem_212420,
                                  .size =0, .references =NULL};
    struct memblock mem_212423 = {.desc ="mem_212423", .mem =
                                  futhark_mc_task_229028->free_mem_212423,
                                  .size =0, .references =NULL};
    int64_t iter_223356;
    struct futhark_mc_segmap_parloop_struct_229033
    futhark_mc_segmap_parloop_struct_229033;
    
    futhark_mc_segmap_parloop_struct_229033.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229033.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229033.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229033.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229033.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229033.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229033.free_gtid_205721 = gtid_205721;
    futhark_mc_segmap_parloop_struct_229033.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229033.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229033.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229033.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229033.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229033.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229033.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229033.free_mem_212420 = mem_212420.mem;
    futhark_mc_segmap_parloop_struct_229033.free_mem_212423 = mem_212423.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229034_task;
    
    futhark_mc_segmap_parloop_229034_task.name =
        "futhark_mc_segmap_parloop_229034";
    futhark_mc_segmap_parloop_229034_task.fn = futhark_mc_segmap_parloop_229034;
    futhark_mc_segmap_parloop_229034_task.args =
        &futhark_mc_segmap_parloop_struct_229033;
    futhark_mc_segmap_parloop_229034_task.iterations = iterations;
    futhark_mc_segmap_parloop_229034_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229034_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229034_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229034_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229034_task);
    
    if (futhark_mc_segmap_parloop_229034_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229034_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229034_total_end -
                 futhark_mc_segmap_parloop_229034_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229034_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229034_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229034_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229032_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229032_end -
                 futhark_mc_segmap_nested_task_229032_start;
        
        ctx->futhark_mc_segmap_nested_task_229032_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229032_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229032_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229025(void *args, int64_t start,
                                            int64_t end, int flat_tid_205720,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229024
    *futhark_mc_segmap_parloop_struct_229024 =
    (struct futhark_mc_segmap_parloop_struct_229024 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229024->ctx;
    uint64_t futhark_mc_segmap_parloop_229025_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229025_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229024->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229024->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229024->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229024->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229024->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229024->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229024->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229024->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229024->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229024->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229024->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229024->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229024->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229024->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212457 = {.desc ="mem_212457", .mem =
                                  futhark_mc_segmap_parloop_struct_229024->free_mem_212457,
                                  .size =0, .references =NULL};
    struct memblock mem_212461 = {.desc ="mem_212461", .mem =
                                  futhark_mc_segmap_parloop_struct_229024->free_mem_212461,
                                  .size =0, .references =NULL};
    size_t mem_212420_cached_sizze_229026 = 0;
    unsigned char *mem_212420 = NULL;
    size_t mem_212423_cached_sizze_229027 = 0;
    unsigned char *mem_212423 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223042 = start;
    
    if (mem_212420_cached_sizze_229026 < (size_t) bytes_210774) {
        mem_212420 = realloc(mem_212420, bytes_210774);
        mem_212420_cached_sizze_229026 = bytes_210774;
    }
    if (mem_212423_cached_sizze_229027 < (size_t) bytes_210774) {
        mem_212423 = realloc(mem_212423, bytes_210774);
        mem_212423_cached_sizze_229027 = bytes_210774;
    }
    for (; iter_223042 < end; iter_223042++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223272 = m_196691;
        int64_t gtid_205721 = iter_223042;
        int64_t remnant_223273 = iter_223042 - gtid_205721;
        int64_t flat_tid_223162 = (int64_t) 0;
        int32_t num_tasks_223274;
        int64_t flat_tid_223043 = (int64_t) 0;
        struct futhark_mc_task_229028 futhark_mc_task_229028;
        
        futhark_mc_task_229028.ctx = ctx;
        futhark_mc_task_229028.free_n_196692 = n_196692;
        futhark_mc_task_229028.free_q_l_196697 = q_l_196697;
        futhark_mc_task_229028.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229028.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_229028.free_i_196779 = i_196779;
        futhark_mc_task_229028.free_gtid_205721 = gtid_205721;
        futhark_mc_task_229028.free_mem_210827 = mem_210827.mem;
        futhark_mc_task_229028.free_mem_210831 = mem_210831.mem;
        futhark_mc_task_229028.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229028.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229028.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229028.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229028.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229028.free_mem_212420 = mem_212420;
        futhark_mc_task_229028.free_mem_212423 = mem_212423;
        
        struct scheduler_segop futhark_mc_task_229028_task;
        
        futhark_mc_task_229028_task.args = &futhark_mc_task_229028;
        futhark_mc_task_229028_task.top_level_fn =
            futhark_mc_segmap_task_229029;
        futhark_mc_task_229028_task.name = "futhark_mc_segmap_task_229029";
        futhark_mc_task_229028_task.iterations = l_n_m_196752;
        futhark_mc_task_229028_task.task_time =
            &ctx->futhark_mc_segmap_task_229029_total_time;
        futhark_mc_task_229028_task.task_iter =
            &ctx->futhark_mc_segmap_task_229029_total_iter;
        futhark_mc_task_229028_task.sched = STATIC;
        futhark_mc_task_229028_task.nested_fn =
            futhark_mc_segmap_nested_task_229032;
        
        int futhark_mc_segmap_task_229029_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229028_task);
        
        if (futhark_mc_segmap_task_229029_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212457.mem + gtid_205721 * l_n_m_196752 * (int64_t) 4,
                    mem_212420 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212461.mem + gtid_205721 * l_n_m_196752 * (int64_t) 4,
                    mem_212423 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212420);
    free(mem_212423);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229025_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229025_end -
                 futhark_mc_segmap_parloop_229025_start;
        
        ctx->futhark_mc_segmap_parloop_229025_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229025_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229025_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229023(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205720 = tid;
    int num_tasks_222916 = info.nsubtasks;
    struct futhark_mc_task_229017 *futhark_mc_task_229017 =
                                  (struct futhark_mc_task_229017 *) args;
    struct futhark_context *ctx = futhark_mc_task_229017->ctx;
    uint64_t futhark_mc_segmap_nested_task_229023_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229023_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229017->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229017->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229017->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229017->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229017->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229017->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229017->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229017->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229017->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229017->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229017->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229017->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229017->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229017->free_mem_212347,
                                  .size =0, .references =NULL};
    struct memblock mem_212457 = {.desc ="mem_212457", .mem =
                                  futhark_mc_task_229017->free_mem_212457,
                                  .size =0, .references =NULL};
    struct memblock mem_212461 = {.desc ="mem_212461", .mem =
                                  futhark_mc_task_229017->free_mem_212461,
                                  .size =0, .references =NULL};
    int64_t iter_223042;
    struct futhark_mc_segmap_parloop_struct_229024
    futhark_mc_segmap_parloop_struct_229024;
    
    futhark_mc_segmap_parloop_struct_229024.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229024.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229024.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229024.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229024.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229024.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229024.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229024.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229024.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229024.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229024.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229024.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229024.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229024.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229024.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229024.free_mem_212457 = mem_212457.mem;
    futhark_mc_segmap_parloop_struct_229024.free_mem_212461 = mem_212461.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229025_task;
    
    futhark_mc_segmap_parloop_229025_task.name =
        "futhark_mc_segmap_parloop_229025";
    futhark_mc_segmap_parloop_229025_task.fn = futhark_mc_segmap_parloop_229025;
    futhark_mc_segmap_parloop_229025_task.args =
        &futhark_mc_segmap_parloop_struct_229024;
    futhark_mc_segmap_parloop_229025_task.iterations = iterations;
    futhark_mc_segmap_parloop_229025_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229025_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229025_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229025_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229025_task);
    
    if (futhark_mc_segmap_parloop_229025_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229025_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229025_total_end -
                 futhark_mc_segmap_parloop_229025_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229025_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229025_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229025_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229023_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229023_end -
                 futhark_mc_segmap_nested_task_229023_start;
        
        ctx->futhark_mc_segmap_nested_task_229023_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229023_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229023_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229050 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212471;
    unsigned char *free_mem_212524;
};
struct futhark_mc_segmap_parloop_struct_229052 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212471;
    unsigned char *free_mem_212524;
};
static int futhark_mc_segmap_parloop_229053(void *args, int64_t start,
                                            int64_t end, int flat_tid_205968,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229052
    *futhark_mc_segmap_parloop_struct_229052 =
    (struct futhark_mc_segmap_parloop_struct_229052 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229052->ctx;
    uint64_t futhark_mc_segmap_parloop_229053_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229053_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229052->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229052->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229052->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229052->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229052->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229052->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229052->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229052->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229052->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229052->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229052->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229052->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229052->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229052->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 =
            futhark_mc_segmap_parloop_struct_229052->free_bytes_212471;
    struct memblock mem_212524 = {.desc ="mem_212524", .mem =
                                  futhark_mc_segmap_parloop_struct_229052->free_mem_212524,
                                  .size =0, .references =NULL};
    size_t mem_212493_cached_sizze_229054 = 0;
    unsigned char *mem_212493 = NULL;
    size_t mem_212503_cached_sizze_229055 = 0;
    unsigned char *mem_212503 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223490 = start;
    
    if (mem_212493_cached_sizze_229054 < (size_t) bytes_210774) {
        mem_212493 = realloc(mem_212493, bytes_210774);
        mem_212493_cached_sizze_229054 = bytes_210774;
    }
    if (mem_212503_cached_sizze_229055 < (size_t) bytes_212471) {
        mem_212503 = realloc(mem_212503, bytes_212471);
        mem_212503_cached_sizze_229055 = bytes_212471;
    }
    for (; iter_223490 < end; iter_223490++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223536 = m_196691;
        int64_t gtid_205969 = iter_223490;
        int64_t remnant_223537 = iter_223490 - gtid_205969;
        
        for (int64_t i_223491 = 0; i_223491 < l_n_m_196752; i_223491++) {
            int64_t x_223493;
            
            x_223493 = ((int64_t *) mem_210827.mem)[gtid_205969 * l_n_m_196752 +
                                                    i_223491];
            
            float x_223494;
            
            x_223494 = ((float *) mem_210831.mem)[gtid_205969 * l_n_m_196752 +
                                                  i_223491];
            
            int64_t min_arg_223495 = mul64(jump_t_196702, i_223491);
            int64_t min_res_223496 = smin64(i_196779, min_arg_223495);
            int64_t defunc_0_g_res_223497 = add64((int64_t) 1, min_res_223496);
            float defunc_2_reduce_res_223499;
            float redout_223502 = 0.0F;
            
            for (int64_t i_223501 = 0; i_223501 < q_l_196697; i_223501++) {
                bool cond_223504 = sle64(n_196692, i_223501);
                int64_t defunc_0_f_res_223505;
                
                if (cond_223504) {
                    defunc_0_f_res_223505 = (int64_t) 0;
                } else {
                    int64_t i_223506 = add64(x_223493, i_223501);
                    int64_t defunc_1_add_res_223507 = add64((int64_t) 1,
                                                            i_223506);
                    
                    defunc_0_f_res_223505 = defunc_1_add_res_223507;
                }
                
                float defunc_0_f_res_223508;
                
                if (cond_223504) {
                    defunc_0_f_res_223508 = 0.0F;
                } else {
                    int64_t i_223509 = add64(x_223493, i_223501);
                    float defunc_0_add_arg_223510;
                    
                    defunc_0_add_arg_223510 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_205969 *
                                                          ctx_param_ext_210921 +
                                                          i_223509 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_223508 = defunc_0_add_arg_223510;
                }
                
                int64_t binop_p_223511 = sub64(defunc_0_f_res_223505,
                                               defunc_0_g_res_223497);
                float defunc_0_f_res_223512 = sitofp_i64_f32(binop_p_223511);
                float abs_res_223513 = (float) fabs(defunc_0_f_res_223512);
                float tmp1_223514 = abs_res_223513 / x_223494;
                float x_223515 = tmp1_223514 * tmp1_223514;
                float y_223516 = tmp1_223514 * x_223515;
                float tmp2_223517 = 1.0F - y_223516;
                float x_223518 = tmp2_223517 * tmp2_223517;
                float tmp3_223519 = tmp2_223517 * x_223518;
                float tmp4_223520 = defunc_0_f_res_223508 * tmp3_223519;
                float defunc_1_op_res_223521 = tmp4_223520 + redout_223502;
                
                ((float *) mem_212503)[i_223501] = tmp4_223520;
                
                float redout_tmp_223539 = defunc_1_op_res_223521;
                
                redout_223502 = redout_tmp_223539;
            }
            defunc_2_reduce_res_223499 = redout_223502;
            
            float a0_223523 = 1.0F / defunc_2_reduce_res_223499;
            float defunc_2_reduce_res_223524;
            float redout_223526 = 0.0F;
            
            for (int64_t i_223525 = 0; i_223525 < q_l_196697; i_223525++) {
                float x_223527;
                
                x_223527 = ((float *) mem_212503)[i_223525];
                
                bool cond_223528 = sle64(n_196692, i_223525);
                float defunc_0_f_res_223529;
                
                if (cond_223528) {
                    defunc_0_f_res_223529 = 0.0F;
                } else {
                    int64_t i_223530 = add64(x_223493, i_223525);
                    float defunc_0_add_arg_223531;
                    
                    defunc_0_add_arg_223531 =
                        ((float *) mem_212347.mem)[gtid_205969 * n_196692 +
                                                   i_223530];
                    defunc_0_f_res_223529 = defunc_0_add_arg_223531;
                }
                
                float x_223532 = a0_223523 * x_223527;
                float defunc_9_fit_fun_res_223533 = defunc_0_f_res_223529 *
                      x_223532;
                float defunc_1_op_res_223534 = defunc_9_fit_fun_res_223533 +
                      redout_223526;
                float redout_tmp_223541 = defunc_1_op_res_223534;
                
                redout_223526 = redout_tmp_223541;
            }
            defunc_2_reduce_res_223524 = redout_223526;
            ((float *) mem_212493)[i_223491] = defunc_2_reduce_res_223524;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212524.mem + gtid_205969 * l_n_m_196752 * (int64_t) 4,
                    mem_212493 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212493);
    free(mem_212503);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229053_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229053_end -
                 futhark_mc_segmap_parloop_229053_start;
        
        ctx->futhark_mc_segmap_parloop_229053_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229053_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229053_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229051(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_205968 = tid;
    int num_tasks_223489 = info.nsubtasks;
    struct futhark_mc_task_229050 *futhark_mc_task_229050 =
                                  (struct futhark_mc_task_229050 *) args;
    struct futhark_context *ctx = futhark_mc_task_229050->ctx;
    uint64_t futhark_mc_segmap_task_229051_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229051_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229050->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229050->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229050->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229050->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229050->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229050->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229050->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229050->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229050->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229050->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229050->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229050->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229050->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229050->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 = futhark_mc_task_229050->free_bytes_212471;
    struct memblock mem_212524 = {.desc ="mem_212524", .mem =
                                  futhark_mc_task_229050->free_mem_212524,
                                  .size =0, .references =NULL};
    int64_t iter_223490;
    struct futhark_mc_segmap_parloop_struct_229052
    futhark_mc_segmap_parloop_struct_229052;
    
    futhark_mc_segmap_parloop_struct_229052.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229052.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229052.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229052.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229052.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229052.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229052.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229052.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229052.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229052.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229052.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229052.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229052.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229052.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229052.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229052.free_bytes_212471 = bytes_212471;
    futhark_mc_segmap_parloop_struct_229052.free_mem_212524 = mem_212524.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229053_task;
    
    futhark_mc_segmap_parloop_229053_task.name =
        "futhark_mc_segmap_parloop_229053";
    futhark_mc_segmap_parloop_229053_task.fn = futhark_mc_segmap_parloop_229053;
    futhark_mc_segmap_parloop_229053_task.args =
        &futhark_mc_segmap_parloop_struct_229052;
    futhark_mc_segmap_parloop_229053_task.iterations = iterations;
    futhark_mc_segmap_parloop_229053_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229053_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229053_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229053_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229053_task);
    
    if (futhark_mc_segmap_parloop_229053_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229053_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229053_total_end -
                 futhark_mc_segmap_parloop_229053_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229053_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229053_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229053_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229051_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229051_end -
                 futhark_mc_segmap_task_229051_start;
        
        ctx->futhark_mc_segmap_task_229051_runs[tid]++;
        ctx->futhark_mc_segmap_task_229051_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229051_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229057 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212471;
    unsigned char *free_mem_212524;
};
struct futhark_mc_task_229060 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206029;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212471;
    unsigned char *free_mem_212490;
};
struct futhark_mc_segmap_parloop_struct_229062 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206029;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212471;
    unsigned char *free_mem_212490;
};
static int futhark_mc_segmap_parloop_229063(void *args, int64_t start,
                                            int64_t end, int flat_tid_223589,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229062
    *futhark_mc_segmap_parloop_struct_229062 =
    (struct futhark_mc_segmap_parloop_struct_229062 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229062->ctx;
    uint64_t futhark_mc_segmap_parloop_229063_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229063_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229062->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229062->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229062->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229062->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229062->free_i_196779;
    int64_t gtid_206029 =
            futhark_mc_segmap_parloop_struct_229062->free_gtid_206029;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229062->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229062->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229062->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229062->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229062->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229062->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229062->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 =
            futhark_mc_segmap_parloop_struct_229062->free_bytes_212471;
    struct memblock mem_212490 = {.desc ="mem_212490", .mem =
                                  futhark_mc_segmap_parloop_struct_229062->free_mem_212490,
                                  .size =0, .references =NULL};
    size_t mem_223596_cached_sizze_229064 = 0;
    unsigned char *mem_223596 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223637 = start;
    
    if (mem_223596_cached_sizze_229064 < (size_t) bytes_212471) {
        mem_223596 = realloc(mem_223596, bytes_212471);
        mem_223596_cached_sizze_229064 = bytes_212471;
    }
    for (; iter_223637 < end; iter_223637++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223670 = l_n_m_196752;
        int64_t gtid_223590 = iter_223637;
        int64_t remnant_223671 = iter_223637 - gtid_223590;
        int64_t x_223591;
        
        x_223591 = ((int64_t *) mem_210827.mem)[gtid_206029 * l_n_m_196752 +
                                                gtid_223590];
        
        float x_223592;
        
        x_223592 = ((float *) mem_210831.mem)[gtid_206029 * l_n_m_196752 +
                                              gtid_223590];
        
        int64_t min_arg_223593 = mul64(jump_t_196702, gtid_223590);
        int64_t min_res_223594 = smin64(i_196779, min_arg_223593);
        int64_t defunc_0_g_res_223595 = add64((int64_t) 1, min_res_223594);
        float defunc_2_reduce_res_223598;
        float redout_223639 = 0.0F;
        
        for (int64_t i_223638 = 0; i_223638 < q_l_196697; i_223638++) {
            bool cond_223641 = sle64(n_196692, i_223638);
            int64_t defunc_0_f_res_223642;
            
            if (cond_223641) {
                defunc_0_f_res_223642 = (int64_t) 0;
            } else {
                int64_t i_223643 = add64(x_223591, i_223638);
                int64_t defunc_1_add_res_223644 = add64((int64_t) 1, i_223643);
                
                defunc_0_f_res_223642 = defunc_1_add_res_223644;
            }
            
            float defunc_0_f_res_223645;
            
            if (cond_223641) {
                defunc_0_f_res_223645 = 0.0F;
            } else {
                int64_t i_223646 = add64(x_223591, i_223638);
                float defunc_0_add_arg_223647;
                
                defunc_0_add_arg_223647 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_206029 *
                                                      ctx_param_ext_210921 +
                                                      i_223646 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_223645 = defunc_0_add_arg_223647;
            }
            
            int64_t binop_p_223648 = sub64(defunc_0_f_res_223642,
                                           defunc_0_g_res_223595);
            float defunc_0_f_res_223649 = sitofp_i64_f32(binop_p_223648);
            float abs_res_223650 = (float) fabs(defunc_0_f_res_223649);
            float tmp1_223651 = abs_res_223650 / x_223592;
            float x_223652 = tmp1_223651 * tmp1_223651;
            float y_223653 = tmp1_223651 * x_223652;
            float tmp2_223654 = 1.0F - y_223653;
            float x_223655 = tmp2_223654 * tmp2_223654;
            float tmp3_223656 = tmp2_223654 * x_223655;
            float tmp4_223657 = defunc_0_f_res_223645 * tmp3_223656;
            float defunc_1_op_res_223658 = tmp4_223657 + redout_223639;
            
            ((float *) mem_223596)[i_223638] = tmp4_223657;
            
            float redout_tmp_223672 = defunc_1_op_res_223658;
            
            redout_223639 = redout_tmp_223672;
        }
        defunc_2_reduce_res_223598 = redout_223639;
        
        float a0_223622 = 1.0F / defunc_2_reduce_res_223598;
        float defunc_2_reduce_res_223623;
        float redout_223661 = 0.0F;
        
        for (int64_t i_223660 = 0; i_223660 < q_l_196697; i_223660++) {
            float x_223662;
            
            x_223662 = ((float *) mem_223596)[i_223660];
            
            bool cond_223663 = sle64(n_196692, i_223660);
            float defunc_0_f_res_223664;
            
            if (cond_223663) {
                defunc_0_f_res_223664 = 0.0F;
            } else {
                int64_t i_223665 = add64(x_223591, i_223660);
                float defunc_0_add_arg_223666;
                
                defunc_0_add_arg_223666 =
                    ((float *) mem_212347.mem)[gtid_206029 * n_196692 +
                                               i_223665];
                defunc_0_f_res_223664 = defunc_0_add_arg_223666;
            }
            
            float x_223667 = a0_223622 * x_223662;
            float defunc_9_fit_fun_res_223668 = defunc_0_f_res_223664 *
                  x_223667;
            float defunc_1_op_res_223669 = defunc_9_fit_fun_res_223668 +
                  redout_223661;
            float redout_tmp_223674 = defunc_1_op_res_223669;
            
            redout_223661 = redout_tmp_223674;
        }
        defunc_2_reduce_res_223623 = redout_223661;
        ((float *) mem_212490.mem)[gtid_223590] = defunc_2_reduce_res_223623;
    }
    
  cleanup:
    { }
    free(mem_223596);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229063_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229063_end -
                 futhark_mc_segmap_parloop_229063_start;
        
        ctx->futhark_mc_segmap_parloop_229063_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229063_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229063_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229061(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223589 = tid;
    int num_tasks_223636 = info.nsubtasks;
    struct futhark_mc_task_229060 *futhark_mc_task_229060 =
                                  (struct futhark_mc_task_229060 *) args;
    struct futhark_context *ctx = futhark_mc_task_229060->ctx;
    uint64_t futhark_mc_segmap_task_229061_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229061_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229060->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229060->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229060->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229060->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229060->free_i_196779;
    int64_t gtid_206029 = futhark_mc_task_229060->free_gtid_206029;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229060->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229060->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229060->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229060->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229060->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229060->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229060->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 = futhark_mc_task_229060->free_bytes_212471;
    struct memblock mem_212490 = {.desc ="mem_212490", .mem =
                                  futhark_mc_task_229060->free_mem_212490,
                                  .size =0, .references =NULL};
    int64_t iter_223637;
    struct futhark_mc_segmap_parloop_struct_229062
    futhark_mc_segmap_parloop_struct_229062;
    
    futhark_mc_segmap_parloop_struct_229062.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229062.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229062.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229062.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229062.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229062.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229062.free_gtid_206029 = gtid_206029;
    futhark_mc_segmap_parloop_struct_229062.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229062.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229062.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229062.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229062.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229062.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229062.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229062.free_bytes_212471 = bytes_212471;
    futhark_mc_segmap_parloop_struct_229062.free_mem_212490 = mem_212490.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229063_task;
    
    futhark_mc_segmap_parloop_229063_task.name =
        "futhark_mc_segmap_parloop_229063";
    futhark_mc_segmap_parloop_229063_task.fn = futhark_mc_segmap_parloop_229063;
    futhark_mc_segmap_parloop_229063_task.args =
        &futhark_mc_segmap_parloop_struct_229062;
    futhark_mc_segmap_parloop_229063_task.iterations = iterations;
    futhark_mc_segmap_parloop_229063_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229063_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229063_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229063_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229063_task);
    
    if (futhark_mc_segmap_parloop_229063_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229063_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229063_total_end -
                 futhark_mc_segmap_parloop_229063_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229063_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229063_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229063_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229061_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229061_end -
                 futhark_mc_segmap_task_229061_start;
        
        ctx->futhark_mc_segmap_task_229061_runs[tid]++;
        ctx->futhark_mc_segmap_task_229061_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229061_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229066 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206029;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212471;
    unsigned char *free_mem_212490;
};
struct futhark_mc_task_229069 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206029;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_223545;
    float free_x_223546;
    int64_t free_defunc_0_g_res_223549;
    float *retval_defunc_2_reduce_res_223551;
    unsigned char *retval_mem_223550;
};
struct futhark_mc_segred_stage_1_parloop_struct_229072 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206029;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_223545;
    float free_x_223546;
    int64_t free_defunc_0_g_res_223549;
    unsigned char *free_mem_223550;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223713;
};
static int futhark_mc_segred_stage_1_parloop_229073(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_223676,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229072
    *futhark_mc_segred_stage_1_parloop_struct_229072 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229072 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229072->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229073_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229073_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_n_196692;
    int64_t gtid_206029 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_gtid_206029;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_229072->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_223545 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_x_223545;
    float x_223546 =
          futhark_mc_segred_stage_1_parloop_struct_229072->free_x_223546;
    int64_t defunc_0_g_res_223549 =
            futhark_mc_segred_stage_1_parloop_struct_229072->free_defunc_0_g_res_223549;
    struct memblock mem_223550 = {.desc ="mem_223550", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229072->free_mem_223550,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_223713 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223713",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229072->free_reduce_stage_1_tid_res_arr_mem_223713,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_223715 = start;
    float x_223678;
    float x_223679;
    float local_acc_223716 = 0.0F;
    
    for (; iter_223715 < end; iter_223715++) {
        int64_t gtid_223677 = iter_223715;
        bool cond_223681 = sle64(n_196692, gtid_223677);
        int64_t defunc_0_f_res_223682;
        
        if (cond_223681) {
            defunc_0_f_res_223682 = (int64_t) 0;
        } else {
            int64_t i_223683 = add64(x_223545, gtid_223677);
            int64_t defunc_1_add_res_223684 = add64((int64_t) 1, i_223683);
            
            defunc_0_f_res_223682 = defunc_1_add_res_223684;
        }
        
        float defunc_0_f_res_223685;
        
        if (cond_223681) {
            defunc_0_f_res_223685 = 0.0F;
        } else {
            int64_t i_223686 = add64(x_223545, gtid_223677);
            float defunc_0_add_arg_223687;
            
            defunc_0_add_arg_223687 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_206029 *
                                                  ctx_param_ext_210921 +
                                                  i_223686 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_223685 = defunc_0_add_arg_223687;
        }
        
        int64_t binop_p_223688 = sub64(defunc_0_f_res_223682,
                                       defunc_0_g_res_223549);
        float defunc_0_f_res_223689 = sitofp_i64_f32(binop_p_223688);
        float abs_res_223690 = (float) fabs(defunc_0_f_res_223689);
        float tmp1_223691 = abs_res_223690 / x_223546;
        float x_223692 = tmp1_223691 * tmp1_223691;
        float y_223693 = tmp1_223691 * x_223692;
        float tmp2_223694 = 1.0F - y_223693;
        float x_223695 = tmp2_223694 * tmp2_223694;
        float tmp3_223696 = tmp2_223694 * x_223695;
        float tmp4_223697 = defunc_0_f_res_223685 * tmp3_223696;
        
        // save map-out results
        {
            ((float *) mem_223550.mem)[gtid_223677] = tmp4_223697;
        }
        // Load accum params
        {
            x_223678 = local_acc_223716;
        }
        // Load next params
        {
            x_223679 = tmp4_223697;
        }
        // Red body
        {
            float defunc_1_op_res_223680 = x_223678 + x_223679;
            
            local_acc_223716 = defunc_1_op_res_223680;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_223713.mem)[flat_tid_223676] =
        local_acc_223716;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229073_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229073_end -
                 futhark_mc_segred_stage_1_parloop_229073_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229073_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229073_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229073_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229070(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223676 = tid;
    int num_tasks_223712 = info.nsubtasks;
    struct futhark_mc_task_229069 *futhark_mc_task_229069 =
                                  (struct futhark_mc_task_229069 *) args;
    struct futhark_context *ctx = futhark_mc_task_229069->ctx;
    uint64_t futhark_mc_segred_task_229070_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229070_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229069->free_n_196692;
    int64_t gtid_206029 = futhark_mc_task_229069->free_gtid_206029;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229069->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229069->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229069->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229069->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_223545 = futhark_mc_task_229069->free_x_223545;
    float x_223546 = futhark_mc_task_229069->free_x_223546;
    int64_t defunc_0_g_res_223549 =
            futhark_mc_task_229069->free_defunc_0_g_res_223549;
    float defunc_2_reduce_res_223551 =
          *futhark_mc_task_229069->retval_defunc_2_reduce_res_223551;
    struct memblock mem_223550 = {.desc ="mem_223550", .mem =
                                  futhark_mc_task_229069->retval_mem_223550,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_223713_cached_sizze_229071 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223713 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_223713_cached_sizze_229071 <
        (size_t) ((int64_t) 4 * num_tasks_223712)) {
        reduce_stage_1_tid_res_arr_mem_223713 =
            realloc(reduce_stage_1_tid_res_arr_mem_223713, (int64_t) 4 *
                    num_tasks_223712);
        reduce_stage_1_tid_res_arr_mem_223713_cached_sizze_229071 =
            (int64_t) 4 * num_tasks_223712;
    }
    
    int64_t iter_223715;
    struct futhark_mc_segred_stage_1_parloop_struct_229072
    futhark_mc_segred_stage_1_parloop_struct_229072;
    
    futhark_mc_segred_stage_1_parloop_struct_229072.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_gtid_206029 =
        gtid_206029;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_x_223545 = x_223545;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_x_223546 = x_223546;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_defunc_0_g_res_223549 =
        defunc_0_g_res_223549;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_mem_223550 =
        mem_223550.mem;
    futhark_mc_segred_stage_1_parloop_struct_229072.free_reduce_stage_1_tid_res_arr_mem_223713 =
        reduce_stage_1_tid_res_arr_mem_223713;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229073_task;
    
    futhark_mc_segred_stage_1_parloop_229073_task.name =
        "futhark_mc_segred_stage_1_parloop_229073";
    futhark_mc_segred_stage_1_parloop_229073_task.fn =
        futhark_mc_segred_stage_1_parloop_229073;
    futhark_mc_segred_stage_1_parloop_229073_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229072;
    futhark_mc_segred_stage_1_parloop_229073_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229073_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229073_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229073_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229073_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229073_task);
    
    if (futhark_mc_segred_stage_1_parloop_229073_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229073_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229073_total_end -
                 futhark_mc_segred_stage_1_parloop_229073_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229073_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229073_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229073_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_223551 = 0.0F;
    }
    
    float x_223717;
    float x_223718;
    
    for (int32_t i_223720 = 0; i_223720 < num_tasks_223712; i_223720++) {
        flat_tid_223676 = i_223720;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_223717 = defunc_2_reduce_res_223551;
            }
            // load next params
            {
                x_223718 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223713)[flat_tid_223676];
            }
            // red body
            {
                float defunc_1_op_res_223719 = x_223717 + x_223718;
                
                defunc_2_reduce_res_223551 = defunc_1_op_res_223719;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_223713);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229070_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229070_end -
                 futhark_mc_segred_task_229070_start;
        
        ctx->futhark_mc_segred_task_229070_runs[tid]++;
        ctx->futhark_mc_segred_task_229070_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229070_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229069->retval_defunc_2_reduce_res_223551 =
            defunc_2_reduce_res_223551;
        futhark_mc_task_229069->retval_mem_223550 = mem_223550.mem;
    }
    return err;
}
struct futhark_mc_task_229074 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206029;
    unsigned char *free_mem_212347;
    int64_t free_x_223545;
    unsigned char *free_mem_223550;
    float free_a0_223575;
    float *retval_defunc_2_reduce_res_223576;
};
struct futhark_mc_segred_stage_1_parloop_struct_229077 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206029;
    unsigned char *free_mem_212347;
    int64_t free_x_223545;
    unsigned char *free_mem_223550;
    float free_a0_223575;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_223722;
};
static int futhark_mc_segred_stage_1_parloop_229078(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_223698,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229077
    *futhark_mc_segred_stage_1_parloop_struct_229077 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229077 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229077->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229078_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229078_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229077->free_n_196692;
    int64_t gtid_206029 =
            futhark_mc_segred_stage_1_parloop_struct_229077->free_gtid_206029;
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229077->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_223545 =
            futhark_mc_segred_stage_1_parloop_struct_229077->free_x_223545;
    struct memblock mem_223550 = {.desc ="mem_223550", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229077->free_mem_223550,
                                  .size =0, .references =NULL};
    float a0_223575 =
          futhark_mc_segred_stage_1_parloop_struct_229077->free_a0_223575;
    struct memblock reduce_stage_1_tid_res_arr_mem_223722 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_223722",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229077->free_reduce_stage_1_tid_res_arr_mem_223722,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_223724 = start;
    float x_223700;
    float x_223701;
    float local_acc_223725 = 0.0F;
    
    for (; iter_223724 < end; iter_223724++) {
        int64_t gtid_223699 = iter_223724;
        float x_223703;
        
        x_223703 = ((float *) mem_223550.mem)[gtid_223699];
        
        bool cond_223704 = sle64(n_196692, gtid_223699);
        float defunc_0_f_res_223705;
        
        if (cond_223704) {
            defunc_0_f_res_223705 = 0.0F;
        } else {
            int64_t i_223706 = add64(x_223545, gtid_223699);
            float defunc_0_add_arg_223707;
            
            defunc_0_add_arg_223707 = ((float *) mem_212347.mem)[gtid_206029 *
                                                                 n_196692 +
                                                                 i_223706];
            defunc_0_f_res_223705 = defunc_0_add_arg_223707;
        }
        
        float x_223708 = a0_223575 * x_223703;
        float defunc_9_fit_fun_res_223709 = defunc_0_f_res_223705 * x_223708;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_223700 = local_acc_223725;
        }
        // Load next params
        {
            x_223701 = defunc_9_fit_fun_res_223709;
        }
        // Red body
        {
            float defunc_1_op_res_223702 = x_223700 + x_223701;
            
            local_acc_223725 = defunc_1_op_res_223702;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_223722.mem)[flat_tid_223698] =
        local_acc_223725;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229078_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229078_end -
                 futhark_mc_segred_stage_1_parloop_229078_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229078_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229078_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229078_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229075(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223698 = tid;
    int num_tasks_223721 = info.nsubtasks;
    struct futhark_mc_task_229074 *futhark_mc_task_229074 =
                                  (struct futhark_mc_task_229074 *) args;
    struct futhark_context *ctx = futhark_mc_task_229074->ctx;
    uint64_t futhark_mc_segred_task_229075_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229075_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229074->free_n_196692;
    int64_t gtid_206029 = futhark_mc_task_229074->free_gtid_206029;
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229074->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_223545 = futhark_mc_task_229074->free_x_223545;
    struct memblock mem_223550 = {.desc ="mem_223550", .mem =
                                  futhark_mc_task_229074->free_mem_223550,
                                  .size =0, .references =NULL};
    float a0_223575 = futhark_mc_task_229074->free_a0_223575;
    float defunc_2_reduce_res_223576 =
          *futhark_mc_task_229074->retval_defunc_2_reduce_res_223576;
    size_t reduce_stage_1_tid_res_arr_mem_223722_cached_sizze_229076 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_223722 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_223722_cached_sizze_229076 <
        (size_t) ((int64_t) 4 * num_tasks_223721)) {
        reduce_stage_1_tid_res_arr_mem_223722 =
            realloc(reduce_stage_1_tid_res_arr_mem_223722, (int64_t) 4 *
                    num_tasks_223721);
        reduce_stage_1_tid_res_arr_mem_223722_cached_sizze_229076 =
            (int64_t) 4 * num_tasks_223721;
    }
    
    int64_t iter_223724;
    struct futhark_mc_segred_stage_1_parloop_struct_229077
    futhark_mc_segred_stage_1_parloop_struct_229077;
    
    futhark_mc_segred_stage_1_parloop_struct_229077.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_gtid_206029 =
        gtid_206029;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_mem_212347 =
        mem_212347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_x_223545 = x_223545;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_mem_223550 =
        mem_223550.mem;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_a0_223575 = a0_223575;
    futhark_mc_segred_stage_1_parloop_struct_229077.free_reduce_stage_1_tid_res_arr_mem_223722 =
        reduce_stage_1_tid_res_arr_mem_223722;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229078_task;
    
    futhark_mc_segred_stage_1_parloop_229078_task.name =
        "futhark_mc_segred_stage_1_parloop_229078";
    futhark_mc_segred_stage_1_parloop_229078_task.fn =
        futhark_mc_segred_stage_1_parloop_229078;
    futhark_mc_segred_stage_1_parloop_229078_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229077;
    futhark_mc_segred_stage_1_parloop_229078_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229078_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229078_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229078_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229078_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229078_task);
    
    if (futhark_mc_segred_stage_1_parloop_229078_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229078_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229078_total_end -
                 futhark_mc_segred_stage_1_parloop_229078_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229078_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229078_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229078_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_223576 = 0.0F;
    }
    
    float x_223726;
    float x_223727;
    
    for (int32_t i_223729 = 0; i_223729 < num_tasks_223721; i_223729++) {
        flat_tid_223698 = i_223729;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_223726 = defunc_2_reduce_res_223576;
            }
            // load next params
            {
                x_223727 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_223722)[flat_tid_223698];
            }
            // red body
            {
                float defunc_1_op_res_223728 = x_223726 + x_223727;
                
                defunc_2_reduce_res_223576 = defunc_1_op_res_223728;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_223722);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229075_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229075_end -
                 futhark_mc_segred_task_229075_start;
        
        ctx->futhark_mc_segred_task_229075_runs[tid]++;
        ctx->futhark_mc_segred_task_229075_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229075_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229074->retval_defunc_2_reduce_res_223576 =
            defunc_2_reduce_res_223576;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229067(void *args, int64_t start,
                                            int64_t end, int flat_tid_223543,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229066
    *futhark_mc_segmap_parloop_struct_229066 =
    (struct futhark_mc_segmap_parloop_struct_229066 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229066->ctx;
    uint64_t futhark_mc_segmap_parloop_229067_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229067_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229066->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229066->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229066->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229066->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229066->free_i_196779;
    int64_t gtid_206029 =
            futhark_mc_segmap_parloop_struct_229066->free_gtid_206029;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229066->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229066->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229066->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229066->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229066->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229066->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229066->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 =
            futhark_mc_segmap_parloop_struct_229066->free_bytes_212471;
    struct memblock mem_212490 = {.desc ="mem_212490", .mem =
                                  futhark_mc_segmap_parloop_struct_229066->free_mem_212490,
                                  .size =0, .references =NULL};
    size_t mem_223550_cached_sizze_229068 = 0;
    unsigned char *mem_223550 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223675 = start;
    
    if (mem_223550_cached_sizze_229068 < (size_t) bytes_212471) {
        mem_223550 = realloc(mem_223550, bytes_212471);
        mem_223550_cached_sizze_229068 = bytes_212471;
    }
    for (; iter_223675 < end; iter_223675++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223710 = l_n_m_196752;
        int64_t gtid_223544 = iter_223675;
        int64_t remnant_223711 = iter_223675 - gtid_223544;
        int64_t x_223545;
        
        x_223545 = ((int64_t *) mem_210827.mem)[gtid_206029 * l_n_m_196752 +
                                                gtid_223544];
        
        float x_223546;
        
        x_223546 = ((float *) mem_210831.mem)[gtid_206029 * l_n_m_196752 +
                                              gtid_223544];
        
        int64_t min_arg_223547 = mul64(jump_t_196702, gtid_223544);
        int64_t min_res_223548 = smin64(i_196779, min_arg_223547);
        int64_t defunc_0_g_res_223549 = add64((int64_t) 1, min_res_223548);
        float defunc_2_reduce_res_223551;
        int64_t flat_tid_223676 = (int64_t) 0;
        int32_t num_tasks_223712;
        
        defunc_2_reduce_res_223551 = 0.0F;
        
        struct futhark_mc_task_229069 futhark_mc_task_229069;
        
        futhark_mc_task_229069.ctx = ctx;
        futhark_mc_task_229069.free_n_196692 = n_196692;
        futhark_mc_task_229069.free_gtid_206029 = gtid_206029;
        futhark_mc_task_229069.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229069.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229069.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229069.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229069.free_x_223545 = x_223545;
        futhark_mc_task_229069.free_x_223546 = x_223546;
        futhark_mc_task_229069.free_defunc_0_g_res_223549 =
            defunc_0_g_res_223549;
        futhark_mc_task_229069.retval_defunc_2_reduce_res_223551 =
            &defunc_2_reduce_res_223551;
        futhark_mc_task_229069.retval_mem_223550 = mem_223550;
        
        struct scheduler_segop futhark_mc_task_229069_task;
        
        futhark_mc_task_229069_task.args = &futhark_mc_task_229069;
        futhark_mc_task_229069_task.top_level_fn =
            futhark_mc_segred_task_229070;
        futhark_mc_task_229069_task.name = "futhark_mc_segred_task_229070";
        futhark_mc_task_229069_task.iterations = q_l_196697;
        futhark_mc_task_229069_task.task_time =
            &ctx->futhark_mc_segred_task_229070_total_time;
        futhark_mc_task_229069_task.task_iter =
            &ctx->futhark_mc_segred_task_229070_total_iter;
        futhark_mc_task_229069_task.sched = STATIC;
        futhark_mc_task_229069_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229070_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229069_task);
        
        if (futhark_mc_segred_task_229070_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float a0_223575 = 1.0F / defunc_2_reduce_res_223551;
        float defunc_2_reduce_res_223576;
        int64_t flat_tid_223698 = (int64_t) 0;
        int32_t num_tasks_223721;
        
        defunc_2_reduce_res_223576 = 0.0F;
        
        struct futhark_mc_task_229074 futhark_mc_task_229074;
        
        futhark_mc_task_229074.ctx = ctx;
        futhark_mc_task_229074.free_n_196692 = n_196692;
        futhark_mc_task_229074.free_gtid_206029 = gtid_206029;
        futhark_mc_task_229074.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229074.free_x_223545 = x_223545;
        futhark_mc_task_229074.free_mem_223550 = mem_223550;
        futhark_mc_task_229074.free_a0_223575 = a0_223575;
        futhark_mc_task_229074.retval_defunc_2_reduce_res_223576 =
            &defunc_2_reduce_res_223576;
        
        struct scheduler_segop futhark_mc_task_229074_task;
        
        futhark_mc_task_229074_task.args = &futhark_mc_task_229074;
        futhark_mc_task_229074_task.top_level_fn =
            futhark_mc_segred_task_229075;
        futhark_mc_task_229074_task.name = "futhark_mc_segred_task_229075";
        futhark_mc_task_229074_task.iterations = q_l_196697;
        futhark_mc_task_229074_task.task_time =
            &ctx->futhark_mc_segred_task_229075_total_time;
        futhark_mc_task_229074_task.task_iter =
            &ctx->futhark_mc_segred_task_229075_total_iter;
        futhark_mc_task_229074_task.sched = STATIC;
        futhark_mc_task_229074_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229075_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229074_task);
        
        if (futhark_mc_segred_task_229075_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212490.mem)[gtid_223544] = defunc_2_reduce_res_223576;
    }
    
  cleanup:
    { }
    free(mem_223550);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229067_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229067_end -
                 futhark_mc_segmap_parloop_229067_start;
        
        ctx->futhark_mc_segmap_parloop_229067_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229067_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229067_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229065(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223543 = tid;
    int num_tasks_223636 = info.nsubtasks;
    struct futhark_mc_task_229060 *futhark_mc_task_229060 =
                                  (struct futhark_mc_task_229060 *) args;
    struct futhark_context *ctx = futhark_mc_task_229060->ctx;
    uint64_t futhark_mc_segmap_nested_task_229065_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229065_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229060->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229060->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229060->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229060->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229060->free_i_196779;
    int64_t gtid_206029 = futhark_mc_task_229060->free_gtid_206029;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229060->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229060->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229060->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229060->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229060->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229060->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229060->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 = futhark_mc_task_229060->free_bytes_212471;
    struct memblock mem_212490 = {.desc ="mem_212490", .mem =
                                  futhark_mc_task_229060->free_mem_212490,
                                  .size =0, .references =NULL};
    int64_t iter_223675;
    struct futhark_mc_segmap_parloop_struct_229066
    futhark_mc_segmap_parloop_struct_229066;
    
    futhark_mc_segmap_parloop_struct_229066.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229066.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229066.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229066.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229066.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229066.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229066.free_gtid_206029 = gtid_206029;
    futhark_mc_segmap_parloop_struct_229066.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229066.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229066.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229066.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229066.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229066.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229066.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229066.free_bytes_212471 = bytes_212471;
    futhark_mc_segmap_parloop_struct_229066.free_mem_212490 = mem_212490.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229067_task;
    
    futhark_mc_segmap_parloop_229067_task.name =
        "futhark_mc_segmap_parloop_229067";
    futhark_mc_segmap_parloop_229067_task.fn = futhark_mc_segmap_parloop_229067;
    futhark_mc_segmap_parloop_229067_task.args =
        &futhark_mc_segmap_parloop_struct_229066;
    futhark_mc_segmap_parloop_229067_task.iterations = iterations;
    futhark_mc_segmap_parloop_229067_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229067_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229067_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229067_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229067_task);
    
    if (futhark_mc_segmap_parloop_229067_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229067_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229067_total_end -
                 futhark_mc_segmap_parloop_229067_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229067_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229067_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229067_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229065_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229065_end -
                 futhark_mc_segmap_nested_task_229065_start;
        
        ctx->futhark_mc_segmap_nested_task_229065_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229065_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229065_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229058(void *args, int64_t start,
                                            int64_t end, int flat_tid_206028,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229057
    *futhark_mc_segmap_parloop_struct_229057 =
    (struct futhark_mc_segmap_parloop_struct_229057 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229057->ctx;
    uint64_t futhark_mc_segmap_parloop_229058_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229058_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229057->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229057->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229057->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229057->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229057->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229057->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229057->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229057->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229057->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229057->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229057->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229057->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229057->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229057->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 =
            futhark_mc_segmap_parloop_struct_229057->free_bytes_212471;
    struct memblock mem_212524 = {.desc ="mem_212524", .mem =
                                  futhark_mc_segmap_parloop_struct_229057->free_mem_212524,
                                  .size =0, .references =NULL};
    size_t mem_212490_cached_sizze_229059 = 0;
    unsigned char *mem_212490 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223542 = start;
    
    if (mem_212490_cached_sizze_229059 < (size_t) bytes_210774) {
        mem_212490 = realloc(mem_212490, bytes_210774);
        mem_212490_cached_sizze_229059 = bytes_210774;
    }
    for (; iter_223542 < end; iter_223542++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223634 = m_196691;
        int64_t gtid_206029 = iter_223542;
        int64_t remnant_223635 = iter_223542 - gtid_206029;
        int64_t flat_tid_223589 = (int64_t) 0;
        int32_t num_tasks_223636;
        int64_t flat_tid_223543 = (int64_t) 0;
        struct futhark_mc_task_229060 futhark_mc_task_229060;
        
        futhark_mc_task_229060.ctx = ctx;
        futhark_mc_task_229060.free_n_196692 = n_196692;
        futhark_mc_task_229060.free_q_l_196697 = q_l_196697;
        futhark_mc_task_229060.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229060.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_229060.free_i_196779 = i_196779;
        futhark_mc_task_229060.free_gtid_206029 = gtid_206029;
        futhark_mc_task_229060.free_mem_210827 = mem_210827.mem;
        futhark_mc_task_229060.free_mem_210831 = mem_210831.mem;
        futhark_mc_task_229060.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229060.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229060.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229060.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229060.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229060.free_bytes_212471 = bytes_212471;
        futhark_mc_task_229060.free_mem_212490 = mem_212490;
        
        struct scheduler_segop futhark_mc_task_229060_task;
        
        futhark_mc_task_229060_task.args = &futhark_mc_task_229060;
        futhark_mc_task_229060_task.top_level_fn =
            futhark_mc_segmap_task_229061;
        futhark_mc_task_229060_task.name = "futhark_mc_segmap_task_229061";
        futhark_mc_task_229060_task.iterations = l_n_m_196752;
        futhark_mc_task_229060_task.task_time =
            &ctx->futhark_mc_segmap_task_229061_total_time;
        futhark_mc_task_229060_task.task_iter =
            &ctx->futhark_mc_segmap_task_229061_total_iter;
        futhark_mc_task_229060_task.sched = STATIC;
        futhark_mc_task_229060_task.nested_fn =
            futhark_mc_segmap_nested_task_229065;
        
        int futhark_mc_segmap_task_229061_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229060_task);
        
        if (futhark_mc_segmap_task_229061_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212524.mem + gtid_206029 * l_n_m_196752 * (int64_t) 4,
                    mem_212490 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212490);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229058_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229058_end -
                 futhark_mc_segmap_parloop_229058_start;
        
        ctx->futhark_mc_segmap_parloop_229058_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229058_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229058_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229056(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206028 = tid;
    int num_tasks_223489 = info.nsubtasks;
    struct futhark_mc_task_229050 *futhark_mc_task_229050 =
                                  (struct futhark_mc_task_229050 *) args;
    struct futhark_context *ctx = futhark_mc_task_229050->ctx;
    uint64_t futhark_mc_segmap_nested_task_229056_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229056_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229050->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229050->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229050->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229050->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229050->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229050->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229050->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229050->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229050->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229050->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229050->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229050->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229050->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229050->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212471 = futhark_mc_task_229050->free_bytes_212471;
    struct memblock mem_212524 = {.desc ="mem_212524", .mem =
                                  futhark_mc_task_229050->free_mem_212524,
                                  .size =0, .references =NULL};
    int64_t iter_223542;
    struct futhark_mc_segmap_parloop_struct_229057
    futhark_mc_segmap_parloop_struct_229057;
    
    futhark_mc_segmap_parloop_struct_229057.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229057.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229057.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229057.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229057.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229057.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229057.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229057.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229057.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229057.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229057.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229057.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229057.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229057.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229057.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229057.free_bytes_212471 = bytes_212471;
    futhark_mc_segmap_parloop_struct_229057.free_mem_212524 = mem_212524.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229058_task;
    
    futhark_mc_segmap_parloop_229058_task.name =
        "futhark_mc_segmap_parloop_229058";
    futhark_mc_segmap_parloop_229058_task.fn = futhark_mc_segmap_parloop_229058;
    futhark_mc_segmap_parloop_229058_task.args =
        &futhark_mc_segmap_parloop_struct_229057;
    futhark_mc_segmap_parloop_229058_task.iterations = iterations;
    futhark_mc_segmap_parloop_229058_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229058_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229058_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229058_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229058_task);
    
    if (futhark_mc_segmap_parloop_229058_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229058_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229058_total_end -
                 futhark_mc_segmap_parloop_229058_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229058_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229058_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229058_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229056_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229056_end -
                 futhark_mc_segmap_nested_task_229056_start;
        
        ctx->futhark_mc_segmap_nested_task_229056_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229056_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229056_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229079 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212526;
    unsigned char *free_mem_212630;
    unsigned char *free_mem_212634;
};
struct futhark_mc_segmap_parloop_struct_229081 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212526;
    unsigned char *free_mem_212630;
    unsigned char *free_mem_212634;
};
static int futhark_mc_segmap_parloop_229082(void *args, int64_t start,
                                            int64_t end, int flat_tid_206127,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229081
    *futhark_mc_segmap_parloop_struct_229081 =
    (struct futhark_mc_segmap_parloop_struct_229081 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229081->ctx;
    uint64_t futhark_mc_segmap_parloop_229082_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229082_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229081->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229081->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229081->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229081->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229081->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229081->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229081->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229081->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229081->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229081->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229081->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229081->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229081->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229081->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 =
            futhark_mc_segmap_parloop_struct_229081->free_bytes_212526;
    struct memblock mem_212630 = {.desc ="mem_212630", .mem =
                                  futhark_mc_segmap_parloop_struct_229081->free_mem_212630,
                                  .size =0, .references =NULL};
    struct memblock mem_212634 = {.desc ="mem_212634", .mem =
                                  futhark_mc_segmap_parloop_struct_229081->free_mem_212634,
                                  .size =0, .references =NULL};
    size_t mem_212569_cached_sizze_229083 = 0;
    unsigned char *mem_212569 = NULL;
    size_t mem_212572_cached_sizze_229084 = 0;
    unsigned char *mem_212572 = NULL;
    size_t mem_212589_cached_sizze_229085 = 0;
    unsigned char *mem_212589 = NULL;
    size_t mem_212592_cached_sizze_229086 = 0;
    unsigned char *mem_212592 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223731 = start;
    
    if (mem_212569_cached_sizze_229083 < (size_t) bytes_210774) {
        mem_212569 = realloc(mem_212569, bytes_210774);
        mem_212569_cached_sizze_229083 = bytes_210774;
    }
    if (mem_212572_cached_sizze_229084 < (size_t) bytes_210774) {
        mem_212572 = realloc(mem_212572, bytes_210774);
        mem_212572_cached_sizze_229084 = bytes_210774;
    }
    if (mem_212589_cached_sizze_229085 < (size_t) bytes_212526) {
        mem_212589 = realloc(mem_212589, bytes_212526);
        mem_212589_cached_sizze_229085 = bytes_212526;
    }
    if (mem_212592_cached_sizze_229086 < (size_t) bytes_212526) {
        mem_212592 = realloc(mem_212592, bytes_212526);
        mem_212592_cached_sizze_229086 = bytes_212526;
    }
    for (; iter_223731 < end; iter_223731++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223808 = m_196691;
        int64_t gtid_206128 = iter_223731;
        int64_t remnant_223809 = iter_223731 - gtid_206128;
        
        for (int64_t i_223732 = 0; i_223732 < l_n_m_196752; i_223732++) {
            int64_t x_223735;
            
            x_223735 = ((int64_t *) mem_210827.mem)[gtid_206128 * l_n_m_196752 +
                                                    i_223732];
            
            float x_223736;
            
            x_223736 = ((float *) mem_210831.mem)[gtid_206128 * l_n_m_196752 +
                                                  i_223732];
            
            int64_t min_arg_223737 = mul64(jump_t_196702, i_223732);
            int64_t min_res_223738 = smin64(i_196779, min_arg_223737);
            int64_t defunc_0_g_res_223739 = add64((int64_t) 1, min_res_223738);
            float defunc_2_reduce_res_223742;
            float defunc_2_reduce_res_223743;
            float defunc_2_reduce_res_223744;
            float redout_223748;
            float redout_223749;
            float redout_223750;
            
            redout_223748 = 0.0F;
            redout_223749 = 0.0F;
            redout_223750 = 0.0F;
            for (int64_t i_223747 = 0; i_223747 < q_l_196697; i_223747++) {
                bool cond_223753 = sle64(n_196692, i_223747);
                int64_t defunc_0_f_res_223754;
                
                if (cond_223753) {
                    defunc_0_f_res_223754 = (int64_t) 0;
                } else {
                    int64_t i_223755 = add64(x_223735, i_223747);
                    int64_t defunc_1_add_res_223756 = add64((int64_t) 1,
                                                            i_223755);
                    
                    defunc_0_f_res_223754 = defunc_1_add_res_223756;
                }
                
                float defunc_0_f_res_223757;
                
                if (cond_223753) {
                    defunc_0_f_res_223757 = 0.0F;
                } else {
                    int64_t i_223758 = add64(x_223735, i_223747);
                    float defunc_0_add_arg_223759;
                    
                    defunc_0_add_arg_223759 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_206128 *
                                                          ctx_param_ext_210921 +
                                                          i_223758 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_223757 = defunc_0_add_arg_223759;
                }
                
                int64_t binop_p_223760 = sub64(defunc_0_f_res_223754,
                                               defunc_0_g_res_223739);
                float defunc_0_f_res_223761 = sitofp_i64_f32(binop_p_223760);
                float abs_res_223762 = (float) fabs(defunc_0_f_res_223761);
                float tmp1_223763 = abs_res_223762 / x_223736;
                float x_223764 = tmp1_223763 * tmp1_223763;
                float y_223765 = tmp1_223763 * x_223764;
                float tmp2_223766 = 1.0F - y_223765;
                float x_223767 = tmp2_223766 * tmp2_223766;
                float tmp3_223768 = tmp2_223766 * x_223767;
                float tmp4_223769 = defunc_0_f_res_223757 * tmp3_223768;
                float defunc_1_f_res_223770 = defunc_0_f_res_223761 *
                      tmp4_223769;
                float defunc_1_f_res_223771 = defunc_0_f_res_223761 *
                      defunc_1_f_res_223770;
                float defunc_1_op_res_223772 = tmp4_223769 + redout_223748;
                float defunc_1_op_res_223773 = defunc_1_f_res_223770 +
                      redout_223749;
                float defunc_1_op_res_223774 = defunc_1_f_res_223771 +
                      redout_223750;
                
                ((float *) mem_212589)[i_223747] = defunc_1_f_res_223770;
                ((float *) mem_212592)[i_223747] = tmp4_223769;
                
                float redout_tmp_223812 = defunc_1_op_res_223772;
                float redout_tmp_223813 = defunc_1_op_res_223773;
                float redout_tmp_223814 = defunc_1_op_res_223774;
                
                redout_223748 = redout_tmp_223812;
                redout_223749 = redout_tmp_223813;
                redout_223750 = redout_tmp_223814;
            }
            defunc_2_reduce_res_223742 = redout_223748;
            defunc_2_reduce_res_223743 = redout_223749;
            defunc_2_reduce_res_223744 = redout_223750;
            
            float x_223777 = defunc_2_reduce_res_223742 *
                  defunc_2_reduce_res_223744;
            float y_223778 = defunc_2_reduce_res_223743 *
                  defunc_2_reduce_res_223743;
            float y_223779 = x_223777 - y_223778;
            float det1_223780 = 1.0F / y_223779;
            float a11_223781 = defunc_2_reduce_res_223744 * det1_223780;
            float x_223782 = 0.0F - defunc_2_reduce_res_223743;
            float b11_223783 = det1_223780 * x_223782;
            float c11_223784 = defunc_2_reduce_res_223742 * det1_223780;
            float defunc_2_reduce_res_223785;
            float defunc_2_reduce_res_223786;
            float redout_223788;
            float redout_223789;
            
            redout_223788 = 0.0F;
            redout_223789 = 0.0F;
            for (int64_t i_223787 = 0; i_223787 < q_l_196697; i_223787++) {
                float x_223790;
                
                x_223790 = ((float *) mem_212592)[i_223787];
                
                float x_223791;
                
                x_223791 = ((float *) mem_212589)[i_223787];
                
                bool cond_223792 = sle64(n_196692, i_223787);
                float defunc_0_f_res_223793;
                
                if (cond_223792) {
                    defunc_0_f_res_223793 = 0.0F;
                } else {
                    int64_t i_223794 = add64(x_223735, i_223787);
                    float defunc_0_add_arg_223795;
                    
                    defunc_0_add_arg_223795 =
                        ((float *) mem_212347.mem)[gtid_206128 * n_196692 +
                                                   i_223794];
                    defunc_0_f_res_223793 = defunc_0_add_arg_223795;
                }
                
                float x_223796 = a11_223781 * x_223790;
                float y_223797 = b11_223783 * x_223791;
                float x_223798 = x_223796 + y_223797;
                float defunc_9_fit_fun_res_223799 = defunc_0_f_res_223793 *
                      x_223798;
                float x_223800 = b11_223783 * x_223790;
                float y_223801 = c11_223784 * x_223791;
                float x_223802 = x_223800 + y_223801;
                float defunc_9_slope_fun_res_223803 = defunc_0_f_res_223793 *
                      x_223802;
                float defunc_1_op_res_223804 = defunc_9_fit_fun_res_223799 +
                      redout_223788;
                float defunc_1_op_res_223805 = defunc_9_slope_fun_res_223803 +
                      redout_223789;
                float redout_tmp_223817 = defunc_1_op_res_223804;
                float redout_tmp_223818 = defunc_1_op_res_223805;
                
                redout_223788 = redout_tmp_223817;
                redout_223789 = redout_tmp_223818;
            }
            defunc_2_reduce_res_223785 = redout_223788;
            defunc_2_reduce_res_223786 = redout_223789;
            ((float *) mem_212569)[i_223732] = defunc_2_reduce_res_223785;
            ((float *) mem_212572)[i_223732] = defunc_2_reduce_res_223786;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212630.mem + gtid_206128 * l_n_m_196752 * (int64_t) 4,
                    mem_212569 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212634.mem + gtid_206128 * l_n_m_196752 * (int64_t) 4,
                    mem_212572 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212569);
    free(mem_212572);
    free(mem_212589);
    free(mem_212592);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229082_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229082_end -
                 futhark_mc_segmap_parloop_229082_start;
        
        ctx->futhark_mc_segmap_parloop_229082_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229082_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229082_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229080(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206127 = tid;
    int num_tasks_223730 = info.nsubtasks;
    struct futhark_mc_task_229079 *futhark_mc_task_229079 =
                                  (struct futhark_mc_task_229079 *) args;
    struct futhark_context *ctx = futhark_mc_task_229079->ctx;
    uint64_t futhark_mc_segmap_task_229080_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229080_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229079->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229079->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229079->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229079->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229079->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229079->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229079->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229079->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229079->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229079->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229079->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229079->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229079->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229079->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 = futhark_mc_task_229079->free_bytes_212526;
    struct memblock mem_212630 = {.desc ="mem_212630", .mem =
                                  futhark_mc_task_229079->free_mem_212630,
                                  .size =0, .references =NULL};
    struct memblock mem_212634 = {.desc ="mem_212634", .mem =
                                  futhark_mc_task_229079->free_mem_212634,
                                  .size =0, .references =NULL};
    int64_t iter_223731;
    struct futhark_mc_segmap_parloop_struct_229081
    futhark_mc_segmap_parloop_struct_229081;
    
    futhark_mc_segmap_parloop_struct_229081.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229081.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229081.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229081.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229081.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229081.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229081.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229081.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229081.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229081.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229081.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229081.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229081.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229081.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229081.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229081.free_bytes_212526 = bytes_212526;
    futhark_mc_segmap_parloop_struct_229081.free_mem_212630 = mem_212630.mem;
    futhark_mc_segmap_parloop_struct_229081.free_mem_212634 = mem_212634.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229082_task;
    
    futhark_mc_segmap_parloop_229082_task.name =
        "futhark_mc_segmap_parloop_229082";
    futhark_mc_segmap_parloop_229082_task.fn = futhark_mc_segmap_parloop_229082;
    futhark_mc_segmap_parloop_229082_task.args =
        &futhark_mc_segmap_parloop_struct_229081;
    futhark_mc_segmap_parloop_229082_task.iterations = iterations;
    futhark_mc_segmap_parloop_229082_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229082_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229082_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229082_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229082_task);
    
    if (futhark_mc_segmap_parloop_229082_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229082_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229082_total_end -
                 futhark_mc_segmap_parloop_229082_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229082_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229082_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229082_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229080_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229080_end -
                 futhark_mc_segmap_task_229080_start;
        
        ctx->futhark_mc_segmap_task_229080_runs[tid]++;
        ctx->futhark_mc_segmap_task_229080_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229080_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229088 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212526;
    unsigned char *free_mem_212630;
    unsigned char *free_mem_212634;
};
struct futhark_mc_task_229092 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206217;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212526;
    unsigned char *free_mem_212563;
    unsigned char *free_mem_212566;
};
struct futhark_mc_segmap_parloop_struct_229094 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206217;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212526;
    unsigned char *free_mem_212563;
    unsigned char *free_mem_212566;
};
static int futhark_mc_segmap_parloop_229095(void *args, int64_t start,
                                            int64_t end, int flat_tid_223896,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229094
    *futhark_mc_segmap_parloop_struct_229094 =
    (struct futhark_mc_segmap_parloop_struct_229094 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229094->ctx;
    uint64_t futhark_mc_segmap_parloop_229095_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229095_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229094->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229094->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229094->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229094->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229094->free_i_196779;
    int64_t gtid_206217 =
            futhark_mc_segmap_parloop_struct_229094->free_gtid_206217;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229094->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229094->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229094->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229094->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229094->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229094->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229094->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 =
            futhark_mc_segmap_parloop_struct_229094->free_bytes_212526;
    struct memblock mem_212563 = {.desc ="mem_212563", .mem =
                                  futhark_mc_segmap_parloop_struct_229094->free_mem_212563,
                                  .size =0, .references =NULL};
    struct memblock mem_212566 = {.desc ="mem_212566", .mem =
                                  futhark_mc_segmap_parloop_struct_229094->free_mem_212566,
                                  .size =0, .references =NULL};
    size_t mem_223903_cached_sizze_229096 = 0;
    unsigned char *mem_223903 = NULL;
    size_t mem_223905_cached_sizze_229097 = 0;
    unsigned char *mem_223905 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223974 = start;
    
    if (mem_223903_cached_sizze_229096 < (size_t) bytes_212526) {
        mem_223903 = realloc(mem_223903, bytes_212526);
        mem_223903_cached_sizze_229096 = bytes_212526;
    }
    if (mem_223905_cached_sizze_229097 < (size_t) bytes_212526) {
        mem_223905 = realloc(mem_223905, bytes_212526);
        mem_223905_cached_sizze_229097 = bytes_212526;
    }
    for (; iter_223974 < end; iter_223974++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224024 = l_n_m_196752;
        int64_t gtid_223897 = iter_223974;
        int64_t remnant_224025 = iter_223974 - gtid_223897;
        int64_t x_223898;
        
        x_223898 = ((int64_t *) mem_210827.mem)[gtid_206217 * l_n_m_196752 +
                                                gtid_223897];
        
        float x_223899;
        
        x_223899 = ((float *) mem_210831.mem)[gtid_206217 * l_n_m_196752 +
                                              gtid_223897];
        
        int64_t min_arg_223900 = mul64(jump_t_196702, gtid_223897);
        int64_t min_res_223901 = smin64(i_196779, min_arg_223900);
        int64_t defunc_0_g_res_223902 = add64((int64_t) 1, min_res_223901);
        float defunc_2_reduce_res_223907;
        float defunc_2_reduce_res_223908;
        float defunc_2_reduce_res_223909;
        float redout_223976;
        float redout_223977;
        float redout_223978;
        
        redout_223976 = 0.0F;
        redout_223977 = 0.0F;
        redout_223978 = 0.0F;
        for (int64_t i_223975 = 0; i_223975 < q_l_196697; i_223975++) {
            bool cond_223981 = sle64(n_196692, i_223975);
            int64_t defunc_0_f_res_223982;
            
            if (cond_223981) {
                defunc_0_f_res_223982 = (int64_t) 0;
            } else {
                int64_t i_223983 = add64(x_223898, i_223975);
                int64_t defunc_1_add_res_223984 = add64((int64_t) 1, i_223983);
                
                defunc_0_f_res_223982 = defunc_1_add_res_223984;
            }
            
            float defunc_0_f_res_223985;
            
            if (cond_223981) {
                defunc_0_f_res_223985 = 0.0F;
            } else {
                int64_t i_223986 = add64(x_223898, i_223975);
                float defunc_0_add_arg_223987;
                
                defunc_0_add_arg_223987 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_206217 *
                                                      ctx_param_ext_210921 +
                                                      i_223986 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_223985 = defunc_0_add_arg_223987;
            }
            
            int64_t binop_p_223988 = sub64(defunc_0_f_res_223982,
                                           defunc_0_g_res_223902);
            float defunc_0_f_res_223989 = sitofp_i64_f32(binop_p_223988);
            float abs_res_223990 = (float) fabs(defunc_0_f_res_223989);
            float tmp1_223991 = abs_res_223990 / x_223899;
            float x_223992 = tmp1_223991 * tmp1_223991;
            float y_223993 = tmp1_223991 * x_223992;
            float tmp2_223994 = 1.0F - y_223993;
            float x_223995 = tmp2_223994 * tmp2_223994;
            float tmp3_223996 = tmp2_223994 * x_223995;
            float tmp4_223997 = defunc_0_f_res_223985 * tmp3_223996;
            float defunc_1_f_res_223998 = defunc_0_f_res_223989 * tmp4_223997;
            float defunc_1_f_res_223999 = defunc_0_f_res_223989 *
                  defunc_1_f_res_223998;
            float defunc_1_op_res_224000 = tmp4_223997 + redout_223976;
            float defunc_1_op_res_224001 = defunc_1_f_res_223998 +
                  redout_223977;
            float defunc_1_op_res_224002 = defunc_1_f_res_223999 +
                  redout_223978;
            
            ((float *) mem_223903)[i_223975] = defunc_1_f_res_223998;
            ((float *) mem_223905)[i_223975] = tmp4_223997;
            
            float redout_tmp_224026 = defunc_1_op_res_224000;
            float redout_tmp_224027 = defunc_1_op_res_224001;
            float redout_tmp_224028 = defunc_1_op_res_224002;
            
            redout_223976 = redout_tmp_224026;
            redout_223977 = redout_tmp_224027;
            redout_223978 = redout_tmp_224028;
        }
        defunc_2_reduce_res_223907 = redout_223976;
        defunc_2_reduce_res_223908 = redout_223977;
        defunc_2_reduce_res_223909 = redout_223978;
        
        float x_223942 = defunc_2_reduce_res_223907 *
              defunc_2_reduce_res_223909;
        float y_223943 = defunc_2_reduce_res_223908 *
              defunc_2_reduce_res_223908;
        float y_223944 = x_223942 - y_223943;
        float det1_223945 = 1.0F / y_223944;
        float a11_223946 = defunc_2_reduce_res_223909 * det1_223945;
        float x_223947 = 0.0F - defunc_2_reduce_res_223908;
        float b11_223948 = det1_223945 * x_223947;
        float c11_223949 = defunc_2_reduce_res_223907 * det1_223945;
        float defunc_2_reduce_res_223950;
        float defunc_2_reduce_res_223951;
        float redout_224006;
        float redout_224007;
        
        redout_224006 = 0.0F;
        redout_224007 = 0.0F;
        for (int64_t i_224005 = 0; i_224005 < q_l_196697; i_224005++) {
            float x_224008;
            
            x_224008 = ((float *) mem_223905)[i_224005];
            
            float x_224009;
            
            x_224009 = ((float *) mem_223903)[i_224005];
            
            bool cond_224010 = sle64(n_196692, i_224005);
            float defunc_0_f_res_224011;
            
            if (cond_224010) {
                defunc_0_f_res_224011 = 0.0F;
            } else {
                int64_t i_224012 = add64(x_223898, i_224005);
                float defunc_0_add_arg_224013;
                
                defunc_0_add_arg_224013 =
                    ((float *) mem_212347.mem)[gtid_206217 * n_196692 +
                                               i_224012];
                defunc_0_f_res_224011 = defunc_0_add_arg_224013;
            }
            
            float x_224014 = a11_223946 * x_224008;
            float y_224015 = b11_223948 * x_224009;
            float x_224016 = x_224014 + y_224015;
            float defunc_9_fit_fun_res_224017 = defunc_0_f_res_224011 *
                  x_224016;
            float x_224018 = b11_223948 * x_224008;
            float y_224019 = c11_223949 * x_224009;
            float x_224020 = x_224018 + y_224019;
            float defunc_9_slope_fun_res_224021 = defunc_0_f_res_224011 *
                  x_224020;
            float defunc_1_op_res_224022 = defunc_9_fit_fun_res_224017 +
                  redout_224006;
            float defunc_1_op_res_224023 = defunc_9_slope_fun_res_224021 +
                  redout_224007;
            float redout_tmp_224031 = defunc_1_op_res_224022;
            float redout_tmp_224032 = defunc_1_op_res_224023;
            
            redout_224006 = redout_tmp_224031;
            redout_224007 = redout_tmp_224032;
        }
        defunc_2_reduce_res_223950 = redout_224006;
        defunc_2_reduce_res_223951 = redout_224007;
        ((float *) mem_212563.mem)[gtid_223897] = defunc_2_reduce_res_223950;
        ((float *) mem_212566.mem)[gtid_223897] = defunc_2_reduce_res_223951;
    }
    
  cleanup:
    { }
    free(mem_223903);
    free(mem_223905);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229095_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229095_end -
                 futhark_mc_segmap_parloop_229095_start;
        
        ctx->futhark_mc_segmap_parloop_229095_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229095_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229095_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229093(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223896 = tid;
    int num_tasks_223973 = info.nsubtasks;
    struct futhark_mc_task_229092 *futhark_mc_task_229092 =
                                  (struct futhark_mc_task_229092 *) args;
    struct futhark_context *ctx = futhark_mc_task_229092->ctx;
    uint64_t futhark_mc_segmap_task_229093_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229093_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229092->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229092->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229092->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229092->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229092->free_i_196779;
    int64_t gtid_206217 = futhark_mc_task_229092->free_gtid_206217;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229092->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229092->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229092->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229092->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229092->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229092->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229092->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 = futhark_mc_task_229092->free_bytes_212526;
    struct memblock mem_212563 = {.desc ="mem_212563", .mem =
                                  futhark_mc_task_229092->free_mem_212563,
                                  .size =0, .references =NULL};
    struct memblock mem_212566 = {.desc ="mem_212566", .mem =
                                  futhark_mc_task_229092->free_mem_212566,
                                  .size =0, .references =NULL};
    int64_t iter_223974;
    struct futhark_mc_segmap_parloop_struct_229094
    futhark_mc_segmap_parloop_struct_229094;
    
    futhark_mc_segmap_parloop_struct_229094.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229094.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229094.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229094.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229094.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229094.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229094.free_gtid_206217 = gtid_206217;
    futhark_mc_segmap_parloop_struct_229094.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229094.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229094.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229094.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229094.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229094.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229094.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229094.free_bytes_212526 = bytes_212526;
    futhark_mc_segmap_parloop_struct_229094.free_mem_212563 = mem_212563.mem;
    futhark_mc_segmap_parloop_struct_229094.free_mem_212566 = mem_212566.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229095_task;
    
    futhark_mc_segmap_parloop_229095_task.name =
        "futhark_mc_segmap_parloop_229095";
    futhark_mc_segmap_parloop_229095_task.fn = futhark_mc_segmap_parloop_229095;
    futhark_mc_segmap_parloop_229095_task.args =
        &futhark_mc_segmap_parloop_struct_229094;
    futhark_mc_segmap_parloop_229095_task.iterations = iterations;
    futhark_mc_segmap_parloop_229095_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229095_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229095_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229095_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229095_task);
    
    if (futhark_mc_segmap_parloop_229095_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229095_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229095_total_end -
                 futhark_mc_segmap_parloop_229095_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229095_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229095_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229095_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229093_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229093_end -
                 futhark_mc_segmap_task_229093_start;
        
        ctx->futhark_mc_segmap_task_229093_runs[tid]++;
        ctx->futhark_mc_segmap_task_229093_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229093_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229099 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206217;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212526;
    unsigned char *free_mem_212563;
    unsigned char *free_mem_212566;
};
struct futhark_mc_task_229103 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206217;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_223822;
    float free_x_223823;
    int64_t free_defunc_0_g_res_223826;
    float *retval_defunc_2_reduce_res_223829;
    float *retval_defunc_2_reduce_res_223830;
    float *retval_defunc_2_reduce_res_223831;
    unsigned char *retval_mem_223827;
    unsigned char *retval_mem_223828;
};
struct futhark_mc_segred_stage_1_parloop_struct_229108 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206217;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_223822;
    float free_x_223823;
    int64_t free_defunc_0_g_res_223826;
    unsigned char *free_mem_223827;
    unsigned char *free_mem_223828;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224089;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224091;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224093;
};
static int futhark_mc_segred_stage_1_parloop_229109(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_224034,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229108
    *futhark_mc_segred_stage_1_parloop_struct_229108 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229108 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229108->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229109_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229109_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_n_196692;
    int64_t gtid_206217 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_gtid_206217;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segred_stage_1_parloop_struct_229108->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_223822 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_x_223822;
    float x_223823 =
          futhark_mc_segred_stage_1_parloop_struct_229108->free_x_223823;
    int64_t defunc_0_g_res_223826 =
            futhark_mc_segred_stage_1_parloop_struct_229108->free_defunc_0_g_res_223826;
    struct memblock mem_223827 = {.desc ="mem_223827", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229108->free_mem_223827,
                                  .size =0, .references =NULL};
    struct memblock mem_223828 = {.desc ="mem_223828", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229108->free_mem_223828,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224089 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224089",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229108->free_reduce_stage_1_tid_res_arr_mem_224089,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224091 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224091",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229108->free_reduce_stage_1_tid_res_arr_mem_224091,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224093 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224093",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229108->free_reduce_stage_1_tid_res_arr_mem_224093,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224095 = start;
    float x_224036;
    float x_224037;
    float x_224039;
    float x_224040;
    float x_224042;
    float x_224043;
    float local_acc_224096 = 0.0F;
    float local_acc_224097 = 0.0F;
    float local_acc_224098 = 0.0F;
    
    for (; iter_224095 < end; iter_224095++) {
        int64_t gtid_224035 = iter_224095;
        bool cond_224045 = sle64(n_196692, gtid_224035);
        int64_t defunc_0_f_res_224046;
        
        if (cond_224045) {
            defunc_0_f_res_224046 = (int64_t) 0;
        } else {
            int64_t i_224047 = add64(x_223822, gtid_224035);
            int64_t defunc_1_add_res_224048 = add64((int64_t) 1, i_224047);
            
            defunc_0_f_res_224046 = defunc_1_add_res_224048;
        }
        
        float defunc_0_f_res_224049;
        
        if (cond_224045) {
            defunc_0_f_res_224049 = 0.0F;
        } else {
            int64_t i_224050 = add64(x_223822, gtid_224035);
            float defunc_0_add_arg_224051;
            
            defunc_0_add_arg_224051 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_206217 *
                                                  ctx_param_ext_210921 +
                                                  i_224050 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_224049 = defunc_0_add_arg_224051;
        }
        
        int64_t binop_p_224052 = sub64(defunc_0_f_res_224046,
                                       defunc_0_g_res_223826);
        float defunc_0_f_res_224053 = sitofp_i64_f32(binop_p_224052);
        float abs_res_224054 = (float) fabs(defunc_0_f_res_224053);
        float tmp1_224055 = abs_res_224054 / x_223823;
        float x_224056 = tmp1_224055 * tmp1_224055;
        float y_224057 = tmp1_224055 * x_224056;
        float tmp2_224058 = 1.0F - y_224057;
        float x_224059 = tmp2_224058 * tmp2_224058;
        float tmp3_224060 = tmp2_224058 * x_224059;
        float tmp4_224061 = defunc_0_f_res_224049 * tmp3_224060;
        float defunc_1_f_res_224062 = defunc_0_f_res_224053 * tmp4_224061;
        float defunc_1_f_res_224063 = defunc_0_f_res_224053 *
              defunc_1_f_res_224062;
        
        // save map-out results
        {
            ((float *) mem_223827.mem)[gtid_224035] = defunc_1_f_res_224062;
            ((float *) mem_223828.mem)[gtid_224035] = tmp4_224061;
        }
        // Load accum params
        {
            x_224036 = local_acc_224096;
        }
        // Load next params
        {
            x_224037 = tmp4_224061;
        }
        // Red body
        {
            float defunc_1_op_res_224038 = x_224036 + x_224037;
            
            local_acc_224096 = defunc_1_op_res_224038;
        }
        // Load accum params
        {
            x_224039 = local_acc_224097;
        }
        // Load next params
        {
            x_224040 = defunc_1_f_res_224062;
        }
        // Red body
        {
            float defunc_1_op_res_224041 = x_224039 + x_224040;
            
            local_acc_224097 = defunc_1_op_res_224041;
        }
        // Load accum params
        {
            x_224042 = local_acc_224098;
        }
        // Load next params
        {
            x_224043 = defunc_1_f_res_224063;
        }
        // Red body
        {
            float defunc_1_op_res_224044 = x_224042 + x_224043;
            
            local_acc_224098 = defunc_1_op_res_224044;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_224089.mem)[flat_tid_224034] =
        local_acc_224096;
    ((float *) reduce_stage_1_tid_res_arr_mem_224091.mem)[flat_tid_224034] =
        local_acc_224097;
    ((float *) reduce_stage_1_tid_res_arr_mem_224093.mem)[flat_tid_224034] =
        local_acc_224098;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229109_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229109_end -
                 futhark_mc_segred_stage_1_parloop_229109_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229109_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229109_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229109_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229104(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224034 = tid;
    int num_tasks_224088 = info.nsubtasks;
    struct futhark_mc_task_229103 *futhark_mc_task_229103 =
                                  (struct futhark_mc_task_229103 *) args;
    struct futhark_context *ctx = futhark_mc_task_229103->ctx;
    uint64_t futhark_mc_segred_task_229104_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229104_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229103->free_n_196692;
    int64_t gtid_206217 = futhark_mc_task_229103->free_gtid_206217;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229103->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229103->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229103->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229103->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_223822 = futhark_mc_task_229103->free_x_223822;
    float x_223823 = futhark_mc_task_229103->free_x_223823;
    int64_t defunc_0_g_res_223826 =
            futhark_mc_task_229103->free_defunc_0_g_res_223826;
    float defunc_2_reduce_res_223829 =
          *futhark_mc_task_229103->retval_defunc_2_reduce_res_223829;
    float defunc_2_reduce_res_223830 =
          *futhark_mc_task_229103->retval_defunc_2_reduce_res_223830;
    float defunc_2_reduce_res_223831 =
          *futhark_mc_task_229103->retval_defunc_2_reduce_res_223831;
    struct memblock mem_223827 = {.desc ="mem_223827", .mem =
                                  futhark_mc_task_229103->retval_mem_223827,
                                  .size =0, .references =NULL};
    struct memblock mem_223828 = {.desc ="mem_223828", .mem =
                                  futhark_mc_task_229103->retval_mem_223828,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_224089_cached_sizze_229105 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224089 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224091_cached_sizze_229106 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224091 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224093_cached_sizze_229107 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224093 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_224089_cached_sizze_229105 <
        (size_t) ((int64_t) 4 * num_tasks_224088)) {
        reduce_stage_1_tid_res_arr_mem_224089 =
            realloc(reduce_stage_1_tid_res_arr_mem_224089, (int64_t) 4 *
                    num_tasks_224088);
        reduce_stage_1_tid_res_arr_mem_224089_cached_sizze_229105 =
            (int64_t) 4 * num_tasks_224088;
    }
    if (reduce_stage_1_tid_res_arr_mem_224091_cached_sizze_229106 <
        (size_t) ((int64_t) 4 * num_tasks_224088)) {
        reduce_stage_1_tid_res_arr_mem_224091 =
            realloc(reduce_stage_1_tid_res_arr_mem_224091, (int64_t) 4 *
                    num_tasks_224088);
        reduce_stage_1_tid_res_arr_mem_224091_cached_sizze_229106 =
            (int64_t) 4 * num_tasks_224088;
    }
    if (reduce_stage_1_tid_res_arr_mem_224093_cached_sizze_229107 <
        (size_t) ((int64_t) 4 * num_tasks_224088)) {
        reduce_stage_1_tid_res_arr_mem_224093 =
            realloc(reduce_stage_1_tid_res_arr_mem_224093, (int64_t) 4 *
                    num_tasks_224088);
        reduce_stage_1_tid_res_arr_mem_224093_cached_sizze_229107 =
            (int64_t) 4 * num_tasks_224088;
    }
    
    int64_t iter_224095;
    struct futhark_mc_segred_stage_1_parloop_struct_229108
    futhark_mc_segred_stage_1_parloop_struct_229108;
    
    futhark_mc_segred_stage_1_parloop_struct_229108.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_gtid_206217 =
        gtid_206217;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_x_223822 = x_223822;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_x_223823 = x_223823;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_defunc_0_g_res_223826 =
        defunc_0_g_res_223826;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_mem_223827 =
        mem_223827.mem;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_mem_223828 =
        mem_223828.mem;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_reduce_stage_1_tid_res_arr_mem_224089 =
        reduce_stage_1_tid_res_arr_mem_224089;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_reduce_stage_1_tid_res_arr_mem_224091 =
        reduce_stage_1_tid_res_arr_mem_224091;
    futhark_mc_segred_stage_1_parloop_struct_229108.free_reduce_stage_1_tid_res_arr_mem_224093 =
        reduce_stage_1_tid_res_arr_mem_224093;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229109_task;
    
    futhark_mc_segred_stage_1_parloop_229109_task.name =
        "futhark_mc_segred_stage_1_parloop_229109";
    futhark_mc_segred_stage_1_parloop_229109_task.fn =
        futhark_mc_segred_stage_1_parloop_229109;
    futhark_mc_segred_stage_1_parloop_229109_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229108;
    futhark_mc_segred_stage_1_parloop_229109_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229109_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229109_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229109_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229109_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229109_task);
    
    if (futhark_mc_segred_stage_1_parloop_229109_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229109_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229109_total_end -
                 futhark_mc_segred_stage_1_parloop_229109_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229109_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229109_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229109_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_223829 = 0.0F;
        defunc_2_reduce_res_223830 = 0.0F;
        defunc_2_reduce_res_223831 = 0.0F;
    }
    
    float x_224099;
    float x_224100;
    float x_224102;
    float x_224103;
    float x_224105;
    float x_224106;
    
    for (int32_t i_224108 = 0; i_224108 < num_tasks_224088; i_224108++) {
        flat_tid_224034 = i_224108;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_224099 = defunc_2_reduce_res_223829;
            }
            // load next params
            {
                x_224100 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224089)[flat_tid_224034];
            }
            // red body
            {
                float defunc_1_op_res_224101 = x_224099 + x_224100;
                
                defunc_2_reduce_res_223829 = defunc_1_op_res_224101;
            }
            // load acc params
            {
                x_224102 = defunc_2_reduce_res_223830;
            }
            // load next params
            {
                x_224103 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224091)[flat_tid_224034];
            }
            // red body
            {
                float defunc_1_op_res_224104 = x_224102 + x_224103;
                
                defunc_2_reduce_res_223830 = defunc_1_op_res_224104;
            }
            // load acc params
            {
                x_224105 = defunc_2_reduce_res_223831;
            }
            // load next params
            {
                x_224106 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224093)[flat_tid_224034];
            }
            // red body
            {
                float defunc_1_op_res_224107 = x_224105 + x_224106;
                
                defunc_2_reduce_res_223831 = defunc_1_op_res_224107;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_224089);
        free(reduce_stage_1_tid_res_arr_mem_224091);
        free(reduce_stage_1_tid_res_arr_mem_224093);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229104_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229104_end -
                 futhark_mc_segred_task_229104_start;
        
        ctx->futhark_mc_segred_task_229104_runs[tid]++;
        ctx->futhark_mc_segred_task_229104_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229104_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229103->retval_defunc_2_reduce_res_223829 =
            defunc_2_reduce_res_223829;
        *futhark_mc_task_229103->retval_defunc_2_reduce_res_223830 =
            defunc_2_reduce_res_223830;
        *futhark_mc_task_229103->retval_defunc_2_reduce_res_223831 =
            defunc_2_reduce_res_223831;
        futhark_mc_task_229103->retval_mem_223827 = mem_223827.mem;
        futhark_mc_task_229103->retval_mem_223828 = mem_223828.mem;
    }
    return err;
}
struct futhark_mc_task_229110 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206217;
    unsigned char *free_mem_212347;
    int64_t free_x_223822;
    unsigned char *free_mem_223827;
    unsigned char *free_mem_223828;
    float free_a11_223868;
    float free_b11_223870;
    float free_c11_223871;
    float *retval_defunc_2_reduce_res_223872;
    float *retval_defunc_2_reduce_res_223873;
};
struct futhark_mc_segred_stage_1_parloop_struct_229114 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206217;
    unsigned char *free_mem_212347;
    int64_t free_x_223822;
    unsigned char *free_mem_223827;
    unsigned char *free_mem_223828;
    float free_a11_223868;
    float free_b11_223870;
    float free_c11_223871;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224110;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224112;
};
static int futhark_mc_segred_stage_1_parloop_229115(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_224064,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229114
    *futhark_mc_segred_stage_1_parloop_struct_229114 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229114 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229114->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229115_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229115_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229114->free_n_196692;
    int64_t gtid_206217 =
            futhark_mc_segred_stage_1_parloop_struct_229114->free_gtid_206217;
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229114->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_223822 =
            futhark_mc_segred_stage_1_parloop_struct_229114->free_x_223822;
    struct memblock mem_223827 = {.desc ="mem_223827", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229114->free_mem_223827,
                                  .size =0, .references =NULL};
    struct memblock mem_223828 = {.desc ="mem_223828", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229114->free_mem_223828,
                                  .size =0, .references =NULL};
    float a11_223868 =
          futhark_mc_segred_stage_1_parloop_struct_229114->free_a11_223868;
    float b11_223870 =
          futhark_mc_segred_stage_1_parloop_struct_229114->free_b11_223870;
    float c11_223871 =
          futhark_mc_segred_stage_1_parloop_struct_229114->free_c11_223871;
    struct memblock reduce_stage_1_tid_res_arr_mem_224110 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224110",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229114->free_reduce_stage_1_tid_res_arr_mem_224110,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224112 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224112",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229114->free_reduce_stage_1_tid_res_arr_mem_224112,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224114 = start;
    float x_224066;
    float x_224067;
    float x_224069;
    float x_224070;
    float local_acc_224115 = 0.0F;
    float local_acc_224116 = 0.0F;
    
    for (; iter_224114 < end; iter_224114++) {
        int64_t gtid_224065 = iter_224114;
        float x_224072;
        
        x_224072 = ((float *) mem_223828.mem)[gtid_224065];
        
        float x_224073;
        
        x_224073 = ((float *) mem_223827.mem)[gtid_224065];
        
        bool cond_224074 = sle64(n_196692, gtid_224065);
        float defunc_0_f_res_224075;
        
        if (cond_224074) {
            defunc_0_f_res_224075 = 0.0F;
        } else {
            int64_t i_224076 = add64(x_223822, gtid_224065);
            float defunc_0_add_arg_224077;
            
            defunc_0_add_arg_224077 = ((float *) mem_212347.mem)[gtid_206217 *
                                                                 n_196692 +
                                                                 i_224076];
            defunc_0_f_res_224075 = defunc_0_add_arg_224077;
        }
        
        float x_224078 = a11_223868 * x_224072;
        float y_224079 = b11_223870 * x_224073;
        float x_224080 = x_224078 + y_224079;
        float defunc_9_fit_fun_res_224081 = defunc_0_f_res_224075 * x_224080;
        float x_224082 = b11_223870 * x_224072;
        float y_224083 = c11_223871 * x_224073;
        float x_224084 = x_224082 + y_224083;
        float defunc_9_slope_fun_res_224085 = defunc_0_f_res_224075 * x_224084;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_224066 = local_acc_224115;
        }
        // Load next params
        {
            x_224067 = defunc_9_fit_fun_res_224081;
        }
        // Red body
        {
            float defunc_1_op_res_224068 = x_224066 + x_224067;
            
            local_acc_224115 = defunc_1_op_res_224068;
        }
        // Load accum params
        {
            x_224069 = local_acc_224116;
        }
        // Load next params
        {
            x_224070 = defunc_9_slope_fun_res_224085;
        }
        // Red body
        {
            float defunc_1_op_res_224071 = x_224069 + x_224070;
            
            local_acc_224116 = defunc_1_op_res_224071;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_224110.mem)[flat_tid_224064] =
        local_acc_224115;
    ((float *) reduce_stage_1_tid_res_arr_mem_224112.mem)[flat_tid_224064] =
        local_acc_224116;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229115_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229115_end -
                 futhark_mc_segred_stage_1_parloop_229115_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229115_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229115_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229115_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229111(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224064 = tid;
    int num_tasks_224109 = info.nsubtasks;
    struct futhark_mc_task_229110 *futhark_mc_task_229110 =
                                  (struct futhark_mc_task_229110 *) args;
    struct futhark_context *ctx = futhark_mc_task_229110->ctx;
    uint64_t futhark_mc_segred_task_229111_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229111_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229110->free_n_196692;
    int64_t gtid_206217 = futhark_mc_task_229110->free_gtid_206217;
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229110->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_223822 = futhark_mc_task_229110->free_x_223822;
    struct memblock mem_223827 = {.desc ="mem_223827", .mem =
                                  futhark_mc_task_229110->free_mem_223827,
                                  .size =0, .references =NULL};
    struct memblock mem_223828 = {.desc ="mem_223828", .mem =
                                  futhark_mc_task_229110->free_mem_223828,
                                  .size =0, .references =NULL};
    float a11_223868 = futhark_mc_task_229110->free_a11_223868;
    float b11_223870 = futhark_mc_task_229110->free_b11_223870;
    float c11_223871 = futhark_mc_task_229110->free_c11_223871;
    float defunc_2_reduce_res_223872 =
          *futhark_mc_task_229110->retval_defunc_2_reduce_res_223872;
    float defunc_2_reduce_res_223873 =
          *futhark_mc_task_229110->retval_defunc_2_reduce_res_223873;
    size_t reduce_stage_1_tid_res_arr_mem_224110_cached_sizze_229112 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224110 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224112_cached_sizze_229113 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224112 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_224110_cached_sizze_229112 <
        (size_t) ((int64_t) 4 * num_tasks_224109)) {
        reduce_stage_1_tid_res_arr_mem_224110 =
            realloc(reduce_stage_1_tid_res_arr_mem_224110, (int64_t) 4 *
                    num_tasks_224109);
        reduce_stage_1_tid_res_arr_mem_224110_cached_sizze_229112 =
            (int64_t) 4 * num_tasks_224109;
    }
    if (reduce_stage_1_tid_res_arr_mem_224112_cached_sizze_229113 <
        (size_t) ((int64_t) 4 * num_tasks_224109)) {
        reduce_stage_1_tid_res_arr_mem_224112 =
            realloc(reduce_stage_1_tid_res_arr_mem_224112, (int64_t) 4 *
                    num_tasks_224109);
        reduce_stage_1_tid_res_arr_mem_224112_cached_sizze_229113 =
            (int64_t) 4 * num_tasks_224109;
    }
    
    int64_t iter_224114;
    struct futhark_mc_segred_stage_1_parloop_struct_229114
    futhark_mc_segred_stage_1_parloop_struct_229114;
    
    futhark_mc_segred_stage_1_parloop_struct_229114.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_gtid_206217 =
        gtid_206217;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_mem_212347 =
        mem_212347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_x_223822 = x_223822;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_mem_223827 =
        mem_223827.mem;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_mem_223828 =
        mem_223828.mem;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_a11_223868 =
        a11_223868;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_b11_223870 =
        b11_223870;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_c11_223871 =
        c11_223871;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_reduce_stage_1_tid_res_arr_mem_224110 =
        reduce_stage_1_tid_res_arr_mem_224110;
    futhark_mc_segred_stage_1_parloop_struct_229114.free_reduce_stage_1_tid_res_arr_mem_224112 =
        reduce_stage_1_tid_res_arr_mem_224112;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229115_task;
    
    futhark_mc_segred_stage_1_parloop_229115_task.name =
        "futhark_mc_segred_stage_1_parloop_229115";
    futhark_mc_segred_stage_1_parloop_229115_task.fn =
        futhark_mc_segred_stage_1_parloop_229115;
    futhark_mc_segred_stage_1_parloop_229115_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229114;
    futhark_mc_segred_stage_1_parloop_229115_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229115_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229115_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229115_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229115_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229115_task);
    
    if (futhark_mc_segred_stage_1_parloop_229115_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229115_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229115_total_end -
                 futhark_mc_segred_stage_1_parloop_229115_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229115_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229115_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229115_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_223872 = 0.0F;
        defunc_2_reduce_res_223873 = 0.0F;
    }
    
    float x_224117;
    float x_224118;
    float x_224120;
    float x_224121;
    
    for (int32_t i_224123 = 0; i_224123 < num_tasks_224109; i_224123++) {
        flat_tid_224064 = i_224123;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_224117 = defunc_2_reduce_res_223872;
            }
            // load next params
            {
                x_224118 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224110)[flat_tid_224064];
            }
            // red body
            {
                float defunc_1_op_res_224119 = x_224117 + x_224118;
                
                defunc_2_reduce_res_223872 = defunc_1_op_res_224119;
            }
            // load acc params
            {
                x_224120 = defunc_2_reduce_res_223873;
            }
            // load next params
            {
                x_224121 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224112)[flat_tid_224064];
            }
            // red body
            {
                float defunc_1_op_res_224122 = x_224120 + x_224121;
                
                defunc_2_reduce_res_223873 = defunc_1_op_res_224122;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_224110);
        free(reduce_stage_1_tid_res_arr_mem_224112);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229111_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229111_end -
                 futhark_mc_segred_task_229111_start;
        
        ctx->futhark_mc_segred_task_229111_runs[tid]++;
        ctx->futhark_mc_segred_task_229111_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229111_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229110->retval_defunc_2_reduce_res_223872 =
            defunc_2_reduce_res_223872;
        *futhark_mc_task_229110->retval_defunc_2_reduce_res_223873 =
            defunc_2_reduce_res_223873;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229100(void *args, int64_t start,
                                            int64_t end, int flat_tid_223820,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229099
    *futhark_mc_segmap_parloop_struct_229099 =
    (struct futhark_mc_segmap_parloop_struct_229099 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229099->ctx;
    uint64_t futhark_mc_segmap_parloop_229100_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229100_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229099->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229099->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229099->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229099->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229099->free_i_196779;
    int64_t gtid_206217 =
            futhark_mc_segmap_parloop_struct_229099->free_gtid_206217;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229099->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229099->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229099->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229099->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229099->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229099->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229099->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 =
            futhark_mc_segmap_parloop_struct_229099->free_bytes_212526;
    struct memblock mem_212563 = {.desc ="mem_212563", .mem =
                                  futhark_mc_segmap_parloop_struct_229099->free_mem_212563,
                                  .size =0, .references =NULL};
    struct memblock mem_212566 = {.desc ="mem_212566", .mem =
                                  futhark_mc_segmap_parloop_struct_229099->free_mem_212566,
                                  .size =0, .references =NULL};
    size_t mem_223827_cached_sizze_229101 = 0;
    unsigned char *mem_223827 = NULL;
    size_t mem_223828_cached_sizze_229102 = 0;
    unsigned char *mem_223828 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224033 = start;
    
    if (mem_223827_cached_sizze_229101 < (size_t) bytes_212526) {
        mem_223827 = realloc(mem_223827, bytes_212526);
        mem_223827_cached_sizze_229101 = bytes_212526;
    }
    if (mem_223828_cached_sizze_229102 < (size_t) bytes_212526) {
        mem_223828 = realloc(mem_223828, bytes_212526);
        mem_223828_cached_sizze_229102 = bytes_212526;
    }
    for (; iter_224033 < end; iter_224033++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224086 = l_n_m_196752;
        int64_t gtid_223821 = iter_224033;
        int64_t remnant_224087 = iter_224033 - gtid_223821;
        int64_t x_223822;
        
        x_223822 = ((int64_t *) mem_210827.mem)[gtid_206217 * l_n_m_196752 +
                                                gtid_223821];
        
        float x_223823;
        
        x_223823 = ((float *) mem_210831.mem)[gtid_206217 * l_n_m_196752 +
                                              gtid_223821];
        
        int64_t min_arg_223824 = mul64(jump_t_196702, gtid_223821);
        int64_t min_res_223825 = smin64(i_196779, min_arg_223824);
        int64_t defunc_0_g_res_223826 = add64((int64_t) 1, min_res_223825);
        float defunc_2_reduce_res_223829;
        float defunc_2_reduce_res_223830;
        float defunc_2_reduce_res_223831;
        int64_t flat_tid_224034 = (int64_t) 0;
        int32_t num_tasks_224088;
        
        defunc_2_reduce_res_223829 = 0.0F;
        defunc_2_reduce_res_223830 = 0.0F;
        defunc_2_reduce_res_223831 = 0.0F;
        
        struct futhark_mc_task_229103 futhark_mc_task_229103;
        
        futhark_mc_task_229103.ctx = ctx;
        futhark_mc_task_229103.free_n_196692 = n_196692;
        futhark_mc_task_229103.free_gtid_206217 = gtid_206217;
        futhark_mc_task_229103.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229103.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229103.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229103.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229103.free_x_223822 = x_223822;
        futhark_mc_task_229103.free_x_223823 = x_223823;
        futhark_mc_task_229103.free_defunc_0_g_res_223826 =
            defunc_0_g_res_223826;
        futhark_mc_task_229103.retval_defunc_2_reduce_res_223829 =
            &defunc_2_reduce_res_223829;
        futhark_mc_task_229103.retval_defunc_2_reduce_res_223830 =
            &defunc_2_reduce_res_223830;
        futhark_mc_task_229103.retval_defunc_2_reduce_res_223831 =
            &defunc_2_reduce_res_223831;
        futhark_mc_task_229103.retval_mem_223827 = mem_223827;
        futhark_mc_task_229103.retval_mem_223828 = mem_223828;
        
        struct scheduler_segop futhark_mc_task_229103_task;
        
        futhark_mc_task_229103_task.args = &futhark_mc_task_229103;
        futhark_mc_task_229103_task.top_level_fn =
            futhark_mc_segred_task_229104;
        futhark_mc_task_229103_task.name = "futhark_mc_segred_task_229104";
        futhark_mc_task_229103_task.iterations = q_l_196697;
        futhark_mc_task_229103_task.task_time =
            &ctx->futhark_mc_segred_task_229104_total_time;
        futhark_mc_task_229103_task.task_iter =
            &ctx->futhark_mc_segred_task_229104_total_iter;
        futhark_mc_task_229103_task.sched = STATIC;
        futhark_mc_task_229103_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229104_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229103_task);
        
        if (futhark_mc_segred_task_229104_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_223864 = defunc_2_reduce_res_223829 *
              defunc_2_reduce_res_223831;
        float y_223865 = defunc_2_reduce_res_223830 *
              defunc_2_reduce_res_223830;
        float y_223866 = x_223864 - y_223865;
        float det1_223867 = 1.0F / y_223866;
        float a11_223868 = defunc_2_reduce_res_223831 * det1_223867;
        float x_223869 = 0.0F - defunc_2_reduce_res_223830;
        float b11_223870 = det1_223867 * x_223869;
        float c11_223871 = defunc_2_reduce_res_223829 * det1_223867;
        float defunc_2_reduce_res_223872;
        float defunc_2_reduce_res_223873;
        int64_t flat_tid_224064 = (int64_t) 0;
        int32_t num_tasks_224109;
        
        defunc_2_reduce_res_223872 = 0.0F;
        defunc_2_reduce_res_223873 = 0.0F;
        
        struct futhark_mc_task_229110 futhark_mc_task_229110;
        
        futhark_mc_task_229110.ctx = ctx;
        futhark_mc_task_229110.free_n_196692 = n_196692;
        futhark_mc_task_229110.free_gtid_206217 = gtid_206217;
        futhark_mc_task_229110.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229110.free_x_223822 = x_223822;
        futhark_mc_task_229110.free_mem_223827 = mem_223827;
        futhark_mc_task_229110.free_mem_223828 = mem_223828;
        futhark_mc_task_229110.free_a11_223868 = a11_223868;
        futhark_mc_task_229110.free_b11_223870 = b11_223870;
        futhark_mc_task_229110.free_c11_223871 = c11_223871;
        futhark_mc_task_229110.retval_defunc_2_reduce_res_223872 =
            &defunc_2_reduce_res_223872;
        futhark_mc_task_229110.retval_defunc_2_reduce_res_223873 =
            &defunc_2_reduce_res_223873;
        
        struct scheduler_segop futhark_mc_task_229110_task;
        
        futhark_mc_task_229110_task.args = &futhark_mc_task_229110;
        futhark_mc_task_229110_task.top_level_fn =
            futhark_mc_segred_task_229111;
        futhark_mc_task_229110_task.name = "futhark_mc_segred_task_229111";
        futhark_mc_task_229110_task.iterations = q_l_196697;
        futhark_mc_task_229110_task.task_time =
            &ctx->futhark_mc_segred_task_229111_total_time;
        futhark_mc_task_229110_task.task_iter =
            &ctx->futhark_mc_segred_task_229111_total_iter;
        futhark_mc_task_229110_task.sched = STATIC;
        futhark_mc_task_229110_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229111_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229110_task);
        
        if (futhark_mc_segred_task_229111_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212563.mem)[gtid_223821] = defunc_2_reduce_res_223872;
        ((float *) mem_212566.mem)[gtid_223821] = defunc_2_reduce_res_223873;
    }
    
  cleanup:
    { }
    free(mem_223827);
    free(mem_223828);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229100_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229100_end -
                 futhark_mc_segmap_parloop_229100_start;
        
        ctx->futhark_mc_segmap_parloop_229100_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229100_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229100_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229098(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_223820 = tid;
    int num_tasks_223973 = info.nsubtasks;
    struct futhark_mc_task_229092 *futhark_mc_task_229092 =
                                  (struct futhark_mc_task_229092 *) args;
    struct futhark_context *ctx = futhark_mc_task_229092->ctx;
    uint64_t futhark_mc_segmap_nested_task_229098_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229098_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229092->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229092->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229092->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229092->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229092->free_i_196779;
    int64_t gtid_206217 = futhark_mc_task_229092->free_gtid_206217;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229092->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229092->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229092->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229092->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229092->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229092->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229092->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 = futhark_mc_task_229092->free_bytes_212526;
    struct memblock mem_212563 = {.desc ="mem_212563", .mem =
                                  futhark_mc_task_229092->free_mem_212563,
                                  .size =0, .references =NULL};
    struct memblock mem_212566 = {.desc ="mem_212566", .mem =
                                  futhark_mc_task_229092->free_mem_212566,
                                  .size =0, .references =NULL};
    int64_t iter_224033;
    struct futhark_mc_segmap_parloop_struct_229099
    futhark_mc_segmap_parloop_struct_229099;
    
    futhark_mc_segmap_parloop_struct_229099.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229099.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229099.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229099.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229099.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229099.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229099.free_gtid_206217 = gtid_206217;
    futhark_mc_segmap_parloop_struct_229099.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229099.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229099.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229099.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229099.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229099.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229099.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229099.free_bytes_212526 = bytes_212526;
    futhark_mc_segmap_parloop_struct_229099.free_mem_212563 = mem_212563.mem;
    futhark_mc_segmap_parloop_struct_229099.free_mem_212566 = mem_212566.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229100_task;
    
    futhark_mc_segmap_parloop_229100_task.name =
        "futhark_mc_segmap_parloop_229100";
    futhark_mc_segmap_parloop_229100_task.fn = futhark_mc_segmap_parloop_229100;
    futhark_mc_segmap_parloop_229100_task.args =
        &futhark_mc_segmap_parloop_struct_229099;
    futhark_mc_segmap_parloop_229100_task.iterations = iterations;
    futhark_mc_segmap_parloop_229100_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229100_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229100_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229100_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229100_task);
    
    if (futhark_mc_segmap_parloop_229100_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229100_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229100_total_end -
                 futhark_mc_segmap_parloop_229100_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229100_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229100_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229100_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229098_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229098_end -
                 futhark_mc_segmap_nested_task_229098_start;
        
        ctx->futhark_mc_segmap_nested_task_229098_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229098_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229098_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229089(void *args, int64_t start,
                                            int64_t end, int flat_tid_206216,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229088
    *futhark_mc_segmap_parloop_struct_229088 =
    (struct futhark_mc_segmap_parloop_struct_229088 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229088->ctx;
    uint64_t futhark_mc_segmap_parloop_229089_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229089_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229088->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229088->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229088->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229088->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229088->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229088->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229088->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229088->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229088->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229088->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229088->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229088->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229088->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229088->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 =
            futhark_mc_segmap_parloop_struct_229088->free_bytes_212526;
    struct memblock mem_212630 = {.desc ="mem_212630", .mem =
                                  futhark_mc_segmap_parloop_struct_229088->free_mem_212630,
                                  .size =0, .references =NULL};
    struct memblock mem_212634 = {.desc ="mem_212634", .mem =
                                  futhark_mc_segmap_parloop_struct_229088->free_mem_212634,
                                  .size =0, .references =NULL};
    size_t mem_212563_cached_sizze_229090 = 0;
    unsigned char *mem_212563 = NULL;
    size_t mem_212566_cached_sizze_229091 = 0;
    unsigned char *mem_212566 = NULL;
    int64_t iterations = end - start;
    int64_t iter_223819 = start;
    
    if (mem_212563_cached_sizze_229090 < (size_t) bytes_210774) {
        mem_212563 = realloc(mem_212563, bytes_210774);
        mem_212563_cached_sizze_229090 = bytes_210774;
    }
    if (mem_212566_cached_sizze_229091 < (size_t) bytes_210774) {
        mem_212566 = realloc(mem_212566, bytes_210774);
        mem_212566_cached_sizze_229091 = bytes_210774;
    }
    for (; iter_223819 < end; iter_223819++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_223971 = m_196691;
        int64_t gtid_206217 = iter_223819;
        int64_t remnant_223972 = iter_223819 - gtid_206217;
        int64_t flat_tid_223896 = (int64_t) 0;
        int32_t num_tasks_223973;
        int64_t flat_tid_223820 = (int64_t) 0;
        struct futhark_mc_task_229092 futhark_mc_task_229092;
        
        futhark_mc_task_229092.ctx = ctx;
        futhark_mc_task_229092.free_n_196692 = n_196692;
        futhark_mc_task_229092.free_q_l_196697 = q_l_196697;
        futhark_mc_task_229092.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229092.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_229092.free_i_196779 = i_196779;
        futhark_mc_task_229092.free_gtid_206217 = gtid_206217;
        futhark_mc_task_229092.free_mem_210827 = mem_210827.mem;
        futhark_mc_task_229092.free_mem_210831 = mem_210831.mem;
        futhark_mc_task_229092.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229092.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229092.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229092.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229092.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229092.free_bytes_212526 = bytes_212526;
        futhark_mc_task_229092.free_mem_212563 = mem_212563;
        futhark_mc_task_229092.free_mem_212566 = mem_212566;
        
        struct scheduler_segop futhark_mc_task_229092_task;
        
        futhark_mc_task_229092_task.args = &futhark_mc_task_229092;
        futhark_mc_task_229092_task.top_level_fn =
            futhark_mc_segmap_task_229093;
        futhark_mc_task_229092_task.name = "futhark_mc_segmap_task_229093";
        futhark_mc_task_229092_task.iterations = l_n_m_196752;
        futhark_mc_task_229092_task.task_time =
            &ctx->futhark_mc_segmap_task_229093_total_time;
        futhark_mc_task_229092_task.task_iter =
            &ctx->futhark_mc_segmap_task_229093_total_iter;
        futhark_mc_task_229092_task.sched = STATIC;
        futhark_mc_task_229092_task.nested_fn =
            futhark_mc_segmap_nested_task_229098;
        
        int futhark_mc_segmap_task_229093_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229092_task);
        
        if (futhark_mc_segmap_task_229093_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212630.mem + gtid_206217 * l_n_m_196752 * (int64_t) 4,
                    mem_212563 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212634.mem + gtid_206217 * l_n_m_196752 * (int64_t) 4,
                    mem_212566 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212563);
    free(mem_212566);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229089_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229089_end -
                 futhark_mc_segmap_parloop_229089_start;
        
        ctx->futhark_mc_segmap_parloop_229089_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229089_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229089_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229087(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206216 = tid;
    int num_tasks_223730 = info.nsubtasks;
    struct futhark_mc_task_229079 *futhark_mc_task_229079 =
                                  (struct futhark_mc_task_229079 *) args;
    struct futhark_context *ctx = futhark_mc_task_229079->ctx;
    uint64_t futhark_mc_segmap_nested_task_229087_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229087_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229079->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229079->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229079->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229079->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229079->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229079->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229079->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229079->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229079->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229079->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229079->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229079->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229079->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229079->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212526 = futhark_mc_task_229079->free_bytes_212526;
    struct memblock mem_212630 = {.desc ="mem_212630", .mem =
                                  futhark_mc_task_229079->free_mem_212630,
                                  .size =0, .references =NULL};
    struct memblock mem_212634 = {.desc ="mem_212634", .mem =
                                  futhark_mc_task_229079->free_mem_212634,
                                  .size =0, .references =NULL};
    int64_t iter_223819;
    struct futhark_mc_segmap_parloop_struct_229088
    futhark_mc_segmap_parloop_struct_229088;
    
    futhark_mc_segmap_parloop_struct_229088.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229088.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229088.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229088.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229088.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229088.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229088.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229088.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229088.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229088.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229088.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229088.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229088.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229088.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229088.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229088.free_bytes_212526 = bytes_212526;
    futhark_mc_segmap_parloop_struct_229088.free_mem_212630 = mem_212630.mem;
    futhark_mc_segmap_parloop_struct_229088.free_mem_212634 = mem_212634.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229089_task;
    
    futhark_mc_segmap_parloop_229089_task.name =
        "futhark_mc_segmap_parloop_229089";
    futhark_mc_segmap_parloop_229089_task.fn = futhark_mc_segmap_parloop_229089;
    futhark_mc_segmap_parloop_229089_task.args =
        &futhark_mc_segmap_parloop_struct_229088;
    futhark_mc_segmap_parloop_229089_task.iterations = iterations;
    futhark_mc_segmap_parloop_229089_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229089_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229089_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229089_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229089_task);
    
    if (futhark_mc_segmap_parloop_229089_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229089_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229089_total_end -
                 futhark_mc_segmap_parloop_229089_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229089_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229089_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229089_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229087_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229087_end -
                 futhark_mc_segmap_nested_task_229087_start;
        
        ctx->futhark_mc_segmap_nested_task_229087_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229087_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229087_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229116 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212636;
    unsigned char *free_mem_212806;
    unsigned char *free_mem_212810;
};
struct futhark_mc_segmap_parloop_struct_229118 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212636;
    unsigned char *free_mem_212806;
    unsigned char *free_mem_212810;
};
static int futhark_mc_segmap_parloop_229119(void *args, int64_t start,
                                            int64_t end, int flat_tid_206374,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229118
    *futhark_mc_segmap_parloop_struct_229118 =
    (struct futhark_mc_segmap_parloop_struct_229118 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229118->ctx;
    uint64_t futhark_mc_segmap_parloop_229119_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229119_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229118->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229118->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229118->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229118->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229118->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229118->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229118->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229118->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229118->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229118->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229118->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229118->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229118->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229118->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 =
            futhark_mc_segmap_parloop_struct_229118->free_bytes_212636;
    struct memblock mem_212806 = {.desc ="mem_212806", .mem =
                                  futhark_mc_segmap_parloop_struct_229118->free_mem_212806,
                                  .size =0, .references =NULL};
    struct memblock mem_212810 = {.desc ="mem_212810", .mem =
                                  futhark_mc_segmap_parloop_struct_229118->free_mem_212810,
                                  .size =0, .references =NULL};
    size_t mem_212715_cached_sizze_229120 = 0;
    unsigned char *mem_212715 = NULL;
    size_t mem_212718_cached_sizze_229121 = 0;
    unsigned char *mem_212718 = NULL;
    size_t mem_212735_cached_sizze_229122 = 0;
    unsigned char *mem_212735 = NULL;
    size_t mem_212738_cached_sizze_229123 = 0;
    unsigned char *mem_212738 = NULL;
    size_t mem_212765_cached_sizze_229124 = 0;
    unsigned char *mem_212765 = NULL;
    size_t mem_212768_cached_sizze_229125 = 0;
    unsigned char *mem_212768 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224125 = start;
    
    if (mem_212715_cached_sizze_229120 < (size_t) bytes_210774) {
        mem_212715 = realloc(mem_212715, bytes_210774);
        mem_212715_cached_sizze_229120 = bytes_210774;
    }
    if (mem_212718_cached_sizze_229121 < (size_t) bytes_210774) {
        mem_212718 = realloc(mem_212718, bytes_210774);
        mem_212718_cached_sizze_229121 = bytes_210774;
    }
    if (mem_212735_cached_sizze_229122 < (size_t) bytes_212636) {
        mem_212735 = realloc(mem_212735, bytes_212636);
        mem_212735_cached_sizze_229122 = bytes_212636;
    }
    if (mem_212738_cached_sizze_229123 < (size_t) bytes_212636) {
        mem_212738 = realloc(mem_212738, bytes_212636);
        mem_212738_cached_sizze_229123 = bytes_212636;
    }
    if (mem_212765_cached_sizze_229124 < (size_t) bytes_212636) {
        mem_212765 = realloc(mem_212765, bytes_212636);
        mem_212765_cached_sizze_229124 = bytes_212636;
    }
    if (mem_212768_cached_sizze_229125 < (size_t) bytes_212636) {
        mem_212768 = realloc(mem_212768, bytes_212636);
        mem_212768_cached_sizze_229125 = bytes_212636;
    }
    for (; iter_224125 < end; iter_224125++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224243 = m_196691;
        int64_t gtid_206375 = iter_224125;
        int64_t remnant_224244 = iter_224125 - gtid_206375;
        
        for (int64_t i_224126 = 0; i_224126 < l_n_m_196752; i_224126++) {
            int64_t x_224129;
            
            x_224129 = ((int64_t *) mem_210827.mem)[gtid_206375 * l_n_m_196752 +
                                                    i_224126];
            
            float x_224130;
            
            x_224130 = ((float *) mem_210831.mem)[gtid_206375 * l_n_m_196752 +
                                                  i_224126];
            
            int64_t min_arg_224131 = mul64(jump_t_196702, i_224126);
            int64_t min_res_224132 = smin64(i_196779, min_arg_224131);
            int64_t defunc_0_g_res_224133 = add64((int64_t) 1, min_res_224132);
            
            for (int64_t i_224138 = 0; i_224138 < q_l_196697; i_224138++) {
                bool cond_224141 = sle64(n_196692, i_224138);
                int64_t defunc_0_f_res_224142;
                
                if (cond_224141) {
                    defunc_0_f_res_224142 = (int64_t) 0;
                } else {
                    int64_t i_224143 = add64(x_224129, i_224138);
                    int64_t defunc_1_add_res_224144 = add64((int64_t) 1,
                                                            i_224143);
                    
                    defunc_0_f_res_224142 = defunc_1_add_res_224144;
                }
                
                float defunc_0_f_res_224145;
                
                if (cond_224141) {
                    defunc_0_f_res_224145 = 0.0F;
                } else {
                    int64_t i_224146 = add64(x_224129, i_224138);
                    float defunc_0_add_arg_224147;
                    
                    defunc_0_add_arg_224147 =
                        ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                         (gtid_206375 *
                                                          ctx_param_ext_210921 +
                                                          i_224146 *
                                                          ctx_param_ext_210923)];
                    defunc_0_f_res_224145 = defunc_0_add_arg_224147;
                }
                
                int64_t binop_p_224148 = sub64(defunc_0_f_res_224142,
                                               defunc_0_g_res_224133);
                float defunc_0_f_res_224149 = sitofp_i64_f32(binop_p_224148);
                float abs_res_224150 = (float) fabs(defunc_0_f_res_224149);
                float tmp1_224151 = abs_res_224150 / x_224130;
                float x_224152 = tmp1_224151 * tmp1_224151;
                float y_224153 = tmp1_224151 * x_224152;
                float tmp2_224154 = 1.0F - y_224153;
                float x_224155 = tmp2_224154 * tmp2_224154;
                float tmp3_224156 = tmp2_224154 * x_224155;
                float tmp4_224157 = defunc_0_f_res_224145 * tmp3_224156;
                
                ((float *) mem_212735)[i_224138] = defunc_0_f_res_224149;
                ((float *) mem_212738)[i_224138] = tmp4_224157;
            }
            
            float defunc_2_reduce_res_224162;
            float defunc_2_reduce_res_224163;
            float defunc_2_reduce_res_224164;
            float defunc_2_reduce_res_224165;
            float defunc_2_reduce_res_224166;
            float redout_224170;
            float redout_224171;
            float redout_224172;
            float redout_224173;
            float redout_224174;
            
            redout_224170 = 0.0F;
            redout_224171 = 0.0F;
            redout_224172 = 0.0F;
            redout_224173 = 0.0F;
            redout_224174 = 0.0F;
            for (int64_t i_224169 = 0; i_224169 < q_l_196697; i_224169++) {
                float x_224177;
                
                x_224177 = ((float *) mem_212735)[i_224169];
                
                float x_224178;
                
                x_224178 = ((float *) mem_212738)[i_224169];
                
                float defunc_1_f_res_224179 = x_224177 * x_224178;
                float defunc_1_f_res_224180 = x_224177 * defunc_1_f_res_224179;
                float defunc_1_f_res_224181 = x_224177 * defunc_1_f_res_224180;
                float defunc_1_f_res_224182 = x_224177 * defunc_1_f_res_224181;
                float defunc_1_op_res_224183 = x_224178 + redout_224170;
                float defunc_1_op_res_224184 = defunc_1_f_res_224179 +
                      redout_224171;
                float defunc_1_op_res_224185 = defunc_1_f_res_224180 +
                      redout_224172;
                float defunc_1_op_res_224186 = defunc_1_f_res_224181 +
                      redout_224173;
                float defunc_1_op_res_224187 = defunc_1_f_res_224182 +
                      redout_224174;
                
                ((float *) mem_212765)[i_224169] = defunc_1_f_res_224180;
                ((float *) mem_212768)[i_224169] = defunc_1_f_res_224179;
                
                float redout_tmp_224249 = defunc_1_op_res_224183;
                float redout_tmp_224250 = defunc_1_op_res_224184;
                float redout_tmp_224251 = defunc_1_op_res_224185;
                float redout_tmp_224252 = defunc_1_op_res_224186;
                float redout_tmp_224253 = defunc_1_op_res_224187;
                
                redout_224170 = redout_tmp_224249;
                redout_224171 = redout_tmp_224250;
                redout_224172 = redout_tmp_224251;
                redout_224173 = redout_tmp_224252;
                redout_224174 = redout_tmp_224253;
            }
            defunc_2_reduce_res_224162 = redout_224170;
            defunc_2_reduce_res_224163 = redout_224171;
            defunc_2_reduce_res_224164 = redout_224172;
            defunc_2_reduce_res_224165 = redout_224173;
            defunc_2_reduce_res_224166 = redout_224174;
            
            float x_224190 = defunc_2_reduce_res_224164 *
                  defunc_2_reduce_res_224166;
            float y_224191 = defunc_2_reduce_res_224165 *
                  defunc_2_reduce_res_224165;
            float a12_224192 = x_224190 - y_224191;
            float x_224193 = defunc_2_reduce_res_224164 *
                  defunc_2_reduce_res_224165;
            float y_224194 = defunc_2_reduce_res_224163 *
                  defunc_2_reduce_res_224166;
            float b12_224195 = x_224193 - y_224194;
            float x_224196 = defunc_2_reduce_res_224163 *
                  defunc_2_reduce_res_224165;
            float y_224197 = defunc_2_reduce_res_224164 *
                  defunc_2_reduce_res_224164;
            float c12_224198 = x_224196 - y_224197;
            float x_224199 = defunc_2_reduce_res_224162 *
                  defunc_2_reduce_res_224166;
            float b2_224200 = x_224199 - y_224197;
            float x_224201 = defunc_2_reduce_res_224163 *
                  defunc_2_reduce_res_224164;
            float y_224202 = defunc_2_reduce_res_224162 *
                  defunc_2_reduce_res_224165;
            float c2_224203 = x_224201 - y_224202;
            float x_224204 = defunc_2_reduce_res_224162 * a12_224192;
            float y_224205 = defunc_2_reduce_res_224163 * b12_224195;
            float x_224206 = x_224204 + y_224205;
            float y_224207 = defunc_2_reduce_res_224164 * c12_224198;
            float y_224208 = x_224206 + y_224207;
            float det_224209 = 1.0F / y_224208;
            float a12_224210 = a12_224192 * det_224209;
            float b12_224211 = b12_224195 * det_224209;
            float c12_224212 = c12_224198 * det_224209;
            float b2_224213 = b2_224200 * det_224209;
            float c2_224214 = c2_224203 * det_224209;
            float defunc_2_reduce_res_224215;
            float defunc_2_reduce_res_224216;
            float redout_224218;
            float redout_224219;
            
            redout_224218 = 0.0F;
            redout_224219 = 0.0F;
            for (int64_t i_224217 = 0; i_224217 < q_l_196697; i_224217++) {
                float x_224220;
                
                x_224220 = ((float *) mem_212738)[i_224217];
                
                float x_224221;
                
                x_224221 = ((float *) mem_212768)[i_224217];
                
                float x_224222;
                
                x_224222 = ((float *) mem_212765)[i_224217];
                
                bool cond_224223 = sle64(n_196692, i_224217);
                float defunc_0_f_res_224224;
                
                if (cond_224223) {
                    defunc_0_f_res_224224 = 0.0F;
                } else {
                    int64_t i_224225 = add64(x_224129, i_224217);
                    float defunc_0_add_arg_224226;
                    
                    defunc_0_add_arg_224226 =
                        ((float *) mem_212347.mem)[gtid_206375 * n_196692 +
                                                   i_224225];
                    defunc_0_f_res_224224 = defunc_0_add_arg_224226;
                }
                
                float x_224227 = a12_224210 * x_224220;
                float y_224228 = b12_224211 * x_224221;
                float x_224229 = x_224227 + y_224228;
                float y_224230 = c12_224212 * x_224222;
                float x_224231 = x_224229 + y_224230;
                float defunc_9_fit_fun_res_224232 = defunc_0_f_res_224224 *
                      x_224231;
                float x_224233 = b12_224211 * x_224220;
                float y_224234 = b2_224213 * x_224221;
                float x_224235 = x_224233 + y_224234;
                float y_224236 = c2_224214 * x_224222;
                float x_224237 = x_224235 + y_224236;
                float defunc_9_slope_fun_res_224238 = defunc_0_f_res_224224 *
                      x_224237;
                float defunc_1_op_res_224239 = defunc_9_fit_fun_res_224232 +
                      redout_224218;
                float defunc_1_op_res_224240 = defunc_9_slope_fun_res_224238 +
                      redout_224219;
                float redout_tmp_224256 = defunc_1_op_res_224239;
                float redout_tmp_224257 = defunc_1_op_res_224240;
                
                redout_224218 = redout_tmp_224256;
                redout_224219 = redout_tmp_224257;
            }
            defunc_2_reduce_res_224215 = redout_224218;
            defunc_2_reduce_res_224216 = redout_224219;
            ((float *) mem_212715)[i_224126] = defunc_2_reduce_res_224215;
            ((float *) mem_212718)[i_224126] = defunc_2_reduce_res_224216;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212806.mem + gtid_206375 * l_n_m_196752 * (int64_t) 4,
                    mem_212715 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212810.mem + gtid_206375 * l_n_m_196752 * (int64_t) 4,
                    mem_212718 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212715);
    free(mem_212718);
    free(mem_212735);
    free(mem_212738);
    free(mem_212765);
    free(mem_212768);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229119_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229119_end -
                 futhark_mc_segmap_parloop_229119_start;
        
        ctx->futhark_mc_segmap_parloop_229119_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229119_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229119_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229117(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206374 = tid;
    int num_tasks_224124 = info.nsubtasks;
    struct futhark_mc_task_229116 *futhark_mc_task_229116 =
                                  (struct futhark_mc_task_229116 *) args;
    struct futhark_context *ctx = futhark_mc_task_229116->ctx;
    uint64_t futhark_mc_segmap_task_229117_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229117_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229116->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229116->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229116->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229116->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229116->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229116->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229116->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229116->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229116->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229116->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229116->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229116->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229116->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229116->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 = futhark_mc_task_229116->free_bytes_212636;
    struct memblock mem_212806 = {.desc ="mem_212806", .mem =
                                  futhark_mc_task_229116->free_mem_212806,
                                  .size =0, .references =NULL};
    struct memblock mem_212810 = {.desc ="mem_212810", .mem =
                                  futhark_mc_task_229116->free_mem_212810,
                                  .size =0, .references =NULL};
    int64_t iter_224125;
    struct futhark_mc_segmap_parloop_struct_229118
    futhark_mc_segmap_parloop_struct_229118;
    
    futhark_mc_segmap_parloop_struct_229118.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229118.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229118.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229118.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229118.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229118.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229118.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229118.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229118.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229118.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229118.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229118.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229118.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229118.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229118.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229118.free_bytes_212636 = bytes_212636;
    futhark_mc_segmap_parloop_struct_229118.free_mem_212806 = mem_212806.mem;
    futhark_mc_segmap_parloop_struct_229118.free_mem_212810 = mem_212810.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229119_task;
    
    futhark_mc_segmap_parloop_229119_task.name =
        "futhark_mc_segmap_parloop_229119";
    futhark_mc_segmap_parloop_229119_task.fn = futhark_mc_segmap_parloop_229119;
    futhark_mc_segmap_parloop_229119_task.args =
        &futhark_mc_segmap_parloop_struct_229118;
    futhark_mc_segmap_parloop_229119_task.iterations = iterations;
    futhark_mc_segmap_parloop_229119_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229119_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229119_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229119_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229119_task);
    
    if (futhark_mc_segmap_parloop_229119_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229119_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229119_total_end -
                 futhark_mc_segmap_parloop_229119_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229119_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229119_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229119_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229117_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229117_end -
                 futhark_mc_segmap_task_229117_start;
        
        ctx->futhark_mc_segmap_task_229117_runs[tid]++;
        ctx->futhark_mc_segmap_task_229117_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229117_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229127 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_bytes_210774;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212636;
    unsigned char *free_mem_212806;
    unsigned char *free_mem_212810;
};
struct futhark_mc_task_229131 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206504;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212636;
    unsigned char *free_mem_212709;
    unsigned char *free_mem_212712;
};
struct futhark_mc_segmap_parloop_struct_229133 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206504;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212636;
    unsigned char *free_mem_212709;
    unsigned char *free_mem_212712;
};
static int futhark_mc_segmap_parloop_229134(void *args, int64_t start,
                                            int64_t end, int flat_tid_224375,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229133
    *futhark_mc_segmap_parloop_struct_229133 =
    (struct futhark_mc_segmap_parloop_struct_229133 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229133->ctx;
    uint64_t futhark_mc_segmap_parloop_229134_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229134_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229133->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229133->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229133->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229133->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229133->free_i_196779;
    int64_t gtid_206504 =
            futhark_mc_segmap_parloop_struct_229133->free_gtid_206504;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229133->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229133->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229133->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229133->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229133->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229133->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229133->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 =
            futhark_mc_segmap_parloop_struct_229133->free_bytes_212636;
    struct memblock mem_212709 = {.desc ="mem_212709", .mem =
                                  futhark_mc_segmap_parloop_struct_229133->free_mem_212709,
                                  .size =0, .references =NULL};
    struct memblock mem_212712 = {.desc ="mem_212712", .mem =
                                  futhark_mc_segmap_parloop_struct_229133->free_mem_212712,
                                  .size =0, .references =NULL};
    size_t mem_224382_cached_sizze_229135 = 0;
    unsigned char *mem_224382 = NULL;
    size_t mem_224384_cached_sizze_229136 = 0;
    unsigned char *mem_224384 = NULL;
    size_t mem_224410_cached_sizze_229137 = 0;
    unsigned char *mem_224410 = NULL;
    size_t mem_224412_cached_sizze_229138 = 0;
    unsigned char *mem_224412 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224496 = start;
    
    if (mem_224382_cached_sizze_229135 < (size_t) bytes_212636) {
        mem_224382 = realloc(mem_224382, bytes_212636);
        mem_224382_cached_sizze_229135 = bytes_212636;
    }
    if (mem_224384_cached_sizze_229136 < (size_t) bytes_212636) {
        mem_224384 = realloc(mem_224384, bytes_212636);
        mem_224384_cached_sizze_229136 = bytes_212636;
    }
    if (mem_224410_cached_sizze_229137 < (size_t) bytes_212636) {
        mem_224410 = realloc(mem_224410, bytes_212636);
        mem_224410_cached_sizze_229137 = bytes_212636;
    }
    if (mem_224412_cached_sizze_229138 < (size_t) bytes_212636) {
        mem_224412 = realloc(mem_224412, bytes_212636);
        mem_224412_cached_sizze_229138 = bytes_212636;
    }
    for (; iter_224496 < end; iter_224496++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224564 = l_n_m_196752;
        int64_t gtid_224376 = iter_224496;
        int64_t remnant_224565 = iter_224496 - gtid_224376;
        int64_t x_224377;
        
        x_224377 = ((int64_t *) mem_210827.mem)[gtid_206504 * l_n_m_196752 +
                                                gtid_224376];
        
        float x_224378;
        
        x_224378 = ((float *) mem_210831.mem)[gtid_206504 * l_n_m_196752 +
                                              gtid_224376];
        
        int64_t min_arg_224379 = mul64(jump_t_196702, gtid_224376);
        int64_t min_res_224380 = smin64(i_196779, min_arg_224379);
        int64_t defunc_0_g_res_224381 = add64((int64_t) 1, min_res_224380);
        
        for (int64_t i_224497 = 0; i_224497 < q_l_196697; i_224497++) {
            bool cond_224500 = sle64(n_196692, i_224497);
            int64_t defunc_0_f_res_224501;
            
            if (cond_224500) {
                defunc_0_f_res_224501 = (int64_t) 0;
            } else {
                int64_t i_224502 = add64(x_224377, i_224497);
                int64_t defunc_1_add_res_224503 = add64((int64_t) 1, i_224502);
                
                defunc_0_f_res_224501 = defunc_1_add_res_224503;
            }
            
            float defunc_0_f_res_224504;
            
            if (cond_224500) {
                defunc_0_f_res_224504 = 0.0F;
            } else {
                int64_t i_224505 = add64(x_224377, i_224497);
                float defunc_0_add_arg_224506;
                
                defunc_0_add_arg_224506 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_206504 *
                                                      ctx_param_ext_210921 +
                                                      i_224505 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_224504 = defunc_0_add_arg_224506;
            }
            
            int64_t binop_p_224507 = sub64(defunc_0_f_res_224501,
                                           defunc_0_g_res_224381);
            float defunc_0_f_res_224508 = sitofp_i64_f32(binop_p_224507);
            float abs_res_224509 = (float) fabs(defunc_0_f_res_224508);
            float tmp1_224510 = abs_res_224509 / x_224378;
            float x_224511 = tmp1_224510 * tmp1_224510;
            float y_224512 = tmp1_224510 * x_224511;
            float tmp2_224513 = 1.0F - y_224512;
            float x_224514 = tmp2_224513 * tmp2_224513;
            float tmp3_224515 = tmp2_224513 * x_224514;
            float tmp4_224516 = defunc_0_f_res_224504 * tmp3_224515;
            
            ((float *) mem_224382)[i_224497] = defunc_0_f_res_224508;
            ((float *) mem_224384)[i_224497] = tmp4_224516;
        }
        
        float defunc_2_reduce_res_224414;
        float defunc_2_reduce_res_224415;
        float defunc_2_reduce_res_224416;
        float defunc_2_reduce_res_224417;
        float defunc_2_reduce_res_224418;
        float redout_224520;
        float redout_224521;
        float redout_224522;
        float redout_224523;
        float redout_224524;
        
        redout_224520 = 0.0F;
        redout_224521 = 0.0F;
        redout_224522 = 0.0F;
        redout_224523 = 0.0F;
        redout_224524 = 0.0F;
        for (int64_t i_224519 = 0; i_224519 < q_l_196697; i_224519++) {
            float x_224527;
            
            x_224527 = ((float *) mem_224382)[i_224519];
            
            float x_224528;
            
            x_224528 = ((float *) mem_224384)[i_224519];
            
            float defunc_1_f_res_224529 = x_224527 * x_224528;
            float defunc_1_f_res_224530 = x_224527 * defunc_1_f_res_224529;
            float defunc_1_f_res_224531 = x_224527 * defunc_1_f_res_224530;
            float defunc_1_f_res_224532 = x_224527 * defunc_1_f_res_224531;
            float defunc_1_op_res_224533 = x_224528 + redout_224520;
            float defunc_1_op_res_224534 = defunc_1_f_res_224529 +
                  redout_224521;
            float defunc_1_op_res_224535 = defunc_1_f_res_224530 +
                  redout_224522;
            float defunc_1_op_res_224536 = defunc_1_f_res_224531 +
                  redout_224523;
            float defunc_1_op_res_224537 = defunc_1_f_res_224532 +
                  redout_224524;
            
            ((float *) mem_224410)[i_224519] = defunc_1_f_res_224530;
            ((float *) mem_224412)[i_224519] = defunc_1_f_res_224529;
            
            float redout_tmp_224568 = defunc_1_op_res_224533;
            float redout_tmp_224569 = defunc_1_op_res_224534;
            float redout_tmp_224570 = defunc_1_op_res_224535;
            float redout_tmp_224571 = defunc_1_op_res_224536;
            float redout_tmp_224572 = defunc_1_op_res_224537;
            
            redout_224520 = redout_tmp_224568;
            redout_224521 = redout_tmp_224569;
            redout_224522 = redout_tmp_224570;
            redout_224523 = redout_tmp_224571;
            redout_224524 = redout_tmp_224572;
        }
        defunc_2_reduce_res_224414 = redout_224520;
        defunc_2_reduce_res_224415 = redout_224521;
        defunc_2_reduce_res_224416 = redout_224522;
        defunc_2_reduce_res_224417 = redout_224523;
        defunc_2_reduce_res_224418 = redout_224524;
        
        float x_224442 = defunc_2_reduce_res_224416 *
              defunc_2_reduce_res_224418;
        float y_224443 = defunc_2_reduce_res_224417 *
              defunc_2_reduce_res_224417;
        float a12_224444 = x_224442 - y_224443;
        float x_224445 = defunc_2_reduce_res_224416 *
              defunc_2_reduce_res_224417;
        float y_224446 = defunc_2_reduce_res_224415 *
              defunc_2_reduce_res_224418;
        float b12_224447 = x_224445 - y_224446;
        float x_224448 = defunc_2_reduce_res_224415 *
              defunc_2_reduce_res_224417;
        float y_224449 = defunc_2_reduce_res_224416 *
              defunc_2_reduce_res_224416;
        float c12_224450 = x_224448 - y_224449;
        float x_224451 = defunc_2_reduce_res_224414 *
              defunc_2_reduce_res_224418;
        float b2_224452 = x_224451 - y_224449;
        float x_224453 = defunc_2_reduce_res_224415 *
              defunc_2_reduce_res_224416;
        float y_224454 = defunc_2_reduce_res_224414 *
              defunc_2_reduce_res_224417;
        float c2_224455 = x_224453 - y_224454;
        float x_224456 = defunc_2_reduce_res_224414 * a12_224444;
        float y_224457 = defunc_2_reduce_res_224415 * b12_224447;
        float x_224458 = x_224456 + y_224457;
        float y_224459 = defunc_2_reduce_res_224416 * c12_224450;
        float y_224460 = x_224458 + y_224459;
        float det_224461 = 1.0F / y_224460;
        float a12_224462 = a12_224444 * det_224461;
        float b12_224463 = b12_224447 * det_224461;
        float c12_224464 = c12_224450 * det_224461;
        float b2_224465 = b2_224452 * det_224461;
        float c2_224466 = c2_224455 * det_224461;
        float defunc_2_reduce_res_224467;
        float defunc_2_reduce_res_224468;
        float redout_224541;
        float redout_224542;
        
        redout_224541 = 0.0F;
        redout_224542 = 0.0F;
        for (int64_t i_224540 = 0; i_224540 < q_l_196697; i_224540++) {
            float x_224543;
            
            x_224543 = ((float *) mem_224384)[i_224540];
            
            float x_224544;
            
            x_224544 = ((float *) mem_224412)[i_224540];
            
            float x_224545;
            
            x_224545 = ((float *) mem_224410)[i_224540];
            
            bool cond_224546 = sle64(n_196692, i_224540);
            float defunc_0_f_res_224547;
            
            if (cond_224546) {
                defunc_0_f_res_224547 = 0.0F;
            } else {
                int64_t i_224548 = add64(x_224377, i_224540);
                float defunc_0_add_arg_224549;
                
                defunc_0_add_arg_224549 =
                    ((float *) mem_212347.mem)[gtid_206504 * n_196692 +
                                               i_224548];
                defunc_0_f_res_224547 = defunc_0_add_arg_224549;
            }
            
            float x_224550 = a12_224462 * x_224543;
            float y_224551 = b12_224463 * x_224544;
            float x_224552 = x_224550 + y_224551;
            float y_224553 = c12_224464 * x_224545;
            float x_224554 = x_224552 + y_224553;
            float defunc_9_fit_fun_res_224555 = defunc_0_f_res_224547 *
                  x_224554;
            float x_224556 = b12_224463 * x_224543;
            float y_224557 = b2_224465 * x_224544;
            float x_224558 = x_224556 + y_224557;
            float y_224559 = c2_224466 * x_224545;
            float x_224560 = x_224558 + y_224559;
            float defunc_9_slope_fun_res_224561 = defunc_0_f_res_224547 *
                  x_224560;
            float defunc_1_op_res_224562 = defunc_9_fit_fun_res_224555 +
                  redout_224541;
            float defunc_1_op_res_224563 = defunc_9_slope_fun_res_224561 +
                  redout_224542;
            float redout_tmp_224575 = defunc_1_op_res_224562;
            float redout_tmp_224576 = defunc_1_op_res_224563;
            
            redout_224541 = redout_tmp_224575;
            redout_224542 = redout_tmp_224576;
        }
        defunc_2_reduce_res_224467 = redout_224541;
        defunc_2_reduce_res_224468 = redout_224542;
        ((float *) mem_212709.mem)[gtid_224376] = defunc_2_reduce_res_224467;
        ((float *) mem_212712.mem)[gtid_224376] = defunc_2_reduce_res_224468;
    }
    
  cleanup:
    { }
    free(mem_224382);
    free(mem_224384);
    free(mem_224410);
    free(mem_224412);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229134_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229134_end -
                 futhark_mc_segmap_parloop_229134_start;
        
        ctx->futhark_mc_segmap_parloop_229134_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229134_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229134_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229132(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224375 = tid;
    int num_tasks_224495 = info.nsubtasks;
    struct futhark_mc_task_229131 *futhark_mc_task_229131 =
                                  (struct futhark_mc_task_229131 *) args;
    struct futhark_context *ctx = futhark_mc_task_229131->ctx;
    uint64_t futhark_mc_segmap_task_229132_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229132_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229131->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229131->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229131->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229131->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229131->free_i_196779;
    int64_t gtid_206504 = futhark_mc_task_229131->free_gtid_206504;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229131->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229131->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229131->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229131->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229131->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229131->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229131->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 = futhark_mc_task_229131->free_bytes_212636;
    struct memblock mem_212709 = {.desc ="mem_212709", .mem =
                                  futhark_mc_task_229131->free_mem_212709,
                                  .size =0, .references =NULL};
    struct memblock mem_212712 = {.desc ="mem_212712", .mem =
                                  futhark_mc_task_229131->free_mem_212712,
                                  .size =0, .references =NULL};
    int64_t iter_224496;
    struct futhark_mc_segmap_parloop_struct_229133
    futhark_mc_segmap_parloop_struct_229133;
    
    futhark_mc_segmap_parloop_struct_229133.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229133.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229133.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229133.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229133.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229133.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229133.free_gtid_206504 = gtid_206504;
    futhark_mc_segmap_parloop_struct_229133.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229133.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229133.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229133.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229133.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229133.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229133.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229133.free_bytes_212636 = bytes_212636;
    futhark_mc_segmap_parloop_struct_229133.free_mem_212709 = mem_212709.mem;
    futhark_mc_segmap_parloop_struct_229133.free_mem_212712 = mem_212712.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229134_task;
    
    futhark_mc_segmap_parloop_229134_task.name =
        "futhark_mc_segmap_parloop_229134";
    futhark_mc_segmap_parloop_229134_task.fn = futhark_mc_segmap_parloop_229134;
    futhark_mc_segmap_parloop_229134_task.args =
        &futhark_mc_segmap_parloop_struct_229133;
    futhark_mc_segmap_parloop_229134_task.iterations = iterations;
    futhark_mc_segmap_parloop_229134_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229134_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229134_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229134_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229134_task);
    
    if (futhark_mc_segmap_parloop_229134_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229134_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229134_total_end -
                 futhark_mc_segmap_parloop_229134_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229134_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229134_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229134_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229132_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229132_end -
                 futhark_mc_segmap_task_229132_start;
        
        ctx->futhark_mc_segmap_task_229132_runs[tid]++;
        ctx->futhark_mc_segmap_task_229132_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229132_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229140 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_jump_t_196702;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_gtid_206504;
    unsigned char *free_mem_210827;
    unsigned char *free_mem_210831;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212347;
    int64_t free_bytes_212636;
    unsigned char *free_mem_212709;
    unsigned char *free_mem_212712;
};
struct futhark_mc_task_229146 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_gtid_206504;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_224261;
    float free_x_224262;
    int64_t free_defunc_0_g_res_224265;
    unsigned char *free_mem_224266;
    unsigned char *free_mem_224267;
};
struct futhark_mc_segmap_parloop_struct_229148 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_l_196697;
    int64_t free_gtid_206504;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_x_224261;
    float free_x_224262;
    int64_t free_defunc_0_g_res_224265;
    unsigned char *free_mem_224266;
    unsigned char *free_mem_224267;
};
static int futhark_mc_segmap_parloop_229149(void *args, int64_t start,
                                            int64_t end, int flat_tid_224578,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229148
    *futhark_mc_segmap_parloop_struct_229148 =
    (struct futhark_mc_segmap_parloop_struct_229148 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229148->ctx;
    uint64_t futhark_mc_segmap_parloop_229149_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229149_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229148->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229148->free_q_l_196697;
    int64_t gtid_206504 =
            futhark_mc_segmap_parloop_struct_229148->free_gtid_206504;
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229148->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229148->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229148->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229148->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_224261 = futhark_mc_segmap_parloop_struct_229148->free_x_224261;
    float x_224262 = futhark_mc_segmap_parloop_struct_229148->free_x_224262;
    int64_t defunc_0_g_res_224265 =
            futhark_mc_segmap_parloop_struct_229148->free_defunc_0_g_res_224265;
    struct memblock mem_224266 = {.desc ="mem_224266", .mem =
                                  futhark_mc_segmap_parloop_struct_229148->free_mem_224266,
                                  .size =0, .references =NULL};
    struct memblock mem_224267 = {.desc ="mem_224267", .mem =
                                  futhark_mc_segmap_parloop_struct_229148->free_mem_224267,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224650 = start;
    
    for (; iter_224650 < end; iter_224650++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224655 = q_l_196697;
        int64_t gtid_224579 = iter_224650;
        int64_t remnant_224656 = iter_224650 - gtid_224579;
        bool cond_224580 = sle64(n_196692, gtid_224579);
        int64_t defunc_0_f_res_224581;
        
        if (cond_224580) {
            defunc_0_f_res_224581 = (int64_t) 0;
        } else {
            int64_t i_224651 = add64(x_224261, gtid_224579);
            int64_t defunc_1_add_res_224652 = add64((int64_t) 1, i_224651);
            
            defunc_0_f_res_224581 = defunc_1_add_res_224652;
        }
        
        float defunc_0_f_res_224584;
        
        if (cond_224580) {
            defunc_0_f_res_224584 = 0.0F;
        } else {
            int64_t i_224653 = add64(x_224261, gtid_224579);
            float defunc_0_add_arg_224654;
            
            defunc_0_add_arg_224654 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_206504 *
                                                  ctx_param_ext_210921 +
                                                  i_224653 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_224584 = defunc_0_add_arg_224654;
        }
        
        int64_t binop_p_224587 = sub64(defunc_0_f_res_224581,
                                       defunc_0_g_res_224265);
        float defunc_0_f_res_224588 = sitofp_i64_f32(binop_p_224587);
        float abs_res_224589 = (float) fabs(defunc_0_f_res_224588);
        float tmp1_224590 = abs_res_224589 / x_224262;
        float x_224591 = tmp1_224590 * tmp1_224590;
        float y_224592 = tmp1_224590 * x_224591;
        float tmp2_224593 = 1.0F - y_224592;
        float x_224594 = tmp2_224593 * tmp2_224593;
        float tmp3_224595 = tmp2_224593 * x_224594;
        float tmp4_224596 = defunc_0_f_res_224584 * tmp3_224595;
        
        ((float *) mem_224266.mem)[gtid_224579] = defunc_0_f_res_224588;
        ((float *) mem_224267.mem)[gtid_224579] = tmp4_224596;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229149_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229149_end -
                 futhark_mc_segmap_parloop_229149_start;
        
        ctx->futhark_mc_segmap_parloop_229149_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229149_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229149_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229147(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224578 = tid;
    int num_tasks_224649 = info.nsubtasks;
    struct futhark_mc_task_229146 *futhark_mc_task_229146 =
                                  (struct futhark_mc_task_229146 *) args;
    struct futhark_context *ctx = futhark_mc_task_229146->ctx;
    uint64_t futhark_mc_segmap_task_229147_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229147_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229146->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229146->free_q_l_196697;
    int64_t gtid_206504 = futhark_mc_task_229146->free_gtid_206504;
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229146->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229146->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229146->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229146->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t x_224261 = futhark_mc_task_229146->free_x_224261;
    float x_224262 = futhark_mc_task_229146->free_x_224262;
    int64_t defunc_0_g_res_224265 =
            futhark_mc_task_229146->free_defunc_0_g_res_224265;
    struct memblock mem_224266 = {.desc ="mem_224266", .mem =
                                  futhark_mc_task_229146->free_mem_224266,
                                  .size =0, .references =NULL};
    struct memblock mem_224267 = {.desc ="mem_224267", .mem =
                                  futhark_mc_task_229146->free_mem_224267,
                                  .size =0, .references =NULL};
    int64_t iter_224650;
    struct futhark_mc_segmap_parloop_struct_229148
    futhark_mc_segmap_parloop_struct_229148;
    
    futhark_mc_segmap_parloop_struct_229148.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229148.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229148.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229148.free_gtid_206504 = gtid_206504;
    futhark_mc_segmap_parloop_struct_229148.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229148.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229148.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229148.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229148.free_x_224261 = x_224261;
    futhark_mc_segmap_parloop_struct_229148.free_x_224262 = x_224262;
    futhark_mc_segmap_parloop_struct_229148.free_defunc_0_g_res_224265 =
        defunc_0_g_res_224265;
    futhark_mc_segmap_parloop_struct_229148.free_mem_224266 = mem_224266.mem;
    futhark_mc_segmap_parloop_struct_229148.free_mem_224267 = mem_224267.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229149_task;
    
    futhark_mc_segmap_parloop_229149_task.name =
        "futhark_mc_segmap_parloop_229149";
    futhark_mc_segmap_parloop_229149_task.fn = futhark_mc_segmap_parloop_229149;
    futhark_mc_segmap_parloop_229149_task.args =
        &futhark_mc_segmap_parloop_struct_229148;
    futhark_mc_segmap_parloop_229149_task.iterations = iterations;
    futhark_mc_segmap_parloop_229149_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229149_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229149_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229149_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229149_task);
    
    if (futhark_mc_segmap_parloop_229149_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229149_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229149_total_end -
                 futhark_mc_segmap_parloop_229149_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229149_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229149_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229149_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229147_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229147_end -
                 futhark_mc_segmap_task_229147_start;
        
        ctx->futhark_mc_segmap_task_229147_runs[tid]++;
        ctx->futhark_mc_segmap_task_229147_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229147_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229150 {
    struct futhark_context *ctx;
    unsigned char *free_mem_224266;
    unsigned char *free_mem_224267;
    float *retval_defunc_2_reduce_res_224291;
    float *retval_defunc_2_reduce_res_224292;
    float *retval_defunc_2_reduce_res_224293;
    float *retval_defunc_2_reduce_res_224294;
    float *retval_defunc_2_reduce_res_224295;
    unsigned char *retval_mem_224289;
    unsigned char *retval_mem_224290;
};
struct futhark_mc_segred_stage_1_parloop_struct_229157 {
    struct futhark_context *ctx;
    unsigned char *free_mem_224266;
    unsigned char *free_mem_224267;
    unsigned char *free_mem_224289;
    unsigned char *free_mem_224290;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224658;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224660;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224662;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224664;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224666;
};
static int futhark_mc_segred_stage_1_parloop_229158(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_224597,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229157
    *futhark_mc_segred_stage_1_parloop_struct_229157 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229157 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229157->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229158_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229158_start = get_wall_time();
    
    struct memblock mem_224266 = {.desc ="mem_224266", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229157->free_mem_224266,
                                  .size =0, .references =NULL};
    struct memblock mem_224267 = {.desc ="mem_224267", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229157->free_mem_224267,
                                  .size =0, .references =NULL};
    struct memblock mem_224289 = {.desc ="mem_224289", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229157->free_mem_224289,
                                  .size =0, .references =NULL};
    struct memblock mem_224290 = {.desc ="mem_224290", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229157->free_mem_224290,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224658 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224658",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229157->free_reduce_stage_1_tid_res_arr_mem_224658,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224660 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224660",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229157->free_reduce_stage_1_tid_res_arr_mem_224660,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224662 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224662",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229157->free_reduce_stage_1_tid_res_arr_mem_224662,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224664 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224664",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229157->free_reduce_stage_1_tid_res_arr_mem_224664,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224666 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224666",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229157->free_reduce_stage_1_tid_res_arr_mem_224666,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224668 = start;
    float x_224599;
    float x_224600;
    float x_224602;
    float x_224603;
    float x_224605;
    float x_224606;
    float x_224608;
    float x_224609;
    float x_224611;
    float x_224612;
    float local_acc_224669 = 0.0F;
    float local_acc_224670 = 0.0F;
    float local_acc_224671 = 0.0F;
    float local_acc_224672 = 0.0F;
    float local_acc_224673 = 0.0F;
    
    for (; iter_224668 < end; iter_224668++) {
        int64_t gtid_224598 = iter_224668;
        float x_224614;
        
        x_224614 = ((float *) mem_224266.mem)[gtid_224598];
        
        float x_224615;
        
        x_224615 = ((float *) mem_224267.mem)[gtid_224598];
        
        float defunc_1_f_res_224616 = x_224614 * x_224615;
        float defunc_1_f_res_224617 = x_224614 * defunc_1_f_res_224616;
        float defunc_1_f_res_224618 = x_224614 * defunc_1_f_res_224617;
        float defunc_1_f_res_224619 = x_224614 * defunc_1_f_res_224618;
        
        // save map-out results
        {
            ((float *) mem_224289.mem)[gtid_224598] = defunc_1_f_res_224617;
            ((float *) mem_224290.mem)[gtid_224598] = defunc_1_f_res_224616;
        }
        // Load accum params
        {
            x_224599 = local_acc_224669;
        }
        // Load next params
        {
            x_224600 = x_224615;
        }
        // Red body
        {
            float defunc_1_op_res_224601 = x_224599 + x_224600;
            
            local_acc_224669 = defunc_1_op_res_224601;
        }
        // Load accum params
        {
            x_224602 = local_acc_224670;
        }
        // Load next params
        {
            x_224603 = defunc_1_f_res_224616;
        }
        // Red body
        {
            float defunc_1_op_res_224604 = x_224602 + x_224603;
            
            local_acc_224670 = defunc_1_op_res_224604;
        }
        // Load accum params
        {
            x_224605 = local_acc_224671;
        }
        // Load next params
        {
            x_224606 = defunc_1_f_res_224617;
        }
        // Red body
        {
            float defunc_1_op_res_224607 = x_224605 + x_224606;
            
            local_acc_224671 = defunc_1_op_res_224607;
        }
        // Load accum params
        {
            x_224608 = local_acc_224672;
        }
        // Load next params
        {
            x_224609 = defunc_1_f_res_224618;
        }
        // Red body
        {
            float defunc_1_op_res_224610 = x_224608 + x_224609;
            
            local_acc_224672 = defunc_1_op_res_224610;
        }
        // Load accum params
        {
            x_224611 = local_acc_224673;
        }
        // Load next params
        {
            x_224612 = defunc_1_f_res_224619;
        }
        // Red body
        {
            float defunc_1_op_res_224613 = x_224611 + x_224612;
            
            local_acc_224673 = defunc_1_op_res_224613;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_224658.mem)[flat_tid_224597] =
        local_acc_224669;
    ((float *) reduce_stage_1_tid_res_arr_mem_224660.mem)[flat_tid_224597] =
        local_acc_224670;
    ((float *) reduce_stage_1_tid_res_arr_mem_224662.mem)[flat_tid_224597] =
        local_acc_224671;
    ((float *) reduce_stage_1_tid_res_arr_mem_224664.mem)[flat_tid_224597] =
        local_acc_224672;
    ((float *) reduce_stage_1_tid_res_arr_mem_224666.mem)[flat_tid_224597] =
        local_acc_224673;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229158_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229158_end -
                 futhark_mc_segred_stage_1_parloop_229158_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229158_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229158_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229158_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229151(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224597 = tid;
    int num_tasks_224657 = info.nsubtasks;
    struct futhark_mc_task_229150 *futhark_mc_task_229150 =
                                  (struct futhark_mc_task_229150 *) args;
    struct futhark_context *ctx = futhark_mc_task_229150->ctx;
    uint64_t futhark_mc_segred_task_229151_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229151_start = get_wall_time();
    
    struct memblock mem_224266 = {.desc ="mem_224266", .mem =
                                  futhark_mc_task_229150->free_mem_224266,
                                  .size =0, .references =NULL};
    struct memblock mem_224267 = {.desc ="mem_224267", .mem =
                                  futhark_mc_task_229150->free_mem_224267,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_224291 =
          *futhark_mc_task_229150->retval_defunc_2_reduce_res_224291;
    float defunc_2_reduce_res_224292 =
          *futhark_mc_task_229150->retval_defunc_2_reduce_res_224292;
    float defunc_2_reduce_res_224293 =
          *futhark_mc_task_229150->retval_defunc_2_reduce_res_224293;
    float defunc_2_reduce_res_224294 =
          *futhark_mc_task_229150->retval_defunc_2_reduce_res_224294;
    float defunc_2_reduce_res_224295 =
          *futhark_mc_task_229150->retval_defunc_2_reduce_res_224295;
    struct memblock mem_224289 = {.desc ="mem_224289", .mem =
                                  futhark_mc_task_229150->retval_mem_224289,
                                  .size =0, .references =NULL};
    struct memblock mem_224290 = {.desc ="mem_224290", .mem =
                                  futhark_mc_task_229150->retval_mem_224290,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_224658_cached_sizze_229152 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224658 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224660_cached_sizze_229153 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224660 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224662_cached_sizze_229154 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224662 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224664_cached_sizze_229155 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224664 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224666_cached_sizze_229156 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224666 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_224658_cached_sizze_229152 <
        (size_t) ((int64_t) 4 * num_tasks_224657)) {
        reduce_stage_1_tid_res_arr_mem_224658 =
            realloc(reduce_stage_1_tid_res_arr_mem_224658, (int64_t) 4 *
                    num_tasks_224657);
        reduce_stage_1_tid_res_arr_mem_224658_cached_sizze_229152 =
            (int64_t) 4 * num_tasks_224657;
    }
    if (reduce_stage_1_tid_res_arr_mem_224660_cached_sizze_229153 <
        (size_t) ((int64_t) 4 * num_tasks_224657)) {
        reduce_stage_1_tid_res_arr_mem_224660 =
            realloc(reduce_stage_1_tid_res_arr_mem_224660, (int64_t) 4 *
                    num_tasks_224657);
        reduce_stage_1_tid_res_arr_mem_224660_cached_sizze_229153 =
            (int64_t) 4 * num_tasks_224657;
    }
    if (reduce_stage_1_tid_res_arr_mem_224662_cached_sizze_229154 <
        (size_t) ((int64_t) 4 * num_tasks_224657)) {
        reduce_stage_1_tid_res_arr_mem_224662 =
            realloc(reduce_stage_1_tid_res_arr_mem_224662, (int64_t) 4 *
                    num_tasks_224657);
        reduce_stage_1_tid_res_arr_mem_224662_cached_sizze_229154 =
            (int64_t) 4 * num_tasks_224657;
    }
    if (reduce_stage_1_tid_res_arr_mem_224664_cached_sizze_229155 <
        (size_t) ((int64_t) 4 * num_tasks_224657)) {
        reduce_stage_1_tid_res_arr_mem_224664 =
            realloc(reduce_stage_1_tid_res_arr_mem_224664, (int64_t) 4 *
                    num_tasks_224657);
        reduce_stage_1_tid_res_arr_mem_224664_cached_sizze_229155 =
            (int64_t) 4 * num_tasks_224657;
    }
    if (reduce_stage_1_tid_res_arr_mem_224666_cached_sizze_229156 <
        (size_t) ((int64_t) 4 * num_tasks_224657)) {
        reduce_stage_1_tid_res_arr_mem_224666 =
            realloc(reduce_stage_1_tid_res_arr_mem_224666, (int64_t) 4 *
                    num_tasks_224657);
        reduce_stage_1_tid_res_arr_mem_224666_cached_sizze_229156 =
            (int64_t) 4 * num_tasks_224657;
    }
    
    int64_t iter_224668;
    struct futhark_mc_segred_stage_1_parloop_struct_229157
    futhark_mc_segred_stage_1_parloop_struct_229157;
    
    futhark_mc_segred_stage_1_parloop_struct_229157.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_mem_224266 =
        mem_224266.mem;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_mem_224267 =
        mem_224267.mem;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_mem_224289 =
        mem_224289.mem;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_mem_224290 =
        mem_224290.mem;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_reduce_stage_1_tid_res_arr_mem_224658 =
        reduce_stage_1_tid_res_arr_mem_224658;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_reduce_stage_1_tid_res_arr_mem_224660 =
        reduce_stage_1_tid_res_arr_mem_224660;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_reduce_stage_1_tid_res_arr_mem_224662 =
        reduce_stage_1_tid_res_arr_mem_224662;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_reduce_stage_1_tid_res_arr_mem_224664 =
        reduce_stage_1_tid_res_arr_mem_224664;
    futhark_mc_segred_stage_1_parloop_struct_229157.free_reduce_stage_1_tid_res_arr_mem_224666 =
        reduce_stage_1_tid_res_arr_mem_224666;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229158_task;
    
    futhark_mc_segred_stage_1_parloop_229158_task.name =
        "futhark_mc_segred_stage_1_parloop_229158";
    futhark_mc_segred_stage_1_parloop_229158_task.fn =
        futhark_mc_segred_stage_1_parloop_229158;
    futhark_mc_segred_stage_1_parloop_229158_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229157;
    futhark_mc_segred_stage_1_parloop_229158_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229158_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229158_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229158_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229158_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229158_task);
    
    if (futhark_mc_segred_stage_1_parloop_229158_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229158_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229158_total_end -
                 futhark_mc_segred_stage_1_parloop_229158_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229158_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229158_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229158_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_224291 = 0.0F;
        defunc_2_reduce_res_224292 = 0.0F;
        defunc_2_reduce_res_224293 = 0.0F;
        defunc_2_reduce_res_224294 = 0.0F;
        defunc_2_reduce_res_224295 = 0.0F;
    }
    
    float x_224674;
    float x_224675;
    float x_224677;
    float x_224678;
    float x_224680;
    float x_224681;
    float x_224683;
    float x_224684;
    float x_224686;
    float x_224687;
    
    for (int32_t i_224689 = 0; i_224689 < num_tasks_224657; i_224689++) {
        flat_tid_224597 = i_224689;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_224674 = defunc_2_reduce_res_224291;
            }
            // load next params
            {
                x_224675 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224658)[flat_tid_224597];
            }
            // red body
            {
                float defunc_1_op_res_224676 = x_224674 + x_224675;
                
                defunc_2_reduce_res_224291 = defunc_1_op_res_224676;
            }
            // load acc params
            {
                x_224677 = defunc_2_reduce_res_224292;
            }
            // load next params
            {
                x_224678 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224660)[flat_tid_224597];
            }
            // red body
            {
                float defunc_1_op_res_224679 = x_224677 + x_224678;
                
                defunc_2_reduce_res_224292 = defunc_1_op_res_224679;
            }
            // load acc params
            {
                x_224680 = defunc_2_reduce_res_224293;
            }
            // load next params
            {
                x_224681 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224662)[flat_tid_224597];
            }
            // red body
            {
                float defunc_1_op_res_224682 = x_224680 + x_224681;
                
                defunc_2_reduce_res_224293 = defunc_1_op_res_224682;
            }
            // load acc params
            {
                x_224683 = defunc_2_reduce_res_224294;
            }
            // load next params
            {
                x_224684 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224664)[flat_tid_224597];
            }
            // red body
            {
                float defunc_1_op_res_224685 = x_224683 + x_224684;
                
                defunc_2_reduce_res_224294 = defunc_1_op_res_224685;
            }
            // load acc params
            {
                x_224686 = defunc_2_reduce_res_224295;
            }
            // load next params
            {
                x_224687 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224666)[flat_tid_224597];
            }
            // red body
            {
                float defunc_1_op_res_224688 = x_224686 + x_224687;
                
                defunc_2_reduce_res_224295 = defunc_1_op_res_224688;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_224658);
        free(reduce_stage_1_tid_res_arr_mem_224660);
        free(reduce_stage_1_tid_res_arr_mem_224662);
        free(reduce_stage_1_tid_res_arr_mem_224664);
        free(reduce_stage_1_tid_res_arr_mem_224666);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229151_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229151_end -
                 futhark_mc_segred_task_229151_start;
        
        ctx->futhark_mc_segred_task_229151_runs[tid]++;
        ctx->futhark_mc_segred_task_229151_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229151_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229150->retval_defunc_2_reduce_res_224291 =
            defunc_2_reduce_res_224291;
        *futhark_mc_task_229150->retval_defunc_2_reduce_res_224292 =
            defunc_2_reduce_res_224292;
        *futhark_mc_task_229150->retval_defunc_2_reduce_res_224293 =
            defunc_2_reduce_res_224293;
        *futhark_mc_task_229150->retval_defunc_2_reduce_res_224294 =
            defunc_2_reduce_res_224294;
        *futhark_mc_task_229150->retval_defunc_2_reduce_res_224295 =
            defunc_2_reduce_res_224295;
        futhark_mc_task_229150->retval_mem_224289 = mem_224289.mem;
        futhark_mc_task_229150->retval_mem_224290 = mem_224290.mem;
    }
    return err;
}
struct futhark_mc_task_229159 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206504;
    unsigned char *free_mem_212347;
    int64_t free_x_224261;
    unsigned char *free_mem_224267;
    unsigned char *free_mem_224289;
    unsigned char *free_mem_224290;
    float free_a12_224341;
    float free_b12_224342;
    float free_c12_224343;
    float free_b2_224344;
    float free_c2_224345;
    float *retval_defunc_2_reduce_res_224346;
    float *retval_defunc_2_reduce_res_224347;
};
struct futhark_mc_segred_stage_1_parloop_struct_229163 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206504;
    unsigned char *free_mem_212347;
    int64_t free_x_224261;
    unsigned char *free_mem_224267;
    unsigned char *free_mem_224289;
    unsigned char *free_mem_224290;
    float free_a12_224341;
    float free_b12_224342;
    float free_c12_224343;
    float free_b2_224344;
    float free_c2_224345;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224691;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_224693;
};
static int futhark_mc_segred_stage_1_parloop_229164(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_224620,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229163
    *futhark_mc_segred_stage_1_parloop_struct_229163 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229163 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229163->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229164_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229164_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229163->free_n_196692;
    int64_t gtid_206504 =
            futhark_mc_segred_stage_1_parloop_struct_229163->free_gtid_206504;
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229163->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_224261 =
            futhark_mc_segred_stage_1_parloop_struct_229163->free_x_224261;
    struct memblock mem_224267 = {.desc ="mem_224267", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229163->free_mem_224267,
                                  .size =0, .references =NULL};
    struct memblock mem_224289 = {.desc ="mem_224289", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229163->free_mem_224289,
                                  .size =0, .references =NULL};
    struct memblock mem_224290 = {.desc ="mem_224290", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229163->free_mem_224290,
                                  .size =0, .references =NULL};
    float a12_224341 =
          futhark_mc_segred_stage_1_parloop_struct_229163->free_a12_224341;
    float b12_224342 =
          futhark_mc_segred_stage_1_parloop_struct_229163->free_b12_224342;
    float c12_224343 =
          futhark_mc_segred_stage_1_parloop_struct_229163->free_c12_224343;
    float b2_224344 =
          futhark_mc_segred_stage_1_parloop_struct_229163->free_b2_224344;
    float c2_224345 =
          futhark_mc_segred_stage_1_parloop_struct_229163->free_c2_224345;
    struct memblock reduce_stage_1_tid_res_arr_mem_224691 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224691",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229163->free_reduce_stage_1_tid_res_arr_mem_224691,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_224693 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_224693",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229163->free_reduce_stage_1_tid_res_arr_mem_224693,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224695 = start;
    float x_224622;
    float x_224623;
    float x_224625;
    float x_224626;
    float local_acc_224696 = 0.0F;
    float local_acc_224697 = 0.0F;
    
    for (; iter_224695 < end; iter_224695++) {
        int64_t gtid_224621 = iter_224695;
        float x_224628;
        
        x_224628 = ((float *) mem_224267.mem)[gtid_224621];
        
        float x_224629;
        
        x_224629 = ((float *) mem_224290.mem)[gtid_224621];
        
        float x_224630;
        
        x_224630 = ((float *) mem_224289.mem)[gtid_224621];
        
        bool cond_224631 = sle64(n_196692, gtid_224621);
        float defunc_0_f_res_224632;
        
        if (cond_224631) {
            defunc_0_f_res_224632 = 0.0F;
        } else {
            int64_t i_224633 = add64(x_224261, gtid_224621);
            float defunc_0_add_arg_224634;
            
            defunc_0_add_arg_224634 = ((float *) mem_212347.mem)[gtid_206504 *
                                                                 n_196692 +
                                                                 i_224633];
            defunc_0_f_res_224632 = defunc_0_add_arg_224634;
        }
        
        float x_224635 = a12_224341 * x_224628;
        float y_224636 = b12_224342 * x_224629;
        float x_224637 = x_224635 + y_224636;
        float y_224638 = c12_224343 * x_224630;
        float x_224639 = x_224637 + y_224638;
        float defunc_9_fit_fun_res_224640 = defunc_0_f_res_224632 * x_224639;
        float x_224641 = b12_224342 * x_224628;
        float y_224642 = b2_224344 * x_224629;
        float x_224643 = x_224641 + y_224642;
        float y_224644 = c2_224345 * x_224630;
        float x_224645 = x_224643 + y_224644;
        float defunc_9_slope_fun_res_224646 = defunc_0_f_res_224632 * x_224645;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_224622 = local_acc_224696;
        }
        // Load next params
        {
            x_224623 = defunc_9_fit_fun_res_224640;
        }
        // Red body
        {
            float defunc_1_op_res_224624 = x_224622 + x_224623;
            
            local_acc_224696 = defunc_1_op_res_224624;
        }
        // Load accum params
        {
            x_224625 = local_acc_224697;
        }
        // Load next params
        {
            x_224626 = defunc_9_slope_fun_res_224646;
        }
        // Red body
        {
            float defunc_1_op_res_224627 = x_224625 + x_224626;
            
            local_acc_224697 = defunc_1_op_res_224627;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_224691.mem)[flat_tid_224620] =
        local_acc_224696;
    ((float *) reduce_stage_1_tid_res_arr_mem_224693.mem)[flat_tid_224620] =
        local_acc_224697;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229164_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229164_end -
                 futhark_mc_segred_stage_1_parloop_229164_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229164_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229164_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229164_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229160(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224620 = tid;
    int num_tasks_224690 = info.nsubtasks;
    struct futhark_mc_task_229159 *futhark_mc_task_229159 =
                                  (struct futhark_mc_task_229159 *) args;
    struct futhark_context *ctx = futhark_mc_task_229159->ctx;
    uint64_t futhark_mc_segred_task_229160_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229160_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229159->free_n_196692;
    int64_t gtid_206504 = futhark_mc_task_229159->free_gtid_206504;
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229159->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t x_224261 = futhark_mc_task_229159->free_x_224261;
    struct memblock mem_224267 = {.desc ="mem_224267", .mem =
                                  futhark_mc_task_229159->free_mem_224267,
                                  .size =0, .references =NULL};
    struct memblock mem_224289 = {.desc ="mem_224289", .mem =
                                  futhark_mc_task_229159->free_mem_224289,
                                  .size =0, .references =NULL};
    struct memblock mem_224290 = {.desc ="mem_224290", .mem =
                                  futhark_mc_task_229159->free_mem_224290,
                                  .size =0, .references =NULL};
    float a12_224341 = futhark_mc_task_229159->free_a12_224341;
    float b12_224342 = futhark_mc_task_229159->free_b12_224342;
    float c12_224343 = futhark_mc_task_229159->free_c12_224343;
    float b2_224344 = futhark_mc_task_229159->free_b2_224344;
    float c2_224345 = futhark_mc_task_229159->free_c2_224345;
    float defunc_2_reduce_res_224346 =
          *futhark_mc_task_229159->retval_defunc_2_reduce_res_224346;
    float defunc_2_reduce_res_224347 =
          *futhark_mc_task_229159->retval_defunc_2_reduce_res_224347;
    size_t reduce_stage_1_tid_res_arr_mem_224691_cached_sizze_229161 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224691 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_224693_cached_sizze_229162 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_224693 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_224691_cached_sizze_229161 <
        (size_t) ((int64_t) 4 * num_tasks_224690)) {
        reduce_stage_1_tid_res_arr_mem_224691 =
            realloc(reduce_stage_1_tid_res_arr_mem_224691, (int64_t) 4 *
                    num_tasks_224690);
        reduce_stage_1_tid_res_arr_mem_224691_cached_sizze_229161 =
            (int64_t) 4 * num_tasks_224690;
    }
    if (reduce_stage_1_tid_res_arr_mem_224693_cached_sizze_229162 <
        (size_t) ((int64_t) 4 * num_tasks_224690)) {
        reduce_stage_1_tid_res_arr_mem_224693 =
            realloc(reduce_stage_1_tid_res_arr_mem_224693, (int64_t) 4 *
                    num_tasks_224690);
        reduce_stage_1_tid_res_arr_mem_224693_cached_sizze_229162 =
            (int64_t) 4 * num_tasks_224690;
    }
    
    int64_t iter_224695;
    struct futhark_mc_segred_stage_1_parloop_struct_229163
    futhark_mc_segred_stage_1_parloop_struct_229163;
    
    futhark_mc_segred_stage_1_parloop_struct_229163.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_gtid_206504 =
        gtid_206504;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_mem_212347 =
        mem_212347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_x_224261 = x_224261;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_mem_224267 =
        mem_224267.mem;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_mem_224289 =
        mem_224289.mem;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_mem_224290 =
        mem_224290.mem;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_a12_224341 =
        a12_224341;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_b12_224342 =
        b12_224342;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_c12_224343 =
        c12_224343;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_b2_224344 = b2_224344;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_c2_224345 = c2_224345;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_reduce_stage_1_tid_res_arr_mem_224691 =
        reduce_stage_1_tid_res_arr_mem_224691;
    futhark_mc_segred_stage_1_parloop_struct_229163.free_reduce_stage_1_tid_res_arr_mem_224693 =
        reduce_stage_1_tid_res_arr_mem_224693;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229164_task;
    
    futhark_mc_segred_stage_1_parloop_229164_task.name =
        "futhark_mc_segred_stage_1_parloop_229164";
    futhark_mc_segred_stage_1_parloop_229164_task.fn =
        futhark_mc_segred_stage_1_parloop_229164;
    futhark_mc_segred_stage_1_parloop_229164_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229163;
    futhark_mc_segred_stage_1_parloop_229164_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229164_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229164_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229164_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229164_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229164_task);
    
    if (futhark_mc_segred_stage_1_parloop_229164_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229164_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229164_total_end -
                 futhark_mc_segred_stage_1_parloop_229164_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229164_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229164_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229164_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_224346 = 0.0F;
        defunc_2_reduce_res_224347 = 0.0F;
    }
    
    float x_224698;
    float x_224699;
    float x_224701;
    float x_224702;
    
    for (int32_t i_224704 = 0; i_224704 < num_tasks_224690; i_224704++) {
        flat_tid_224620 = i_224704;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_224698 = defunc_2_reduce_res_224346;
            }
            // load next params
            {
                x_224699 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224691)[flat_tid_224620];
            }
            // red body
            {
                float defunc_1_op_res_224700 = x_224698 + x_224699;
                
                defunc_2_reduce_res_224346 = defunc_1_op_res_224700;
            }
            // load acc params
            {
                x_224701 = defunc_2_reduce_res_224347;
            }
            // load next params
            {
                x_224702 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_224693)[flat_tid_224620];
            }
            // red body
            {
                float defunc_1_op_res_224703 = x_224701 + x_224702;
                
                defunc_2_reduce_res_224347 = defunc_1_op_res_224703;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_224691);
        free(reduce_stage_1_tid_res_arr_mem_224693);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229160_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229160_end -
                 futhark_mc_segred_task_229160_start;
        
        ctx->futhark_mc_segred_task_229160_runs[tid]++;
        ctx->futhark_mc_segred_task_229160_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229160_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229159->retval_defunc_2_reduce_res_224346 =
            defunc_2_reduce_res_224346;
        *futhark_mc_task_229159->retval_defunc_2_reduce_res_224347 =
            defunc_2_reduce_res_224347;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229141(void *args, int64_t start,
                                            int64_t end, int flat_tid_224259,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229140
    *futhark_mc_segmap_parloop_struct_229140 =
    (struct futhark_mc_segmap_parloop_struct_229140 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229140->ctx;
    uint64_t futhark_mc_segmap_parloop_229141_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229141_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229140->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229140->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229140->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229140->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229140->free_i_196779;
    int64_t gtid_206504 =
            futhark_mc_segmap_parloop_struct_229140->free_gtid_206504;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229140->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229140->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229140->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229140->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229140->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229140->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229140->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 =
            futhark_mc_segmap_parloop_struct_229140->free_bytes_212636;
    struct memblock mem_212709 = {.desc ="mem_212709", .mem =
                                  futhark_mc_segmap_parloop_struct_229140->free_mem_212709,
                                  .size =0, .references =NULL};
    struct memblock mem_212712 = {.desc ="mem_212712", .mem =
                                  futhark_mc_segmap_parloop_struct_229140->free_mem_212712,
                                  .size =0, .references =NULL};
    size_t mem_224266_cached_sizze_229142 = 0;
    unsigned char *mem_224266 = NULL;
    size_t mem_224267_cached_sizze_229143 = 0;
    unsigned char *mem_224267 = NULL;
    size_t mem_224289_cached_sizze_229144 = 0;
    unsigned char *mem_224289 = NULL;
    size_t mem_224290_cached_sizze_229145 = 0;
    unsigned char *mem_224290 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224577 = start;
    
    if (mem_224266_cached_sizze_229142 < (size_t) bytes_212636) {
        mem_224266 = realloc(mem_224266, bytes_212636);
        mem_224266_cached_sizze_229142 = bytes_212636;
    }
    if (mem_224267_cached_sizze_229143 < (size_t) bytes_212636) {
        mem_224267 = realloc(mem_224267, bytes_212636);
        mem_224267_cached_sizze_229143 = bytes_212636;
    }
    if (mem_224289_cached_sizze_229144 < (size_t) bytes_212636) {
        mem_224289 = realloc(mem_224289, bytes_212636);
        mem_224289_cached_sizze_229144 = bytes_212636;
    }
    if (mem_224290_cached_sizze_229145 < (size_t) bytes_212636) {
        mem_224290 = realloc(mem_224290, bytes_212636);
        mem_224290_cached_sizze_229145 = bytes_212636;
    }
    for (; iter_224577 < end; iter_224577++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224647 = l_n_m_196752;
        int64_t gtid_224260 = iter_224577;
        int64_t remnant_224648 = iter_224577 - gtid_224260;
        int64_t x_224261;
        
        x_224261 = ((int64_t *) mem_210827.mem)[gtid_206504 * l_n_m_196752 +
                                                gtid_224260];
        
        float x_224262;
        
        x_224262 = ((float *) mem_210831.mem)[gtid_206504 * l_n_m_196752 +
                                              gtid_224260];
        
        int64_t min_arg_224263 = mul64(jump_t_196702, gtid_224260);
        int64_t min_res_224264 = smin64(i_196779, min_arg_224263);
        int64_t defunc_0_g_res_224265 = add64((int64_t) 1, min_res_224264);
        int64_t flat_tid_224578 = (int64_t) 0;
        int32_t num_tasks_224649;
        struct futhark_mc_task_229146 futhark_mc_task_229146;
        
        futhark_mc_task_229146.ctx = ctx;
        futhark_mc_task_229146.free_n_196692 = n_196692;
        futhark_mc_task_229146.free_q_l_196697 = q_l_196697;
        futhark_mc_task_229146.free_gtid_206504 = gtid_206504;
        futhark_mc_task_229146.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229146.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229146.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229146.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229146.free_x_224261 = x_224261;
        futhark_mc_task_229146.free_x_224262 = x_224262;
        futhark_mc_task_229146.free_defunc_0_g_res_224265 =
            defunc_0_g_res_224265;
        futhark_mc_task_229146.free_mem_224266 = mem_224266;
        futhark_mc_task_229146.free_mem_224267 = mem_224267;
        
        struct scheduler_segop futhark_mc_task_229146_task;
        
        futhark_mc_task_229146_task.args = &futhark_mc_task_229146;
        futhark_mc_task_229146_task.top_level_fn =
            futhark_mc_segmap_task_229147;
        futhark_mc_task_229146_task.name = "futhark_mc_segmap_task_229147";
        futhark_mc_task_229146_task.iterations = q_l_196697;
        futhark_mc_task_229146_task.task_time =
            &ctx->futhark_mc_segmap_task_229147_total_time;
        futhark_mc_task_229146_task.task_iter =
            &ctx->futhark_mc_segmap_task_229147_total_iter;
        futhark_mc_task_229146_task.sched = STATIC;
        futhark_mc_task_229146_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229147_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229146_task);
        
        if (futhark_mc_segmap_task_229147_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float defunc_2_reduce_res_224291;
        float defunc_2_reduce_res_224292;
        float defunc_2_reduce_res_224293;
        float defunc_2_reduce_res_224294;
        float defunc_2_reduce_res_224295;
        int64_t flat_tid_224597 = (int64_t) 0;
        int32_t num_tasks_224657;
        
        defunc_2_reduce_res_224291 = 0.0F;
        defunc_2_reduce_res_224292 = 0.0F;
        defunc_2_reduce_res_224293 = 0.0F;
        defunc_2_reduce_res_224294 = 0.0F;
        defunc_2_reduce_res_224295 = 0.0F;
        
        struct futhark_mc_task_229150 futhark_mc_task_229150;
        
        futhark_mc_task_229150.ctx = ctx;
        futhark_mc_task_229150.free_mem_224266 = mem_224266;
        futhark_mc_task_229150.free_mem_224267 = mem_224267;
        futhark_mc_task_229150.retval_defunc_2_reduce_res_224291 =
            &defunc_2_reduce_res_224291;
        futhark_mc_task_229150.retval_defunc_2_reduce_res_224292 =
            &defunc_2_reduce_res_224292;
        futhark_mc_task_229150.retval_defunc_2_reduce_res_224293 =
            &defunc_2_reduce_res_224293;
        futhark_mc_task_229150.retval_defunc_2_reduce_res_224294 =
            &defunc_2_reduce_res_224294;
        futhark_mc_task_229150.retval_defunc_2_reduce_res_224295 =
            &defunc_2_reduce_res_224295;
        futhark_mc_task_229150.retval_mem_224289 = mem_224289;
        futhark_mc_task_229150.retval_mem_224290 = mem_224290;
        
        struct scheduler_segop futhark_mc_task_229150_task;
        
        futhark_mc_task_229150_task.args = &futhark_mc_task_229150;
        futhark_mc_task_229150_task.top_level_fn =
            futhark_mc_segred_task_229151;
        futhark_mc_task_229150_task.name = "futhark_mc_segred_task_229151";
        futhark_mc_task_229150_task.iterations = q_l_196697;
        futhark_mc_task_229150_task.task_time =
            &ctx->futhark_mc_segred_task_229151_total_time;
        futhark_mc_task_229150_task.task_iter =
            &ctx->futhark_mc_segred_task_229151_total_iter;
        futhark_mc_task_229150_task.sched = STATIC;
        futhark_mc_task_229150_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229151_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229150_task);
        
        if (futhark_mc_segred_task_229151_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_224321 = defunc_2_reduce_res_224293 *
              defunc_2_reduce_res_224295;
        float y_224322 = defunc_2_reduce_res_224294 *
              defunc_2_reduce_res_224294;
        float a12_224323 = x_224321 - y_224322;
        float x_224324 = defunc_2_reduce_res_224293 *
              defunc_2_reduce_res_224294;
        float y_224325 = defunc_2_reduce_res_224292 *
              defunc_2_reduce_res_224295;
        float b12_224326 = x_224324 - y_224325;
        float x_224327 = defunc_2_reduce_res_224292 *
              defunc_2_reduce_res_224294;
        float y_224328 = defunc_2_reduce_res_224293 *
              defunc_2_reduce_res_224293;
        float c12_224329 = x_224327 - y_224328;
        float x_224330 = defunc_2_reduce_res_224291 *
              defunc_2_reduce_res_224295;
        float b2_224331 = x_224330 - y_224328;
        float x_224332 = defunc_2_reduce_res_224292 *
              defunc_2_reduce_res_224293;
        float y_224333 = defunc_2_reduce_res_224291 *
              defunc_2_reduce_res_224294;
        float c2_224334 = x_224332 - y_224333;
        float x_224335 = defunc_2_reduce_res_224291 * a12_224323;
        float y_224336 = defunc_2_reduce_res_224292 * b12_224326;
        float x_224337 = x_224335 + y_224336;
        float y_224338 = defunc_2_reduce_res_224293 * c12_224329;
        float y_224339 = x_224337 + y_224338;
        float det_224340 = 1.0F / y_224339;
        float a12_224341 = a12_224323 * det_224340;
        float b12_224342 = b12_224326 * det_224340;
        float c12_224343 = c12_224329 * det_224340;
        float b2_224344 = b2_224331 * det_224340;
        float c2_224345 = c2_224334 * det_224340;
        float defunc_2_reduce_res_224346;
        float defunc_2_reduce_res_224347;
        int64_t flat_tid_224620 = (int64_t) 0;
        int32_t num_tasks_224690;
        
        defunc_2_reduce_res_224346 = 0.0F;
        defunc_2_reduce_res_224347 = 0.0F;
        
        struct futhark_mc_task_229159 futhark_mc_task_229159;
        
        futhark_mc_task_229159.ctx = ctx;
        futhark_mc_task_229159.free_n_196692 = n_196692;
        futhark_mc_task_229159.free_gtid_206504 = gtid_206504;
        futhark_mc_task_229159.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229159.free_x_224261 = x_224261;
        futhark_mc_task_229159.free_mem_224267 = mem_224267;
        futhark_mc_task_229159.free_mem_224289 = mem_224289;
        futhark_mc_task_229159.free_mem_224290 = mem_224290;
        futhark_mc_task_229159.free_a12_224341 = a12_224341;
        futhark_mc_task_229159.free_b12_224342 = b12_224342;
        futhark_mc_task_229159.free_c12_224343 = c12_224343;
        futhark_mc_task_229159.free_b2_224344 = b2_224344;
        futhark_mc_task_229159.free_c2_224345 = c2_224345;
        futhark_mc_task_229159.retval_defunc_2_reduce_res_224346 =
            &defunc_2_reduce_res_224346;
        futhark_mc_task_229159.retval_defunc_2_reduce_res_224347 =
            &defunc_2_reduce_res_224347;
        
        struct scheduler_segop futhark_mc_task_229159_task;
        
        futhark_mc_task_229159_task.args = &futhark_mc_task_229159;
        futhark_mc_task_229159_task.top_level_fn =
            futhark_mc_segred_task_229160;
        futhark_mc_task_229159_task.name = "futhark_mc_segred_task_229160";
        futhark_mc_task_229159_task.iterations = q_l_196697;
        futhark_mc_task_229159_task.task_time =
            &ctx->futhark_mc_segred_task_229160_total_time;
        futhark_mc_task_229159_task.task_iter =
            &ctx->futhark_mc_segred_task_229160_total_iter;
        futhark_mc_task_229159_task.sched = STATIC;
        futhark_mc_task_229159_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229160_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229159_task);
        
        if (futhark_mc_segred_task_229160_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212709.mem)[gtid_224260] = defunc_2_reduce_res_224346;
        ((float *) mem_212712.mem)[gtid_224260] = defunc_2_reduce_res_224347;
    }
    
  cleanup:
    { }
    free(mem_224266);
    free(mem_224267);
    free(mem_224289);
    free(mem_224290);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229141_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229141_end -
                 futhark_mc_segmap_parloop_229141_start;
        
        ctx->futhark_mc_segmap_parloop_229141_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229141_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229141_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229139(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224259 = tid;
    int num_tasks_224495 = info.nsubtasks;
    struct futhark_mc_task_229131 *futhark_mc_task_229131 =
                                  (struct futhark_mc_task_229131 *) args;
    struct futhark_context *ctx = futhark_mc_task_229131->ctx;
    uint64_t futhark_mc_segmap_nested_task_229139_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229139_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229131->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229131->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229131->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229131->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229131->free_i_196779;
    int64_t gtid_206504 = futhark_mc_task_229131->free_gtid_206504;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229131->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229131->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229131->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229131->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229131->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229131->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229131->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 = futhark_mc_task_229131->free_bytes_212636;
    struct memblock mem_212709 = {.desc ="mem_212709", .mem =
                                  futhark_mc_task_229131->free_mem_212709,
                                  .size =0, .references =NULL};
    struct memblock mem_212712 = {.desc ="mem_212712", .mem =
                                  futhark_mc_task_229131->free_mem_212712,
                                  .size =0, .references =NULL};
    int64_t iter_224577;
    struct futhark_mc_segmap_parloop_struct_229140
    futhark_mc_segmap_parloop_struct_229140;
    
    futhark_mc_segmap_parloop_struct_229140.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229140.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229140.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229140.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229140.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229140.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229140.free_gtid_206504 = gtid_206504;
    futhark_mc_segmap_parloop_struct_229140.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229140.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229140.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229140.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229140.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229140.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229140.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229140.free_bytes_212636 = bytes_212636;
    futhark_mc_segmap_parloop_struct_229140.free_mem_212709 = mem_212709.mem;
    futhark_mc_segmap_parloop_struct_229140.free_mem_212712 = mem_212712.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229141_task;
    
    futhark_mc_segmap_parloop_229141_task.name =
        "futhark_mc_segmap_parloop_229141";
    futhark_mc_segmap_parloop_229141_task.fn = futhark_mc_segmap_parloop_229141;
    futhark_mc_segmap_parloop_229141_task.args =
        &futhark_mc_segmap_parloop_struct_229140;
    futhark_mc_segmap_parloop_229141_task.iterations = iterations;
    futhark_mc_segmap_parloop_229141_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229141_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229141_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229141_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229141_task);
    
    if (futhark_mc_segmap_parloop_229141_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229141_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229141_total_end -
                 futhark_mc_segmap_parloop_229141_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229141_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229141_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229141_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229139_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229139_end -
                 futhark_mc_segmap_nested_task_229139_start;
        
        ctx->futhark_mc_segmap_nested_task_229139_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229139_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229139_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229128(void *args, int64_t start,
                                            int64_t end, int flat_tid_206503,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229127
    *futhark_mc_segmap_parloop_struct_229127 =
    (struct futhark_mc_segmap_parloop_struct_229127 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229127->ctx;
    uint64_t futhark_mc_segmap_parloop_229128_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229128_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229127->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229127->free_n_196692;
    int64_t q_l_196697 =
            futhark_mc_segmap_parloop_struct_229127->free_q_l_196697;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229127->free_jump_t_196702;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229127->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229127->free_i_196779;
    int64_t bytes_210774 =
            futhark_mc_segmap_parloop_struct_229127->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_segmap_parloop_struct_229127->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_segmap_parloop_struct_229127->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229127->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229127->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229127->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229127->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_segmap_parloop_struct_229127->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 =
            futhark_mc_segmap_parloop_struct_229127->free_bytes_212636;
    struct memblock mem_212806 = {.desc ="mem_212806", .mem =
                                  futhark_mc_segmap_parloop_struct_229127->free_mem_212806,
                                  .size =0, .references =NULL};
    struct memblock mem_212810 = {.desc ="mem_212810", .mem =
                                  futhark_mc_segmap_parloop_struct_229127->free_mem_212810,
                                  .size =0, .references =NULL};
    size_t mem_212709_cached_sizze_229129 = 0;
    unsigned char *mem_212709 = NULL;
    size_t mem_212712_cached_sizze_229130 = 0;
    unsigned char *mem_212712 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224258 = start;
    
    if (mem_212709_cached_sizze_229129 < (size_t) bytes_210774) {
        mem_212709 = realloc(mem_212709, bytes_210774);
        mem_212709_cached_sizze_229129 = bytes_210774;
    }
    if (mem_212712_cached_sizze_229130 < (size_t) bytes_210774) {
        mem_212712 = realloc(mem_212712, bytes_210774);
        mem_212712_cached_sizze_229130 = bytes_210774;
    }
    for (; iter_224258 < end; iter_224258++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224493 = m_196691;
        int64_t gtid_206504 = iter_224258;
        int64_t remnant_224494 = iter_224258 - gtid_206504;
        int64_t flat_tid_224375 = (int64_t) 0;
        int32_t num_tasks_224495;
        int64_t flat_tid_224259 = (int64_t) 0;
        struct futhark_mc_task_229131 futhark_mc_task_229131;
        
        futhark_mc_task_229131.ctx = ctx;
        futhark_mc_task_229131.free_n_196692 = n_196692;
        futhark_mc_task_229131.free_q_l_196697 = q_l_196697;
        futhark_mc_task_229131.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229131.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_229131.free_i_196779 = i_196779;
        futhark_mc_task_229131.free_gtid_206504 = gtid_206504;
        futhark_mc_task_229131.free_mem_210827 = mem_210827.mem;
        futhark_mc_task_229131.free_mem_210831 = mem_210831.mem;
        futhark_mc_task_229131.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229131.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229131.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229131.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229131.free_mem_212347 = mem_212347.mem;
        futhark_mc_task_229131.free_bytes_212636 = bytes_212636;
        futhark_mc_task_229131.free_mem_212709 = mem_212709;
        futhark_mc_task_229131.free_mem_212712 = mem_212712;
        
        struct scheduler_segop futhark_mc_task_229131_task;
        
        futhark_mc_task_229131_task.args = &futhark_mc_task_229131;
        futhark_mc_task_229131_task.top_level_fn =
            futhark_mc_segmap_task_229132;
        futhark_mc_task_229131_task.name = "futhark_mc_segmap_task_229132";
        futhark_mc_task_229131_task.iterations = l_n_m_196752;
        futhark_mc_task_229131_task.task_time =
            &ctx->futhark_mc_segmap_task_229132_total_time;
        futhark_mc_task_229131_task.task_iter =
            &ctx->futhark_mc_segmap_task_229132_total_iter;
        futhark_mc_task_229131_task.sched = STATIC;
        futhark_mc_task_229131_task.nested_fn =
            futhark_mc_segmap_nested_task_229139;
        
        int futhark_mc_segmap_task_229132_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229131_task);
        
        if (futhark_mc_segmap_task_229132_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212806.mem + gtid_206504 * l_n_m_196752 * (int64_t) 4,
                    mem_212709 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
        if (l_n_m_196752 * (int64_t) 4 > 0)
            memmove(mem_212810.mem + gtid_206504 * l_n_m_196752 * (int64_t) 4,
                    mem_212712 + (int64_t) 0, l_n_m_196752 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212709);
    free(mem_212712);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229128_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229128_end -
                 futhark_mc_segmap_parloop_229128_start;
        
        ctx->futhark_mc_segmap_parloop_229128_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229128_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229128_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229126(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206503 = tid;
    int num_tasks_224124 = info.nsubtasks;
    struct futhark_mc_task_229116 *futhark_mc_task_229116 =
                                  (struct futhark_mc_task_229116 *) args;
    struct futhark_context *ctx = futhark_mc_task_229116->ctx;
    uint64_t futhark_mc_segmap_nested_task_229126_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229126_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229116->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229116->free_n_196692;
    int64_t q_l_196697 = futhark_mc_task_229116->free_q_l_196697;
    int64_t jump_t_196702 = futhark_mc_task_229116->free_jump_t_196702;
    int64_t l_n_m_196752 = futhark_mc_task_229116->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229116->free_i_196779;
    int64_t bytes_210774 = futhark_mc_task_229116->free_bytes_210774;
    struct memblock mem_210827 = {.desc ="mem_210827", .mem =
                                  futhark_mc_task_229116->free_mem_210827,
                                  .size =0, .references =NULL};
    struct memblock mem_210831 = {.desc ="mem_210831", .mem =
                                  futhark_mc_task_229116->free_mem_210831,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229116->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229116->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229116->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229116->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212347 = {.desc ="mem_212347", .mem =
                                  futhark_mc_task_229116->free_mem_212347,
                                  .size =0, .references =NULL};
    int64_t bytes_212636 = futhark_mc_task_229116->free_bytes_212636;
    struct memblock mem_212806 = {.desc ="mem_212806", .mem =
                                  futhark_mc_task_229116->free_mem_212806,
                                  .size =0, .references =NULL};
    struct memblock mem_212810 = {.desc ="mem_212810", .mem =
                                  futhark_mc_task_229116->free_mem_212810,
                                  .size =0, .references =NULL};
    int64_t iter_224258;
    struct futhark_mc_segmap_parloop_struct_229127
    futhark_mc_segmap_parloop_struct_229127;
    
    futhark_mc_segmap_parloop_struct_229127.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229127.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229127.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229127.free_q_l_196697 = q_l_196697;
    futhark_mc_segmap_parloop_struct_229127.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229127.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229127.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229127.free_bytes_210774 = bytes_210774;
    futhark_mc_segmap_parloop_struct_229127.free_mem_210827 = mem_210827.mem;
    futhark_mc_segmap_parloop_struct_229127.free_mem_210831 = mem_210831.mem;
    futhark_mc_segmap_parloop_struct_229127.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229127.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229127.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229127.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229127.free_mem_212347 = mem_212347.mem;
    futhark_mc_segmap_parloop_struct_229127.free_bytes_212636 = bytes_212636;
    futhark_mc_segmap_parloop_struct_229127.free_mem_212806 = mem_212806.mem;
    futhark_mc_segmap_parloop_struct_229127.free_mem_212810 = mem_212810.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229128_task;
    
    futhark_mc_segmap_parloop_229128_task.name =
        "futhark_mc_segmap_parloop_229128";
    futhark_mc_segmap_parloop_229128_task.fn = futhark_mc_segmap_parloop_229128;
    futhark_mc_segmap_parloop_229128_task.args =
        &futhark_mc_segmap_parloop_struct_229127;
    futhark_mc_segmap_parloop_229128_task.iterations = iterations;
    futhark_mc_segmap_parloop_229128_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229128_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229128_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229128_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229128_task);
    
    if (futhark_mc_segmap_parloop_229128_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229128_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229128_total_end -
                 futhark_mc_segmap_parloop_229128_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229128_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229128_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229128_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229126_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229126_end -
                 futhark_mc_segmap_nested_task_229126_start;
        
        ctx->futhark_mc_segmap_nested_task_229126_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229126_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229126_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229165 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_y_198899;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_212815;
    unsigned char *free_ext_mem_212816;
    unsigned char *free_mem_212838;
};
struct futhark_mc_segmap_parloop_struct_229167 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_y_198899;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_212815;
    unsigned char *free_ext_mem_212816;
    unsigned char *free_mem_212838;
};
static int futhark_mc_segmap_parloop_229168(void *args, int64_t start,
                                            int64_t end, int flat_tid_206735,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229167
    *futhark_mc_segmap_parloop_struct_229167 =
    (struct futhark_mc_segmap_parloop_struct_229167 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229167->ctx;
    uint64_t futhark_mc_segmap_parloop_229168_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229168_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229167->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229167->free_n_196692;
    int64_t jump_l_196703 =
            futhark_mc_segmap_parloop_struct_229167->free_jump_l_196703;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229167->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229167->free_i_196779;
    int64_t y_198899 = futhark_mc_segmap_parloop_struct_229167->free_y_198899;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229167->free_bytes_210949;
    struct memblock ext_mem_212815 = {.desc ="ext_mem_212815", .mem =
                                      futhark_mc_segmap_parloop_struct_229167->free_ext_mem_212815,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212816 = {.desc ="ext_mem_212816", .mem =
                                      futhark_mc_segmap_parloop_struct_229167->free_ext_mem_212816,
                                      .size =0, .references =NULL};
    struct memblock mem_212838 = {.desc ="mem_212838", .mem =
                                  futhark_mc_segmap_parloop_struct_229167->free_mem_212838,
                                  .size =0, .references =NULL};
    size_t mem_212822_cached_sizze_229169 = 0;
    unsigned char *mem_212822 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224706 = start;
    
    if (mem_212822_cached_sizze_229169 < (size_t) bytes_210949) {
        mem_212822 = realloc(mem_212822, bytes_210949);
        mem_212822_cached_sizze_229169 = bytes_210949;
    }
    for (; iter_224706 < end; iter_224706++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224756 = m_196691;
        int64_t gtid_206736 = iter_224706;
        int64_t remnant_224757 = iter_224706 - gtid_206736;
        
        for (int64_t i_224707 = 0; i_224707 < n_196692; i_224707++) {
            int64_t m_v_224709 = sdiv64(i_224707, jump_l_196703);
            bool cond_224710 = m_v_224709 == y_198899;
            int64_t j_224711;
            
            if (cond_224710) {
                int64_t j_t_res_224712 = sub64(m_v_224709, (int64_t) 1);
                
                j_224711 = j_t_res_224712;
            } else {
                j_224711 = m_v_224709;
            }
            
            int64_t min_arg_224713 = mul64(jump_l_196703, j_224711);
            int64_t min_res_224714 = smin64(i_196779, min_arg_224713);
            int64_t defunc_0_m_fun_arg_224715 = add64((int64_t) 1, j_224711);
            int64_t min_arg_224716 = mul64(jump_l_196703,
                                           defunc_0_m_fun_arg_224715);
            int64_t min_res_224717 = smin64(i_196779, min_arg_224716);
            int64_t i64_arg_224718 = sub64(min_res_224717, min_res_224714);
            float i64_res_224719 = sitofp_i64_f32(i64_arg_224718);
            int64_t i64_arg_224720 = sub64(i_224707, min_res_224714);
            float i64_res_224721 = sitofp_i64_f32(i64_arg_224720);
            float u_224722 = i64_res_224721 / i64_res_224719;
            float u2_224723 = u_224722 * u_224722;
            float u3_224724 = u_224722 * u2_224723;
            float x_224725 = 2.0F * u3_224724;
            float y_224726 = 3.0F * u2_224723;
            float x_224727 = x_224725 - y_224726;
            float x_224728 = 1.0F + x_224727;
            bool x_224729 = sle64((int64_t) 0, j_224711);
            bool y_224730 = slt64(j_224711, l_n_m_196752);
            bool bounds_check_224731 = x_224729 && y_224730;
            bool index_certs_224732;
            
            if (!bounds_check_224731) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) j_224711,
                              "] out of bounds for array of shape [",
                              (long long) l_n_m_196752, "].",
                              "-> #0  loess.fut:535:27-33\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float y_224733;
            
            y_224733 = ((float *) ext_mem_212816.mem)[gtid_206736 *
                                                      l_n_m_196752 + j_224711];
            
            float x_224734 = x_224728 * y_224733;
            float x_224735 = y_224726 - x_224725;
            bool x_224736 = sle64((int64_t) 0, defunc_0_m_fun_arg_224715);
            bool y_224737 = slt64(defunc_0_m_fun_arg_224715, l_n_m_196752);
            bool bounds_check_224738 = x_224736 && y_224737;
            bool index_certs_224739;
            
            if (!bounds_check_224738) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) defunc_0_m_fun_arg_224715,
                              "] out of bounds for array of shape [",
                              (long long) l_n_m_196752, "].",
                              "-> #0  loess.fut:536:27-37\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float y_224740;
            
            y_224740 = ((float *) ext_mem_212816.mem)[gtid_206736 *
                                                      l_n_m_196752 +
                                                      defunc_0_m_fun_arg_224715];
            
            float y_224741 = x_224735 * y_224740;
            float x_224742 = x_224734 + y_224741;
            float y_224743 = 2.0F * u2_224723;
            float x_224744 = u3_224724 - y_224743;
            float x_224745 = u_224722 + x_224744;
            float y_224746;
            
            y_224746 = ((float *) ext_mem_212815.mem)[gtid_206736 *
                                                      l_n_m_196752 + j_224711];
            
            float x_224747 = x_224745 * y_224746;
            float y_224748 = i64_res_224719 * x_224747;
            float x_224749 = x_224742 + y_224748;
            float x_224750 = u3_224724 - u2_224723;
            float y_224751;
            
            y_224751 = ((float *) ext_mem_212815.mem)[gtid_206736 *
                                                      l_n_m_196752 +
                                                      defunc_0_m_fun_arg_224715];
            
            float x_224752 = x_224750 * y_224751;
            float y_224753 = i64_res_224719 * x_224752;
            float defunc_4_interpolate_proc_res_224754 = x_224749 + y_224753;
            
            ((float *) mem_212822)[i_224707] =
                defunc_4_interpolate_proc_res_224754;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_212838.mem + gtid_206736 * n_196692 * (int64_t) 4,
                    mem_212822 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212822);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229168_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229168_end -
                 futhark_mc_segmap_parloop_229168_start;
        
        ctx->futhark_mc_segmap_parloop_229168_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229168_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229168_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229166(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206735 = tid;
    int num_tasks_224705 = info.nsubtasks;
    struct futhark_mc_task_229165 *futhark_mc_task_229165 =
                                  (struct futhark_mc_task_229165 *) args;
    struct futhark_context *ctx = futhark_mc_task_229165->ctx;
    uint64_t futhark_mc_segmap_task_229166_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229166_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229165->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229165->free_n_196692;
    int64_t jump_l_196703 = futhark_mc_task_229165->free_jump_l_196703;
    int64_t l_n_m_196752 = futhark_mc_task_229165->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229165->free_i_196779;
    int64_t y_198899 = futhark_mc_task_229165->free_y_198899;
    int64_t bytes_210949 = futhark_mc_task_229165->free_bytes_210949;
    struct memblock ext_mem_212815 = {.desc ="ext_mem_212815", .mem =
                                      futhark_mc_task_229165->free_ext_mem_212815,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212816 = {.desc ="ext_mem_212816", .mem =
                                      futhark_mc_task_229165->free_ext_mem_212816,
                                      .size =0, .references =NULL};
    struct memblock mem_212838 = {.desc ="mem_212838", .mem =
                                  futhark_mc_task_229165->free_mem_212838,
                                  .size =0, .references =NULL};
    int64_t iter_224706;
    struct futhark_mc_segmap_parloop_struct_229167
    futhark_mc_segmap_parloop_struct_229167;
    
    futhark_mc_segmap_parloop_struct_229167.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229167.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229167.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229167.free_jump_l_196703 = jump_l_196703;
    futhark_mc_segmap_parloop_struct_229167.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229167.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229167.free_y_198899 = y_198899;
    futhark_mc_segmap_parloop_struct_229167.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229167.free_ext_mem_212815 =
        ext_mem_212815.mem;
    futhark_mc_segmap_parloop_struct_229167.free_ext_mem_212816 =
        ext_mem_212816.mem;
    futhark_mc_segmap_parloop_struct_229167.free_mem_212838 = mem_212838.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229168_task;
    
    futhark_mc_segmap_parloop_229168_task.name =
        "futhark_mc_segmap_parloop_229168";
    futhark_mc_segmap_parloop_229168_task.fn = futhark_mc_segmap_parloop_229168;
    futhark_mc_segmap_parloop_229168_task.args =
        &futhark_mc_segmap_parloop_struct_229167;
    futhark_mc_segmap_parloop_229168_task.iterations = iterations;
    futhark_mc_segmap_parloop_229168_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229168_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229168_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229168_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229168_task);
    
    if (futhark_mc_segmap_parloop_229168_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229168_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229168_total_end -
                 futhark_mc_segmap_parloop_229168_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229168_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229168_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229168_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229166_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229166_end -
                 futhark_mc_segmap_task_229166_start;
        
        ctx->futhark_mc_segmap_task_229166_runs[tid]++;
        ctx->futhark_mc_segmap_task_229166_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229166_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229171 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_y_198899;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_212815;
    unsigned char *free_ext_mem_212816;
    unsigned char *free_mem_212838;
};
struct futhark_mc_task_229174 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_y_198899;
    int64_t free_gtid_206742;
    unsigned char *free_ext_mem_212815;
    unsigned char *free_ext_mem_212816;
    unsigned char *free_mem_212819;
};
struct futhark_mc_segmap_parloop_struct_229176 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_l_196703;
    int64_t free_l_n_m_196752;
    int64_t free_i_196779;
    int64_t free_y_198899;
    int64_t free_gtid_206742;
    unsigned char *free_ext_mem_212815;
    unsigned char *free_ext_mem_212816;
    unsigned char *free_mem_212819;
};
static int futhark_mc_segmap_parloop_229177(void *args, int64_t start,
                                            int64_t end, int flat_tid_224760,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229176
    *futhark_mc_segmap_parloop_struct_229176 =
    (struct futhark_mc_segmap_parloop_struct_229176 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229176->ctx;
    uint64_t futhark_mc_segmap_parloop_229177_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229177_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229176->free_n_196692;
    int64_t jump_l_196703 =
            futhark_mc_segmap_parloop_struct_229176->free_jump_l_196703;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229176->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229176->free_i_196779;
    int64_t y_198899 = futhark_mc_segmap_parloop_struct_229176->free_y_198899;
    int64_t gtid_206742 =
            futhark_mc_segmap_parloop_struct_229176->free_gtid_206742;
    struct memblock ext_mem_212815 = {.desc ="ext_mem_212815", .mem =
                                      futhark_mc_segmap_parloop_struct_229176->free_ext_mem_212815,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212816 = {.desc ="ext_mem_212816", .mem =
                                      futhark_mc_segmap_parloop_struct_229176->free_ext_mem_212816,
                                      .size =0, .references =NULL};
    struct memblock mem_212819 = {.desc ="mem_212819", .mem =
                                  futhark_mc_segmap_parloop_struct_229176->free_mem_212819,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224811 = start;
    
    for (; iter_224811 < end; iter_224811++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224813 = n_196692;
        int64_t gtid_224761 = iter_224811;
        int64_t remnant_224814 = iter_224811 - gtid_224761;
        int64_t m_v_224762 = sdiv64(gtid_224761, jump_l_196703);
        bool cond_224763 = m_v_224762 == y_198899;
        int64_t j_224764;
        
        if (cond_224763) {
            int64_t j_t_res_224812 = sub64(m_v_224762, (int64_t) 1);
            
            j_224764 = j_t_res_224812;
        } else {
            j_224764 = m_v_224762;
        }
        
        int64_t min_arg_224766 = mul64(jump_l_196703, j_224764);
        int64_t min_res_224767 = smin64(i_196779, min_arg_224766);
        int64_t defunc_0_m_fun_arg_224768 = add64((int64_t) 1, j_224764);
        int64_t min_arg_224769 = mul64(jump_l_196703,
                                       defunc_0_m_fun_arg_224768);
        int64_t min_res_224770 = smin64(i_196779, min_arg_224769);
        int64_t i64_arg_224771 = sub64(min_res_224770, min_res_224767);
        float i64_res_224772 = sitofp_i64_f32(i64_arg_224771);
        int64_t i64_arg_224773 = sub64(gtid_224761, min_res_224767);
        float i64_res_224774 = sitofp_i64_f32(i64_arg_224773);
        float u_224775 = i64_res_224774 / i64_res_224772;
        float u2_224776 = u_224775 * u_224775;
        float u3_224777 = u_224775 * u2_224776;
        float x_224778 = 2.0F * u3_224777;
        float y_224779 = 3.0F * u2_224776;
        float x_224780 = x_224778 - y_224779;
        float x_224781 = 1.0F + x_224780;
        bool x_224782 = sle64((int64_t) 0, j_224764);
        bool y_224783 = slt64(j_224764, l_n_m_196752);
        bool bounds_check_224784 = x_224782 && y_224783;
        bool index_certs_224785;
        
        if (!bounds_check_224784) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) j_224764,
                                   "] out of bounds for array of shape [",
                                   (long long) l_n_m_196752, "].",
                                   "-> #0  loess.fut:535:27-33\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        float y_224786;
        
        y_224786 = ((float *) ext_mem_212816.mem)[gtid_206742 * l_n_m_196752 +
                                                  j_224764];
        
        float x_224787 = x_224781 * y_224786;
        float x_224788 = y_224779 - x_224778;
        bool x_224789 = sle64((int64_t) 0, defunc_0_m_fun_arg_224768);
        bool y_224790 = slt64(defunc_0_m_fun_arg_224768, l_n_m_196752);
        bool bounds_check_224791 = x_224789 && y_224790;
        bool index_certs_224792;
        
        if (!bounds_check_224791) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [",
                                   (long long) defunc_0_m_fun_arg_224768,
                                   "] out of bounds for array of shape [",
                                   (long long) l_n_m_196752, "].",
                                   "-> #0  loess.fut:536:27-37\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        float y_224793;
        
        y_224793 = ((float *) ext_mem_212816.mem)[gtid_206742 * l_n_m_196752 +
                                                  defunc_0_m_fun_arg_224768];
        
        float y_224794 = x_224788 * y_224793;
        float x_224795 = x_224787 + y_224794;
        float y_224796 = 2.0F * u2_224776;
        float x_224797 = u3_224777 - y_224796;
        float x_224798 = u_224775 + x_224797;
        float y_224799;
        
        y_224799 = ((float *) ext_mem_212815.mem)[gtid_206742 * l_n_m_196752 +
                                                  j_224764];
        
        float x_224800 = x_224798 * y_224799;
        float y_224801 = i64_res_224772 * x_224800;
        float x_224802 = x_224795 + y_224801;
        float x_224803 = u3_224777 - u2_224776;
        float y_224804;
        
        y_224804 = ((float *) ext_mem_212815.mem)[gtid_206742 * l_n_m_196752 +
                                                  defunc_0_m_fun_arg_224768];
        
        float x_224805 = x_224803 * y_224804;
        float y_224806 = i64_res_224772 * x_224805;
        float defunc_4_interpolate_proc_res_224807 = x_224802 + y_224806;
        
        ((float *) mem_212819.mem)[gtid_224761] =
            defunc_4_interpolate_proc_res_224807;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229177_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229177_end -
                 futhark_mc_segmap_parloop_229177_start;
        
        ctx->futhark_mc_segmap_parloop_229177_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229177_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229177_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229175(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224760 = tid;
    int num_tasks_224810 = info.nsubtasks;
    struct futhark_mc_task_229174 *futhark_mc_task_229174 =
                                  (struct futhark_mc_task_229174 *) args;
    struct futhark_context *ctx = futhark_mc_task_229174->ctx;
    uint64_t futhark_mc_segmap_task_229175_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229175_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229174->free_n_196692;
    int64_t jump_l_196703 = futhark_mc_task_229174->free_jump_l_196703;
    int64_t l_n_m_196752 = futhark_mc_task_229174->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229174->free_i_196779;
    int64_t y_198899 = futhark_mc_task_229174->free_y_198899;
    int64_t gtid_206742 = futhark_mc_task_229174->free_gtid_206742;
    struct memblock ext_mem_212815 = {.desc ="ext_mem_212815", .mem =
                                      futhark_mc_task_229174->free_ext_mem_212815,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212816 = {.desc ="ext_mem_212816", .mem =
                                      futhark_mc_task_229174->free_ext_mem_212816,
                                      .size =0, .references =NULL};
    struct memblock mem_212819 = {.desc ="mem_212819", .mem =
                                  futhark_mc_task_229174->free_mem_212819,
                                  .size =0, .references =NULL};
    int64_t iter_224811;
    struct futhark_mc_segmap_parloop_struct_229176
    futhark_mc_segmap_parloop_struct_229176;
    
    futhark_mc_segmap_parloop_struct_229176.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229176.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229176.free_jump_l_196703 = jump_l_196703;
    futhark_mc_segmap_parloop_struct_229176.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229176.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229176.free_y_198899 = y_198899;
    futhark_mc_segmap_parloop_struct_229176.free_gtid_206742 = gtid_206742;
    futhark_mc_segmap_parloop_struct_229176.free_ext_mem_212815 =
        ext_mem_212815.mem;
    futhark_mc_segmap_parloop_struct_229176.free_ext_mem_212816 =
        ext_mem_212816.mem;
    futhark_mc_segmap_parloop_struct_229176.free_mem_212819 = mem_212819.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229177_task;
    
    futhark_mc_segmap_parloop_229177_task.name =
        "futhark_mc_segmap_parloop_229177";
    futhark_mc_segmap_parloop_229177_task.fn = futhark_mc_segmap_parloop_229177;
    futhark_mc_segmap_parloop_229177_task.args =
        &futhark_mc_segmap_parloop_struct_229176;
    futhark_mc_segmap_parloop_229177_task.iterations = iterations;
    futhark_mc_segmap_parloop_229177_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229177_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229177_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229177_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229177_task);
    
    if (futhark_mc_segmap_parloop_229177_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229177_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229177_total_end -
                 futhark_mc_segmap_parloop_229177_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229177_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229177_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229177_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229175_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229175_end -
                 futhark_mc_segmap_task_229175_start;
        
        ctx->futhark_mc_segmap_task_229175_runs[tid]++;
        ctx->futhark_mc_segmap_task_229175_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229175_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229172(void *args, int64_t start,
                                            int64_t end, int flat_tid_206741,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229171
    *futhark_mc_segmap_parloop_struct_229171 =
    (struct futhark_mc_segmap_parloop_struct_229171 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229171->ctx;
    uint64_t futhark_mc_segmap_parloop_229172_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229172_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229171->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229171->free_n_196692;
    int64_t jump_l_196703 =
            futhark_mc_segmap_parloop_struct_229171->free_jump_l_196703;
    int64_t l_n_m_196752 =
            futhark_mc_segmap_parloop_struct_229171->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229171->free_i_196779;
    int64_t y_198899 = futhark_mc_segmap_parloop_struct_229171->free_y_198899;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229171->free_bytes_210949;
    struct memblock ext_mem_212815 = {.desc ="ext_mem_212815", .mem =
                                      futhark_mc_segmap_parloop_struct_229171->free_ext_mem_212815,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212816 = {.desc ="ext_mem_212816", .mem =
                                      futhark_mc_segmap_parloop_struct_229171->free_ext_mem_212816,
                                      .size =0, .references =NULL};
    struct memblock mem_212838 = {.desc ="mem_212838", .mem =
                                  futhark_mc_segmap_parloop_struct_229171->free_mem_212838,
                                  .size =0, .references =NULL};
    size_t mem_212819_cached_sizze_229173 = 0;
    unsigned char *mem_212819 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224759 = start;
    
    if (mem_212819_cached_sizze_229173 < (size_t) bytes_210949) {
        mem_212819 = realloc(mem_212819, bytes_210949);
        mem_212819_cached_sizze_229173 = bytes_210949;
    }
    for (; iter_224759 < end; iter_224759++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224808 = m_196691;
        int64_t gtid_206742 = iter_224759;
        int64_t remnant_224809 = iter_224759 - gtid_206742;
        int64_t flat_tid_224760 = (int64_t) 0;
        int32_t num_tasks_224810;
        struct futhark_mc_task_229174 futhark_mc_task_229174;
        
        futhark_mc_task_229174.ctx = ctx;
        futhark_mc_task_229174.free_n_196692 = n_196692;
        futhark_mc_task_229174.free_jump_l_196703 = jump_l_196703;
        futhark_mc_task_229174.free_l_n_m_196752 = l_n_m_196752;
        futhark_mc_task_229174.free_i_196779 = i_196779;
        futhark_mc_task_229174.free_y_198899 = y_198899;
        futhark_mc_task_229174.free_gtid_206742 = gtid_206742;
        futhark_mc_task_229174.free_ext_mem_212815 = ext_mem_212815.mem;
        futhark_mc_task_229174.free_ext_mem_212816 = ext_mem_212816.mem;
        futhark_mc_task_229174.free_mem_212819 = mem_212819;
        
        struct scheduler_segop futhark_mc_task_229174_task;
        
        futhark_mc_task_229174_task.args = &futhark_mc_task_229174;
        futhark_mc_task_229174_task.top_level_fn =
            futhark_mc_segmap_task_229175;
        futhark_mc_task_229174_task.name = "futhark_mc_segmap_task_229175";
        futhark_mc_task_229174_task.iterations = n_196692;
        futhark_mc_task_229174_task.task_time =
            &ctx->futhark_mc_segmap_task_229175_total_time;
        futhark_mc_task_229174_task.task_iter =
            &ctx->futhark_mc_segmap_task_229175_total_iter;
        futhark_mc_task_229174_task.sched = STATIC;
        futhark_mc_task_229174_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229175_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229174_task);
        
        if (futhark_mc_segmap_task_229175_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_212838.mem + gtid_206742 * n_196692 * (int64_t) 4,
                    mem_212819 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212819);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229172_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229172_end -
                 futhark_mc_segmap_parloop_229172_start;
        
        ctx->futhark_mc_segmap_parloop_229172_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229172_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229172_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229170(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206741 = tid;
    int num_tasks_224705 = info.nsubtasks;
    struct futhark_mc_task_229165 *futhark_mc_task_229165 =
                                  (struct futhark_mc_task_229165 *) args;
    struct futhark_context *ctx = futhark_mc_task_229165->ctx;
    uint64_t futhark_mc_segmap_nested_task_229170_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229170_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229165->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229165->free_n_196692;
    int64_t jump_l_196703 = futhark_mc_task_229165->free_jump_l_196703;
    int64_t l_n_m_196752 = futhark_mc_task_229165->free_l_n_m_196752;
    int64_t i_196779 = futhark_mc_task_229165->free_i_196779;
    int64_t y_198899 = futhark_mc_task_229165->free_y_198899;
    int64_t bytes_210949 = futhark_mc_task_229165->free_bytes_210949;
    struct memblock ext_mem_212815 = {.desc ="ext_mem_212815", .mem =
                                      futhark_mc_task_229165->free_ext_mem_212815,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_212816 = {.desc ="ext_mem_212816", .mem =
                                      futhark_mc_task_229165->free_ext_mem_212816,
                                      .size =0, .references =NULL};
    struct memblock mem_212838 = {.desc ="mem_212838", .mem =
                                  futhark_mc_task_229165->free_mem_212838,
                                  .size =0, .references =NULL};
    int64_t iter_224759;
    struct futhark_mc_segmap_parloop_struct_229171
    futhark_mc_segmap_parloop_struct_229171;
    
    futhark_mc_segmap_parloop_struct_229171.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229171.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229171.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229171.free_jump_l_196703 = jump_l_196703;
    futhark_mc_segmap_parloop_struct_229171.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_segmap_parloop_struct_229171.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229171.free_y_198899 = y_198899;
    futhark_mc_segmap_parloop_struct_229171.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229171.free_ext_mem_212815 =
        ext_mem_212815.mem;
    futhark_mc_segmap_parloop_struct_229171.free_ext_mem_212816 =
        ext_mem_212816.mem;
    futhark_mc_segmap_parloop_struct_229171.free_mem_212838 = mem_212838.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229172_task;
    
    futhark_mc_segmap_parloop_229172_task.name =
        "futhark_mc_segmap_parloop_229172";
    futhark_mc_segmap_parloop_229172_task.fn = futhark_mc_segmap_parloop_229172;
    futhark_mc_segmap_parloop_229172_task.args =
        &futhark_mc_segmap_parloop_struct_229171;
    futhark_mc_segmap_parloop_229172_task.iterations = iterations;
    futhark_mc_segmap_parloop_229172_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229172_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229172_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229172_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229172_task);
    
    if (futhark_mc_segmap_parloop_229172_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229172_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229172_total_end -
                 futhark_mc_segmap_parloop_229172_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229172_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229172_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229172_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229170_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229170_end -
                 futhark_mc_segmap_nested_task_229170_start;
        
        ctx->futhark_mc_segmap_nested_task_229170_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229170_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229170_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229178 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212272;
    unsigned char *free_ext_mem_212839;
    int64_t free_ext_212840;
    unsigned char *free_mem_212862;
};
struct futhark_mc_segmap_parloop_struct_229180 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212272;
    unsigned char *free_ext_mem_212839;
    int64_t free_ext_212840;
    unsigned char *free_mem_212862;
};
static int futhark_mc_segmap_parloop_229181(void *args, int64_t start,
                                            int64_t end, int flat_tid_206795,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229180
    *futhark_mc_segmap_parloop_struct_229180 =
    (struct futhark_mc_segmap_parloop_struct_229180 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229180->ctx;
    uint64_t futhark_mc_segmap_parloop_229181_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229181_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229180->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229180->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_229180->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_229180->free_C_len_196743;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229180->free_bytes_210949;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_229180->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock ext_mem_212839 = {.desc ="ext_mem_212839", .mem =
                                      futhark_mc_segmap_parloop_struct_229180->free_ext_mem_212839,
                                      .size =0, .references =NULL};
    int64_t ext_212840 =
            futhark_mc_segmap_parloop_struct_229180->free_ext_212840;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229180->free_mem_212862,
                                  .size =0, .references =NULL};
    size_t mem_212846_cached_sizze_229182 = 0;
    unsigned char *mem_212846 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224816 = start;
    
    if (mem_212846_cached_sizze_229182 < (size_t) bytes_210949) {
        mem_212846 = realloc(mem_212846, bytes_210949);
        mem_212846_cached_sizze_229182 = bytes_210949;
    }
    for (; iter_224816 < end; iter_224816++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224824 = m_196691;
        int64_t gtid_206796 = iter_224816;
        int64_t remnant_224825 = iter_224816 - gtid_206796;
        
        for (int64_t i_224817 = 0; i_224817 < n_196692; i_224817++) {
            int64_t slice_224819 = n_p_196694 + i_224817;
            float x_224820;
            
            x_224820 = ((float *) mem_212272.mem)[gtid_206796 * C_len_196743 +
                                                  slice_224819];
            
            float x_224821;
            
            x_224821 = ((float *) ext_mem_212839.mem)[gtid_206796 * ext_212840 +
                                                      i_224817];
            
            float defunc_1_f_res_224822 = x_224820 - x_224821;
            
            ((float *) mem_212846)[i_224817] = defunc_1_f_res_224822;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_212862.mem + gtid_206796 * n_196692 * (int64_t) 4,
                    mem_212846 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212846);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229181_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229181_end -
                 futhark_mc_segmap_parloop_229181_start;
        
        ctx->futhark_mc_segmap_parloop_229181_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229181_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229181_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229179(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206795 = tid;
    int num_tasks_224815 = info.nsubtasks;
    struct futhark_mc_task_229178 *futhark_mc_task_229178 =
                                  (struct futhark_mc_task_229178 *) args;
    struct futhark_context *ctx = futhark_mc_task_229178->ctx;
    uint64_t futhark_mc_segmap_task_229179_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229179_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229178->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229178->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_229178->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_229178->free_C_len_196743;
    int64_t bytes_210949 = futhark_mc_task_229178->free_bytes_210949;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_229178->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock ext_mem_212839 = {.desc ="ext_mem_212839", .mem =
                                      futhark_mc_task_229178->free_ext_mem_212839,
                                      .size =0, .references =NULL};
    int64_t ext_212840 = futhark_mc_task_229178->free_ext_212840;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229178->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t iter_224816;
    struct futhark_mc_segmap_parloop_struct_229180
    futhark_mc_segmap_parloop_struct_229180;
    
    futhark_mc_segmap_parloop_struct_229180.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229180.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229180.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229180.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_229180.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_229180.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229180.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_229180.free_ext_mem_212839 =
        ext_mem_212839.mem;
    futhark_mc_segmap_parloop_struct_229180.free_ext_212840 = ext_212840;
    futhark_mc_segmap_parloop_struct_229180.free_mem_212862 = mem_212862.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229181_task;
    
    futhark_mc_segmap_parloop_229181_task.name =
        "futhark_mc_segmap_parloop_229181";
    futhark_mc_segmap_parloop_229181_task.fn = futhark_mc_segmap_parloop_229181;
    futhark_mc_segmap_parloop_229181_task.args =
        &futhark_mc_segmap_parloop_struct_229180;
    futhark_mc_segmap_parloop_229181_task.iterations = iterations;
    futhark_mc_segmap_parloop_229181_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229181_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229181_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229181_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229181_task);
    
    if (futhark_mc_segmap_parloop_229181_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229181_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229181_total_end -
                 futhark_mc_segmap_parloop_229181_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229181_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229181_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229181_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229179_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229179_end -
                 futhark_mc_segmap_task_229179_start;
        
        ctx->futhark_mc_segmap_task_229179_runs[tid]++;
        ctx->futhark_mc_segmap_task_229179_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229179_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229184 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212272;
    unsigned char *free_ext_mem_212839;
    int64_t free_ext_212840;
    unsigned char *free_mem_212862;
};
struct futhark_mc_task_229187 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_gtid_206802;
    unsigned char *free_mem_212272;
    unsigned char *free_ext_mem_212839;
    int64_t free_ext_212840;
    unsigned char *free_mem_212843;
};
struct futhark_mc_segmap_parloop_struct_229189 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_n_p_196694;
    int64_t free_C_len_196743;
    int64_t free_gtid_206802;
    unsigned char *free_mem_212272;
    unsigned char *free_ext_mem_212839;
    int64_t free_ext_212840;
    unsigned char *free_mem_212843;
};
static int futhark_mc_segmap_parloop_229190(void *args, int64_t start,
                                            int64_t end, int flat_tid_224828,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229189
    *futhark_mc_segmap_parloop_struct_229189 =
    (struct futhark_mc_segmap_parloop_struct_229189 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229189->ctx;
    uint64_t futhark_mc_segmap_parloop_229190_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229190_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229189->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_229189->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_229189->free_C_len_196743;
    int64_t gtid_206802 =
            futhark_mc_segmap_parloop_struct_229189->free_gtid_206802;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_229189->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock ext_mem_212839 = {.desc ="ext_mem_212839", .mem =
                                      futhark_mc_segmap_parloop_struct_229189->free_ext_mem_212839,
                                      .size =0, .references =NULL};
    int64_t ext_212840 =
            futhark_mc_segmap_parloop_struct_229189->free_ext_212840;
    struct memblock mem_212843 = {.desc ="mem_212843", .mem =
                                  futhark_mc_segmap_parloop_struct_229189->free_mem_212843,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_224837 = start;
    
    for (; iter_224837 < end; iter_224837++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224838 = n_196692;
        int64_t gtid_224829 = iter_224837;
        int64_t remnant_224839 = iter_224837 - gtid_224829;
        int64_t slice_224830 = n_p_196694 + gtid_224829;
        float x_224831;
        
        x_224831 = ((float *) mem_212272.mem)[gtid_206802 * C_len_196743 +
                                              slice_224830];
        
        float x_224832;
        
        x_224832 = ((float *) ext_mem_212839.mem)[gtid_206802 * ext_212840 +
                                                  gtid_224829];
        
        float defunc_1_f_res_224833 = x_224831 - x_224832;
        
        ((float *) mem_212843.mem)[gtid_224829] = defunc_1_f_res_224833;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229190_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229190_end -
                 futhark_mc_segmap_parloop_229190_start;
        
        ctx->futhark_mc_segmap_parloop_229190_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229190_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229190_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229188(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224828 = tid;
    int num_tasks_224836 = info.nsubtasks;
    struct futhark_mc_task_229187 *futhark_mc_task_229187 =
                                  (struct futhark_mc_task_229187 *) args;
    struct futhark_context *ctx = futhark_mc_task_229187->ctx;
    uint64_t futhark_mc_segmap_task_229188_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229188_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229187->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_229187->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_229187->free_C_len_196743;
    int64_t gtid_206802 = futhark_mc_task_229187->free_gtid_206802;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_229187->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock ext_mem_212839 = {.desc ="ext_mem_212839", .mem =
                                      futhark_mc_task_229187->free_ext_mem_212839,
                                      .size =0, .references =NULL};
    int64_t ext_212840 = futhark_mc_task_229187->free_ext_212840;
    struct memblock mem_212843 = {.desc ="mem_212843", .mem =
                                  futhark_mc_task_229187->free_mem_212843,
                                  .size =0, .references =NULL};
    int64_t iter_224837;
    struct futhark_mc_segmap_parloop_struct_229189
    futhark_mc_segmap_parloop_struct_229189;
    
    futhark_mc_segmap_parloop_struct_229189.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229189.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229189.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_229189.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_229189.free_gtid_206802 = gtid_206802;
    futhark_mc_segmap_parloop_struct_229189.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_229189.free_ext_mem_212839 =
        ext_mem_212839.mem;
    futhark_mc_segmap_parloop_struct_229189.free_ext_212840 = ext_212840;
    futhark_mc_segmap_parloop_struct_229189.free_mem_212843 = mem_212843.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229190_task;
    
    futhark_mc_segmap_parloop_229190_task.name =
        "futhark_mc_segmap_parloop_229190";
    futhark_mc_segmap_parloop_229190_task.fn = futhark_mc_segmap_parloop_229190;
    futhark_mc_segmap_parloop_229190_task.args =
        &futhark_mc_segmap_parloop_struct_229189;
    futhark_mc_segmap_parloop_229190_task.iterations = iterations;
    futhark_mc_segmap_parloop_229190_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229190_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229190_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229190_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229190_task);
    
    if (futhark_mc_segmap_parloop_229190_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229190_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229190_total_end -
                 futhark_mc_segmap_parloop_229190_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229190_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229190_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229190_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229188_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229188_end -
                 futhark_mc_segmap_task_229188_start;
        
        ctx->futhark_mc_segmap_task_229188_runs[tid]++;
        ctx->futhark_mc_segmap_task_229188_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229188_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229185(void *args, int64_t start,
                                            int64_t end, int flat_tid_206801,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229184
    *futhark_mc_segmap_parloop_struct_229184 =
    (struct futhark_mc_segmap_parloop_struct_229184 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229184->ctx;
    uint64_t futhark_mc_segmap_parloop_229185_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229185_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229184->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229184->free_n_196692;
    int64_t n_p_196694 =
            futhark_mc_segmap_parloop_struct_229184->free_n_p_196694;
    int64_t C_len_196743 =
            futhark_mc_segmap_parloop_struct_229184->free_C_len_196743;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229184->free_bytes_210949;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_segmap_parloop_struct_229184->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock ext_mem_212839 = {.desc ="ext_mem_212839", .mem =
                                      futhark_mc_segmap_parloop_struct_229184->free_ext_mem_212839,
                                      .size =0, .references =NULL};
    int64_t ext_212840 =
            futhark_mc_segmap_parloop_struct_229184->free_ext_212840;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229184->free_mem_212862,
                                  .size =0, .references =NULL};
    size_t mem_212843_cached_sizze_229186 = 0;
    unsigned char *mem_212843 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224827 = start;
    
    if (mem_212843_cached_sizze_229186 < (size_t) bytes_210949) {
        mem_212843 = realloc(mem_212843, bytes_210949);
        mem_212843_cached_sizze_229186 = bytes_210949;
    }
    for (; iter_224827 < end; iter_224827++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224834 = m_196691;
        int64_t gtid_206802 = iter_224827;
        int64_t remnant_224835 = iter_224827 - gtid_206802;
        int64_t flat_tid_224828 = (int64_t) 0;
        int32_t num_tasks_224836;
        struct futhark_mc_task_229187 futhark_mc_task_229187;
        
        futhark_mc_task_229187.ctx = ctx;
        futhark_mc_task_229187.free_n_196692 = n_196692;
        futhark_mc_task_229187.free_n_p_196694 = n_p_196694;
        futhark_mc_task_229187.free_C_len_196743 = C_len_196743;
        futhark_mc_task_229187.free_gtid_206802 = gtid_206802;
        futhark_mc_task_229187.free_mem_212272 = mem_212272.mem;
        futhark_mc_task_229187.free_ext_mem_212839 = ext_mem_212839.mem;
        futhark_mc_task_229187.free_ext_212840 = ext_212840;
        futhark_mc_task_229187.free_mem_212843 = mem_212843;
        
        struct scheduler_segop futhark_mc_task_229187_task;
        
        futhark_mc_task_229187_task.args = &futhark_mc_task_229187;
        futhark_mc_task_229187_task.top_level_fn =
            futhark_mc_segmap_task_229188;
        futhark_mc_task_229187_task.name = "futhark_mc_segmap_task_229188";
        futhark_mc_task_229187_task.iterations = n_196692;
        futhark_mc_task_229187_task.task_time =
            &ctx->futhark_mc_segmap_task_229188_total_time;
        futhark_mc_task_229187_task.task_iter =
            &ctx->futhark_mc_segmap_task_229188_total_iter;
        futhark_mc_task_229187_task.sched = STATIC;
        futhark_mc_task_229187_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229188_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229187_task);
        
        if (futhark_mc_segmap_task_229188_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_212862.mem + gtid_206802 * n_196692 * (int64_t) 4,
                    mem_212843 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212843);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229185_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229185_end -
                 futhark_mc_segmap_parloop_229185_start;
        
        ctx->futhark_mc_segmap_parloop_229185_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229185_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229185_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229183(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206801 = tid;
    int num_tasks_224815 = info.nsubtasks;
    struct futhark_mc_task_229178 *futhark_mc_task_229178 =
                                  (struct futhark_mc_task_229178 *) args;
    struct futhark_context *ctx = futhark_mc_task_229178->ctx;
    uint64_t futhark_mc_segmap_nested_task_229183_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229183_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229178->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229178->free_n_196692;
    int64_t n_p_196694 = futhark_mc_task_229178->free_n_p_196694;
    int64_t C_len_196743 = futhark_mc_task_229178->free_C_len_196743;
    int64_t bytes_210949 = futhark_mc_task_229178->free_bytes_210949;
    struct memblock mem_212272 = {.desc ="mem_212272", .mem =
                                  futhark_mc_task_229178->free_mem_212272,
                                  .size =0, .references =NULL};
    struct memblock ext_mem_212839 = {.desc ="ext_mem_212839", .mem =
                                      futhark_mc_task_229178->free_ext_mem_212839,
                                      .size =0, .references =NULL};
    int64_t ext_212840 = futhark_mc_task_229178->free_ext_212840;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229178->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t iter_224827;
    struct futhark_mc_segmap_parloop_struct_229184
    futhark_mc_segmap_parloop_struct_229184;
    
    futhark_mc_segmap_parloop_struct_229184.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229184.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229184.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229184.free_n_p_196694 = n_p_196694;
    futhark_mc_segmap_parloop_struct_229184.free_C_len_196743 = C_len_196743;
    futhark_mc_segmap_parloop_struct_229184.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229184.free_mem_212272 = mem_212272.mem;
    futhark_mc_segmap_parloop_struct_229184.free_ext_mem_212839 =
        ext_mem_212839.mem;
    futhark_mc_segmap_parloop_struct_229184.free_ext_212840 = ext_212840;
    futhark_mc_segmap_parloop_struct_229184.free_mem_212862 = mem_212862.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229185_task;
    
    futhark_mc_segmap_parloop_229185_task.name =
        "futhark_mc_segmap_parloop_229185";
    futhark_mc_segmap_parloop_229185_task.fn = futhark_mc_segmap_parloop_229185;
    futhark_mc_segmap_parloop_229185_task.args =
        &futhark_mc_segmap_parloop_struct_229184;
    futhark_mc_segmap_parloop_229185_task.iterations = iterations;
    futhark_mc_segmap_parloop_229185_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229185_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229185_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229185_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229185_task);
    
    if (futhark_mc_segmap_parloop_229185_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229185_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229185_total_end -
                 futhark_mc_segmap_parloop_229185_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229185_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229185_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229185_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229183_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229183_end -
                 futhark_mc_segmap_nested_task_229183_start;
        
        ctx->futhark_mc_segmap_nested_task_229183_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229183_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229183_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229191 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212942;
};
struct futhark_mc_segmap_parloop_struct_229193 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212942;
};
static int futhark_mc_segmap_parloop_229194(void *args, int64_t start,
                                            int64_t end, int flat_tid_206811,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229193
    *futhark_mc_segmap_parloop_struct_229193 =
    (struct futhark_mc_segmap_parloop_struct_229193 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229193->ctx;
    uint64_t futhark_mc_segmap_parloop_229194_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229194_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229193->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229193->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229193->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229193->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229193->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229193->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229193->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229193->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229193->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229193->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229193->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229193->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229193->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229193->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229193->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229193->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229193->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229193->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212942 = {.desc ="mem_212942", .mem =
                                  futhark_mc_segmap_parloop_struct_229193->free_mem_212942,
                                  .size =0, .references =NULL};
    size_t mem_212881_cached_sizze_229195 = 0;
    unsigned char *mem_212881 = NULL;
    size_t mem_212896_cached_sizze_229196 = 0;
    unsigned char *mem_212896 = NULL;
    size_t mem_212899_cached_sizze_229197 = 0;
    unsigned char *mem_212899 = NULL;
    size_t mem_212926_cached_sizze_229198 = 0;
    unsigned char *mem_212926 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224843 = start;
    
    if (mem_212881_cached_sizze_229195 < (size_t) bytes_210949) {
        mem_212881 = realloc(mem_212881, bytes_210949);
        mem_212881_cached_sizze_229195 = bytes_210949;
    }
    if (mem_212896_cached_sizze_229196 < (size_t) bytes_210949) {
        mem_212896 = realloc(mem_212896, bytes_210949);
        mem_212896_cached_sizze_229196 = bytes_210949;
    }
    if (mem_212899_cached_sizze_229197 < (size_t) bytes_210949) {
        mem_212899 = realloc(mem_212899, bytes_210949);
        mem_212899_cached_sizze_229197 = bytes_210949;
    }
    if (mem_212926_cached_sizze_229198 < (size_t) bytes_210836) {
        mem_212926 = realloc(mem_212926, bytes_210836);
        mem_212926_cached_sizze_229198 = bytes_210836;
    }
    for (; iter_224843 < end; iter_224843++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_224925 = m_196691;
        int64_t gtid_206812 = iter_224843;
        int64_t remnant_224926 = iter_224843 - gtid_206812;
        int64_t x_198974;
        
        x_198974 = ((int64_t *) mem_210397.mem)[gtid_206812];
        for (int64_t i_224844 = 0; i_224844 < n_196692; i_224844++) {
            float x_224846;
            
            x_224846 = ((float *) Y_mem_210354.mem)[gtid_206812 * n_196692 +
                                                    i_224844];
            
            float x_224847;
            
            x_224847 = ((float *) mem_212862.mem)[gtid_206812 * n_196692 +
                                                  i_224844];
            
            float defunc_1_f_res_224848 = x_224846 - x_224847;
            
            ((float *) mem_212881)[i_224844] = defunc_1_f_res_224848;
        }
        for (int64_t i_224850 = 0; i_224850 < n_196692; i_224850++) {
            int64_t x_224853;
            
            x_224853 = ((int64_t *) mem_210394.mem)[gtid_206812 * n_196692 +
                                                    i_224850];
            
            bool cond_224854 = sle64((int64_t) 0, x_224853);
            float defunc_0_f_res_224855;
            
            if (cond_224854) {
                bool y_224856 = slt64(x_224853, n_196692);
                bool bounds_check_224857 = cond_224854 && y_224856;
                bool index_certs_224858;
                
                if (!bounds_check_224857) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_224853,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_224859;
                
                defunc_0_f_res_t_res_224859 = ((float *) mem_212881)[x_224853];
                defunc_0_f_res_224855 = defunc_0_f_res_t_res_224859;
            } else {
                defunc_0_f_res_224855 = 0.0F;
            }
            
            float defunc_0_f_res_224860;
            
            if (cond_224854) {
                bool y_224861 = slt64(x_224853, n_196692);
                bool bounds_check_224862 = cond_224854 && y_224861;
                bool index_certs_224863;
                
                if (!bounds_check_224862) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_224853,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_224864;
                
                defunc_0_f_res_t_res_224864 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_206812 *
                                                      ctx_param_ext_210921 +
                                                      x_224853 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_224860 = defunc_0_f_res_t_res_224864;
            } else {
                defunc_0_f_res_224860 = 0.0F;
            }
            ((float *) mem_212896)[i_224850] = defunc_0_f_res_224860;
            ((float *) mem_212899)[i_224850] = defunc_0_f_res_224855;
        }
        for (int64_t i_224867 = 0; i_224867 < t_n_m_196759; i_224867++) {
            int64_t x_224869;
            
            x_224869 = ((int64_t *) mem_210889.mem)[gtid_206812 * t_n_m_196759 +
                                                    i_224867];
            
            float x_224870;
            
            x_224870 = ((float *) mem_210893.mem)[gtid_206812 * t_n_m_196759 +
                                                  i_224867];
            
            int64_t min_arg_224871 = mul64(jump_t_196702, i_224867);
            int64_t min_res_224872 = smin64(i_196779, min_arg_224871);
            int64_t defunc_0_g_res_224873 = add64((int64_t) 1, min_res_224872);
            float defunc_2_reduce_res_224874;
            float redout_224876 = 0.0F;
            
            for (int64_t i_224875 = 0; i_224875 < q_t_196696; i_224875++) {
                bool cond_224877 = sle64(x_198974, i_224875);
                int64_t defunc_0_f_res_224878;
                
                if (cond_224877) {
                    defunc_0_f_res_224878 = (int64_t) 0;
                } else {
                    int64_t i_224879 = add64(x_224869, i_224875);
                    int64_t defunc_0_add_arg_224880;
                    
                    defunc_0_add_arg_224880 =
                        ((int64_t *) mem_210394.mem)[gtid_206812 * n_196692 +
                                                     i_224879];
                    
                    int64_t defunc_1_add_res_224881 = add64((int64_t) 1,
                                                            defunc_0_add_arg_224880);
                    
                    defunc_0_f_res_224878 = defunc_1_add_res_224881;
                }
                
                float defunc_0_f_res_224882;
                
                if (cond_224877) {
                    defunc_0_f_res_224882 = 0.0F;
                } else {
                    int64_t i_224883 = add64(x_224869, i_224875);
                    float defunc_0_add_arg_224884;
                    
                    defunc_0_add_arg_224884 = ((float *) mem_212896)[i_224883];
                    defunc_0_f_res_224882 = defunc_0_add_arg_224884;
                }
                
                int64_t binop_p_224885 = sub64(defunc_0_f_res_224878,
                                               defunc_0_g_res_224873);
                float defunc_0_f_res_224886 = sitofp_i64_f32(binop_p_224885);
                float abs_res_224887 = (float) fabs(defunc_0_f_res_224886);
                float tmp1_224888 = abs_res_224887 / x_224870;
                float x_224889 = tmp1_224888 * tmp1_224888;
                float y_224890 = tmp1_224888 * x_224889;
                float tmp2_224891 = 1.0F - y_224890;
                float x_224892 = tmp2_224891 * tmp2_224891;
                float tmp3_224893 = tmp2_224891 * x_224892;
                float w_j_224894 = defunc_0_f_res_224882 * tmp3_224893;
                float defunc_1_op_res_224895 = w_j_224894 + redout_224876;
                float redout_tmp_224931 = defunc_1_op_res_224895;
                
                redout_224876 = redout_tmp_224931;
            }
            defunc_2_reduce_res_224874 = redout_224876;
            
            float a0_224896 = 1.0F / defunc_2_reduce_res_224874;
            float defunc_2_reduce_res_224897;
            float redout_224899 = 0.0F;
            
            for (int64_t i_224898 = 0; i_224898 < q_t_196696; i_224898++) {
                bool cond_224900 = sle64(x_198974, i_224898);
                int64_t defunc_0_f_res_224901;
                
                if (cond_224900) {
                    defunc_0_f_res_224901 = (int64_t) 0;
                } else {
                    int64_t i_224902 = add64(x_224869, i_224898);
                    int64_t defunc_0_add_arg_224903;
                    
                    defunc_0_add_arg_224903 =
                        ((int64_t *) mem_210394.mem)[gtid_206812 * n_196692 +
                                                     i_224902];
                    
                    int64_t defunc_1_add_res_224904 = add64((int64_t) 1,
                                                            defunc_0_add_arg_224903);
                    
                    defunc_0_f_res_224901 = defunc_1_add_res_224904;
                }
                
                float defunc_0_f_res_224905;
                
                if (cond_224900) {
                    defunc_0_f_res_224905 = 0.0F;
                } else {
                    int64_t i_224906 = add64(x_224869, i_224898);
                    float defunc_0_add_arg_224907;
                    
                    defunc_0_add_arg_224907 = ((float *) mem_212896)[i_224906];
                    defunc_0_f_res_224905 = defunc_0_add_arg_224907;
                }
                
                int64_t binop_p_224908 = sub64(defunc_0_f_res_224901,
                                               defunc_0_g_res_224873);
                float defunc_0_f_res_224909 = sitofp_i64_f32(binop_p_224908);
                float abs_res_224910 = (float) fabs(defunc_0_f_res_224909);
                float tmp1_224911 = abs_res_224910 / x_224870;
                float x_224912 = tmp1_224911 * tmp1_224911;
                float y_224913 = tmp1_224911 * x_224912;
                float tmp2_224914 = 1.0F - y_224913;
                float x_224915 = tmp2_224914 * tmp2_224914;
                float tmp3_224916 = tmp2_224914 * x_224915;
                float tmp4_224917 = defunc_0_f_res_224905 * tmp3_224916;
                float defunc_0_f_res_224918;
                
                if (cond_224900) {
                    defunc_0_f_res_224918 = 0.0F;
                } else {
                    int64_t i_224919 = add64(x_224869, i_224898);
                    float defunc_0_add_arg_224920;
                    
                    defunc_0_add_arg_224920 = ((float *) mem_212899)[i_224919];
                    defunc_0_f_res_224918 = defunc_0_add_arg_224920;
                }
                
                float x_224921 = a0_224896 * tmp4_224917;
                float defunc_9_fit_fun_res_224922 = defunc_0_f_res_224918 *
                      x_224921;
                float defunc_1_op_res_224923 = defunc_9_fit_fun_res_224922 +
                      redout_224899;
                float redout_tmp_224932 = defunc_1_op_res_224923;
                
                redout_224899 = redout_tmp_224932;
            }
            defunc_2_reduce_res_224897 = redout_224899;
            ((float *) mem_212926)[i_224867] = defunc_2_reduce_res_224897;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_212942.mem + gtid_206812 * t_n_m_196759 * (int64_t) 4,
                    mem_212926 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212881);
    free(mem_212896);
    free(mem_212899);
    free(mem_212926);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229194_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229194_end -
                 futhark_mc_segmap_parloop_229194_start;
        
        ctx->futhark_mc_segmap_parloop_229194_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229194_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229194_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229192(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206811 = tid;
    int num_tasks_224842 = info.nsubtasks;
    struct futhark_mc_task_229191 *futhark_mc_task_229191 =
                                  (struct futhark_mc_task_229191 *) args;
    struct futhark_context *ctx = futhark_mc_task_229191->ctx;
    uint64_t futhark_mc_segmap_task_229192_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229192_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229191->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229191->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229191->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229191->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229191->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229191->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229191->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229191->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229191->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229191->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229191->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229191->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229191->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229191->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229191->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229191->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229191->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229191->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212942 = {.desc ="mem_212942", .mem =
                                  futhark_mc_task_229191->free_mem_212942,
                                  .size =0, .references =NULL};
    int64_t iter_224843;
    struct futhark_mc_segmap_parloop_struct_229193
    futhark_mc_segmap_parloop_struct_229193;
    
    futhark_mc_segmap_parloop_struct_229193.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229193.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229193.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229193.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229193.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229193.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229193.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229193.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229193.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229193.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229193.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229193.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229193.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229193.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229193.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229193.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229193.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229193.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229193.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229193.free_mem_212942 = mem_212942.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229194_task;
    
    futhark_mc_segmap_parloop_229194_task.name =
        "futhark_mc_segmap_parloop_229194";
    futhark_mc_segmap_parloop_229194_task.fn = futhark_mc_segmap_parloop_229194;
    futhark_mc_segmap_parloop_229194_task.args =
        &futhark_mc_segmap_parloop_struct_229193;
    futhark_mc_segmap_parloop_229194_task.iterations = iterations;
    futhark_mc_segmap_parloop_229194_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229194_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229194_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229194_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229194_task);
    
    if (futhark_mc_segmap_parloop_229194_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229194_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229194_total_end -
                 futhark_mc_segmap_parloop_229194_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229194_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229194_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229194_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229192_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229192_end -
                 futhark_mc_segmap_task_229192_start;
        
        ctx->futhark_mc_segmap_task_229192_runs[tid]++;
        ctx->futhark_mc_segmap_task_229192_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229192_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229200 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212942;
};
struct futhark_mc_task_229206 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212869;
};
struct futhark_mc_segmap_parloop_struct_229208 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212869;
};
static int futhark_mc_segmap_parloop_229209(void *args, int64_t start,
                                            int64_t end, int flat_tid_224934,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229208
    *futhark_mc_segmap_parloop_struct_229208 =
    (struct futhark_mc_segmap_parloop_struct_229208 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229208->ctx;
    uint64_t futhark_mc_segmap_parloop_229209_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229209_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229208->free_n_196692;
    int64_t gtid_206892 =
            futhark_mc_segmap_parloop_struct_229208->free_gtid_206892;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229208->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229208->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212869 = {.desc ="mem_212869", .mem =
                                  futhark_mc_segmap_parloop_struct_229208->free_mem_212869,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225074 = start;
    
    for (; iter_225074 < end; iter_225074++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225075 = n_196692;
        int64_t gtid_224935 = iter_225074;
        int64_t remnant_225076 = iter_225074 - gtid_224935;
        float x_224936;
        
        x_224936 = ((float *) Y_mem_210354.mem)[gtid_206892 * n_196692 +
                                                gtid_224935];
        
        float x_224937;
        
        x_224937 = ((float *) mem_212862.mem)[gtid_206892 * n_196692 +
                                              gtid_224935];
        
        float defunc_1_f_res_224938 = x_224936 - x_224937;
        
        ((float *) mem_212869.mem)[gtid_224935] = defunc_1_f_res_224938;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229209_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229209_end -
                 futhark_mc_segmap_parloop_229209_start;
        
        ctx->futhark_mc_segmap_parloop_229209_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229209_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229209_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229207(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224934 = tid;
    int num_tasks_225073 = info.nsubtasks;
    struct futhark_mc_task_229206 *futhark_mc_task_229206 =
                                  (struct futhark_mc_task_229206 *) args;
    struct futhark_context *ctx = futhark_mc_task_229206->ctx;
    uint64_t futhark_mc_segmap_task_229207_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229207_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229206->free_n_196692;
    int64_t gtid_206892 = futhark_mc_task_229206->free_gtid_206892;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229206->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229206->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212869 = {.desc ="mem_212869", .mem =
                                  futhark_mc_task_229206->free_mem_212869,
                                  .size =0, .references =NULL};
    int64_t iter_225074;
    struct futhark_mc_segmap_parloop_struct_229208
    futhark_mc_segmap_parloop_struct_229208;
    
    futhark_mc_segmap_parloop_struct_229208.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229208.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229208.free_gtid_206892 = gtid_206892;
    futhark_mc_segmap_parloop_struct_229208.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229208.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229208.free_mem_212869 = mem_212869.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229209_task;
    
    futhark_mc_segmap_parloop_229209_task.name =
        "futhark_mc_segmap_parloop_229209";
    futhark_mc_segmap_parloop_229209_task.fn = futhark_mc_segmap_parloop_229209;
    futhark_mc_segmap_parloop_229209_task.args =
        &futhark_mc_segmap_parloop_struct_229208;
    futhark_mc_segmap_parloop_229209_task.iterations = iterations;
    futhark_mc_segmap_parloop_229209_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229209_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229209_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229209_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229209_task);
    
    if (futhark_mc_segmap_parloop_229209_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229209_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229209_total_end -
                 futhark_mc_segmap_parloop_229209_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229209_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229209_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229209_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229207_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229207_end -
                 futhark_mc_segmap_task_229207_start;
        
        ctx->futhark_mc_segmap_task_229207_runs[tid]++;
        ctx->futhark_mc_segmap_task_229207_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229207_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229210 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212869;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
};
struct futhark_mc_segmap_parloop_struct_229212 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212869;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
};
static int futhark_mc_segmap_parloop_229213(void *args, int64_t start,
                                            int64_t end, int flat_tid_224939,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229212
    *futhark_mc_segmap_parloop_struct_229212 =
    (struct futhark_mc_segmap_parloop_struct_229212 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229212->ctx;
    uint64_t futhark_mc_segmap_parloop_229213_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229213_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229212->free_n_196692;
    int64_t gtid_206892 =
            futhark_mc_segmap_parloop_struct_229212->free_gtid_206892;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229212->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229212->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229212->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229212->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229212->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212869 = {.desc ="mem_212869", .mem =
                                  futhark_mc_segmap_parloop_struct_229212->free_mem_212869,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_segmap_parloop_struct_229212->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_segmap_parloop_struct_229212->free_mem_212875,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225078 = start;
    
    for (; iter_225078 < end; iter_225078++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225087 = n_196692;
        int64_t gtid_224940 = iter_225078;
        int64_t remnant_225088 = iter_225078 - gtid_224940;
        int64_t x_224941;
        
        x_224941 = ((int64_t *) mem_210394.mem)[gtid_206892 * n_196692 +
                                                gtid_224940];
        
        bool cond_224942 = sle64((int64_t) 0, x_224941);
        float defunc_0_f_res_224943;
        
        if (cond_224942) {
            bool y_225079 = slt64(x_224941, n_196692);
            bool bounds_check_225080 = cond_224942 && y_225079;
            bool index_certs_225081;
            
            if (!bounds_check_225080) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_224941,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_225082;
            
            defunc_0_f_res_t_res_225082 = ((float *) mem_212869.mem)[x_224941];
            defunc_0_f_res_224943 = defunc_0_f_res_t_res_225082;
        } else {
            defunc_0_f_res_224943 = 0.0F;
        }
        
        float defunc_0_f_res_224948;
        
        if (cond_224942) {
            bool y_225083 = slt64(x_224941, n_196692);
            bool bounds_check_225084 = cond_224942 && y_225083;
            bool index_certs_225085;
            
            if (!bounds_check_225084) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_224941,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_225086;
            
            defunc_0_f_res_t_res_225086 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_206892 *
                                                  ctx_param_ext_210921 +
                                                  x_224941 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_224948 = defunc_0_f_res_t_res_225086;
        } else {
            defunc_0_f_res_224948 = 0.0F;
        }
        ((float *) mem_212872.mem)[gtid_224940] = defunc_0_f_res_224948;
        ((float *) mem_212875.mem)[gtid_224940] = defunc_0_f_res_224943;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229213_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229213_end -
                 futhark_mc_segmap_parloop_229213_start;
        
        ctx->futhark_mc_segmap_parloop_229213_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229213_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229213_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229211(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224939 = tid;
    int num_tasks_225077 = info.nsubtasks;
    struct futhark_mc_task_229210 *futhark_mc_task_229210 =
                                  (struct futhark_mc_task_229210 *) args;
    struct futhark_context *ctx = futhark_mc_task_229210->ctx;
    uint64_t futhark_mc_segmap_task_229211_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229211_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229210->free_n_196692;
    int64_t gtid_206892 = futhark_mc_task_229210->free_gtid_206892;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229210->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229210->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229210->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229210->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229210->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212869 = {.desc ="mem_212869", .mem =
                                  futhark_mc_task_229210->free_mem_212869,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_task_229210->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_task_229210->free_mem_212875,
                                  .size =0, .references =NULL};
    int64_t iter_225078;
    struct futhark_mc_segmap_parloop_struct_229212
    futhark_mc_segmap_parloop_struct_229212;
    
    futhark_mc_segmap_parloop_struct_229212.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229212.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229212.free_gtid_206892 = gtid_206892;
    futhark_mc_segmap_parloop_struct_229212.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229212.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229212.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229212.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229212.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229212.free_mem_212869 = mem_212869.mem;
    futhark_mc_segmap_parloop_struct_229212.free_mem_212872 = mem_212872.mem;
    futhark_mc_segmap_parloop_struct_229212.free_mem_212875 = mem_212875.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229213_task;
    
    futhark_mc_segmap_parloop_229213_task.name =
        "futhark_mc_segmap_parloop_229213";
    futhark_mc_segmap_parloop_229213_task.fn = futhark_mc_segmap_parloop_229213;
    futhark_mc_segmap_parloop_229213_task.args =
        &futhark_mc_segmap_parloop_struct_229212;
    futhark_mc_segmap_parloop_229213_task.iterations = iterations;
    futhark_mc_segmap_parloop_229213_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229213_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229213_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229213_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229213_task);
    
    if (futhark_mc_segmap_parloop_229213_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229213_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229213_total_end -
                 futhark_mc_segmap_parloop_229213_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229213_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229213_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229213_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229211_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229211_end -
                 futhark_mc_segmap_task_229211_start;
        
        ctx->futhark_mc_segmap_task_229211_runs[tid]++;
        ctx->futhark_mc_segmap_task_229211_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229211_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229214 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
    unsigned char *free_mem_212878;
};
struct futhark_mc_segmap_parloop_struct_229216 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
    unsigned char *free_mem_212878;
};
static int futhark_mc_segmap_parloop_229217(void *args, int64_t start,
                                            int64_t end, int flat_tid_225014,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229216
    *futhark_mc_segmap_parloop_struct_229216 =
    (struct futhark_mc_segmap_parloop_struct_229216 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229216->ctx;
    uint64_t futhark_mc_segmap_parloop_229217_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229217_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229216->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229216->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229216->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229216->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229216->free_i_196779;
    int64_t gtid_206892 =
            futhark_mc_segmap_parloop_struct_229216->free_gtid_206892;
    int64_t x_206897 = futhark_mc_segmap_parloop_struct_229216->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229216->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229216->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229216->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_segmap_parloop_struct_229216->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_segmap_parloop_struct_229216->free_mem_212875,
                                  .size =0, .references =NULL};
    struct memblock mem_212878 = {.desc ="mem_212878", .mem =
                                  futhark_mc_segmap_parloop_struct_229216->free_mem_212878,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225090 = start;
    
    for (; iter_225090 < end; iter_225090++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225138 = t_n_m_196759;
        int64_t gtid_225015 = iter_225090;
        int64_t remnant_225139 = iter_225090 - gtid_225015;
        int64_t x_225016;
        
        x_225016 = ((int64_t *) mem_210889.mem)[gtid_206892 * t_n_m_196759 +
                                                gtid_225015];
        
        float x_225017;
        
        x_225017 = ((float *) mem_210893.mem)[gtid_206892 * t_n_m_196759 +
                                              gtid_225015];
        
        int64_t min_arg_225018 = mul64(jump_t_196702, gtid_225015);
        int64_t min_res_225019 = smin64(i_196779, min_arg_225018);
        int64_t defunc_0_g_res_225020 = add64((int64_t) 1, min_res_225019);
        float defunc_2_reduce_res_225021;
        float redout_225092 = 0.0F;
        
        for (int64_t i_225091 = 0; i_225091 < q_t_196696; i_225091++) {
            bool cond_225093 = sle64(x_206897, i_225091);
            int64_t defunc_0_f_res_225094;
            
            if (cond_225093) {
                defunc_0_f_res_225094 = (int64_t) 0;
            } else {
                int64_t i_225095 = add64(x_225016, i_225091);
                int64_t defunc_0_add_arg_225096;
                
                defunc_0_add_arg_225096 =
                    ((int64_t *) mem_210394.mem)[gtid_206892 * n_196692 +
                                                 i_225095];
                
                int64_t defunc_1_add_res_225097 = add64((int64_t) 1,
                                                        defunc_0_add_arg_225096);
                
                defunc_0_f_res_225094 = defunc_1_add_res_225097;
            }
            
            float defunc_0_f_res_225098;
            
            if (cond_225093) {
                defunc_0_f_res_225098 = 0.0F;
            } else {
                int64_t i_225099 = add64(x_225016, i_225091);
                float defunc_0_add_arg_225100;
                
                defunc_0_add_arg_225100 = ((float *) mem_212872.mem)[i_225099];
                defunc_0_f_res_225098 = defunc_0_add_arg_225100;
            }
            
            int64_t binop_p_225101 = sub64(defunc_0_f_res_225094,
                                           defunc_0_g_res_225020);
            float defunc_0_f_res_225102 = sitofp_i64_f32(binop_p_225101);
            float abs_res_225103 = (float) fabs(defunc_0_f_res_225102);
            float tmp1_225104 = abs_res_225103 / x_225017;
            float x_225105 = tmp1_225104 * tmp1_225104;
            float y_225106 = tmp1_225104 * x_225105;
            float tmp2_225107 = 1.0F - y_225106;
            float x_225108 = tmp2_225107 * tmp2_225107;
            float tmp3_225109 = tmp2_225107 * x_225108;
            float w_j_225110 = defunc_0_f_res_225098 * tmp3_225109;
            float defunc_1_op_res_225111 = w_j_225110 + redout_225092;
            float redout_tmp_225140 = defunc_1_op_res_225111;
            
            redout_225092 = redout_tmp_225140;
        }
        defunc_2_reduce_res_225021 = redout_225092;
        
        float a0_225043 = 1.0F / defunc_2_reduce_res_225021;
        float defunc_2_reduce_res_225044;
        float redout_225113 = 0.0F;
        
        for (int64_t i_225112 = 0; i_225112 < q_t_196696; i_225112++) {
            bool cond_225114 = sle64(x_206897, i_225112);
            int64_t defunc_0_f_res_225115;
            
            if (cond_225114) {
                defunc_0_f_res_225115 = (int64_t) 0;
            } else {
                int64_t i_225116 = add64(x_225016, i_225112);
                int64_t defunc_0_add_arg_225117;
                
                defunc_0_add_arg_225117 =
                    ((int64_t *) mem_210394.mem)[gtid_206892 * n_196692 +
                                                 i_225116];
                
                int64_t defunc_1_add_res_225118 = add64((int64_t) 1,
                                                        defunc_0_add_arg_225117);
                
                defunc_0_f_res_225115 = defunc_1_add_res_225118;
            }
            
            float defunc_0_f_res_225119;
            
            if (cond_225114) {
                defunc_0_f_res_225119 = 0.0F;
            } else {
                int64_t i_225120 = add64(x_225016, i_225112);
                float defunc_0_add_arg_225121;
                
                defunc_0_add_arg_225121 = ((float *) mem_212872.mem)[i_225120];
                defunc_0_f_res_225119 = defunc_0_add_arg_225121;
            }
            
            int64_t binop_p_225122 = sub64(defunc_0_f_res_225115,
                                           defunc_0_g_res_225020);
            float defunc_0_f_res_225123 = sitofp_i64_f32(binop_p_225122);
            float abs_res_225124 = (float) fabs(defunc_0_f_res_225123);
            float tmp1_225125 = abs_res_225124 / x_225017;
            float x_225126 = tmp1_225125 * tmp1_225125;
            float y_225127 = tmp1_225125 * x_225126;
            float tmp2_225128 = 1.0F - y_225127;
            float x_225129 = tmp2_225128 * tmp2_225128;
            float tmp3_225130 = tmp2_225128 * x_225129;
            float tmp4_225131 = defunc_0_f_res_225119 * tmp3_225130;
            float defunc_0_f_res_225132;
            
            if (cond_225114) {
                defunc_0_f_res_225132 = 0.0F;
            } else {
                int64_t i_225133 = add64(x_225016, i_225112);
                float defunc_0_add_arg_225134;
                
                defunc_0_add_arg_225134 = ((float *) mem_212875.mem)[i_225133];
                defunc_0_f_res_225132 = defunc_0_add_arg_225134;
            }
            
            float x_225135 = a0_225043 * tmp4_225131;
            float defunc_9_fit_fun_res_225136 = defunc_0_f_res_225132 *
                  x_225135;
            float defunc_1_op_res_225137 = defunc_9_fit_fun_res_225136 +
                  redout_225113;
            float redout_tmp_225141 = defunc_1_op_res_225137;
            
            redout_225113 = redout_tmp_225141;
        }
        defunc_2_reduce_res_225044 = redout_225113;
        ((float *) mem_212878.mem)[gtid_225015] = defunc_2_reduce_res_225044;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229217_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229217_end -
                 futhark_mc_segmap_parloop_229217_start;
        
        ctx->futhark_mc_segmap_parloop_229217_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229217_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229217_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229215(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225014 = tid;
    int num_tasks_225089 = info.nsubtasks;
    struct futhark_mc_task_229214 *futhark_mc_task_229214 =
                                  (struct futhark_mc_task_229214 *) args;
    struct futhark_context *ctx = futhark_mc_task_229214->ctx;
    uint64_t futhark_mc_segmap_task_229215_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229215_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229214->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229214->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229214->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229214->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229214->free_i_196779;
    int64_t gtid_206892 = futhark_mc_task_229214->free_gtid_206892;
    int64_t x_206897 = futhark_mc_task_229214->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229214->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229214->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229214->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_task_229214->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_task_229214->free_mem_212875,
                                  .size =0, .references =NULL};
    struct memblock mem_212878 = {.desc ="mem_212878", .mem =
                                  futhark_mc_task_229214->free_mem_212878,
                                  .size =0, .references =NULL};
    int64_t iter_225090;
    struct futhark_mc_segmap_parloop_struct_229216
    futhark_mc_segmap_parloop_struct_229216;
    
    futhark_mc_segmap_parloop_struct_229216.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229216.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229216.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229216.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229216.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229216.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229216.free_gtid_206892 = gtid_206892;
    futhark_mc_segmap_parloop_struct_229216.free_x_206897 = x_206897;
    futhark_mc_segmap_parloop_struct_229216.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229216.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229216.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229216.free_mem_212872 = mem_212872.mem;
    futhark_mc_segmap_parloop_struct_229216.free_mem_212875 = mem_212875.mem;
    futhark_mc_segmap_parloop_struct_229216.free_mem_212878 = mem_212878.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229217_task;
    
    futhark_mc_segmap_parloop_229217_task.name =
        "futhark_mc_segmap_parloop_229217";
    futhark_mc_segmap_parloop_229217_task.fn = futhark_mc_segmap_parloop_229217;
    futhark_mc_segmap_parloop_229217_task.args =
        &futhark_mc_segmap_parloop_struct_229216;
    futhark_mc_segmap_parloop_229217_task.iterations = iterations;
    futhark_mc_segmap_parloop_229217_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229217_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229217_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229217_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229217_task);
    
    if (futhark_mc_segmap_parloop_229217_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229217_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229217_total_end -
                 futhark_mc_segmap_parloop_229217_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229217_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229217_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229217_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229215_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229215_end -
                 futhark_mc_segmap_task_229215_start;
        
        ctx->futhark_mc_segmap_task_229215_runs[tid]++;
        ctx->futhark_mc_segmap_task_229215_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229215_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229219 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
    unsigned char *free_mem_212878;
};
struct futhark_mc_task_229221 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212872;
    int64_t free_x_224955;
    float free_x_224956;
    int64_t free_defunc_0_g_res_224959;
    float *retval_defunc_2_reduce_res_224960;
};
struct futhark_mc_segred_stage_1_parloop_struct_229224 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212872;
    int64_t free_x_224955;
    float free_x_224956;
    int64_t free_defunc_0_g_res_224959;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225197;
};
static int futhark_mc_segred_stage_1_parloop_229225(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_225143,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229224
    *futhark_mc_segred_stage_1_parloop_struct_229224 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229224 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229224->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229225_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229225_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229224->free_n_196692;
    int64_t gtid_206892 =
            futhark_mc_segred_stage_1_parloop_struct_229224->free_gtid_206892;
    int64_t x_206897 =
            futhark_mc_segred_stage_1_parloop_struct_229224->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229224->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229224->free_mem_212872,
                                  .size =0, .references =NULL};
    int64_t x_224955 =
            futhark_mc_segred_stage_1_parloop_struct_229224->free_x_224955;
    float x_224956 =
          futhark_mc_segred_stage_1_parloop_struct_229224->free_x_224956;
    int64_t defunc_0_g_res_224959 =
            futhark_mc_segred_stage_1_parloop_struct_229224->free_defunc_0_g_res_224959;
    struct memblock reduce_stage_1_tid_res_arr_mem_225197 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225197",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229224->free_reduce_stage_1_tid_res_arr_mem_225197,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225199 = start;
    float x_225145;
    float x_225146;
    float local_acc_225200 = 0.0F;
    
    for (; iter_225199 < end; iter_225199++) {
        int64_t gtid_225144 = iter_225199;
        bool cond_225148 = sle64(x_206897, gtid_225144);
        int64_t defunc_0_f_res_225149;
        
        if (cond_225148) {
            defunc_0_f_res_225149 = (int64_t) 0;
        } else {
            int64_t i_225150 = add64(x_224955, gtid_225144);
            int64_t defunc_0_add_arg_225151;
            
            defunc_0_add_arg_225151 = ((int64_t *) mem_210394.mem)[gtid_206892 *
                                                                   n_196692 +
                                                                   i_225150];
            
            int64_t defunc_1_add_res_225152 = add64((int64_t) 1,
                                                    defunc_0_add_arg_225151);
            
            defunc_0_f_res_225149 = defunc_1_add_res_225152;
        }
        
        float defunc_0_f_res_225153;
        
        if (cond_225148) {
            defunc_0_f_res_225153 = 0.0F;
        } else {
            int64_t i_225154 = add64(x_224955, gtid_225144);
            float defunc_0_add_arg_225155;
            
            defunc_0_add_arg_225155 = ((float *) mem_212872.mem)[i_225154];
            defunc_0_f_res_225153 = defunc_0_add_arg_225155;
        }
        
        int64_t binop_p_225156 = sub64(defunc_0_f_res_225149,
                                       defunc_0_g_res_224959);
        float defunc_0_f_res_225157 = sitofp_i64_f32(binop_p_225156);
        float abs_res_225158 = (float) fabs(defunc_0_f_res_225157);
        float tmp1_225159 = abs_res_225158 / x_224956;
        float x_225160 = tmp1_225159 * tmp1_225159;
        float y_225161 = tmp1_225159 * x_225160;
        float tmp2_225162 = 1.0F - y_225161;
        float x_225163 = tmp2_225162 * tmp2_225162;
        float tmp3_225164 = tmp2_225162 * x_225163;
        float w_j_225165 = defunc_0_f_res_225153 * tmp3_225164;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_225145 = local_acc_225200;
        }
        // Load next params
        {
            x_225146 = w_j_225165;
        }
        // Red body
        {
            float defunc_1_op_res_225147 = x_225145 + x_225146;
            
            local_acc_225200 = defunc_1_op_res_225147;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_225197.mem)[flat_tid_225143] =
        local_acc_225200;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229225_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229225_end -
                 futhark_mc_segred_stage_1_parloop_229225_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229225_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229225_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229225_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229222(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225143 = tid;
    int num_tasks_225196 = info.nsubtasks;
    struct futhark_mc_task_229221 *futhark_mc_task_229221 =
                                  (struct futhark_mc_task_229221 *) args;
    struct futhark_context *ctx = futhark_mc_task_229221->ctx;
    uint64_t futhark_mc_segred_task_229222_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229222_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229221->free_n_196692;
    int64_t gtid_206892 = futhark_mc_task_229221->free_gtid_206892;
    int64_t x_206897 = futhark_mc_task_229221->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229221->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_task_229221->free_mem_212872,
                                  .size =0, .references =NULL};
    int64_t x_224955 = futhark_mc_task_229221->free_x_224955;
    float x_224956 = futhark_mc_task_229221->free_x_224956;
    int64_t defunc_0_g_res_224959 =
            futhark_mc_task_229221->free_defunc_0_g_res_224959;
    float defunc_2_reduce_res_224960 =
          *futhark_mc_task_229221->retval_defunc_2_reduce_res_224960;
    size_t reduce_stage_1_tid_res_arr_mem_225197_cached_sizze_229223 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225197 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_225197_cached_sizze_229223 <
        (size_t) ((int64_t) 4 * num_tasks_225196)) {
        reduce_stage_1_tid_res_arr_mem_225197 =
            realloc(reduce_stage_1_tid_res_arr_mem_225197, (int64_t) 4 *
                    num_tasks_225196);
        reduce_stage_1_tid_res_arr_mem_225197_cached_sizze_229223 =
            (int64_t) 4 * num_tasks_225196;
    }
    
    int64_t iter_225199;
    struct futhark_mc_segred_stage_1_parloop_struct_229224
    futhark_mc_segred_stage_1_parloop_struct_229224;
    
    futhark_mc_segred_stage_1_parloop_struct_229224.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_gtid_206892 =
        gtid_206892;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_x_206897 = x_206897;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_mem_212872 =
        mem_212872.mem;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_x_224955 = x_224955;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_x_224956 = x_224956;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_defunc_0_g_res_224959 =
        defunc_0_g_res_224959;
    futhark_mc_segred_stage_1_parloop_struct_229224.free_reduce_stage_1_tid_res_arr_mem_225197 =
        reduce_stage_1_tid_res_arr_mem_225197;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229225_task;
    
    futhark_mc_segred_stage_1_parloop_229225_task.name =
        "futhark_mc_segred_stage_1_parloop_229225";
    futhark_mc_segred_stage_1_parloop_229225_task.fn =
        futhark_mc_segred_stage_1_parloop_229225;
    futhark_mc_segred_stage_1_parloop_229225_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229224;
    futhark_mc_segred_stage_1_parloop_229225_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229225_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229225_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229225_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229225_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229225_task);
    
    if (futhark_mc_segred_stage_1_parloop_229225_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229225_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229225_total_end -
                 futhark_mc_segred_stage_1_parloop_229225_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229225_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229225_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229225_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_224960 = 0.0F;
    }
    
    float x_225201;
    float x_225202;
    
    for (int32_t i_225204 = 0; i_225204 < num_tasks_225196; i_225204++) {
        flat_tid_225143 = i_225204;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_225201 = defunc_2_reduce_res_224960;
            }
            // load next params
            {
                x_225202 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225197)[flat_tid_225143];
            }
            // red body
            {
                float defunc_1_op_res_225203 = x_225201 + x_225202;
                
                defunc_2_reduce_res_224960 = defunc_1_op_res_225203;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_225197);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229222_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229222_end -
                 futhark_mc_segred_task_229222_start;
        
        ctx->futhark_mc_segred_task_229222_runs[tid]++;
        ctx->futhark_mc_segred_task_229222_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229222_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229221->retval_defunc_2_reduce_res_224960 =
            defunc_2_reduce_res_224960;
    }
    return err;
}
struct futhark_mc_task_229226 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
    int64_t free_x_224955;
    float free_x_224956;
    int64_t free_defunc_0_g_res_224959;
    float free_a0_224984;
    float *retval_defunc_2_reduce_res_224985;
};
struct futhark_mc_segred_stage_1_parloop_struct_229229 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_206892;
    int64_t free_x_206897;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212872;
    unsigned char *free_mem_212875;
    int64_t free_x_224955;
    float free_x_224956;
    int64_t free_defunc_0_g_res_224959;
    float free_a0_224984;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225206;
};
static int futhark_mc_segred_stage_1_parloop_229230(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_225166,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229229
    *futhark_mc_segred_stage_1_parloop_struct_229229 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229229 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229229->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229230_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229230_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229229->free_n_196692;
    int64_t gtid_206892 =
            futhark_mc_segred_stage_1_parloop_struct_229229->free_gtid_206892;
    int64_t x_206897 =
            futhark_mc_segred_stage_1_parloop_struct_229229->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229229->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229229->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229229->free_mem_212875,
                                  .size =0, .references =NULL};
    int64_t x_224955 =
            futhark_mc_segred_stage_1_parloop_struct_229229->free_x_224955;
    float x_224956 =
          futhark_mc_segred_stage_1_parloop_struct_229229->free_x_224956;
    int64_t defunc_0_g_res_224959 =
            futhark_mc_segred_stage_1_parloop_struct_229229->free_defunc_0_g_res_224959;
    float a0_224984 =
          futhark_mc_segred_stage_1_parloop_struct_229229->free_a0_224984;
    struct memblock reduce_stage_1_tid_res_arr_mem_225206 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225206",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229229->free_reduce_stage_1_tid_res_arr_mem_225206,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225208 = start;
    float x_225168;
    float x_225169;
    float local_acc_225209 = 0.0F;
    
    for (; iter_225208 < end; iter_225208++) {
        int64_t gtid_225167 = iter_225208;
        bool cond_225171 = sle64(x_206897, gtid_225167);
        int64_t defunc_0_f_res_225172;
        
        if (cond_225171) {
            defunc_0_f_res_225172 = (int64_t) 0;
        } else {
            int64_t i_225173 = add64(x_224955, gtid_225167);
            int64_t defunc_0_add_arg_225174;
            
            defunc_0_add_arg_225174 = ((int64_t *) mem_210394.mem)[gtid_206892 *
                                                                   n_196692 +
                                                                   i_225173];
            
            int64_t defunc_1_add_res_225175 = add64((int64_t) 1,
                                                    defunc_0_add_arg_225174);
            
            defunc_0_f_res_225172 = defunc_1_add_res_225175;
        }
        
        float defunc_0_f_res_225176;
        
        if (cond_225171) {
            defunc_0_f_res_225176 = 0.0F;
        } else {
            int64_t i_225177 = add64(x_224955, gtid_225167);
            float defunc_0_add_arg_225178;
            
            defunc_0_add_arg_225178 = ((float *) mem_212872.mem)[i_225177];
            defunc_0_f_res_225176 = defunc_0_add_arg_225178;
        }
        
        int64_t binop_p_225179 = sub64(defunc_0_f_res_225172,
                                       defunc_0_g_res_224959);
        float defunc_0_f_res_225180 = sitofp_i64_f32(binop_p_225179);
        float abs_res_225181 = (float) fabs(defunc_0_f_res_225180);
        float tmp1_225182 = abs_res_225181 / x_224956;
        float x_225183 = tmp1_225182 * tmp1_225182;
        float y_225184 = tmp1_225182 * x_225183;
        float tmp2_225185 = 1.0F - y_225184;
        float x_225186 = tmp2_225185 * tmp2_225185;
        float tmp3_225187 = tmp2_225185 * x_225186;
        float tmp4_225188 = defunc_0_f_res_225176 * tmp3_225187;
        float defunc_0_f_res_225189;
        
        if (cond_225171) {
            defunc_0_f_res_225189 = 0.0F;
        } else {
            int64_t i_225190 = add64(x_224955, gtid_225167);
            float defunc_0_add_arg_225191;
            
            defunc_0_add_arg_225191 = ((float *) mem_212875.mem)[i_225190];
            defunc_0_f_res_225189 = defunc_0_add_arg_225191;
        }
        
        float x_225192 = a0_224984 * tmp4_225188;
        float defunc_9_fit_fun_res_225193 = defunc_0_f_res_225189 * x_225192;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_225168 = local_acc_225209;
        }
        // Load next params
        {
            x_225169 = defunc_9_fit_fun_res_225193;
        }
        // Red body
        {
            float defunc_1_op_res_225170 = x_225168 + x_225169;
            
            local_acc_225209 = defunc_1_op_res_225170;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_225206.mem)[flat_tid_225166] =
        local_acc_225209;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229230_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229230_end -
                 futhark_mc_segred_stage_1_parloop_229230_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229230_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229230_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229230_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229227(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225166 = tid;
    int num_tasks_225205 = info.nsubtasks;
    struct futhark_mc_task_229226 *futhark_mc_task_229226 =
                                  (struct futhark_mc_task_229226 *) args;
    struct futhark_context *ctx = futhark_mc_task_229226->ctx;
    uint64_t futhark_mc_segred_task_229227_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229227_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229226->free_n_196692;
    int64_t gtid_206892 = futhark_mc_task_229226->free_gtid_206892;
    int64_t x_206897 = futhark_mc_task_229226->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229226->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_task_229226->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_task_229226->free_mem_212875,
                                  .size =0, .references =NULL};
    int64_t x_224955 = futhark_mc_task_229226->free_x_224955;
    float x_224956 = futhark_mc_task_229226->free_x_224956;
    int64_t defunc_0_g_res_224959 =
            futhark_mc_task_229226->free_defunc_0_g_res_224959;
    float a0_224984 = futhark_mc_task_229226->free_a0_224984;
    float defunc_2_reduce_res_224985 =
          *futhark_mc_task_229226->retval_defunc_2_reduce_res_224985;
    size_t reduce_stage_1_tid_res_arr_mem_225206_cached_sizze_229228 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225206 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_225206_cached_sizze_229228 <
        (size_t) ((int64_t) 4 * num_tasks_225205)) {
        reduce_stage_1_tid_res_arr_mem_225206 =
            realloc(reduce_stage_1_tid_res_arr_mem_225206, (int64_t) 4 *
                    num_tasks_225205);
        reduce_stage_1_tid_res_arr_mem_225206_cached_sizze_229228 =
            (int64_t) 4 * num_tasks_225205;
    }
    
    int64_t iter_225208;
    struct futhark_mc_segred_stage_1_parloop_struct_229229
    futhark_mc_segred_stage_1_parloop_struct_229229;
    
    futhark_mc_segred_stage_1_parloop_struct_229229.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_gtid_206892 =
        gtid_206892;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_x_206897 = x_206897;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_mem_212872 =
        mem_212872.mem;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_mem_212875 =
        mem_212875.mem;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_x_224955 = x_224955;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_x_224956 = x_224956;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_defunc_0_g_res_224959 =
        defunc_0_g_res_224959;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_a0_224984 = a0_224984;
    futhark_mc_segred_stage_1_parloop_struct_229229.free_reduce_stage_1_tid_res_arr_mem_225206 =
        reduce_stage_1_tid_res_arr_mem_225206;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229230_task;
    
    futhark_mc_segred_stage_1_parloop_229230_task.name =
        "futhark_mc_segred_stage_1_parloop_229230";
    futhark_mc_segred_stage_1_parloop_229230_task.fn =
        futhark_mc_segred_stage_1_parloop_229230;
    futhark_mc_segred_stage_1_parloop_229230_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229229;
    futhark_mc_segred_stage_1_parloop_229230_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229230_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229230_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229230_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229230_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229230_task);
    
    if (futhark_mc_segred_stage_1_parloop_229230_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229230_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229230_total_end -
                 futhark_mc_segred_stage_1_parloop_229230_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229230_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229230_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229230_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_224985 = 0.0F;
    }
    
    float x_225210;
    float x_225211;
    
    for (int32_t i_225213 = 0; i_225213 < num_tasks_225205; i_225213++) {
        flat_tid_225166 = i_225213;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_225210 = defunc_2_reduce_res_224985;
            }
            // load next params
            {
                x_225211 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225206)[flat_tid_225166];
            }
            // red body
            {
                float defunc_1_op_res_225212 = x_225210 + x_225211;
                
                defunc_2_reduce_res_224985 = defunc_1_op_res_225212;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_225206);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229227_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229227_end -
                 futhark_mc_segred_task_229227_start;
        
        ctx->futhark_mc_segred_task_229227_runs[tid]++;
        ctx->futhark_mc_segred_task_229227_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229227_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229226->retval_defunc_2_reduce_res_224985 =
            defunc_2_reduce_res_224985;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229220(void *args, int64_t start,
                                            int64_t end, int flat_tid_224953,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229219
    *futhark_mc_segmap_parloop_struct_229219 =
    (struct futhark_mc_segmap_parloop_struct_229219 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229219->ctx;
    uint64_t futhark_mc_segmap_parloop_229220_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229220_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229219->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229219->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229219->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229219->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229219->free_i_196779;
    int64_t gtid_206892 =
            futhark_mc_segmap_parloop_struct_229219->free_gtid_206892;
    int64_t x_206897 = futhark_mc_segmap_parloop_struct_229219->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229219->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229219->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229219->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_segmap_parloop_struct_229219->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_segmap_parloop_struct_229219->free_mem_212875,
                                  .size =0, .references =NULL};
    struct memblock mem_212878 = {.desc ="mem_212878", .mem =
                                  futhark_mc_segmap_parloop_struct_229219->free_mem_212878,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225142 = start;
    
    for (; iter_225142 < end; iter_225142++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225194 = t_n_m_196759;
        int64_t gtid_224954 = iter_225142;
        int64_t remnant_225195 = iter_225142 - gtid_224954;
        int64_t x_224955;
        
        x_224955 = ((int64_t *) mem_210889.mem)[gtid_206892 * t_n_m_196759 +
                                                gtid_224954];
        
        float x_224956;
        
        x_224956 = ((float *) mem_210893.mem)[gtid_206892 * t_n_m_196759 +
                                              gtid_224954];
        
        int64_t min_arg_224957 = mul64(jump_t_196702, gtid_224954);
        int64_t min_res_224958 = smin64(i_196779, min_arg_224957);
        int64_t defunc_0_g_res_224959 = add64((int64_t) 1, min_res_224958);
        float defunc_2_reduce_res_224960;
        int64_t flat_tid_225143 = (int64_t) 0;
        int32_t num_tasks_225196;
        
        defunc_2_reduce_res_224960 = 0.0F;
        
        struct futhark_mc_task_229221 futhark_mc_task_229221;
        
        futhark_mc_task_229221.ctx = ctx;
        futhark_mc_task_229221.free_n_196692 = n_196692;
        futhark_mc_task_229221.free_gtid_206892 = gtid_206892;
        futhark_mc_task_229221.free_x_206897 = x_206897;
        futhark_mc_task_229221.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229221.free_mem_212872 = mem_212872.mem;
        futhark_mc_task_229221.free_x_224955 = x_224955;
        futhark_mc_task_229221.free_x_224956 = x_224956;
        futhark_mc_task_229221.free_defunc_0_g_res_224959 =
            defunc_0_g_res_224959;
        futhark_mc_task_229221.retval_defunc_2_reduce_res_224960 =
            &defunc_2_reduce_res_224960;
        
        struct scheduler_segop futhark_mc_task_229221_task;
        
        futhark_mc_task_229221_task.args = &futhark_mc_task_229221;
        futhark_mc_task_229221_task.top_level_fn =
            futhark_mc_segred_task_229222;
        futhark_mc_task_229221_task.name = "futhark_mc_segred_task_229222";
        futhark_mc_task_229221_task.iterations = q_t_196696;
        futhark_mc_task_229221_task.task_time =
            &ctx->futhark_mc_segred_task_229222_total_time;
        futhark_mc_task_229221_task.task_iter =
            &ctx->futhark_mc_segred_task_229222_total_iter;
        futhark_mc_task_229221_task.sched = STATIC;
        futhark_mc_task_229221_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229222_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229221_task);
        
        if (futhark_mc_segred_task_229222_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float a0_224984 = 1.0F / defunc_2_reduce_res_224960;
        float defunc_2_reduce_res_224985;
        int64_t flat_tid_225166 = (int64_t) 0;
        int32_t num_tasks_225205;
        
        defunc_2_reduce_res_224985 = 0.0F;
        
        struct futhark_mc_task_229226 futhark_mc_task_229226;
        
        futhark_mc_task_229226.ctx = ctx;
        futhark_mc_task_229226.free_n_196692 = n_196692;
        futhark_mc_task_229226.free_gtid_206892 = gtid_206892;
        futhark_mc_task_229226.free_x_206897 = x_206897;
        futhark_mc_task_229226.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229226.free_mem_212872 = mem_212872.mem;
        futhark_mc_task_229226.free_mem_212875 = mem_212875.mem;
        futhark_mc_task_229226.free_x_224955 = x_224955;
        futhark_mc_task_229226.free_x_224956 = x_224956;
        futhark_mc_task_229226.free_defunc_0_g_res_224959 =
            defunc_0_g_res_224959;
        futhark_mc_task_229226.free_a0_224984 = a0_224984;
        futhark_mc_task_229226.retval_defunc_2_reduce_res_224985 =
            &defunc_2_reduce_res_224985;
        
        struct scheduler_segop futhark_mc_task_229226_task;
        
        futhark_mc_task_229226_task.args = &futhark_mc_task_229226;
        futhark_mc_task_229226_task.top_level_fn =
            futhark_mc_segred_task_229227;
        futhark_mc_task_229226_task.name = "futhark_mc_segred_task_229227";
        futhark_mc_task_229226_task.iterations = q_t_196696;
        futhark_mc_task_229226_task.task_time =
            &ctx->futhark_mc_segred_task_229227_total_time;
        futhark_mc_task_229226_task.task_iter =
            &ctx->futhark_mc_segred_task_229227_total_iter;
        futhark_mc_task_229226_task.sched = STATIC;
        futhark_mc_task_229226_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229227_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229226_task);
        
        if (futhark_mc_segred_task_229227_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212878.mem)[gtid_224954] = defunc_2_reduce_res_224985;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229220_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229220_end -
                 futhark_mc_segmap_parloop_229220_start;
        
        ctx->futhark_mc_segmap_parloop_229220_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229220_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229220_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229218(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_224953 = tid;
    int num_tasks_225089 = info.nsubtasks;
    struct futhark_mc_task_229214 *futhark_mc_task_229214 =
                                  (struct futhark_mc_task_229214 *) args;
    struct futhark_context *ctx = futhark_mc_task_229214->ctx;
    uint64_t futhark_mc_segmap_nested_task_229218_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229218_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229214->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229214->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229214->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229214->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229214->free_i_196779;
    int64_t gtid_206892 = futhark_mc_task_229214->free_gtid_206892;
    int64_t x_206897 = futhark_mc_task_229214->free_x_206897;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229214->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229214->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229214->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212872 = {.desc ="mem_212872", .mem =
                                  futhark_mc_task_229214->free_mem_212872,
                                  .size =0, .references =NULL};
    struct memblock mem_212875 = {.desc ="mem_212875", .mem =
                                  futhark_mc_task_229214->free_mem_212875,
                                  .size =0, .references =NULL};
    struct memblock mem_212878 = {.desc ="mem_212878", .mem =
                                  futhark_mc_task_229214->free_mem_212878,
                                  .size =0, .references =NULL};
    int64_t iter_225142;
    struct futhark_mc_segmap_parloop_struct_229219
    futhark_mc_segmap_parloop_struct_229219;
    
    futhark_mc_segmap_parloop_struct_229219.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229219.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229219.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229219.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229219.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229219.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229219.free_gtid_206892 = gtid_206892;
    futhark_mc_segmap_parloop_struct_229219.free_x_206897 = x_206897;
    futhark_mc_segmap_parloop_struct_229219.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229219.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229219.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229219.free_mem_212872 = mem_212872.mem;
    futhark_mc_segmap_parloop_struct_229219.free_mem_212875 = mem_212875.mem;
    futhark_mc_segmap_parloop_struct_229219.free_mem_212878 = mem_212878.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229220_task;
    
    futhark_mc_segmap_parloop_229220_task.name =
        "futhark_mc_segmap_parloop_229220";
    futhark_mc_segmap_parloop_229220_task.fn = futhark_mc_segmap_parloop_229220;
    futhark_mc_segmap_parloop_229220_task.args =
        &futhark_mc_segmap_parloop_struct_229219;
    futhark_mc_segmap_parloop_229220_task.iterations = iterations;
    futhark_mc_segmap_parloop_229220_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229220_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229220_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229220_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229220_task);
    
    if (futhark_mc_segmap_parloop_229220_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229220_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229220_total_end -
                 futhark_mc_segmap_parloop_229220_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229220_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229220_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229220_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229218_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229218_end -
                 futhark_mc_segmap_nested_task_229218_start;
        
        ctx->futhark_mc_segmap_nested_task_229218_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229218_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229218_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229201(void *args, int64_t start,
                                            int64_t end, int flat_tid_206891,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229200
    *futhark_mc_segmap_parloop_struct_229200 =
    (struct futhark_mc_segmap_parloop_struct_229200 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229200->ctx;
    uint64_t futhark_mc_segmap_parloop_229201_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229201_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229200->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229200->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229200->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229200->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229200->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229200->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229200->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229200->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229200->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229200->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229200->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229200->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229200->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229200->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229200->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229200->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229200->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229200->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212942 = {.desc ="mem_212942", .mem =
                                  futhark_mc_segmap_parloop_struct_229200->free_mem_212942,
                                  .size =0, .references =NULL};
    size_t mem_212869_cached_sizze_229202 = 0;
    unsigned char *mem_212869 = NULL;
    size_t mem_212872_cached_sizze_229203 = 0;
    unsigned char *mem_212872 = NULL;
    size_t mem_212875_cached_sizze_229204 = 0;
    unsigned char *mem_212875 = NULL;
    size_t mem_212878_cached_sizze_229205 = 0;
    unsigned char *mem_212878 = NULL;
    int64_t iterations = end - start;
    int64_t iter_224933 = start;
    
    if (mem_212869_cached_sizze_229202 < (size_t) bytes_210949) {
        mem_212869 = realloc(mem_212869, bytes_210949);
        mem_212869_cached_sizze_229202 = bytes_210949;
    }
    if (mem_212872_cached_sizze_229203 < (size_t) bytes_210949) {
        mem_212872 = realloc(mem_212872, bytes_210949);
        mem_212872_cached_sizze_229203 = bytes_210949;
    }
    if (mem_212875_cached_sizze_229204 < (size_t) bytes_210949) {
        mem_212875 = realloc(mem_212875, bytes_210949);
        mem_212875_cached_sizze_229204 = bytes_210949;
    }
    if (mem_212878_cached_sizze_229205 < (size_t) bytes_210836) {
        mem_212878 = realloc(mem_212878, bytes_210836);
        mem_212878_cached_sizze_229205 = bytes_210836;
    }
    for (; iter_224933 < end; iter_224933++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225071 = m_196691;
        int64_t gtid_206892 = iter_224933;
        int64_t remnant_225072 = iter_224933 - gtid_206892;
        int64_t x_206897;
        
        x_206897 = ((int64_t *) mem_210397.mem)[gtid_206892];
        
        int64_t flat_tid_224934 = (int64_t) 0;
        int32_t num_tasks_225073;
        struct futhark_mc_task_229206 futhark_mc_task_229206;
        
        futhark_mc_task_229206.ctx = ctx;
        futhark_mc_task_229206.free_n_196692 = n_196692;
        futhark_mc_task_229206.free_gtid_206892 = gtid_206892;
        futhark_mc_task_229206.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229206.free_mem_212862 = mem_212862.mem;
        futhark_mc_task_229206.free_mem_212869 = mem_212869;
        
        struct scheduler_segop futhark_mc_task_229206_task;
        
        futhark_mc_task_229206_task.args = &futhark_mc_task_229206;
        futhark_mc_task_229206_task.top_level_fn =
            futhark_mc_segmap_task_229207;
        futhark_mc_task_229206_task.name = "futhark_mc_segmap_task_229207";
        futhark_mc_task_229206_task.iterations = n_196692;
        futhark_mc_task_229206_task.task_time =
            &ctx->futhark_mc_segmap_task_229207_total_time;
        futhark_mc_task_229206_task.task_iter =
            &ctx->futhark_mc_segmap_task_229207_total_iter;
        futhark_mc_task_229206_task.sched = STATIC;
        futhark_mc_task_229206_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229207_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229206_task);
        
        if (futhark_mc_segmap_task_229207_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_224939 = (int64_t) 0;
        int32_t num_tasks_225077;
        struct futhark_mc_task_229210 futhark_mc_task_229210;
        
        futhark_mc_task_229210.ctx = ctx;
        futhark_mc_task_229210.free_n_196692 = n_196692;
        futhark_mc_task_229210.free_gtid_206892 = gtid_206892;
        futhark_mc_task_229210.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229210.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229210.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229210.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229210.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229210.free_mem_212869 = mem_212869;
        futhark_mc_task_229210.free_mem_212872 = mem_212872;
        futhark_mc_task_229210.free_mem_212875 = mem_212875;
        
        struct scheduler_segop futhark_mc_task_229210_task;
        
        futhark_mc_task_229210_task.args = &futhark_mc_task_229210;
        futhark_mc_task_229210_task.top_level_fn =
            futhark_mc_segmap_task_229211;
        futhark_mc_task_229210_task.name = "futhark_mc_segmap_task_229211";
        futhark_mc_task_229210_task.iterations = n_196692;
        futhark_mc_task_229210_task.task_time =
            &ctx->futhark_mc_segmap_task_229211_total_time;
        futhark_mc_task_229210_task.task_iter =
            &ctx->futhark_mc_segmap_task_229211_total_iter;
        futhark_mc_task_229210_task.sched = STATIC;
        futhark_mc_task_229210_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229211_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229210_task);
        
        if (futhark_mc_segmap_task_229211_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_225014 = (int64_t) 0;
        int32_t num_tasks_225089;
        int64_t flat_tid_224953 = (int64_t) 0;
        struct futhark_mc_task_229214 futhark_mc_task_229214;
        
        futhark_mc_task_229214.ctx = ctx;
        futhark_mc_task_229214.free_n_196692 = n_196692;
        futhark_mc_task_229214.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229214.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229214.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229214.free_i_196779 = i_196779;
        futhark_mc_task_229214.free_gtid_206892 = gtid_206892;
        futhark_mc_task_229214.free_x_206897 = x_206897;
        futhark_mc_task_229214.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229214.free_mem_210889 = mem_210889.mem;
        futhark_mc_task_229214.free_mem_210893 = mem_210893.mem;
        futhark_mc_task_229214.free_mem_212872 = mem_212872;
        futhark_mc_task_229214.free_mem_212875 = mem_212875;
        futhark_mc_task_229214.free_mem_212878 = mem_212878;
        
        struct scheduler_segop futhark_mc_task_229214_task;
        
        futhark_mc_task_229214_task.args = &futhark_mc_task_229214;
        futhark_mc_task_229214_task.top_level_fn =
            futhark_mc_segmap_task_229215;
        futhark_mc_task_229214_task.name = "futhark_mc_segmap_task_229215";
        futhark_mc_task_229214_task.iterations = t_n_m_196759;
        futhark_mc_task_229214_task.task_time =
            &ctx->futhark_mc_segmap_task_229215_total_time;
        futhark_mc_task_229214_task.task_iter =
            &ctx->futhark_mc_segmap_task_229215_total_iter;
        futhark_mc_task_229214_task.sched = STATIC;
        futhark_mc_task_229214_task.nested_fn =
            futhark_mc_segmap_nested_task_229218;
        
        int futhark_mc_segmap_task_229215_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229214_task);
        
        if (futhark_mc_segmap_task_229215_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_212942.mem + gtid_206892 * t_n_m_196759 * (int64_t) 4,
                    mem_212878 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212869);
    free(mem_212872);
    free(mem_212875);
    free(mem_212878);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229201_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229201_end -
                 futhark_mc_segmap_parloop_229201_start;
        
        ctx->futhark_mc_segmap_parloop_229201_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229201_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229201_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229199(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_206891 = tid;
    int num_tasks_224842 = info.nsubtasks;
    struct futhark_mc_task_229191 *futhark_mc_task_229191 =
                                  (struct futhark_mc_task_229191 *) args;
    struct futhark_context *ctx = futhark_mc_task_229191->ctx;
    uint64_t futhark_mc_segmap_nested_task_229199_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229199_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229191->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229191->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229191->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229191->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229191->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229191->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229191->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229191->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229191->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229191->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229191->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229191->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229191->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229191->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229191->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229191->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229191->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229191->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212942 = {.desc ="mem_212942", .mem =
                                  futhark_mc_task_229191->free_mem_212942,
                                  .size =0, .references =NULL};
    int64_t iter_224933;
    struct futhark_mc_segmap_parloop_struct_229200
    futhark_mc_segmap_parloop_struct_229200;
    
    futhark_mc_segmap_parloop_struct_229200.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229200.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229200.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229200.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229200.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229200.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229200.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229200.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229200.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229200.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229200.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229200.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229200.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229200.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229200.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229200.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229200.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229200.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229200.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229200.free_mem_212942 = mem_212942.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229201_task;
    
    futhark_mc_segmap_parloop_229201_task.name =
        "futhark_mc_segmap_parloop_229201";
    futhark_mc_segmap_parloop_229201_task.fn = futhark_mc_segmap_parloop_229201;
    futhark_mc_segmap_parloop_229201_task.args =
        &futhark_mc_segmap_parloop_struct_229200;
    futhark_mc_segmap_parloop_229201_task.iterations = iterations;
    futhark_mc_segmap_parloop_229201_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229201_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229201_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229201_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229201_task);
    
    if (futhark_mc_segmap_parloop_229201_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229201_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229201_total_end -
                 futhark_mc_segmap_parloop_229201_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229201_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229201_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229201_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229199_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229199_end -
                 futhark_mc_segmap_nested_task_229199_start;
        
        ctx->futhark_mc_segmap_nested_task_229199_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229199_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229199_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229231 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213036;
    unsigned char *free_mem_213040;
};
struct futhark_mc_segmap_parloop_struct_229233 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213036;
    unsigned char *free_mem_213040;
};
static int futhark_mc_segmap_parloop_229234(void *args, int64_t start,
                                            int64_t end, int flat_tid_207047,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229233
    *futhark_mc_segmap_parloop_struct_229233 =
    (struct futhark_mc_segmap_parloop_struct_229233 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229233->ctx;
    uint64_t futhark_mc_segmap_parloop_229234_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229234_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229233->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229233->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229233->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229233->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229233->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229233->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229233->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229233->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229233->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229233->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229233->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229233->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229233->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213036 = {.desc ="mem_213036", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_213036,
                                  .size =0, .references =NULL};
    struct memblock mem_213040 = {.desc ="mem_213040", .mem =
                                  futhark_mc_segmap_parloop_struct_229233->free_mem_213040,
                                  .size =0, .references =NULL};
    size_t mem_212960_cached_sizze_229235 = 0;
    unsigned char *mem_212960 = NULL;
    size_t mem_212975_cached_sizze_229236 = 0;
    unsigned char *mem_212975 = NULL;
    size_t mem_212978_cached_sizze_229237 = 0;
    unsigned char *mem_212978 = NULL;
    size_t mem_213005_cached_sizze_229238 = 0;
    unsigned char *mem_213005 = NULL;
    size_t mem_213008_cached_sizze_229239 = 0;
    unsigned char *mem_213008 = NULL;
    int64_t iterations = end - start;
    int64_t iter_225215 = start;
    
    if (mem_212960_cached_sizze_229235 < (size_t) bytes_210949) {
        mem_212960 = realloc(mem_212960, bytes_210949);
        mem_212960_cached_sizze_229235 = bytes_210949;
    }
    if (mem_212975_cached_sizze_229236 < (size_t) bytes_210949) {
        mem_212975 = realloc(mem_212975, bytes_210949);
        mem_212975_cached_sizze_229236 = bytes_210949;
    }
    if (mem_212978_cached_sizze_229237 < (size_t) bytes_210949) {
        mem_212978 = realloc(mem_212978, bytes_210949);
        mem_212978_cached_sizze_229237 = bytes_210949;
    }
    if (mem_213005_cached_sizze_229238 < (size_t) bytes_210836) {
        mem_213005 = realloc(mem_213005, bytes_210836);
        mem_213005_cached_sizze_229238 = bytes_210836;
    }
    if (mem_213008_cached_sizze_229239 < (size_t) bytes_210836) {
        mem_213008 = realloc(mem_213008, bytes_210836);
        mem_213008_cached_sizze_229239 = bytes_210836;
    }
    for (; iter_225215 < end; iter_225215++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225324 = m_196691;
        int64_t gtid_207048 = iter_225215;
        int64_t remnant_225325 = iter_225215 - gtid_207048;
        int64_t x_199066;
        
        x_199066 = ((int64_t *) mem_210397.mem)[gtid_207048];
        for (int64_t i_225216 = 0; i_225216 < n_196692; i_225216++) {
            float x_225218;
            
            x_225218 = ((float *) Y_mem_210354.mem)[gtid_207048 * n_196692 +
                                                    i_225216];
            
            float x_225219;
            
            x_225219 = ((float *) mem_212862.mem)[gtid_207048 * n_196692 +
                                                  i_225216];
            
            float defunc_1_f_res_225220 = x_225218 - x_225219;
            
            ((float *) mem_212960)[i_225216] = defunc_1_f_res_225220;
        }
        for (int64_t i_225222 = 0; i_225222 < n_196692; i_225222++) {
            int64_t x_225225;
            
            x_225225 = ((int64_t *) mem_210394.mem)[gtid_207048 * n_196692 +
                                                    i_225222];
            
            bool cond_225226 = sle64((int64_t) 0, x_225225);
            float defunc_0_f_res_225227;
            
            if (cond_225226) {
                bool y_225228 = slt64(x_225225, n_196692);
                bool bounds_check_225229 = cond_225226 && y_225228;
                bool index_certs_225230;
                
                if (!bounds_check_225229) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_225225,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_225231;
                
                defunc_0_f_res_t_res_225231 = ((float *) mem_212960)[x_225225];
                defunc_0_f_res_225227 = defunc_0_f_res_t_res_225231;
            } else {
                defunc_0_f_res_225227 = 0.0F;
            }
            
            float defunc_0_f_res_225232;
            
            if (cond_225226) {
                bool y_225233 = slt64(x_225225, n_196692);
                bool bounds_check_225234 = cond_225226 && y_225233;
                bool index_certs_225235;
                
                if (!bounds_check_225234) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_225225,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_225236;
                
                defunc_0_f_res_t_res_225236 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_207048 *
                                                      ctx_param_ext_210921 +
                                                      x_225225 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_225232 = defunc_0_f_res_t_res_225236;
            } else {
                defunc_0_f_res_225232 = 0.0F;
            }
            ((float *) mem_212975)[i_225222] = defunc_0_f_res_225232;
            ((float *) mem_212978)[i_225222] = defunc_0_f_res_225227;
        }
        for (int64_t i_225239 = 0; i_225239 < t_n_m_196759; i_225239++) {
            int64_t x_225242;
            
            x_225242 = ((int64_t *) mem_210889.mem)[gtid_207048 * t_n_m_196759 +
                                                    i_225239];
            
            float x_225243;
            
            x_225243 = ((float *) mem_210893.mem)[gtid_207048 * t_n_m_196759 +
                                                  i_225239];
            
            int64_t min_arg_225244 = mul64(jump_t_196702, i_225239);
            int64_t min_res_225245 = smin64(i_196779, min_arg_225244);
            int64_t defunc_0_g_res_225246 = add64((int64_t) 1, min_res_225245);
            float defunc_2_reduce_res_225247;
            float defunc_2_reduce_res_225248;
            float defunc_2_reduce_res_225249;
            float redout_225251;
            float redout_225252;
            float redout_225253;
            
            redout_225251 = 0.0F;
            redout_225252 = 0.0F;
            redout_225253 = 0.0F;
            for (int64_t i_225250 = 0; i_225250 < q_t_196696; i_225250++) {
                bool cond_225254 = sle64(x_199066, i_225250);
                int64_t defunc_0_f_res_225255;
                
                if (cond_225254) {
                    defunc_0_f_res_225255 = (int64_t) 0;
                } else {
                    int64_t i_225256 = add64(x_225242, i_225250);
                    int64_t defunc_0_add_arg_225257;
                    
                    defunc_0_add_arg_225257 =
                        ((int64_t *) mem_210394.mem)[gtid_207048 * n_196692 +
                                                     i_225256];
                    
                    int64_t defunc_1_add_res_225258 = add64((int64_t) 1,
                                                            defunc_0_add_arg_225257);
                    
                    defunc_0_f_res_225255 = defunc_1_add_res_225258;
                }
                
                float defunc_0_f_res_225259;
                
                if (cond_225254) {
                    defunc_0_f_res_225259 = 0.0F;
                } else {
                    int64_t i_225260 = add64(x_225242, i_225250);
                    float defunc_0_add_arg_225261;
                    
                    defunc_0_add_arg_225261 = ((float *) mem_212975)[i_225260];
                    defunc_0_f_res_225259 = defunc_0_add_arg_225261;
                }
                
                int64_t binop_p_225262 = sub64(defunc_0_f_res_225255,
                                               defunc_0_g_res_225246);
                float defunc_0_f_res_225263 = sitofp_i64_f32(binop_p_225262);
                float abs_res_225264 = (float) fabs(defunc_0_f_res_225263);
                float tmp1_225265 = abs_res_225264 / x_225243;
                float x_225266 = tmp1_225265 * tmp1_225265;
                float y_225267 = tmp1_225265 * x_225266;
                float tmp2_225268 = 1.0F - y_225267;
                float x_225269 = tmp2_225268 * tmp2_225268;
                float tmp3_225270 = tmp2_225268 * x_225269;
                float w_j_225271 = defunc_0_f_res_225259 * tmp3_225270;
                float xw_j_225272 = defunc_0_f_res_225263 * w_j_225271;
                float x2w_j_225273 = defunc_0_f_res_225263 * xw_j_225272;
                float defunc_1_op_res_225274 = w_j_225271 + redout_225251;
                float defunc_1_op_res_225275 = xw_j_225272 + redout_225252;
                float defunc_1_op_res_225276 = x2w_j_225273 + redout_225253;
                float redout_tmp_225331 = defunc_1_op_res_225274;
                float redout_tmp_225332 = defunc_1_op_res_225275;
                float redout_tmp_225333 = defunc_1_op_res_225276;
                
                redout_225251 = redout_tmp_225331;
                redout_225252 = redout_tmp_225332;
                redout_225253 = redout_tmp_225333;
            }
            defunc_2_reduce_res_225247 = redout_225251;
            defunc_2_reduce_res_225248 = redout_225252;
            defunc_2_reduce_res_225249 = redout_225253;
            
            float x_225277 = defunc_2_reduce_res_225247 *
                  defunc_2_reduce_res_225249;
            float y_225278 = defunc_2_reduce_res_225248 *
                  defunc_2_reduce_res_225248;
            float y_225279 = x_225277 - y_225278;
            float det1_225280 = 1.0F / y_225279;
            float a11_225281 = defunc_2_reduce_res_225249 * det1_225280;
            float x_225282 = 0.0F - defunc_2_reduce_res_225248;
            float b11_225283 = det1_225280 * x_225282;
            float c11_225284 = defunc_2_reduce_res_225247 * det1_225280;
            float defunc_2_reduce_res_225285;
            float defunc_2_reduce_res_225286;
            float redout_225288;
            float redout_225289;
            
            redout_225288 = 0.0F;
            redout_225289 = 0.0F;
            for (int64_t i_225287 = 0; i_225287 < q_t_196696; i_225287++) {
                bool cond_225290 = sle64(x_199066, i_225287);
                int64_t defunc_0_f_res_225291;
                
                if (cond_225290) {
                    defunc_0_f_res_225291 = (int64_t) 0;
                } else {
                    int64_t i_225292 = add64(x_225242, i_225287);
                    int64_t defunc_0_add_arg_225293;
                    
                    defunc_0_add_arg_225293 =
                        ((int64_t *) mem_210394.mem)[gtid_207048 * n_196692 +
                                                     i_225292];
                    
                    int64_t defunc_1_add_res_225294 = add64((int64_t) 1,
                                                            defunc_0_add_arg_225293);
                    
                    defunc_0_f_res_225291 = defunc_1_add_res_225294;
                }
                
                float defunc_0_f_res_225295;
                
                if (cond_225290) {
                    defunc_0_f_res_225295 = 0.0F;
                } else {
                    int64_t i_225296 = add64(x_225242, i_225287);
                    float defunc_0_add_arg_225297;
                    
                    defunc_0_add_arg_225297 = ((float *) mem_212975)[i_225296];
                    defunc_0_f_res_225295 = defunc_0_add_arg_225297;
                }
                
                int64_t binop_p_225298 = sub64(defunc_0_f_res_225291,
                                               defunc_0_g_res_225246);
                float defunc_0_f_res_225299 = sitofp_i64_f32(binop_p_225298);
                float abs_res_225300 = (float) fabs(defunc_0_f_res_225299);
                float tmp1_225301 = abs_res_225300 / x_225243;
                float x_225302 = tmp1_225301 * tmp1_225301;
                float y_225303 = tmp1_225301 * x_225302;
                float tmp2_225304 = 1.0F - y_225303;
                float x_225305 = tmp2_225304 * tmp2_225304;
                float tmp3_225306 = tmp2_225304 * x_225305;
                float tmp4_225307 = defunc_0_f_res_225295 * tmp3_225306;
                float defunc_1_f_res_225308 = defunc_0_f_res_225299 *
                      tmp4_225307;
                float defunc_0_f_res_225309;
                
                if (cond_225290) {
                    defunc_0_f_res_225309 = 0.0F;
                } else {
                    int64_t i_225310 = add64(x_225242, i_225287);
                    float defunc_0_add_arg_225311;
                    
                    defunc_0_add_arg_225311 = ((float *) mem_212978)[i_225310];
                    defunc_0_f_res_225309 = defunc_0_add_arg_225311;
                }
                
                float x_225312 = a11_225281 * tmp4_225307;
                float y_225313 = b11_225283 * defunc_1_f_res_225308;
                float x_225314 = x_225312 + y_225313;
                float defunc_9_fit_fun_res_225315 = defunc_0_f_res_225309 *
                      x_225314;
                float x_225316 = b11_225283 * tmp4_225307;
                float y_225317 = c11_225284 * defunc_1_f_res_225308;
                float x_225318 = x_225316 + y_225317;
                float defunc_9_slope_fun_res_225319 = defunc_0_f_res_225309 *
                      x_225318;
                float defunc_1_op_res_225320 = defunc_9_fit_fun_res_225315 +
                      redout_225288;
                float defunc_1_op_res_225321 = defunc_9_slope_fun_res_225319 +
                      redout_225289;
                float redout_tmp_225334 = defunc_1_op_res_225320;
                float redout_tmp_225335 = defunc_1_op_res_225321;
                
                redout_225288 = redout_tmp_225334;
                redout_225289 = redout_tmp_225335;
            }
            defunc_2_reduce_res_225285 = redout_225288;
            defunc_2_reduce_res_225286 = redout_225289;
            ((float *) mem_213005)[i_225239] = defunc_2_reduce_res_225285;
            ((float *) mem_213008)[i_225239] = defunc_2_reduce_res_225286;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213036.mem + gtid_207048 * t_n_m_196759 * (int64_t) 4,
                    mem_213005 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213040.mem + gtid_207048 * t_n_m_196759 * (int64_t) 4,
                    mem_213008 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212960);
    free(mem_212975);
    free(mem_212978);
    free(mem_213005);
    free(mem_213008);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229234_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229234_end -
                 futhark_mc_segmap_parloop_229234_start;
        
        ctx->futhark_mc_segmap_parloop_229234_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229234_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229234_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229232(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207047 = tid;
    int num_tasks_225214 = info.nsubtasks;
    struct futhark_mc_task_229231 *futhark_mc_task_229231 =
                                  (struct futhark_mc_task_229231 *) args;
    struct futhark_context *ctx = futhark_mc_task_229231->ctx;
    uint64_t futhark_mc_segmap_task_229232_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229232_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229231->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229231->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229231->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229231->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229231->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229231->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229231->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229231->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229231->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229231->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229231->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229231->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229231->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229231->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229231->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229231->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229231->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229231->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213036 = {.desc ="mem_213036", .mem =
                                  futhark_mc_task_229231->free_mem_213036,
                                  .size =0, .references =NULL};
    struct memblock mem_213040 = {.desc ="mem_213040", .mem =
                                  futhark_mc_task_229231->free_mem_213040,
                                  .size =0, .references =NULL};
    int64_t iter_225215;
    struct futhark_mc_segmap_parloop_struct_229233
    futhark_mc_segmap_parloop_struct_229233;
    
    futhark_mc_segmap_parloop_struct_229233.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229233.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229233.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229233.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229233.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229233.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229233.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229233.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229233.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229233.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229233.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229233.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229233.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229233.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229233.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229233.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229233.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229233.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229233.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229233.free_mem_213036 = mem_213036.mem;
    futhark_mc_segmap_parloop_struct_229233.free_mem_213040 = mem_213040.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229234_task;
    
    futhark_mc_segmap_parloop_229234_task.name =
        "futhark_mc_segmap_parloop_229234";
    futhark_mc_segmap_parloop_229234_task.fn = futhark_mc_segmap_parloop_229234;
    futhark_mc_segmap_parloop_229234_task.args =
        &futhark_mc_segmap_parloop_struct_229233;
    futhark_mc_segmap_parloop_229234_task.iterations = iterations;
    futhark_mc_segmap_parloop_229234_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229234_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229234_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229234_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229234_task);
    
    if (futhark_mc_segmap_parloop_229234_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229234_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229234_total_end -
                 futhark_mc_segmap_parloop_229234_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229234_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229234_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229234_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229232_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229232_end -
                 futhark_mc_segmap_task_229232_start;
        
        ctx->futhark_mc_segmap_task_229232_runs[tid]++;
        ctx->futhark_mc_segmap_task_229232_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229232_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229241 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213036;
    unsigned char *free_mem_213040;
};
struct futhark_mc_task_229248 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212945;
};
struct futhark_mc_segmap_parloop_struct_229250 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_212945;
};
static int futhark_mc_segmap_parloop_229251(void *args, int64_t start,
                                            int64_t end, int flat_tid_225337,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229250
    *futhark_mc_segmap_parloop_struct_229250 =
    (struct futhark_mc_segmap_parloop_struct_229250 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229250->ctx;
    uint64_t futhark_mc_segmap_parloop_229251_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229251_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229250->free_n_196692;
    int64_t gtid_207156 =
            futhark_mc_segmap_parloop_struct_229250->free_gtid_207156;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229250->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229250->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212945 = {.desc ="mem_212945", .mem =
                                  futhark_mc_segmap_parloop_struct_229250->free_mem_212945,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225530 = start;
    
    for (; iter_225530 < end; iter_225530++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225531 = n_196692;
        int64_t gtid_225338 = iter_225530;
        int64_t remnant_225532 = iter_225530 - gtid_225338;
        float x_225339;
        
        x_225339 = ((float *) Y_mem_210354.mem)[gtid_207156 * n_196692 +
                                                gtid_225338];
        
        float x_225340;
        
        x_225340 = ((float *) mem_212862.mem)[gtid_207156 * n_196692 +
                                              gtid_225338];
        
        float defunc_1_f_res_225341 = x_225339 - x_225340;
        
        ((float *) mem_212945.mem)[gtid_225338] = defunc_1_f_res_225341;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229251_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229251_end -
                 futhark_mc_segmap_parloop_229251_start;
        
        ctx->futhark_mc_segmap_parloop_229251_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229251_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229251_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229249(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225337 = tid;
    int num_tasks_225529 = info.nsubtasks;
    struct futhark_mc_task_229248 *futhark_mc_task_229248 =
                                  (struct futhark_mc_task_229248 *) args;
    struct futhark_context *ctx = futhark_mc_task_229248->ctx;
    uint64_t futhark_mc_segmap_task_229249_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229249_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229248->free_n_196692;
    int64_t gtid_207156 = futhark_mc_task_229248->free_gtid_207156;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229248->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229248->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_212945 = {.desc ="mem_212945", .mem =
                                  futhark_mc_task_229248->free_mem_212945,
                                  .size =0, .references =NULL};
    int64_t iter_225530;
    struct futhark_mc_segmap_parloop_struct_229250
    futhark_mc_segmap_parloop_struct_229250;
    
    futhark_mc_segmap_parloop_struct_229250.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229250.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229250.free_gtid_207156 = gtid_207156;
    futhark_mc_segmap_parloop_struct_229250.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229250.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229250.free_mem_212945 = mem_212945.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229251_task;
    
    futhark_mc_segmap_parloop_229251_task.name =
        "futhark_mc_segmap_parloop_229251";
    futhark_mc_segmap_parloop_229251_task.fn = futhark_mc_segmap_parloop_229251;
    futhark_mc_segmap_parloop_229251_task.args =
        &futhark_mc_segmap_parloop_struct_229250;
    futhark_mc_segmap_parloop_229251_task.iterations = iterations;
    futhark_mc_segmap_parloop_229251_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229251_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229251_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229251_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229251_task);
    
    if (futhark_mc_segmap_parloop_229251_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229251_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229251_total_end -
                 futhark_mc_segmap_parloop_229251_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229251_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229251_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229251_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229249_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229249_end -
                 futhark_mc_segmap_task_229249_start;
        
        ctx->futhark_mc_segmap_task_229249_runs[tid]++;
        ctx->futhark_mc_segmap_task_229249_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229249_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229252 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212945;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
};
struct futhark_mc_segmap_parloop_struct_229254 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_212945;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
};
static int futhark_mc_segmap_parloop_229255(void *args, int64_t start,
                                            int64_t end, int flat_tid_225342,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229254
    *futhark_mc_segmap_parloop_struct_229254 =
    (struct futhark_mc_segmap_parloop_struct_229254 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229254->ctx;
    uint64_t futhark_mc_segmap_parloop_229255_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229255_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229254->free_n_196692;
    int64_t gtid_207156 =
            futhark_mc_segmap_parloop_struct_229254->free_gtid_207156;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229254->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229254->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229254->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229254->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229254->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212945 = {.desc ="mem_212945", .mem =
                                  futhark_mc_segmap_parloop_struct_229254->free_mem_212945,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_segmap_parloop_struct_229254->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_segmap_parloop_struct_229254->free_mem_212951,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225534 = start;
    
    for (; iter_225534 < end; iter_225534++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225543 = n_196692;
        int64_t gtid_225343 = iter_225534;
        int64_t remnant_225544 = iter_225534 - gtid_225343;
        int64_t x_225344;
        
        x_225344 = ((int64_t *) mem_210394.mem)[gtid_207156 * n_196692 +
                                                gtid_225343];
        
        bool cond_225345 = sle64((int64_t) 0, x_225344);
        float defunc_0_f_res_225346;
        
        if (cond_225345) {
            bool y_225535 = slt64(x_225344, n_196692);
            bool bounds_check_225536 = cond_225345 && y_225535;
            bool index_certs_225537;
            
            if (!bounds_check_225536) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_225344,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_225538;
            
            defunc_0_f_res_t_res_225538 = ((float *) mem_212945.mem)[x_225344];
            defunc_0_f_res_225346 = defunc_0_f_res_t_res_225538;
        } else {
            defunc_0_f_res_225346 = 0.0F;
        }
        
        float defunc_0_f_res_225351;
        
        if (cond_225345) {
            bool y_225539 = slt64(x_225344, n_196692);
            bool bounds_check_225540 = cond_225345 && y_225539;
            bool index_certs_225541;
            
            if (!bounds_check_225540) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_225344,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_225542;
            
            defunc_0_f_res_t_res_225542 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_207156 *
                                                  ctx_param_ext_210921 +
                                                  x_225344 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_225351 = defunc_0_f_res_t_res_225542;
        } else {
            defunc_0_f_res_225351 = 0.0F;
        }
        ((float *) mem_212948.mem)[gtid_225343] = defunc_0_f_res_225351;
        ((float *) mem_212951.mem)[gtid_225343] = defunc_0_f_res_225346;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229255_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229255_end -
                 futhark_mc_segmap_parloop_229255_start;
        
        ctx->futhark_mc_segmap_parloop_229255_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229255_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229255_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229253(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225342 = tid;
    int num_tasks_225533 = info.nsubtasks;
    struct futhark_mc_task_229252 *futhark_mc_task_229252 =
                                  (struct futhark_mc_task_229252 *) args;
    struct futhark_context *ctx = futhark_mc_task_229252->ctx;
    uint64_t futhark_mc_segmap_task_229253_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229253_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229252->free_n_196692;
    int64_t gtid_207156 = futhark_mc_task_229252->free_gtid_207156;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229252->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229252->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229252->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229252->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229252->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_212945 = {.desc ="mem_212945", .mem =
                                  futhark_mc_task_229252->free_mem_212945,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_task_229252->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_task_229252->free_mem_212951,
                                  .size =0, .references =NULL};
    int64_t iter_225534;
    struct futhark_mc_segmap_parloop_struct_229254
    futhark_mc_segmap_parloop_struct_229254;
    
    futhark_mc_segmap_parloop_struct_229254.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229254.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229254.free_gtid_207156 = gtid_207156;
    futhark_mc_segmap_parloop_struct_229254.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229254.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229254.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229254.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229254.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229254.free_mem_212945 = mem_212945.mem;
    futhark_mc_segmap_parloop_struct_229254.free_mem_212948 = mem_212948.mem;
    futhark_mc_segmap_parloop_struct_229254.free_mem_212951 = mem_212951.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229255_task;
    
    futhark_mc_segmap_parloop_229255_task.name =
        "futhark_mc_segmap_parloop_229255";
    futhark_mc_segmap_parloop_229255_task.fn = futhark_mc_segmap_parloop_229255;
    futhark_mc_segmap_parloop_229255_task.args =
        &futhark_mc_segmap_parloop_struct_229254;
    futhark_mc_segmap_parloop_229255_task.iterations = iterations;
    futhark_mc_segmap_parloop_229255_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229255_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229255_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229255_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229255_task);
    
    if (futhark_mc_segmap_parloop_229255_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229255_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229255_total_end -
                 futhark_mc_segmap_parloop_229255_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229255_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229255_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229255_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229253_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229253_end -
                 futhark_mc_segmap_task_229253_start;
        
        ctx->futhark_mc_segmap_task_229253_runs[tid]++;
        ctx->futhark_mc_segmap_task_229253_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229253_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229256 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
    unsigned char *free_mem_212954;
    unsigned char *free_mem_212957;
};
struct futhark_mc_segmap_parloop_struct_229258 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
    unsigned char *free_mem_212954;
    unsigned char *free_mem_212957;
};
static int futhark_mc_segmap_parloop_229259(void *args, int64_t start,
                                            int64_t end, int flat_tid_225445,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229258
    *futhark_mc_segmap_parloop_struct_229258 =
    (struct futhark_mc_segmap_parloop_struct_229258 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229258->ctx;
    uint64_t futhark_mc_segmap_parloop_229259_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229259_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229258->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229258->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229258->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229258->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229258->free_i_196779;
    int64_t gtid_207156 =
            futhark_mc_segmap_parloop_struct_229258->free_gtid_207156;
    int64_t x_207161 = futhark_mc_segmap_parloop_struct_229258->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_212951,
                                  .size =0, .references =NULL};
    struct memblock mem_212954 = {.desc ="mem_212954", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_212954,
                                  .size =0, .references =NULL};
    struct memblock mem_212957 = {.desc ="mem_212957", .mem =
                                  futhark_mc_segmap_parloop_struct_229258->free_mem_212957,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225546 = start;
    
    for (; iter_225546 < end; iter_225546++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225609 = t_n_m_196759;
        int64_t gtid_225446 = iter_225546;
        int64_t remnant_225610 = iter_225546 - gtid_225446;
        int64_t x_225447;
        
        x_225447 = ((int64_t *) mem_210889.mem)[gtid_207156 * t_n_m_196759 +
                                                gtid_225446];
        
        float x_225448;
        
        x_225448 = ((float *) mem_210893.mem)[gtid_207156 * t_n_m_196759 +
                                              gtid_225446];
        
        int64_t min_arg_225449 = mul64(jump_t_196702, gtid_225446);
        int64_t min_res_225450 = smin64(i_196779, min_arg_225449);
        int64_t defunc_0_g_res_225451 = add64((int64_t) 1, min_res_225450);
        float defunc_2_reduce_res_225452;
        float defunc_2_reduce_res_225453;
        float defunc_2_reduce_res_225454;
        float redout_225548;
        float redout_225549;
        float redout_225550;
        
        redout_225548 = 0.0F;
        redout_225549 = 0.0F;
        redout_225550 = 0.0F;
        for (int64_t i_225547 = 0; i_225547 < q_t_196696; i_225547++) {
            bool cond_225551 = sle64(x_207161, i_225547);
            int64_t defunc_0_f_res_225552;
            
            if (cond_225551) {
                defunc_0_f_res_225552 = (int64_t) 0;
            } else {
                int64_t i_225553 = add64(x_225447, i_225547);
                int64_t defunc_0_add_arg_225554;
                
                defunc_0_add_arg_225554 =
                    ((int64_t *) mem_210394.mem)[gtid_207156 * n_196692 +
                                                 i_225553];
                
                int64_t defunc_1_add_res_225555 = add64((int64_t) 1,
                                                        defunc_0_add_arg_225554);
                
                defunc_0_f_res_225552 = defunc_1_add_res_225555;
            }
            
            float defunc_0_f_res_225556;
            
            if (cond_225551) {
                defunc_0_f_res_225556 = 0.0F;
            } else {
                int64_t i_225557 = add64(x_225447, i_225547);
                float defunc_0_add_arg_225558;
                
                defunc_0_add_arg_225558 = ((float *) mem_212948.mem)[i_225557];
                defunc_0_f_res_225556 = defunc_0_add_arg_225558;
            }
            
            int64_t binop_p_225559 = sub64(defunc_0_f_res_225552,
                                           defunc_0_g_res_225451);
            float defunc_0_f_res_225560 = sitofp_i64_f32(binop_p_225559);
            float abs_res_225561 = (float) fabs(defunc_0_f_res_225560);
            float tmp1_225562 = abs_res_225561 / x_225448;
            float x_225563 = tmp1_225562 * tmp1_225562;
            float y_225564 = tmp1_225562 * x_225563;
            float tmp2_225565 = 1.0F - y_225564;
            float x_225566 = tmp2_225565 * tmp2_225565;
            float tmp3_225567 = tmp2_225565 * x_225566;
            float w_j_225568 = defunc_0_f_res_225556 * tmp3_225567;
            float xw_j_225569 = defunc_0_f_res_225560 * w_j_225568;
            float x2w_j_225570 = defunc_0_f_res_225560 * xw_j_225569;
            float defunc_1_op_res_225571 = w_j_225568 + redout_225548;
            float defunc_1_op_res_225572 = xw_j_225569 + redout_225549;
            float defunc_1_op_res_225573 = x2w_j_225570 + redout_225550;
            float redout_tmp_225611 = defunc_1_op_res_225571;
            float redout_tmp_225612 = defunc_1_op_res_225572;
            float redout_tmp_225613 = defunc_1_op_res_225573;
            
            redout_225548 = redout_tmp_225611;
            redout_225549 = redout_tmp_225612;
            redout_225550 = redout_tmp_225613;
        }
        defunc_2_reduce_res_225452 = redout_225548;
        defunc_2_reduce_res_225453 = redout_225549;
        defunc_2_reduce_res_225454 = redout_225550;
        
        float x_225482 = defunc_2_reduce_res_225452 *
              defunc_2_reduce_res_225454;
        float y_225483 = defunc_2_reduce_res_225453 *
              defunc_2_reduce_res_225453;
        float y_225484 = x_225482 - y_225483;
        float det1_225485 = 1.0F / y_225484;
        float a11_225486 = defunc_2_reduce_res_225454 * det1_225485;
        float x_225487 = 0.0F - defunc_2_reduce_res_225453;
        float b11_225488 = det1_225485 * x_225487;
        float c11_225489 = defunc_2_reduce_res_225452 * det1_225485;
        float defunc_2_reduce_res_225490;
        float defunc_2_reduce_res_225491;
        float redout_225575;
        float redout_225576;
        
        redout_225575 = 0.0F;
        redout_225576 = 0.0F;
        for (int64_t i_225574 = 0; i_225574 < q_t_196696; i_225574++) {
            bool cond_225577 = sle64(x_207161, i_225574);
            int64_t defunc_0_f_res_225578;
            
            if (cond_225577) {
                defunc_0_f_res_225578 = (int64_t) 0;
            } else {
                int64_t i_225579 = add64(x_225447, i_225574);
                int64_t defunc_0_add_arg_225580;
                
                defunc_0_add_arg_225580 =
                    ((int64_t *) mem_210394.mem)[gtid_207156 * n_196692 +
                                                 i_225579];
                
                int64_t defunc_1_add_res_225581 = add64((int64_t) 1,
                                                        defunc_0_add_arg_225580);
                
                defunc_0_f_res_225578 = defunc_1_add_res_225581;
            }
            
            float defunc_0_f_res_225582;
            
            if (cond_225577) {
                defunc_0_f_res_225582 = 0.0F;
            } else {
                int64_t i_225583 = add64(x_225447, i_225574);
                float defunc_0_add_arg_225584;
                
                defunc_0_add_arg_225584 = ((float *) mem_212948.mem)[i_225583];
                defunc_0_f_res_225582 = defunc_0_add_arg_225584;
            }
            
            int64_t binop_p_225585 = sub64(defunc_0_f_res_225578,
                                           defunc_0_g_res_225451);
            float defunc_0_f_res_225586 = sitofp_i64_f32(binop_p_225585);
            float abs_res_225587 = (float) fabs(defunc_0_f_res_225586);
            float tmp1_225588 = abs_res_225587 / x_225448;
            float x_225589 = tmp1_225588 * tmp1_225588;
            float y_225590 = tmp1_225588 * x_225589;
            float tmp2_225591 = 1.0F - y_225590;
            float x_225592 = tmp2_225591 * tmp2_225591;
            float tmp3_225593 = tmp2_225591 * x_225592;
            float tmp4_225594 = defunc_0_f_res_225582 * tmp3_225593;
            float defunc_1_f_res_225595 = defunc_0_f_res_225586 * tmp4_225594;
            float defunc_0_f_res_225596;
            
            if (cond_225577) {
                defunc_0_f_res_225596 = 0.0F;
            } else {
                int64_t i_225597 = add64(x_225447, i_225574);
                float defunc_0_add_arg_225598;
                
                defunc_0_add_arg_225598 = ((float *) mem_212951.mem)[i_225597];
                defunc_0_f_res_225596 = defunc_0_add_arg_225598;
            }
            
            float x_225599 = a11_225486 * tmp4_225594;
            float y_225600 = b11_225488 * defunc_1_f_res_225595;
            float x_225601 = x_225599 + y_225600;
            float defunc_9_fit_fun_res_225602 = defunc_0_f_res_225596 *
                  x_225601;
            float x_225603 = b11_225488 * tmp4_225594;
            float y_225604 = c11_225489 * defunc_1_f_res_225595;
            float x_225605 = x_225603 + y_225604;
            float defunc_9_slope_fun_res_225606 = defunc_0_f_res_225596 *
                  x_225605;
            float defunc_1_op_res_225607 = defunc_9_fit_fun_res_225602 +
                  redout_225575;
            float defunc_1_op_res_225608 = defunc_9_slope_fun_res_225606 +
                  redout_225576;
            float redout_tmp_225614 = defunc_1_op_res_225607;
            float redout_tmp_225615 = defunc_1_op_res_225608;
            
            redout_225575 = redout_tmp_225614;
            redout_225576 = redout_tmp_225615;
        }
        defunc_2_reduce_res_225490 = redout_225575;
        defunc_2_reduce_res_225491 = redout_225576;
        ((float *) mem_212954.mem)[gtid_225446] = defunc_2_reduce_res_225490;
        ((float *) mem_212957.mem)[gtid_225446] = defunc_2_reduce_res_225491;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229259_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229259_end -
                 futhark_mc_segmap_parloop_229259_start;
        
        ctx->futhark_mc_segmap_parloop_229259_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229259_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229259_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229257(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225445 = tid;
    int num_tasks_225545 = info.nsubtasks;
    struct futhark_mc_task_229256 *futhark_mc_task_229256 =
                                  (struct futhark_mc_task_229256 *) args;
    struct futhark_context *ctx = futhark_mc_task_229256->ctx;
    uint64_t futhark_mc_segmap_task_229257_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229257_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229256->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229256->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229256->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229256->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229256->free_i_196779;
    int64_t gtid_207156 = futhark_mc_task_229256->free_gtid_207156;
    int64_t x_207161 = futhark_mc_task_229256->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229256->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229256->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229256->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_task_229256->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_task_229256->free_mem_212951,
                                  .size =0, .references =NULL};
    struct memblock mem_212954 = {.desc ="mem_212954", .mem =
                                  futhark_mc_task_229256->free_mem_212954,
                                  .size =0, .references =NULL};
    struct memblock mem_212957 = {.desc ="mem_212957", .mem =
                                  futhark_mc_task_229256->free_mem_212957,
                                  .size =0, .references =NULL};
    int64_t iter_225546;
    struct futhark_mc_segmap_parloop_struct_229258
    futhark_mc_segmap_parloop_struct_229258;
    
    futhark_mc_segmap_parloop_struct_229258.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229258.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229258.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229258.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229258.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229258.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229258.free_gtid_207156 = gtid_207156;
    futhark_mc_segmap_parloop_struct_229258.free_x_207161 = x_207161;
    futhark_mc_segmap_parloop_struct_229258.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229258.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229258.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229258.free_mem_212948 = mem_212948.mem;
    futhark_mc_segmap_parloop_struct_229258.free_mem_212951 = mem_212951.mem;
    futhark_mc_segmap_parloop_struct_229258.free_mem_212954 = mem_212954.mem;
    futhark_mc_segmap_parloop_struct_229258.free_mem_212957 = mem_212957.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229259_task;
    
    futhark_mc_segmap_parloop_229259_task.name =
        "futhark_mc_segmap_parloop_229259";
    futhark_mc_segmap_parloop_229259_task.fn = futhark_mc_segmap_parloop_229259;
    futhark_mc_segmap_parloop_229259_task.args =
        &futhark_mc_segmap_parloop_struct_229258;
    futhark_mc_segmap_parloop_229259_task.iterations = iterations;
    futhark_mc_segmap_parloop_229259_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229259_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229259_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229259_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229259_task);
    
    if (futhark_mc_segmap_parloop_229259_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229259_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229259_total_end -
                 futhark_mc_segmap_parloop_229259_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229259_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229259_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229259_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229257_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229257_end -
                 futhark_mc_segmap_task_229257_start;
        
        ctx->futhark_mc_segmap_task_229257_runs[tid]++;
        ctx->futhark_mc_segmap_task_229257_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229257_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229261 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
    unsigned char *free_mem_212954;
    unsigned char *free_mem_212957;
};
struct futhark_mc_task_229263 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212948;
    int64_t free_x_225358;
    float free_x_225359;
    int64_t free_defunc_0_g_res_225362;
    float *retval_defunc_2_reduce_res_225363;
    float *retval_defunc_2_reduce_res_225364;
    float *retval_defunc_2_reduce_res_225365;
};
struct futhark_mc_segred_stage_1_parloop_struct_229268 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212948;
    int64_t free_x_225358;
    float free_x_225359;
    int64_t free_defunc_0_g_res_225362;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225689;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225691;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225693;
};
static int futhark_mc_segred_stage_1_parloop_229269(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_225617,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229268
    *futhark_mc_segred_stage_1_parloop_struct_229268 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229268 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229268->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229269_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229269_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229268->free_n_196692;
    int64_t gtid_207156 =
            futhark_mc_segred_stage_1_parloop_struct_229268->free_gtid_207156;
    int64_t x_207161 =
            futhark_mc_segred_stage_1_parloop_struct_229268->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229268->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229268->free_mem_212948,
                                  .size =0, .references =NULL};
    int64_t x_225358 =
            futhark_mc_segred_stage_1_parloop_struct_229268->free_x_225358;
    float x_225359 =
          futhark_mc_segred_stage_1_parloop_struct_229268->free_x_225359;
    int64_t defunc_0_g_res_225362 =
            futhark_mc_segred_stage_1_parloop_struct_229268->free_defunc_0_g_res_225362;
    struct memblock reduce_stage_1_tid_res_arr_mem_225689 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225689",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229268->free_reduce_stage_1_tid_res_arr_mem_225689,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_225691 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225691",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229268->free_reduce_stage_1_tid_res_arr_mem_225691,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_225693 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225693",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229268->free_reduce_stage_1_tid_res_arr_mem_225693,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225695 = start;
    float x_225619;
    float x_225620;
    float x_225622;
    float x_225623;
    float x_225625;
    float x_225626;
    float local_acc_225696 = 0.0F;
    float local_acc_225697 = 0.0F;
    float local_acc_225698 = 0.0F;
    
    for (; iter_225695 < end; iter_225695++) {
        int64_t gtid_225618 = iter_225695;
        bool cond_225628 = sle64(x_207161, gtid_225618);
        int64_t defunc_0_f_res_225629;
        
        if (cond_225628) {
            defunc_0_f_res_225629 = (int64_t) 0;
        } else {
            int64_t i_225630 = add64(x_225358, gtid_225618);
            int64_t defunc_0_add_arg_225631;
            
            defunc_0_add_arg_225631 = ((int64_t *) mem_210394.mem)[gtid_207156 *
                                                                   n_196692 +
                                                                   i_225630];
            
            int64_t defunc_1_add_res_225632 = add64((int64_t) 1,
                                                    defunc_0_add_arg_225631);
            
            defunc_0_f_res_225629 = defunc_1_add_res_225632;
        }
        
        float defunc_0_f_res_225633;
        
        if (cond_225628) {
            defunc_0_f_res_225633 = 0.0F;
        } else {
            int64_t i_225634 = add64(x_225358, gtid_225618);
            float defunc_0_add_arg_225635;
            
            defunc_0_add_arg_225635 = ((float *) mem_212948.mem)[i_225634];
            defunc_0_f_res_225633 = defunc_0_add_arg_225635;
        }
        
        int64_t binop_p_225636 = sub64(defunc_0_f_res_225629,
                                       defunc_0_g_res_225362);
        float defunc_0_f_res_225637 = sitofp_i64_f32(binop_p_225636);
        float abs_res_225638 = (float) fabs(defunc_0_f_res_225637);
        float tmp1_225639 = abs_res_225638 / x_225359;
        float x_225640 = tmp1_225639 * tmp1_225639;
        float y_225641 = tmp1_225639 * x_225640;
        float tmp2_225642 = 1.0F - y_225641;
        float x_225643 = tmp2_225642 * tmp2_225642;
        float tmp3_225644 = tmp2_225642 * x_225643;
        float w_j_225645 = defunc_0_f_res_225633 * tmp3_225644;
        float xw_j_225646 = defunc_0_f_res_225637 * w_j_225645;
        float x2w_j_225647 = defunc_0_f_res_225637 * xw_j_225646;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_225619 = local_acc_225696;
        }
        // Load next params
        {
            x_225620 = w_j_225645;
        }
        // Red body
        {
            float defunc_1_op_res_225621 = x_225619 + x_225620;
            
            local_acc_225696 = defunc_1_op_res_225621;
        }
        // Load accum params
        {
            x_225622 = local_acc_225697;
        }
        // Load next params
        {
            x_225623 = xw_j_225646;
        }
        // Red body
        {
            float defunc_1_op_res_225624 = x_225622 + x_225623;
            
            local_acc_225697 = defunc_1_op_res_225624;
        }
        // Load accum params
        {
            x_225625 = local_acc_225698;
        }
        // Load next params
        {
            x_225626 = x2w_j_225647;
        }
        // Red body
        {
            float defunc_1_op_res_225627 = x_225625 + x_225626;
            
            local_acc_225698 = defunc_1_op_res_225627;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_225689.mem)[flat_tid_225617] =
        local_acc_225696;
    ((float *) reduce_stage_1_tid_res_arr_mem_225691.mem)[flat_tid_225617] =
        local_acc_225697;
    ((float *) reduce_stage_1_tid_res_arr_mem_225693.mem)[flat_tid_225617] =
        local_acc_225698;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229269_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229269_end -
                 futhark_mc_segred_stage_1_parloop_229269_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229269_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229269_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229269_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229264(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225617 = tid;
    int num_tasks_225688 = info.nsubtasks;
    struct futhark_mc_task_229263 *futhark_mc_task_229263 =
                                  (struct futhark_mc_task_229263 *) args;
    struct futhark_context *ctx = futhark_mc_task_229263->ctx;
    uint64_t futhark_mc_segred_task_229264_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229264_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229263->free_n_196692;
    int64_t gtid_207156 = futhark_mc_task_229263->free_gtid_207156;
    int64_t x_207161 = futhark_mc_task_229263->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229263->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_task_229263->free_mem_212948,
                                  .size =0, .references =NULL};
    int64_t x_225358 = futhark_mc_task_229263->free_x_225358;
    float x_225359 = futhark_mc_task_229263->free_x_225359;
    int64_t defunc_0_g_res_225362 =
            futhark_mc_task_229263->free_defunc_0_g_res_225362;
    float defunc_2_reduce_res_225363 =
          *futhark_mc_task_229263->retval_defunc_2_reduce_res_225363;
    float defunc_2_reduce_res_225364 =
          *futhark_mc_task_229263->retval_defunc_2_reduce_res_225364;
    float defunc_2_reduce_res_225365 =
          *futhark_mc_task_229263->retval_defunc_2_reduce_res_225365;
    size_t reduce_stage_1_tid_res_arr_mem_225689_cached_sizze_229265 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225689 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_225691_cached_sizze_229266 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225691 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_225693_cached_sizze_229267 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225693 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_225689_cached_sizze_229265 <
        (size_t) ((int64_t) 4 * num_tasks_225688)) {
        reduce_stage_1_tid_res_arr_mem_225689 =
            realloc(reduce_stage_1_tid_res_arr_mem_225689, (int64_t) 4 *
                    num_tasks_225688);
        reduce_stage_1_tid_res_arr_mem_225689_cached_sizze_229265 =
            (int64_t) 4 * num_tasks_225688;
    }
    if (reduce_stage_1_tid_res_arr_mem_225691_cached_sizze_229266 <
        (size_t) ((int64_t) 4 * num_tasks_225688)) {
        reduce_stage_1_tid_res_arr_mem_225691 =
            realloc(reduce_stage_1_tid_res_arr_mem_225691, (int64_t) 4 *
                    num_tasks_225688);
        reduce_stage_1_tid_res_arr_mem_225691_cached_sizze_229266 =
            (int64_t) 4 * num_tasks_225688;
    }
    if (reduce_stage_1_tid_res_arr_mem_225693_cached_sizze_229267 <
        (size_t) ((int64_t) 4 * num_tasks_225688)) {
        reduce_stage_1_tid_res_arr_mem_225693 =
            realloc(reduce_stage_1_tid_res_arr_mem_225693, (int64_t) 4 *
                    num_tasks_225688);
        reduce_stage_1_tid_res_arr_mem_225693_cached_sizze_229267 =
            (int64_t) 4 * num_tasks_225688;
    }
    
    int64_t iter_225695;
    struct futhark_mc_segred_stage_1_parloop_struct_229268
    futhark_mc_segred_stage_1_parloop_struct_229268;
    
    futhark_mc_segred_stage_1_parloop_struct_229268.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_gtid_207156 =
        gtid_207156;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_x_207161 = x_207161;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_mem_212948 =
        mem_212948.mem;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_x_225358 = x_225358;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_x_225359 = x_225359;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_defunc_0_g_res_225362 =
        defunc_0_g_res_225362;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_reduce_stage_1_tid_res_arr_mem_225689 =
        reduce_stage_1_tid_res_arr_mem_225689;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_reduce_stage_1_tid_res_arr_mem_225691 =
        reduce_stage_1_tid_res_arr_mem_225691;
    futhark_mc_segred_stage_1_parloop_struct_229268.free_reduce_stage_1_tid_res_arr_mem_225693 =
        reduce_stage_1_tid_res_arr_mem_225693;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229269_task;
    
    futhark_mc_segred_stage_1_parloop_229269_task.name =
        "futhark_mc_segred_stage_1_parloop_229269";
    futhark_mc_segred_stage_1_parloop_229269_task.fn =
        futhark_mc_segred_stage_1_parloop_229269;
    futhark_mc_segred_stage_1_parloop_229269_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229268;
    futhark_mc_segred_stage_1_parloop_229269_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229269_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229269_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229269_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229269_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229269_task);
    
    if (futhark_mc_segred_stage_1_parloop_229269_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229269_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229269_total_end -
                 futhark_mc_segred_stage_1_parloop_229269_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229269_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229269_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229269_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_225363 = 0.0F;
        defunc_2_reduce_res_225364 = 0.0F;
        defunc_2_reduce_res_225365 = 0.0F;
    }
    
    float x_225699;
    float x_225700;
    float x_225702;
    float x_225703;
    float x_225705;
    float x_225706;
    
    for (int32_t i_225708 = 0; i_225708 < num_tasks_225688; i_225708++) {
        flat_tid_225617 = i_225708;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_225699 = defunc_2_reduce_res_225363;
            }
            // load next params
            {
                x_225700 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225689)[flat_tid_225617];
            }
            // red body
            {
                float defunc_1_op_res_225701 = x_225699 + x_225700;
                
                defunc_2_reduce_res_225363 = defunc_1_op_res_225701;
            }
            // load acc params
            {
                x_225702 = defunc_2_reduce_res_225364;
            }
            // load next params
            {
                x_225703 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225691)[flat_tid_225617];
            }
            // red body
            {
                float defunc_1_op_res_225704 = x_225702 + x_225703;
                
                defunc_2_reduce_res_225364 = defunc_1_op_res_225704;
            }
            // load acc params
            {
                x_225705 = defunc_2_reduce_res_225365;
            }
            // load next params
            {
                x_225706 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225693)[flat_tid_225617];
            }
            // red body
            {
                float defunc_1_op_res_225707 = x_225705 + x_225706;
                
                defunc_2_reduce_res_225365 = defunc_1_op_res_225707;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_225689);
        free(reduce_stage_1_tid_res_arr_mem_225691);
        free(reduce_stage_1_tid_res_arr_mem_225693);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229264_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229264_end -
                 futhark_mc_segred_task_229264_start;
        
        ctx->futhark_mc_segred_task_229264_runs[tid]++;
        ctx->futhark_mc_segred_task_229264_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229264_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229263->retval_defunc_2_reduce_res_225363 =
            defunc_2_reduce_res_225363;
        *futhark_mc_task_229263->retval_defunc_2_reduce_res_225364 =
            defunc_2_reduce_res_225364;
        *futhark_mc_task_229263->retval_defunc_2_reduce_res_225365 =
            defunc_2_reduce_res_225365;
    }
    return err;
}
struct futhark_mc_task_229270 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
    int64_t free_x_225358;
    float free_x_225359;
    int64_t free_defunc_0_g_res_225362;
    float free_a11_225401;
    float free_b11_225403;
    float free_c11_225404;
    float *retval_defunc_2_reduce_res_225405;
    float *retval_defunc_2_reduce_res_225406;
};
struct futhark_mc_segred_stage_1_parloop_struct_229274 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207156;
    int64_t free_x_207161;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_212948;
    unsigned char *free_mem_212951;
    int64_t free_x_225358;
    float free_x_225359;
    int64_t free_defunc_0_g_res_225362;
    float free_a11_225401;
    float free_b11_225403;
    float free_c11_225404;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225710;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_225712;
};
static int futhark_mc_segred_stage_1_parloop_229275(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_225648,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229274
    *futhark_mc_segred_stage_1_parloop_struct_229274 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229274 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229274->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229275_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229275_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229274->free_n_196692;
    int64_t gtid_207156 =
            futhark_mc_segred_stage_1_parloop_struct_229274->free_gtid_207156;
    int64_t x_207161 =
            futhark_mc_segred_stage_1_parloop_struct_229274->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229274->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229274->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229274->free_mem_212951,
                                  .size =0, .references =NULL};
    int64_t x_225358 =
            futhark_mc_segred_stage_1_parloop_struct_229274->free_x_225358;
    float x_225359 =
          futhark_mc_segred_stage_1_parloop_struct_229274->free_x_225359;
    int64_t defunc_0_g_res_225362 =
            futhark_mc_segred_stage_1_parloop_struct_229274->free_defunc_0_g_res_225362;
    float a11_225401 =
          futhark_mc_segred_stage_1_parloop_struct_229274->free_a11_225401;
    float b11_225403 =
          futhark_mc_segred_stage_1_parloop_struct_229274->free_b11_225403;
    float c11_225404 =
          futhark_mc_segred_stage_1_parloop_struct_229274->free_c11_225404;
    struct memblock reduce_stage_1_tid_res_arr_mem_225710 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225710",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229274->free_reduce_stage_1_tid_res_arr_mem_225710,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_225712 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_225712",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229274->free_reduce_stage_1_tid_res_arr_mem_225712,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225714 = start;
    float x_225650;
    float x_225651;
    float x_225653;
    float x_225654;
    float local_acc_225715 = 0.0F;
    float local_acc_225716 = 0.0F;
    
    for (; iter_225714 < end; iter_225714++) {
        int64_t gtid_225649 = iter_225714;
        bool cond_225656 = sle64(x_207161, gtid_225649);
        int64_t defunc_0_f_res_225657;
        
        if (cond_225656) {
            defunc_0_f_res_225657 = (int64_t) 0;
        } else {
            int64_t i_225658 = add64(x_225358, gtid_225649);
            int64_t defunc_0_add_arg_225659;
            
            defunc_0_add_arg_225659 = ((int64_t *) mem_210394.mem)[gtid_207156 *
                                                                   n_196692 +
                                                                   i_225658];
            
            int64_t defunc_1_add_res_225660 = add64((int64_t) 1,
                                                    defunc_0_add_arg_225659);
            
            defunc_0_f_res_225657 = defunc_1_add_res_225660;
        }
        
        float defunc_0_f_res_225661;
        
        if (cond_225656) {
            defunc_0_f_res_225661 = 0.0F;
        } else {
            int64_t i_225662 = add64(x_225358, gtid_225649);
            float defunc_0_add_arg_225663;
            
            defunc_0_add_arg_225663 = ((float *) mem_212948.mem)[i_225662];
            defunc_0_f_res_225661 = defunc_0_add_arg_225663;
        }
        
        int64_t binop_p_225664 = sub64(defunc_0_f_res_225657,
                                       defunc_0_g_res_225362);
        float defunc_0_f_res_225665 = sitofp_i64_f32(binop_p_225664);
        float abs_res_225666 = (float) fabs(defunc_0_f_res_225665);
        float tmp1_225667 = abs_res_225666 / x_225359;
        float x_225668 = tmp1_225667 * tmp1_225667;
        float y_225669 = tmp1_225667 * x_225668;
        float tmp2_225670 = 1.0F - y_225669;
        float x_225671 = tmp2_225670 * tmp2_225670;
        float tmp3_225672 = tmp2_225670 * x_225671;
        float tmp4_225673 = defunc_0_f_res_225661 * tmp3_225672;
        float defunc_1_f_res_225674 = defunc_0_f_res_225665 * tmp4_225673;
        float defunc_0_f_res_225675;
        
        if (cond_225656) {
            defunc_0_f_res_225675 = 0.0F;
        } else {
            int64_t i_225676 = add64(x_225358, gtid_225649);
            float defunc_0_add_arg_225677;
            
            defunc_0_add_arg_225677 = ((float *) mem_212951.mem)[i_225676];
            defunc_0_f_res_225675 = defunc_0_add_arg_225677;
        }
        
        float x_225678 = a11_225401 * tmp4_225673;
        float y_225679 = b11_225403 * defunc_1_f_res_225674;
        float x_225680 = x_225678 + y_225679;
        float defunc_9_fit_fun_res_225681 = defunc_0_f_res_225675 * x_225680;
        float x_225682 = b11_225403 * tmp4_225673;
        float y_225683 = c11_225404 * defunc_1_f_res_225674;
        float x_225684 = x_225682 + y_225683;
        float defunc_9_slope_fun_res_225685 = defunc_0_f_res_225675 * x_225684;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_225650 = local_acc_225715;
        }
        // Load next params
        {
            x_225651 = defunc_9_fit_fun_res_225681;
        }
        // Red body
        {
            float defunc_1_op_res_225652 = x_225650 + x_225651;
            
            local_acc_225715 = defunc_1_op_res_225652;
        }
        // Load accum params
        {
            x_225653 = local_acc_225716;
        }
        // Load next params
        {
            x_225654 = defunc_9_slope_fun_res_225685;
        }
        // Red body
        {
            float defunc_1_op_res_225655 = x_225653 + x_225654;
            
            local_acc_225716 = defunc_1_op_res_225655;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_225710.mem)[flat_tid_225648] =
        local_acc_225715;
    ((float *) reduce_stage_1_tid_res_arr_mem_225712.mem)[flat_tid_225648] =
        local_acc_225716;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229275_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229275_end -
                 futhark_mc_segred_stage_1_parloop_229275_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229275_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229275_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229275_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229271(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225648 = tid;
    int num_tasks_225709 = info.nsubtasks;
    struct futhark_mc_task_229270 *futhark_mc_task_229270 =
                                  (struct futhark_mc_task_229270 *) args;
    struct futhark_context *ctx = futhark_mc_task_229270->ctx;
    uint64_t futhark_mc_segred_task_229271_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229271_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229270->free_n_196692;
    int64_t gtid_207156 = futhark_mc_task_229270->free_gtid_207156;
    int64_t x_207161 = futhark_mc_task_229270->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229270->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_task_229270->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_task_229270->free_mem_212951,
                                  .size =0, .references =NULL};
    int64_t x_225358 = futhark_mc_task_229270->free_x_225358;
    float x_225359 = futhark_mc_task_229270->free_x_225359;
    int64_t defunc_0_g_res_225362 =
            futhark_mc_task_229270->free_defunc_0_g_res_225362;
    float a11_225401 = futhark_mc_task_229270->free_a11_225401;
    float b11_225403 = futhark_mc_task_229270->free_b11_225403;
    float c11_225404 = futhark_mc_task_229270->free_c11_225404;
    float defunc_2_reduce_res_225405 =
          *futhark_mc_task_229270->retval_defunc_2_reduce_res_225405;
    float defunc_2_reduce_res_225406 =
          *futhark_mc_task_229270->retval_defunc_2_reduce_res_225406;
    size_t reduce_stage_1_tid_res_arr_mem_225710_cached_sizze_229272 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225710 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_225712_cached_sizze_229273 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_225712 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_225710_cached_sizze_229272 <
        (size_t) ((int64_t) 4 * num_tasks_225709)) {
        reduce_stage_1_tid_res_arr_mem_225710 =
            realloc(reduce_stage_1_tid_res_arr_mem_225710, (int64_t) 4 *
                    num_tasks_225709);
        reduce_stage_1_tid_res_arr_mem_225710_cached_sizze_229272 =
            (int64_t) 4 * num_tasks_225709;
    }
    if (reduce_stage_1_tid_res_arr_mem_225712_cached_sizze_229273 <
        (size_t) ((int64_t) 4 * num_tasks_225709)) {
        reduce_stage_1_tid_res_arr_mem_225712 =
            realloc(reduce_stage_1_tid_res_arr_mem_225712, (int64_t) 4 *
                    num_tasks_225709);
        reduce_stage_1_tid_res_arr_mem_225712_cached_sizze_229273 =
            (int64_t) 4 * num_tasks_225709;
    }
    
    int64_t iter_225714;
    struct futhark_mc_segred_stage_1_parloop_struct_229274
    futhark_mc_segred_stage_1_parloop_struct_229274;
    
    futhark_mc_segred_stage_1_parloop_struct_229274.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_gtid_207156 =
        gtid_207156;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_x_207161 = x_207161;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_mem_212948 =
        mem_212948.mem;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_mem_212951 =
        mem_212951.mem;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_x_225358 = x_225358;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_x_225359 = x_225359;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_defunc_0_g_res_225362 =
        defunc_0_g_res_225362;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_a11_225401 =
        a11_225401;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_b11_225403 =
        b11_225403;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_c11_225404 =
        c11_225404;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_reduce_stage_1_tid_res_arr_mem_225710 =
        reduce_stage_1_tid_res_arr_mem_225710;
    futhark_mc_segred_stage_1_parloop_struct_229274.free_reduce_stage_1_tid_res_arr_mem_225712 =
        reduce_stage_1_tid_res_arr_mem_225712;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229275_task;
    
    futhark_mc_segred_stage_1_parloop_229275_task.name =
        "futhark_mc_segred_stage_1_parloop_229275";
    futhark_mc_segred_stage_1_parloop_229275_task.fn =
        futhark_mc_segred_stage_1_parloop_229275;
    futhark_mc_segred_stage_1_parloop_229275_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229274;
    futhark_mc_segred_stage_1_parloop_229275_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229275_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229275_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229275_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229275_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229275_task);
    
    if (futhark_mc_segred_stage_1_parloop_229275_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229275_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229275_total_end -
                 futhark_mc_segred_stage_1_parloop_229275_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229275_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229275_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229275_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_225405 = 0.0F;
        defunc_2_reduce_res_225406 = 0.0F;
    }
    
    float x_225717;
    float x_225718;
    float x_225720;
    float x_225721;
    
    for (int32_t i_225723 = 0; i_225723 < num_tasks_225709; i_225723++) {
        flat_tid_225648 = i_225723;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_225717 = defunc_2_reduce_res_225405;
            }
            // load next params
            {
                x_225718 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225710)[flat_tid_225648];
            }
            // red body
            {
                float defunc_1_op_res_225719 = x_225717 + x_225718;
                
                defunc_2_reduce_res_225405 = defunc_1_op_res_225719;
            }
            // load acc params
            {
                x_225720 = defunc_2_reduce_res_225406;
            }
            // load next params
            {
                x_225721 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_225712)[flat_tid_225648];
            }
            // red body
            {
                float defunc_1_op_res_225722 = x_225720 + x_225721;
                
                defunc_2_reduce_res_225406 = defunc_1_op_res_225722;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_225710);
        free(reduce_stage_1_tid_res_arr_mem_225712);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229271_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229271_end -
                 futhark_mc_segred_task_229271_start;
        
        ctx->futhark_mc_segred_task_229271_runs[tid]++;
        ctx->futhark_mc_segred_task_229271_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229271_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229270->retval_defunc_2_reduce_res_225405 =
            defunc_2_reduce_res_225405;
        *futhark_mc_task_229270->retval_defunc_2_reduce_res_225406 =
            defunc_2_reduce_res_225406;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229262(void *args, int64_t start,
                                            int64_t end, int flat_tid_225356,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229261
    *futhark_mc_segmap_parloop_struct_229261 =
    (struct futhark_mc_segmap_parloop_struct_229261 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229261->ctx;
    uint64_t futhark_mc_segmap_parloop_229262_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229262_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229261->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229261->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229261->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229261->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229261->free_i_196779;
    int64_t gtid_207156 =
            futhark_mc_segmap_parloop_struct_229261->free_gtid_207156;
    int64_t x_207161 = futhark_mc_segmap_parloop_struct_229261->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_212951,
                                  .size =0, .references =NULL};
    struct memblock mem_212954 = {.desc ="mem_212954", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_212954,
                                  .size =0, .references =NULL};
    struct memblock mem_212957 = {.desc ="mem_212957", .mem =
                                  futhark_mc_segmap_parloop_struct_229261->free_mem_212957,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_225616 = start;
    
    for (; iter_225616 < end; iter_225616++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225686 = t_n_m_196759;
        int64_t gtid_225357 = iter_225616;
        int64_t remnant_225687 = iter_225616 - gtid_225357;
        int64_t x_225358;
        
        x_225358 = ((int64_t *) mem_210889.mem)[gtid_207156 * t_n_m_196759 +
                                                gtid_225357];
        
        float x_225359;
        
        x_225359 = ((float *) mem_210893.mem)[gtid_207156 * t_n_m_196759 +
                                              gtid_225357];
        
        int64_t min_arg_225360 = mul64(jump_t_196702, gtid_225357);
        int64_t min_res_225361 = smin64(i_196779, min_arg_225360);
        int64_t defunc_0_g_res_225362 = add64((int64_t) 1, min_res_225361);
        float defunc_2_reduce_res_225363;
        float defunc_2_reduce_res_225364;
        float defunc_2_reduce_res_225365;
        int64_t flat_tid_225617 = (int64_t) 0;
        int32_t num_tasks_225688;
        
        defunc_2_reduce_res_225363 = 0.0F;
        defunc_2_reduce_res_225364 = 0.0F;
        defunc_2_reduce_res_225365 = 0.0F;
        
        struct futhark_mc_task_229263 futhark_mc_task_229263;
        
        futhark_mc_task_229263.ctx = ctx;
        futhark_mc_task_229263.free_n_196692 = n_196692;
        futhark_mc_task_229263.free_gtid_207156 = gtid_207156;
        futhark_mc_task_229263.free_x_207161 = x_207161;
        futhark_mc_task_229263.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229263.free_mem_212948 = mem_212948.mem;
        futhark_mc_task_229263.free_x_225358 = x_225358;
        futhark_mc_task_229263.free_x_225359 = x_225359;
        futhark_mc_task_229263.free_defunc_0_g_res_225362 =
            defunc_0_g_res_225362;
        futhark_mc_task_229263.retval_defunc_2_reduce_res_225363 =
            &defunc_2_reduce_res_225363;
        futhark_mc_task_229263.retval_defunc_2_reduce_res_225364 =
            &defunc_2_reduce_res_225364;
        futhark_mc_task_229263.retval_defunc_2_reduce_res_225365 =
            &defunc_2_reduce_res_225365;
        
        struct scheduler_segop futhark_mc_task_229263_task;
        
        futhark_mc_task_229263_task.args = &futhark_mc_task_229263;
        futhark_mc_task_229263_task.top_level_fn =
            futhark_mc_segred_task_229264;
        futhark_mc_task_229263_task.name = "futhark_mc_segred_task_229264";
        futhark_mc_task_229263_task.iterations = q_t_196696;
        futhark_mc_task_229263_task.task_time =
            &ctx->futhark_mc_segred_task_229264_total_time;
        futhark_mc_task_229263_task.task_iter =
            &ctx->futhark_mc_segred_task_229264_total_iter;
        futhark_mc_task_229263_task.sched = STATIC;
        futhark_mc_task_229263_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229264_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229263_task);
        
        if (futhark_mc_segred_task_229264_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_225397 = defunc_2_reduce_res_225363 *
              defunc_2_reduce_res_225365;
        float y_225398 = defunc_2_reduce_res_225364 *
              defunc_2_reduce_res_225364;
        float y_225399 = x_225397 - y_225398;
        float det1_225400 = 1.0F / y_225399;
        float a11_225401 = defunc_2_reduce_res_225365 * det1_225400;
        float x_225402 = 0.0F - defunc_2_reduce_res_225364;
        float b11_225403 = det1_225400 * x_225402;
        float c11_225404 = defunc_2_reduce_res_225363 * det1_225400;
        float defunc_2_reduce_res_225405;
        float defunc_2_reduce_res_225406;
        int64_t flat_tid_225648 = (int64_t) 0;
        int32_t num_tasks_225709;
        
        defunc_2_reduce_res_225405 = 0.0F;
        defunc_2_reduce_res_225406 = 0.0F;
        
        struct futhark_mc_task_229270 futhark_mc_task_229270;
        
        futhark_mc_task_229270.ctx = ctx;
        futhark_mc_task_229270.free_n_196692 = n_196692;
        futhark_mc_task_229270.free_gtid_207156 = gtid_207156;
        futhark_mc_task_229270.free_x_207161 = x_207161;
        futhark_mc_task_229270.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229270.free_mem_212948 = mem_212948.mem;
        futhark_mc_task_229270.free_mem_212951 = mem_212951.mem;
        futhark_mc_task_229270.free_x_225358 = x_225358;
        futhark_mc_task_229270.free_x_225359 = x_225359;
        futhark_mc_task_229270.free_defunc_0_g_res_225362 =
            defunc_0_g_res_225362;
        futhark_mc_task_229270.free_a11_225401 = a11_225401;
        futhark_mc_task_229270.free_b11_225403 = b11_225403;
        futhark_mc_task_229270.free_c11_225404 = c11_225404;
        futhark_mc_task_229270.retval_defunc_2_reduce_res_225405 =
            &defunc_2_reduce_res_225405;
        futhark_mc_task_229270.retval_defunc_2_reduce_res_225406 =
            &defunc_2_reduce_res_225406;
        
        struct scheduler_segop futhark_mc_task_229270_task;
        
        futhark_mc_task_229270_task.args = &futhark_mc_task_229270;
        futhark_mc_task_229270_task.top_level_fn =
            futhark_mc_segred_task_229271;
        futhark_mc_task_229270_task.name = "futhark_mc_segred_task_229271";
        futhark_mc_task_229270_task.iterations = q_t_196696;
        futhark_mc_task_229270_task.task_time =
            &ctx->futhark_mc_segred_task_229271_total_time;
        futhark_mc_task_229270_task.task_iter =
            &ctx->futhark_mc_segred_task_229271_total_iter;
        futhark_mc_task_229270_task.sched = STATIC;
        futhark_mc_task_229270_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229271_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229270_task);
        
        if (futhark_mc_segred_task_229271_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_212954.mem)[gtid_225357] = defunc_2_reduce_res_225405;
        ((float *) mem_212957.mem)[gtid_225357] = defunc_2_reduce_res_225406;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229262_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229262_end -
                 futhark_mc_segmap_parloop_229262_start;
        
        ctx->futhark_mc_segmap_parloop_229262_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229262_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229262_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229260(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225356 = tid;
    int num_tasks_225545 = info.nsubtasks;
    struct futhark_mc_task_229256 *futhark_mc_task_229256 =
                                  (struct futhark_mc_task_229256 *) args;
    struct futhark_context *ctx = futhark_mc_task_229256->ctx;
    uint64_t futhark_mc_segmap_nested_task_229260_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229260_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229256->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229256->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229256->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229256->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229256->free_i_196779;
    int64_t gtid_207156 = futhark_mc_task_229256->free_gtid_207156;
    int64_t x_207161 = futhark_mc_task_229256->free_x_207161;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229256->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229256->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229256->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_212948 = {.desc ="mem_212948", .mem =
                                  futhark_mc_task_229256->free_mem_212948,
                                  .size =0, .references =NULL};
    struct memblock mem_212951 = {.desc ="mem_212951", .mem =
                                  futhark_mc_task_229256->free_mem_212951,
                                  .size =0, .references =NULL};
    struct memblock mem_212954 = {.desc ="mem_212954", .mem =
                                  futhark_mc_task_229256->free_mem_212954,
                                  .size =0, .references =NULL};
    struct memblock mem_212957 = {.desc ="mem_212957", .mem =
                                  futhark_mc_task_229256->free_mem_212957,
                                  .size =0, .references =NULL};
    int64_t iter_225616;
    struct futhark_mc_segmap_parloop_struct_229261
    futhark_mc_segmap_parloop_struct_229261;
    
    futhark_mc_segmap_parloop_struct_229261.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229261.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229261.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229261.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229261.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229261.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229261.free_gtid_207156 = gtid_207156;
    futhark_mc_segmap_parloop_struct_229261.free_x_207161 = x_207161;
    futhark_mc_segmap_parloop_struct_229261.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229261.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229261.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229261.free_mem_212948 = mem_212948.mem;
    futhark_mc_segmap_parloop_struct_229261.free_mem_212951 = mem_212951.mem;
    futhark_mc_segmap_parloop_struct_229261.free_mem_212954 = mem_212954.mem;
    futhark_mc_segmap_parloop_struct_229261.free_mem_212957 = mem_212957.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229262_task;
    
    futhark_mc_segmap_parloop_229262_task.name =
        "futhark_mc_segmap_parloop_229262";
    futhark_mc_segmap_parloop_229262_task.fn = futhark_mc_segmap_parloop_229262;
    futhark_mc_segmap_parloop_229262_task.args =
        &futhark_mc_segmap_parloop_struct_229261;
    futhark_mc_segmap_parloop_229262_task.iterations = iterations;
    futhark_mc_segmap_parloop_229262_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229262_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229262_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229262_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229262_task);
    
    if (futhark_mc_segmap_parloop_229262_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229262_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229262_total_end -
                 futhark_mc_segmap_parloop_229262_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229262_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229262_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229262_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229260_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229260_end -
                 futhark_mc_segmap_nested_task_229260_start;
        
        ctx->futhark_mc_segmap_nested_task_229260_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229260_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229260_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229242(void *args, int64_t start,
                                            int64_t end, int flat_tid_207155,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229241
    *futhark_mc_segmap_parloop_struct_229241 =
    (struct futhark_mc_segmap_parloop_struct_229241 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229241->ctx;
    uint64_t futhark_mc_segmap_parloop_229242_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229242_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229241->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229241->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229241->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229241->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229241->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229241->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229241->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229241->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229241->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229241->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229241->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229241->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229241->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213036 = {.desc ="mem_213036", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_213036,
                                  .size =0, .references =NULL};
    struct memblock mem_213040 = {.desc ="mem_213040", .mem =
                                  futhark_mc_segmap_parloop_struct_229241->free_mem_213040,
                                  .size =0, .references =NULL};
    size_t mem_212945_cached_sizze_229243 = 0;
    unsigned char *mem_212945 = NULL;
    size_t mem_212948_cached_sizze_229244 = 0;
    unsigned char *mem_212948 = NULL;
    size_t mem_212951_cached_sizze_229245 = 0;
    unsigned char *mem_212951 = NULL;
    size_t mem_212954_cached_sizze_229246 = 0;
    unsigned char *mem_212954 = NULL;
    size_t mem_212957_cached_sizze_229247 = 0;
    unsigned char *mem_212957 = NULL;
    int64_t iterations = end - start;
    int64_t iter_225336 = start;
    
    if (mem_212945_cached_sizze_229243 < (size_t) bytes_210949) {
        mem_212945 = realloc(mem_212945, bytes_210949);
        mem_212945_cached_sizze_229243 = bytes_210949;
    }
    if (mem_212948_cached_sizze_229244 < (size_t) bytes_210949) {
        mem_212948 = realloc(mem_212948, bytes_210949);
        mem_212948_cached_sizze_229244 = bytes_210949;
    }
    if (mem_212951_cached_sizze_229245 < (size_t) bytes_210949) {
        mem_212951 = realloc(mem_212951, bytes_210949);
        mem_212951_cached_sizze_229245 = bytes_210949;
    }
    if (mem_212954_cached_sizze_229246 < (size_t) bytes_210836) {
        mem_212954 = realloc(mem_212954, bytes_210836);
        mem_212954_cached_sizze_229246 = bytes_210836;
    }
    if (mem_212957_cached_sizze_229247 < (size_t) bytes_210836) {
        mem_212957 = realloc(mem_212957, bytes_210836);
        mem_212957_cached_sizze_229247 = bytes_210836;
    }
    for (; iter_225336 < end; iter_225336++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225527 = m_196691;
        int64_t gtid_207156 = iter_225336;
        int64_t remnant_225528 = iter_225336 - gtid_207156;
        int64_t x_207161;
        
        x_207161 = ((int64_t *) mem_210397.mem)[gtid_207156];
        
        int64_t flat_tid_225337 = (int64_t) 0;
        int32_t num_tasks_225529;
        struct futhark_mc_task_229248 futhark_mc_task_229248;
        
        futhark_mc_task_229248.ctx = ctx;
        futhark_mc_task_229248.free_n_196692 = n_196692;
        futhark_mc_task_229248.free_gtid_207156 = gtid_207156;
        futhark_mc_task_229248.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229248.free_mem_212862 = mem_212862.mem;
        futhark_mc_task_229248.free_mem_212945 = mem_212945;
        
        struct scheduler_segop futhark_mc_task_229248_task;
        
        futhark_mc_task_229248_task.args = &futhark_mc_task_229248;
        futhark_mc_task_229248_task.top_level_fn =
            futhark_mc_segmap_task_229249;
        futhark_mc_task_229248_task.name = "futhark_mc_segmap_task_229249";
        futhark_mc_task_229248_task.iterations = n_196692;
        futhark_mc_task_229248_task.task_time =
            &ctx->futhark_mc_segmap_task_229249_total_time;
        futhark_mc_task_229248_task.task_iter =
            &ctx->futhark_mc_segmap_task_229249_total_iter;
        futhark_mc_task_229248_task.sched = STATIC;
        futhark_mc_task_229248_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229249_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229248_task);
        
        if (futhark_mc_segmap_task_229249_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_225342 = (int64_t) 0;
        int32_t num_tasks_225533;
        struct futhark_mc_task_229252 futhark_mc_task_229252;
        
        futhark_mc_task_229252.ctx = ctx;
        futhark_mc_task_229252.free_n_196692 = n_196692;
        futhark_mc_task_229252.free_gtid_207156 = gtid_207156;
        futhark_mc_task_229252.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229252.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229252.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229252.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229252.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229252.free_mem_212945 = mem_212945;
        futhark_mc_task_229252.free_mem_212948 = mem_212948;
        futhark_mc_task_229252.free_mem_212951 = mem_212951;
        
        struct scheduler_segop futhark_mc_task_229252_task;
        
        futhark_mc_task_229252_task.args = &futhark_mc_task_229252;
        futhark_mc_task_229252_task.top_level_fn =
            futhark_mc_segmap_task_229253;
        futhark_mc_task_229252_task.name = "futhark_mc_segmap_task_229253";
        futhark_mc_task_229252_task.iterations = n_196692;
        futhark_mc_task_229252_task.task_time =
            &ctx->futhark_mc_segmap_task_229253_total_time;
        futhark_mc_task_229252_task.task_iter =
            &ctx->futhark_mc_segmap_task_229253_total_iter;
        futhark_mc_task_229252_task.sched = STATIC;
        futhark_mc_task_229252_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229253_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229252_task);
        
        if (futhark_mc_segmap_task_229253_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_225445 = (int64_t) 0;
        int32_t num_tasks_225545;
        int64_t flat_tid_225356 = (int64_t) 0;
        struct futhark_mc_task_229256 futhark_mc_task_229256;
        
        futhark_mc_task_229256.ctx = ctx;
        futhark_mc_task_229256.free_n_196692 = n_196692;
        futhark_mc_task_229256.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229256.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229256.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229256.free_i_196779 = i_196779;
        futhark_mc_task_229256.free_gtid_207156 = gtid_207156;
        futhark_mc_task_229256.free_x_207161 = x_207161;
        futhark_mc_task_229256.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229256.free_mem_210889 = mem_210889.mem;
        futhark_mc_task_229256.free_mem_210893 = mem_210893.mem;
        futhark_mc_task_229256.free_mem_212948 = mem_212948;
        futhark_mc_task_229256.free_mem_212951 = mem_212951;
        futhark_mc_task_229256.free_mem_212954 = mem_212954;
        futhark_mc_task_229256.free_mem_212957 = mem_212957;
        
        struct scheduler_segop futhark_mc_task_229256_task;
        
        futhark_mc_task_229256_task.args = &futhark_mc_task_229256;
        futhark_mc_task_229256_task.top_level_fn =
            futhark_mc_segmap_task_229257;
        futhark_mc_task_229256_task.name = "futhark_mc_segmap_task_229257";
        futhark_mc_task_229256_task.iterations = t_n_m_196759;
        futhark_mc_task_229256_task.task_time =
            &ctx->futhark_mc_segmap_task_229257_total_time;
        futhark_mc_task_229256_task.task_iter =
            &ctx->futhark_mc_segmap_task_229257_total_iter;
        futhark_mc_task_229256_task.sched = STATIC;
        futhark_mc_task_229256_task.nested_fn =
            futhark_mc_segmap_nested_task_229260;
        
        int futhark_mc_segmap_task_229257_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229256_task);
        
        if (futhark_mc_segmap_task_229257_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213036.mem + gtid_207156 * t_n_m_196759 * (int64_t) 4,
                    mem_212954 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213040.mem + gtid_207156 * t_n_m_196759 * (int64_t) 4,
                    mem_212957 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_212945);
    free(mem_212948);
    free(mem_212951);
    free(mem_212954);
    free(mem_212957);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229242_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229242_end -
                 futhark_mc_segmap_parloop_229242_start;
        
        ctx->futhark_mc_segmap_parloop_229242_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229242_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229242_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229240(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207155 = tid;
    int num_tasks_225214 = info.nsubtasks;
    struct futhark_mc_task_229231 *futhark_mc_task_229231 =
                                  (struct futhark_mc_task_229231 *) args;
    struct futhark_context *ctx = futhark_mc_task_229231->ctx;
    uint64_t futhark_mc_segmap_nested_task_229240_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229240_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229231->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229231->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229231->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229231->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229231->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229231->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229231->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229231->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229231->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229231->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229231->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229231->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229231->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229231->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229231->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229231->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229231->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229231->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213036 = {.desc ="mem_213036", .mem =
                                  futhark_mc_task_229231->free_mem_213036,
                                  .size =0, .references =NULL};
    struct memblock mem_213040 = {.desc ="mem_213040", .mem =
                                  futhark_mc_task_229231->free_mem_213040,
                                  .size =0, .references =NULL};
    int64_t iter_225336;
    struct futhark_mc_segmap_parloop_struct_229241
    futhark_mc_segmap_parloop_struct_229241;
    
    futhark_mc_segmap_parloop_struct_229241.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229241.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229241.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229241.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229241.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229241.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229241.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229241.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229241.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229241.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229241.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229241.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229241.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229241.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229241.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229241.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229241.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229241.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229241.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229241.free_mem_213036 = mem_213036.mem;
    futhark_mc_segmap_parloop_struct_229241.free_mem_213040 = mem_213040.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229242_task;
    
    futhark_mc_segmap_parloop_229242_task.name =
        "futhark_mc_segmap_parloop_229242";
    futhark_mc_segmap_parloop_229242_task.fn = futhark_mc_segmap_parloop_229242;
    futhark_mc_segmap_parloop_229242_task.args =
        &futhark_mc_segmap_parloop_struct_229241;
    futhark_mc_segmap_parloop_229242_task.iterations = iterations;
    futhark_mc_segmap_parloop_229242_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229242_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229242_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229242_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229242_task);
    
    if (futhark_mc_segmap_parloop_229242_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229242_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229242_total_end -
                 futhark_mc_segmap_parloop_229242_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229242_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229242_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229242_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229240_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229240_end -
                 futhark_mc_segmap_nested_task_229240_start;
        
        ctx->futhark_mc_segmap_nested_task_229240_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229240_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229240_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229276 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213134;
    unsigned char *free_mem_213138;
};
struct futhark_mc_segmap_parloop_struct_229278 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213134;
    unsigned char *free_mem_213138;
};
static int futhark_mc_segmap_parloop_229279(void *args, int64_t start,
                                            int64_t end, int flat_tid_207368,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229278
    *futhark_mc_segmap_parloop_struct_229278 =
    (struct futhark_mc_segmap_parloop_struct_229278 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229278->ctx;
    uint64_t futhark_mc_segmap_parloop_229279_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229279_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229278->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229278->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229278->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229278->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229278->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229278->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229278->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229278->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229278->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229278->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229278->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229278->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229278->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213134 = {.desc ="mem_213134", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_213134,
                                  .size =0, .references =NULL};
    struct memblock mem_213138 = {.desc ="mem_213138", .mem =
                                  futhark_mc_segmap_parloop_struct_229278->free_mem_213138,
                                  .size =0, .references =NULL};
    size_t mem_213058_cached_sizze_229280 = 0;
    unsigned char *mem_213058 = NULL;
    size_t mem_213073_cached_sizze_229281 = 0;
    unsigned char *mem_213073 = NULL;
    size_t mem_213076_cached_sizze_229282 = 0;
    unsigned char *mem_213076 = NULL;
    size_t mem_213103_cached_sizze_229283 = 0;
    unsigned char *mem_213103 = NULL;
    size_t mem_213106_cached_sizze_229284 = 0;
    unsigned char *mem_213106 = NULL;
    int64_t iterations = end - start;
    int64_t iter_225725 = start;
    
    if (mem_213058_cached_sizze_229280 < (size_t) bytes_210949) {
        mem_213058 = realloc(mem_213058, bytes_210949);
        mem_213058_cached_sizze_229280 = bytes_210949;
    }
    if (mem_213073_cached_sizze_229281 < (size_t) bytes_210949) {
        mem_213073 = realloc(mem_213073, bytes_210949);
        mem_213073_cached_sizze_229281 = bytes_210949;
    }
    if (mem_213076_cached_sizze_229282 < (size_t) bytes_210949) {
        mem_213076 = realloc(mem_213076, bytes_210949);
        mem_213076_cached_sizze_229282 = bytes_210949;
    }
    if (mem_213103_cached_sizze_229283 < (size_t) bytes_210836) {
        mem_213103 = realloc(mem_213103, bytes_210836);
        mem_213103_cached_sizze_229283 = bytes_210836;
    }
    if (mem_213106_cached_sizze_229284 < (size_t) bytes_210836) {
        mem_213106 = realloc(mem_213106, bytes_210836);
        mem_213106_cached_sizze_229284 = bytes_210836;
    }
    for (; iter_225725 < end; iter_225725++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_225864 = m_196691;
        int64_t gtid_207369 = iter_225725;
        int64_t remnant_225865 = iter_225725 - gtid_207369;
        int64_t x_199184;
        
        x_199184 = ((int64_t *) mem_210397.mem)[gtid_207369];
        for (int64_t i_225726 = 0; i_225726 < n_196692; i_225726++) {
            float x_225728;
            
            x_225728 = ((float *) Y_mem_210354.mem)[gtid_207369 * n_196692 +
                                                    i_225726];
            
            float x_225729;
            
            x_225729 = ((float *) mem_212862.mem)[gtid_207369 * n_196692 +
                                                  i_225726];
            
            float defunc_1_f_res_225730 = x_225728 - x_225729;
            
            ((float *) mem_213058)[i_225726] = defunc_1_f_res_225730;
        }
        for (int64_t i_225732 = 0; i_225732 < n_196692; i_225732++) {
            int64_t x_225735;
            
            x_225735 = ((int64_t *) mem_210394.mem)[gtid_207369 * n_196692 +
                                                    i_225732];
            
            bool cond_225736 = sle64((int64_t) 0, x_225735);
            float defunc_0_f_res_225737;
            
            if (cond_225736) {
                bool y_225738 = slt64(x_225735, n_196692);
                bool bounds_check_225739 = cond_225736 && y_225738;
                bool index_certs_225740;
                
                if (!bounds_check_225739) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_225735,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_225741;
                
                defunc_0_f_res_t_res_225741 = ((float *) mem_213058)[x_225735];
                defunc_0_f_res_225737 = defunc_0_f_res_t_res_225741;
            } else {
                defunc_0_f_res_225737 = 0.0F;
            }
            
            float defunc_0_f_res_225742;
            
            if (cond_225736) {
                bool y_225743 = slt64(x_225735, n_196692);
                bool bounds_check_225744 = cond_225736 && y_225743;
                bool index_certs_225745;
                
                if (!bounds_check_225744) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_225735,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_225746;
                
                defunc_0_f_res_t_res_225746 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_207369 *
                                                      ctx_param_ext_210921 +
                                                      x_225735 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_225742 = defunc_0_f_res_t_res_225746;
            } else {
                defunc_0_f_res_225742 = 0.0F;
            }
            ((float *) mem_213073)[i_225732] = defunc_0_f_res_225742;
            ((float *) mem_213076)[i_225732] = defunc_0_f_res_225737;
        }
        for (int64_t i_225749 = 0; i_225749 < t_n_m_196759; i_225749++) {
            int64_t x_225752;
            
            x_225752 = ((int64_t *) mem_210889.mem)[gtid_207369 * t_n_m_196759 +
                                                    i_225749];
            
            float x_225753;
            
            x_225753 = ((float *) mem_210893.mem)[gtid_207369 * t_n_m_196759 +
                                                  i_225749];
            
            int64_t min_arg_225754 = mul64(jump_t_196702, i_225749);
            int64_t min_res_225755 = smin64(i_196779, min_arg_225754);
            int64_t defunc_0_g_res_225756 = add64((int64_t) 1, min_res_225755);
            float defunc_2_reduce_res_225757;
            float defunc_2_reduce_res_225758;
            float defunc_2_reduce_res_225759;
            float defunc_2_reduce_res_225760;
            float defunc_2_reduce_res_225761;
            float redout_225763;
            float redout_225764;
            float redout_225765;
            float redout_225766;
            float redout_225767;
            
            redout_225763 = 0.0F;
            redout_225764 = 0.0F;
            redout_225765 = 0.0F;
            redout_225766 = 0.0F;
            redout_225767 = 0.0F;
            for (int64_t i_225762 = 0; i_225762 < q_t_196696; i_225762++) {
                bool cond_225768 = sle64(x_199184, i_225762);
                int64_t defunc_0_f_res_225769;
                
                if (cond_225768) {
                    defunc_0_f_res_225769 = (int64_t) 0;
                } else {
                    int64_t i_225770 = add64(x_225752, i_225762);
                    int64_t defunc_0_add_arg_225771;
                    
                    defunc_0_add_arg_225771 =
                        ((int64_t *) mem_210394.mem)[gtid_207369 * n_196692 +
                                                     i_225770];
                    
                    int64_t defunc_1_add_res_225772 = add64((int64_t) 1,
                                                            defunc_0_add_arg_225771);
                    
                    defunc_0_f_res_225769 = defunc_1_add_res_225772;
                }
                
                float defunc_0_f_res_225773;
                
                if (cond_225768) {
                    defunc_0_f_res_225773 = 0.0F;
                } else {
                    int64_t i_225774 = add64(x_225752, i_225762);
                    float defunc_0_add_arg_225775;
                    
                    defunc_0_add_arg_225775 = ((float *) mem_213073)[i_225774];
                    defunc_0_f_res_225773 = defunc_0_add_arg_225775;
                }
                
                int64_t binop_p_225776 = sub64(defunc_0_f_res_225769,
                                               defunc_0_g_res_225756);
                float defunc_0_f_res_225777 = sitofp_i64_f32(binop_p_225776);
                float abs_res_225778 = (float) fabs(defunc_0_f_res_225777);
                float tmp1_225779 = abs_res_225778 / x_225753;
                float x_225780 = tmp1_225779 * tmp1_225779;
                float y_225781 = tmp1_225779 * x_225780;
                float tmp2_225782 = 1.0F - y_225781;
                float x_225783 = tmp2_225782 * tmp2_225782;
                float tmp3_225784 = tmp2_225782 * x_225783;
                float w_j_225785 = defunc_0_f_res_225773 * tmp3_225784;
                float xw_j_225786 = defunc_0_f_res_225777 * w_j_225785;
                float x2w_j_225787 = defunc_0_f_res_225777 * xw_j_225786;
                float x3w_j_225788 = defunc_0_f_res_225777 * x2w_j_225787;
                float x4w_j_225789 = defunc_0_f_res_225777 * x3w_j_225788;
                float defunc_1_op_res_225790 = w_j_225785 + redout_225763;
                float defunc_1_op_res_225791 = xw_j_225786 + redout_225764;
                float defunc_1_op_res_225792 = x2w_j_225787 + redout_225765;
                float defunc_1_op_res_225793 = x3w_j_225788 + redout_225766;
                float defunc_1_op_res_225794 = x4w_j_225789 + redout_225767;
                float redout_tmp_225871 = defunc_1_op_res_225790;
                float redout_tmp_225872 = defunc_1_op_res_225791;
                float redout_tmp_225873 = defunc_1_op_res_225792;
                float redout_tmp_225874 = defunc_1_op_res_225793;
                float redout_tmp_225875 = defunc_1_op_res_225794;
                
                redout_225763 = redout_tmp_225871;
                redout_225764 = redout_tmp_225872;
                redout_225765 = redout_tmp_225873;
                redout_225766 = redout_tmp_225874;
                redout_225767 = redout_tmp_225875;
            }
            defunc_2_reduce_res_225757 = redout_225763;
            defunc_2_reduce_res_225758 = redout_225764;
            defunc_2_reduce_res_225759 = redout_225765;
            defunc_2_reduce_res_225760 = redout_225766;
            defunc_2_reduce_res_225761 = redout_225767;
            
            float x_225795 = defunc_2_reduce_res_225759 *
                  defunc_2_reduce_res_225761;
            float y_225796 = defunc_2_reduce_res_225760 *
                  defunc_2_reduce_res_225760;
            float a12_225797 = x_225795 - y_225796;
            float x_225798 = defunc_2_reduce_res_225759 *
                  defunc_2_reduce_res_225760;
            float y_225799 = defunc_2_reduce_res_225758 *
                  defunc_2_reduce_res_225761;
            float b12_225800 = x_225798 - y_225799;
            float x_225801 = defunc_2_reduce_res_225758 *
                  defunc_2_reduce_res_225760;
            float y_225802 = defunc_2_reduce_res_225759 *
                  defunc_2_reduce_res_225759;
            float c12_225803 = x_225801 - y_225802;
            float x_225804 = defunc_2_reduce_res_225757 *
                  defunc_2_reduce_res_225761;
            float b2_225805 = x_225804 - y_225802;
            float x_225806 = defunc_2_reduce_res_225758 *
                  defunc_2_reduce_res_225759;
            float y_225807 = defunc_2_reduce_res_225757 *
                  defunc_2_reduce_res_225760;
            float c2_225808 = x_225806 - y_225807;
            float x_225809 = defunc_2_reduce_res_225757 * a12_225797;
            float y_225810 = defunc_2_reduce_res_225758 * b12_225800;
            float x_225811 = x_225809 + y_225810;
            float y_225812 = defunc_2_reduce_res_225759 * c12_225803;
            float y_225813 = x_225811 + y_225812;
            float det_225814 = 1.0F / y_225813;
            float a12_225815 = a12_225797 * det_225814;
            float b12_225816 = b12_225800 * det_225814;
            float c12_225817 = c12_225803 * det_225814;
            float b2_225818 = b2_225805 * det_225814;
            float c2_225819 = c2_225808 * det_225814;
            float defunc_2_reduce_res_225820;
            float defunc_2_reduce_res_225821;
            float redout_225823;
            float redout_225824;
            
            redout_225823 = 0.0F;
            redout_225824 = 0.0F;
            for (int64_t i_225822 = 0; i_225822 < q_t_196696; i_225822++) {
                bool cond_225825 = sle64(x_199184, i_225822);
                int64_t defunc_0_f_res_225826;
                
                if (cond_225825) {
                    defunc_0_f_res_225826 = (int64_t) 0;
                } else {
                    int64_t i_225827 = add64(x_225752, i_225822);
                    int64_t defunc_0_add_arg_225828;
                    
                    defunc_0_add_arg_225828 =
                        ((int64_t *) mem_210394.mem)[gtid_207369 * n_196692 +
                                                     i_225827];
                    
                    int64_t defunc_1_add_res_225829 = add64((int64_t) 1,
                                                            defunc_0_add_arg_225828);
                    
                    defunc_0_f_res_225826 = defunc_1_add_res_225829;
                }
                
                float defunc_0_f_res_225830;
                
                if (cond_225825) {
                    defunc_0_f_res_225830 = 0.0F;
                } else {
                    int64_t i_225831 = add64(x_225752, i_225822);
                    float defunc_0_add_arg_225832;
                    
                    defunc_0_add_arg_225832 = ((float *) mem_213073)[i_225831];
                    defunc_0_f_res_225830 = defunc_0_add_arg_225832;
                }
                
                int64_t binop_p_225833 = sub64(defunc_0_f_res_225826,
                                               defunc_0_g_res_225756);
                float defunc_0_f_res_225834 = sitofp_i64_f32(binop_p_225833);
                float abs_res_225835 = (float) fabs(defunc_0_f_res_225834);
                float tmp1_225836 = abs_res_225835 / x_225753;
                float x_225837 = tmp1_225836 * tmp1_225836;
                float y_225838 = tmp1_225836 * x_225837;
                float tmp2_225839 = 1.0F - y_225838;
                float x_225840 = tmp2_225839 * tmp2_225839;
                float tmp3_225841 = tmp2_225839 * x_225840;
                float tmp4_225842 = defunc_0_f_res_225830 * tmp3_225841;
                float defunc_1_f_res_225843 = defunc_0_f_res_225834 *
                      tmp4_225842;
                float defunc_1_f_res_225844 = defunc_0_f_res_225834 *
                      defunc_1_f_res_225843;
                float defunc_0_f_res_225845;
                
                if (cond_225825) {
                    defunc_0_f_res_225845 = 0.0F;
                } else {
                    int64_t i_225846 = add64(x_225752, i_225822);
                    float defunc_0_add_arg_225847;
                    
                    defunc_0_add_arg_225847 = ((float *) mem_213076)[i_225846];
                    defunc_0_f_res_225845 = defunc_0_add_arg_225847;
                }
                
                float x_225848 = a12_225815 * tmp4_225842;
                float y_225849 = b12_225816 * defunc_1_f_res_225843;
                float x_225850 = x_225848 + y_225849;
                float y_225851 = c12_225817 * defunc_1_f_res_225844;
                float x_225852 = x_225850 + y_225851;
                float defunc_9_fit_fun_res_225853 = defunc_0_f_res_225845 *
                      x_225852;
                float x_225854 = b12_225816 * tmp4_225842;
                float y_225855 = b2_225818 * defunc_1_f_res_225843;
                float x_225856 = x_225854 + y_225855;
                float y_225857 = c2_225819 * defunc_1_f_res_225844;
                float x_225858 = x_225856 + y_225857;
                float defunc_9_slope_fun_res_225859 = defunc_0_f_res_225845 *
                      x_225858;
                float defunc_1_op_res_225860 = defunc_9_fit_fun_res_225853 +
                      redout_225823;
                float defunc_1_op_res_225861 = defunc_9_slope_fun_res_225859 +
                      redout_225824;
                float redout_tmp_225876 = defunc_1_op_res_225860;
                float redout_tmp_225877 = defunc_1_op_res_225861;
                
                redout_225823 = redout_tmp_225876;
                redout_225824 = redout_tmp_225877;
            }
            defunc_2_reduce_res_225820 = redout_225823;
            defunc_2_reduce_res_225821 = redout_225824;
            ((float *) mem_213103)[i_225749] = defunc_2_reduce_res_225820;
            ((float *) mem_213106)[i_225749] = defunc_2_reduce_res_225821;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213134.mem + gtid_207369 * t_n_m_196759 * (int64_t) 4,
                    mem_213103 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213138.mem + gtid_207369 * t_n_m_196759 * (int64_t) 4,
                    mem_213106 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213058);
    free(mem_213073);
    free(mem_213076);
    free(mem_213103);
    free(mem_213106);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229279_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229279_end -
                 futhark_mc_segmap_parloop_229279_start;
        
        ctx->futhark_mc_segmap_parloop_229279_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229279_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229279_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229277(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207368 = tid;
    int num_tasks_225724 = info.nsubtasks;
    struct futhark_mc_task_229276 *futhark_mc_task_229276 =
                                  (struct futhark_mc_task_229276 *) args;
    struct futhark_context *ctx = futhark_mc_task_229276->ctx;
    uint64_t futhark_mc_segmap_task_229277_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229277_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229276->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229276->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229276->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229276->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229276->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229276->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229276->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229276->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229276->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229276->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229276->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229276->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229276->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229276->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229276->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229276->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229276->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229276->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213134 = {.desc ="mem_213134", .mem =
                                  futhark_mc_task_229276->free_mem_213134,
                                  .size =0, .references =NULL};
    struct memblock mem_213138 = {.desc ="mem_213138", .mem =
                                  futhark_mc_task_229276->free_mem_213138,
                                  .size =0, .references =NULL};
    int64_t iter_225725;
    struct futhark_mc_segmap_parloop_struct_229278
    futhark_mc_segmap_parloop_struct_229278;
    
    futhark_mc_segmap_parloop_struct_229278.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229278.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229278.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229278.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229278.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229278.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229278.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229278.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229278.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229278.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229278.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229278.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229278.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229278.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229278.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229278.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229278.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229278.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229278.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229278.free_mem_213134 = mem_213134.mem;
    futhark_mc_segmap_parloop_struct_229278.free_mem_213138 = mem_213138.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229279_task;
    
    futhark_mc_segmap_parloop_229279_task.name =
        "futhark_mc_segmap_parloop_229279";
    futhark_mc_segmap_parloop_229279_task.fn = futhark_mc_segmap_parloop_229279;
    futhark_mc_segmap_parloop_229279_task.args =
        &futhark_mc_segmap_parloop_struct_229278;
    futhark_mc_segmap_parloop_229279_task.iterations = iterations;
    futhark_mc_segmap_parloop_229279_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229279_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229279_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229279_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229279_task);
    
    if (futhark_mc_segmap_parloop_229279_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229279_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229279_total_end -
                 futhark_mc_segmap_parloop_229279_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229279_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229279_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229279_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229277_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229277_end -
                 futhark_mc_segmap_task_229277_start;
        
        ctx->futhark_mc_segmap_task_229277_runs[tid]++;
        ctx->futhark_mc_segmap_task_229277_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229277_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229286 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213134;
    unsigned char *free_mem_213138;
};
struct futhark_mc_task_229293 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213043;
};
struct futhark_mc_segmap_parloop_struct_229295 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213043;
};
static int futhark_mc_segmap_parloop_229296(void *args, int64_t start,
                                            int64_t end, int flat_tid_225879,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229295
    *futhark_mc_segmap_parloop_struct_229295 =
    (struct futhark_mc_segmap_parloop_struct_229295 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229295->ctx;
    uint64_t futhark_mc_segmap_parloop_229296_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229296_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229295->free_n_196692;
    int64_t gtid_207509 =
            futhark_mc_segmap_parloop_struct_229295->free_gtid_207509;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229295->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229295->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213043 = {.desc ="mem_213043", .mem =
                                  futhark_mc_segmap_parloop_struct_229295->free_mem_213043,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226134 = start;
    
    for (; iter_226134 < end; iter_226134++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226135 = n_196692;
        int64_t gtid_225880 = iter_226134;
        int64_t remnant_226136 = iter_226134 - gtid_225880;
        float x_225881;
        
        x_225881 = ((float *) Y_mem_210354.mem)[gtid_207509 * n_196692 +
                                                gtid_225880];
        
        float x_225882;
        
        x_225882 = ((float *) mem_212862.mem)[gtid_207509 * n_196692 +
                                              gtid_225880];
        
        float defunc_1_f_res_225883 = x_225881 - x_225882;
        
        ((float *) mem_213043.mem)[gtid_225880] = defunc_1_f_res_225883;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229296_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229296_end -
                 futhark_mc_segmap_parloop_229296_start;
        
        ctx->futhark_mc_segmap_parloop_229296_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229296_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229296_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229294(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225879 = tid;
    int num_tasks_226133 = info.nsubtasks;
    struct futhark_mc_task_229293 *futhark_mc_task_229293 =
                                  (struct futhark_mc_task_229293 *) args;
    struct futhark_context *ctx = futhark_mc_task_229293->ctx;
    uint64_t futhark_mc_segmap_task_229294_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229294_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229293->free_n_196692;
    int64_t gtid_207509 = futhark_mc_task_229293->free_gtid_207509;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229293->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229293->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213043 = {.desc ="mem_213043", .mem =
                                  futhark_mc_task_229293->free_mem_213043,
                                  .size =0, .references =NULL};
    int64_t iter_226134;
    struct futhark_mc_segmap_parloop_struct_229295
    futhark_mc_segmap_parloop_struct_229295;
    
    futhark_mc_segmap_parloop_struct_229295.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229295.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229295.free_gtid_207509 = gtid_207509;
    futhark_mc_segmap_parloop_struct_229295.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229295.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229295.free_mem_213043 = mem_213043.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229296_task;
    
    futhark_mc_segmap_parloop_229296_task.name =
        "futhark_mc_segmap_parloop_229296";
    futhark_mc_segmap_parloop_229296_task.fn = futhark_mc_segmap_parloop_229296;
    futhark_mc_segmap_parloop_229296_task.args =
        &futhark_mc_segmap_parloop_struct_229295;
    futhark_mc_segmap_parloop_229296_task.iterations = iterations;
    futhark_mc_segmap_parloop_229296_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229296_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229296_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229296_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229296_task);
    
    if (futhark_mc_segmap_parloop_229296_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229296_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229296_total_end -
                 futhark_mc_segmap_parloop_229296_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229296_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229296_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229296_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229294_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229294_end -
                 futhark_mc_segmap_task_229294_start;
        
        ctx->futhark_mc_segmap_task_229294_runs[tid]++;
        ctx->futhark_mc_segmap_task_229294_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229294_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229297 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213043;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
};
struct futhark_mc_segmap_parloop_struct_229299 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213043;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
};
static int futhark_mc_segmap_parloop_229300(void *args, int64_t start,
                                            int64_t end, int flat_tid_225884,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229299
    *futhark_mc_segmap_parloop_struct_229299 =
    (struct futhark_mc_segmap_parloop_struct_229299 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229299->ctx;
    uint64_t futhark_mc_segmap_parloop_229300_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229300_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229299->free_n_196692;
    int64_t gtid_207509 =
            futhark_mc_segmap_parloop_struct_229299->free_gtid_207509;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229299->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229299->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229299->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229299->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229299->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213043 = {.desc ="mem_213043", .mem =
                                  futhark_mc_segmap_parloop_struct_229299->free_mem_213043,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_segmap_parloop_struct_229299->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_segmap_parloop_struct_229299->free_mem_213049,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226138 = start;
    
    for (; iter_226138 < end; iter_226138++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226147 = n_196692;
        int64_t gtid_225885 = iter_226138;
        int64_t remnant_226148 = iter_226138 - gtid_225885;
        int64_t x_225886;
        
        x_225886 = ((int64_t *) mem_210394.mem)[gtid_207509 * n_196692 +
                                                gtid_225885];
        
        bool cond_225887 = sle64((int64_t) 0, x_225886);
        float defunc_0_f_res_225888;
        
        if (cond_225887) {
            bool y_226139 = slt64(x_225886, n_196692);
            bool bounds_check_226140 = cond_225887 && y_226139;
            bool index_certs_226141;
            
            if (!bounds_check_226140) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_225886,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_226142;
            
            defunc_0_f_res_t_res_226142 = ((float *) mem_213043.mem)[x_225886];
            defunc_0_f_res_225888 = defunc_0_f_res_t_res_226142;
        } else {
            defunc_0_f_res_225888 = 0.0F;
        }
        
        float defunc_0_f_res_225893;
        
        if (cond_225887) {
            bool y_226143 = slt64(x_225886, n_196692);
            bool bounds_check_226144 = cond_225887 && y_226143;
            bool index_certs_226145;
            
            if (!bounds_check_226144) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_225886,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_226146;
            
            defunc_0_f_res_t_res_226146 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_207509 *
                                                  ctx_param_ext_210921 +
                                                  x_225886 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_225893 = defunc_0_f_res_t_res_226146;
        } else {
            defunc_0_f_res_225893 = 0.0F;
        }
        ((float *) mem_213046.mem)[gtid_225885] = defunc_0_f_res_225893;
        ((float *) mem_213049.mem)[gtid_225885] = defunc_0_f_res_225888;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229300_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229300_end -
                 futhark_mc_segmap_parloop_229300_start;
        
        ctx->futhark_mc_segmap_parloop_229300_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229300_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229300_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229298(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225884 = tid;
    int num_tasks_226137 = info.nsubtasks;
    struct futhark_mc_task_229297 *futhark_mc_task_229297 =
                                  (struct futhark_mc_task_229297 *) args;
    struct futhark_context *ctx = futhark_mc_task_229297->ctx;
    uint64_t futhark_mc_segmap_task_229298_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229298_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229297->free_n_196692;
    int64_t gtid_207509 = futhark_mc_task_229297->free_gtid_207509;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229297->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229297->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229297->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229297->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229297->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213043 = {.desc ="mem_213043", .mem =
                                  futhark_mc_task_229297->free_mem_213043,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_task_229297->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_task_229297->free_mem_213049,
                                  .size =0, .references =NULL};
    int64_t iter_226138;
    struct futhark_mc_segmap_parloop_struct_229299
    futhark_mc_segmap_parloop_struct_229299;
    
    futhark_mc_segmap_parloop_struct_229299.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229299.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229299.free_gtid_207509 = gtid_207509;
    futhark_mc_segmap_parloop_struct_229299.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229299.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229299.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229299.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229299.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229299.free_mem_213043 = mem_213043.mem;
    futhark_mc_segmap_parloop_struct_229299.free_mem_213046 = mem_213046.mem;
    futhark_mc_segmap_parloop_struct_229299.free_mem_213049 = mem_213049.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229300_task;
    
    futhark_mc_segmap_parloop_229300_task.name =
        "futhark_mc_segmap_parloop_229300";
    futhark_mc_segmap_parloop_229300_task.fn = futhark_mc_segmap_parloop_229300;
    futhark_mc_segmap_parloop_229300_task.args =
        &futhark_mc_segmap_parloop_struct_229299;
    futhark_mc_segmap_parloop_229300_task.iterations = iterations;
    futhark_mc_segmap_parloop_229300_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229300_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229300_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229300_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229300_task);
    
    if (futhark_mc_segmap_parloop_229300_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229300_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229300_total_end -
                 futhark_mc_segmap_parloop_229300_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229300_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229300_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229300_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229298_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229298_end -
                 futhark_mc_segmap_task_229298_start;
        
        ctx->futhark_mc_segmap_task_229298_runs[tid]++;
        ctx->futhark_mc_segmap_task_229298_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229298_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229301 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
    unsigned char *free_mem_213052;
    unsigned char *free_mem_213055;
};
struct futhark_mc_segmap_parloop_struct_229303 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
    unsigned char *free_mem_213052;
    unsigned char *free_mem_213055;
};
static int futhark_mc_segmap_parloop_229304(void *args, int64_t start,
                                            int64_t end, int flat_tid_226019,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229303
    *futhark_mc_segmap_parloop_struct_229303 =
    (struct futhark_mc_segmap_parloop_struct_229303 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229303->ctx;
    uint64_t futhark_mc_segmap_parloop_229304_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229304_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229303->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229303->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229303->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229303->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229303->free_i_196779;
    int64_t gtid_207509 =
            futhark_mc_segmap_parloop_struct_229303->free_gtid_207509;
    int64_t x_207514 = futhark_mc_segmap_parloop_struct_229303->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_213049,
                                  .size =0, .references =NULL};
    struct memblock mem_213052 = {.desc ="mem_213052", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_213052,
                                  .size =0, .references =NULL};
    struct memblock mem_213055 = {.desc ="mem_213055", .mem =
                                  futhark_mc_segmap_parloop_struct_229303->free_mem_213055,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226150 = start;
    
    for (; iter_226150 < end; iter_226150++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226224 = t_n_m_196759;
        int64_t gtid_226020 = iter_226150;
        int64_t remnant_226225 = iter_226150 - gtid_226020;
        int64_t x_226021;
        
        x_226021 = ((int64_t *) mem_210889.mem)[gtid_207509 * t_n_m_196759 +
                                                gtid_226020];
        
        float x_226022;
        
        x_226022 = ((float *) mem_210893.mem)[gtid_207509 * t_n_m_196759 +
                                              gtid_226020];
        
        int64_t min_arg_226023 = mul64(jump_t_196702, gtid_226020);
        int64_t min_res_226024 = smin64(i_196779, min_arg_226023);
        int64_t defunc_0_g_res_226025 = add64((int64_t) 1, min_res_226024);
        float defunc_2_reduce_res_226026;
        float defunc_2_reduce_res_226027;
        float defunc_2_reduce_res_226028;
        float defunc_2_reduce_res_226029;
        float defunc_2_reduce_res_226030;
        float redout_226152;
        float redout_226153;
        float redout_226154;
        float redout_226155;
        float redout_226156;
        
        redout_226152 = 0.0F;
        redout_226153 = 0.0F;
        redout_226154 = 0.0F;
        redout_226155 = 0.0F;
        redout_226156 = 0.0F;
        for (int64_t i_226151 = 0; i_226151 < q_t_196696; i_226151++) {
            bool cond_226157 = sle64(x_207514, i_226151);
            int64_t defunc_0_f_res_226158;
            
            if (cond_226157) {
                defunc_0_f_res_226158 = (int64_t) 0;
            } else {
                int64_t i_226159 = add64(x_226021, i_226151);
                int64_t defunc_0_add_arg_226160;
                
                defunc_0_add_arg_226160 =
                    ((int64_t *) mem_210394.mem)[gtid_207509 * n_196692 +
                                                 i_226159];
                
                int64_t defunc_1_add_res_226161 = add64((int64_t) 1,
                                                        defunc_0_add_arg_226160);
                
                defunc_0_f_res_226158 = defunc_1_add_res_226161;
            }
            
            float defunc_0_f_res_226162;
            
            if (cond_226157) {
                defunc_0_f_res_226162 = 0.0F;
            } else {
                int64_t i_226163 = add64(x_226021, i_226151);
                float defunc_0_add_arg_226164;
                
                defunc_0_add_arg_226164 = ((float *) mem_213046.mem)[i_226163];
                defunc_0_f_res_226162 = defunc_0_add_arg_226164;
            }
            
            int64_t binop_p_226165 = sub64(defunc_0_f_res_226158,
                                           defunc_0_g_res_226025);
            float defunc_0_f_res_226166 = sitofp_i64_f32(binop_p_226165);
            float abs_res_226167 = (float) fabs(defunc_0_f_res_226166);
            float tmp1_226168 = abs_res_226167 / x_226022;
            float x_226169 = tmp1_226168 * tmp1_226168;
            float y_226170 = tmp1_226168 * x_226169;
            float tmp2_226171 = 1.0F - y_226170;
            float x_226172 = tmp2_226171 * tmp2_226171;
            float tmp3_226173 = tmp2_226171 * x_226172;
            float w_j_226174 = defunc_0_f_res_226162 * tmp3_226173;
            float xw_j_226175 = defunc_0_f_res_226166 * w_j_226174;
            float x2w_j_226176 = defunc_0_f_res_226166 * xw_j_226175;
            float x3w_j_226177 = defunc_0_f_res_226166 * x2w_j_226176;
            float x4w_j_226178 = defunc_0_f_res_226166 * x3w_j_226177;
            float defunc_1_op_res_226179 = w_j_226174 + redout_226152;
            float defunc_1_op_res_226180 = xw_j_226175 + redout_226153;
            float defunc_1_op_res_226181 = x2w_j_226176 + redout_226154;
            float defunc_1_op_res_226182 = x3w_j_226177 + redout_226155;
            float defunc_1_op_res_226183 = x4w_j_226178 + redout_226156;
            float redout_tmp_226226 = defunc_1_op_res_226179;
            float redout_tmp_226227 = defunc_1_op_res_226180;
            float redout_tmp_226228 = defunc_1_op_res_226181;
            float redout_tmp_226229 = defunc_1_op_res_226182;
            float redout_tmp_226230 = defunc_1_op_res_226183;
            
            redout_226152 = redout_tmp_226226;
            redout_226153 = redout_tmp_226227;
            redout_226154 = redout_tmp_226228;
            redout_226155 = redout_tmp_226229;
            redout_226156 = redout_tmp_226230;
        }
        defunc_2_reduce_res_226026 = redout_226152;
        defunc_2_reduce_res_226027 = redout_226153;
        defunc_2_reduce_res_226028 = redout_226154;
        defunc_2_reduce_res_226029 = redout_226155;
        defunc_2_reduce_res_226030 = redout_226156;
        
        float x_226064 = defunc_2_reduce_res_226028 *
              defunc_2_reduce_res_226030;
        float y_226065 = defunc_2_reduce_res_226029 *
              defunc_2_reduce_res_226029;
        float a12_226066 = x_226064 - y_226065;
        float x_226067 = defunc_2_reduce_res_226028 *
              defunc_2_reduce_res_226029;
        float y_226068 = defunc_2_reduce_res_226027 *
              defunc_2_reduce_res_226030;
        float b12_226069 = x_226067 - y_226068;
        float x_226070 = defunc_2_reduce_res_226027 *
              defunc_2_reduce_res_226029;
        float y_226071 = defunc_2_reduce_res_226028 *
              defunc_2_reduce_res_226028;
        float c12_226072 = x_226070 - y_226071;
        float x_226073 = defunc_2_reduce_res_226026 *
              defunc_2_reduce_res_226030;
        float b2_226074 = x_226073 - y_226071;
        float x_226075 = defunc_2_reduce_res_226027 *
              defunc_2_reduce_res_226028;
        float y_226076 = defunc_2_reduce_res_226026 *
              defunc_2_reduce_res_226029;
        float c2_226077 = x_226075 - y_226076;
        float x_226078 = defunc_2_reduce_res_226026 * a12_226066;
        float y_226079 = defunc_2_reduce_res_226027 * b12_226069;
        float x_226080 = x_226078 + y_226079;
        float y_226081 = defunc_2_reduce_res_226028 * c12_226072;
        float y_226082 = x_226080 + y_226081;
        float det_226083 = 1.0F / y_226082;
        float a12_226084 = a12_226066 * det_226083;
        float b12_226085 = b12_226069 * det_226083;
        float c12_226086 = c12_226072 * det_226083;
        float b2_226087 = b2_226074 * det_226083;
        float c2_226088 = c2_226077 * det_226083;
        float defunc_2_reduce_res_226089;
        float defunc_2_reduce_res_226090;
        float redout_226185;
        float redout_226186;
        
        redout_226185 = 0.0F;
        redout_226186 = 0.0F;
        for (int64_t i_226184 = 0; i_226184 < q_t_196696; i_226184++) {
            bool cond_226187 = sle64(x_207514, i_226184);
            int64_t defunc_0_f_res_226188;
            
            if (cond_226187) {
                defunc_0_f_res_226188 = (int64_t) 0;
            } else {
                int64_t i_226189 = add64(x_226021, i_226184);
                int64_t defunc_0_add_arg_226190;
                
                defunc_0_add_arg_226190 =
                    ((int64_t *) mem_210394.mem)[gtid_207509 * n_196692 +
                                                 i_226189];
                
                int64_t defunc_1_add_res_226191 = add64((int64_t) 1,
                                                        defunc_0_add_arg_226190);
                
                defunc_0_f_res_226188 = defunc_1_add_res_226191;
            }
            
            float defunc_0_f_res_226192;
            
            if (cond_226187) {
                defunc_0_f_res_226192 = 0.0F;
            } else {
                int64_t i_226193 = add64(x_226021, i_226184);
                float defunc_0_add_arg_226194;
                
                defunc_0_add_arg_226194 = ((float *) mem_213046.mem)[i_226193];
                defunc_0_f_res_226192 = defunc_0_add_arg_226194;
            }
            
            int64_t binop_p_226195 = sub64(defunc_0_f_res_226188,
                                           defunc_0_g_res_226025);
            float defunc_0_f_res_226196 = sitofp_i64_f32(binop_p_226195);
            float abs_res_226197 = (float) fabs(defunc_0_f_res_226196);
            float tmp1_226198 = abs_res_226197 / x_226022;
            float x_226199 = tmp1_226198 * tmp1_226198;
            float y_226200 = tmp1_226198 * x_226199;
            float tmp2_226201 = 1.0F - y_226200;
            float x_226202 = tmp2_226201 * tmp2_226201;
            float tmp3_226203 = tmp2_226201 * x_226202;
            float tmp4_226204 = defunc_0_f_res_226192 * tmp3_226203;
            float defunc_1_f_res_226205 = defunc_0_f_res_226196 * tmp4_226204;
            float defunc_1_f_res_226206 = defunc_0_f_res_226196 *
                  defunc_1_f_res_226205;
            float defunc_0_f_res_226207;
            
            if (cond_226187) {
                defunc_0_f_res_226207 = 0.0F;
            } else {
                int64_t i_226208 = add64(x_226021, i_226184);
                float defunc_0_add_arg_226209;
                
                defunc_0_add_arg_226209 = ((float *) mem_213049.mem)[i_226208];
                defunc_0_f_res_226207 = defunc_0_add_arg_226209;
            }
            
            float x_226210 = a12_226084 * tmp4_226204;
            float y_226211 = b12_226085 * defunc_1_f_res_226205;
            float x_226212 = x_226210 + y_226211;
            float y_226213 = c12_226086 * defunc_1_f_res_226206;
            float x_226214 = x_226212 + y_226213;
            float defunc_9_fit_fun_res_226215 = defunc_0_f_res_226207 *
                  x_226214;
            float x_226216 = b12_226085 * tmp4_226204;
            float y_226217 = b2_226087 * defunc_1_f_res_226205;
            float x_226218 = x_226216 + y_226217;
            float y_226219 = c2_226088 * defunc_1_f_res_226206;
            float x_226220 = x_226218 + y_226219;
            float defunc_9_slope_fun_res_226221 = defunc_0_f_res_226207 *
                  x_226220;
            float defunc_1_op_res_226222 = defunc_9_fit_fun_res_226215 +
                  redout_226185;
            float defunc_1_op_res_226223 = defunc_9_slope_fun_res_226221 +
                  redout_226186;
            float redout_tmp_226231 = defunc_1_op_res_226222;
            float redout_tmp_226232 = defunc_1_op_res_226223;
            
            redout_226185 = redout_tmp_226231;
            redout_226186 = redout_tmp_226232;
        }
        defunc_2_reduce_res_226089 = redout_226185;
        defunc_2_reduce_res_226090 = redout_226186;
        ((float *) mem_213052.mem)[gtid_226020] = defunc_2_reduce_res_226089;
        ((float *) mem_213055.mem)[gtid_226020] = defunc_2_reduce_res_226090;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229304_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229304_end -
                 futhark_mc_segmap_parloop_229304_start;
        
        ctx->futhark_mc_segmap_parloop_229304_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229304_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229304_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229302(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226019 = tid;
    int num_tasks_226149 = info.nsubtasks;
    struct futhark_mc_task_229301 *futhark_mc_task_229301 =
                                  (struct futhark_mc_task_229301 *) args;
    struct futhark_context *ctx = futhark_mc_task_229301->ctx;
    uint64_t futhark_mc_segmap_task_229302_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229302_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229301->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229301->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229301->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229301->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229301->free_i_196779;
    int64_t gtid_207509 = futhark_mc_task_229301->free_gtid_207509;
    int64_t x_207514 = futhark_mc_task_229301->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229301->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229301->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229301->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_task_229301->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_task_229301->free_mem_213049,
                                  .size =0, .references =NULL};
    struct memblock mem_213052 = {.desc ="mem_213052", .mem =
                                  futhark_mc_task_229301->free_mem_213052,
                                  .size =0, .references =NULL};
    struct memblock mem_213055 = {.desc ="mem_213055", .mem =
                                  futhark_mc_task_229301->free_mem_213055,
                                  .size =0, .references =NULL};
    int64_t iter_226150;
    struct futhark_mc_segmap_parloop_struct_229303
    futhark_mc_segmap_parloop_struct_229303;
    
    futhark_mc_segmap_parloop_struct_229303.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229303.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229303.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229303.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229303.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229303.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229303.free_gtid_207509 = gtid_207509;
    futhark_mc_segmap_parloop_struct_229303.free_x_207514 = x_207514;
    futhark_mc_segmap_parloop_struct_229303.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229303.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229303.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229303.free_mem_213046 = mem_213046.mem;
    futhark_mc_segmap_parloop_struct_229303.free_mem_213049 = mem_213049.mem;
    futhark_mc_segmap_parloop_struct_229303.free_mem_213052 = mem_213052.mem;
    futhark_mc_segmap_parloop_struct_229303.free_mem_213055 = mem_213055.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229304_task;
    
    futhark_mc_segmap_parloop_229304_task.name =
        "futhark_mc_segmap_parloop_229304";
    futhark_mc_segmap_parloop_229304_task.fn = futhark_mc_segmap_parloop_229304;
    futhark_mc_segmap_parloop_229304_task.args =
        &futhark_mc_segmap_parloop_struct_229303;
    futhark_mc_segmap_parloop_229304_task.iterations = iterations;
    futhark_mc_segmap_parloop_229304_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229304_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229304_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229304_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229304_task);
    
    if (futhark_mc_segmap_parloop_229304_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229304_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229304_total_end -
                 futhark_mc_segmap_parloop_229304_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229304_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229304_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229304_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229302_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229302_end -
                 futhark_mc_segmap_task_229302_start;
        
        ctx->futhark_mc_segmap_task_229302_runs[tid]++;
        ctx->futhark_mc_segmap_task_229302_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229302_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229306 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
    unsigned char *free_mem_213052;
    unsigned char *free_mem_213055;
};
struct futhark_mc_task_229308 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213046;
    int64_t free_x_225900;
    float free_x_225901;
    int64_t free_defunc_0_g_res_225904;
    float *retval_defunc_2_reduce_res_225905;
    float *retval_defunc_2_reduce_res_225906;
    float *retval_defunc_2_reduce_res_225907;
    float *retval_defunc_2_reduce_res_225908;
    float *retval_defunc_2_reduce_res_225909;
};
struct futhark_mc_segred_stage_1_parloop_struct_229315 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213046;
    int64_t free_x_225900;
    float free_x_225901;
    int64_t free_defunc_0_g_res_225904;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226319;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226321;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226323;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226325;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226327;
};
static int futhark_mc_segred_stage_1_parloop_229316(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_226234,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229315
    *futhark_mc_segred_stage_1_parloop_struct_229315 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229315 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229315->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229316_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229316_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229315->free_n_196692;
    int64_t gtid_207509 =
            futhark_mc_segred_stage_1_parloop_struct_229315->free_gtid_207509;
    int64_t x_207514 =
            futhark_mc_segred_stage_1_parloop_struct_229315->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229315->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229315->free_mem_213046,
                                  .size =0, .references =NULL};
    int64_t x_225900 =
            futhark_mc_segred_stage_1_parloop_struct_229315->free_x_225900;
    float x_225901 =
          futhark_mc_segred_stage_1_parloop_struct_229315->free_x_225901;
    int64_t defunc_0_g_res_225904 =
            futhark_mc_segred_stage_1_parloop_struct_229315->free_defunc_0_g_res_225904;
    struct memblock reduce_stage_1_tid_res_arr_mem_226319 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226319",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229315->free_reduce_stage_1_tid_res_arr_mem_226319,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_226321 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226321",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229315->free_reduce_stage_1_tid_res_arr_mem_226321,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_226323 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226323",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229315->free_reduce_stage_1_tid_res_arr_mem_226323,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_226325 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226325",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229315->free_reduce_stage_1_tid_res_arr_mem_226325,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_226327 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226327",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229315->free_reduce_stage_1_tid_res_arr_mem_226327,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226329 = start;
    float x_226236;
    float x_226237;
    float x_226239;
    float x_226240;
    float x_226242;
    float x_226243;
    float x_226245;
    float x_226246;
    float x_226248;
    float x_226249;
    float local_acc_226330 = 0.0F;
    float local_acc_226331 = 0.0F;
    float local_acc_226332 = 0.0F;
    float local_acc_226333 = 0.0F;
    float local_acc_226334 = 0.0F;
    
    for (; iter_226329 < end; iter_226329++) {
        int64_t gtid_226235 = iter_226329;
        bool cond_226251 = sle64(x_207514, gtid_226235);
        int64_t defunc_0_f_res_226252;
        
        if (cond_226251) {
            defunc_0_f_res_226252 = (int64_t) 0;
        } else {
            int64_t i_226253 = add64(x_225900, gtid_226235);
            int64_t defunc_0_add_arg_226254;
            
            defunc_0_add_arg_226254 = ((int64_t *) mem_210394.mem)[gtid_207509 *
                                                                   n_196692 +
                                                                   i_226253];
            
            int64_t defunc_1_add_res_226255 = add64((int64_t) 1,
                                                    defunc_0_add_arg_226254);
            
            defunc_0_f_res_226252 = defunc_1_add_res_226255;
        }
        
        float defunc_0_f_res_226256;
        
        if (cond_226251) {
            defunc_0_f_res_226256 = 0.0F;
        } else {
            int64_t i_226257 = add64(x_225900, gtid_226235);
            float defunc_0_add_arg_226258;
            
            defunc_0_add_arg_226258 = ((float *) mem_213046.mem)[i_226257];
            defunc_0_f_res_226256 = defunc_0_add_arg_226258;
        }
        
        int64_t binop_p_226259 = sub64(defunc_0_f_res_226252,
                                       defunc_0_g_res_225904);
        float defunc_0_f_res_226260 = sitofp_i64_f32(binop_p_226259);
        float abs_res_226261 = (float) fabs(defunc_0_f_res_226260);
        float tmp1_226262 = abs_res_226261 / x_225901;
        float x_226263 = tmp1_226262 * tmp1_226262;
        float y_226264 = tmp1_226262 * x_226263;
        float tmp2_226265 = 1.0F - y_226264;
        float x_226266 = tmp2_226265 * tmp2_226265;
        float tmp3_226267 = tmp2_226265 * x_226266;
        float w_j_226268 = defunc_0_f_res_226256 * tmp3_226267;
        float xw_j_226269 = defunc_0_f_res_226260 * w_j_226268;
        float x2w_j_226270 = defunc_0_f_res_226260 * xw_j_226269;
        float x3w_j_226271 = defunc_0_f_res_226260 * x2w_j_226270;
        float x4w_j_226272 = defunc_0_f_res_226260 * x3w_j_226271;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_226236 = local_acc_226330;
        }
        // Load next params
        {
            x_226237 = w_j_226268;
        }
        // Red body
        {
            float defunc_1_op_res_226238 = x_226236 + x_226237;
            
            local_acc_226330 = defunc_1_op_res_226238;
        }
        // Load accum params
        {
            x_226239 = local_acc_226331;
        }
        // Load next params
        {
            x_226240 = xw_j_226269;
        }
        // Red body
        {
            float defunc_1_op_res_226241 = x_226239 + x_226240;
            
            local_acc_226331 = defunc_1_op_res_226241;
        }
        // Load accum params
        {
            x_226242 = local_acc_226332;
        }
        // Load next params
        {
            x_226243 = x2w_j_226270;
        }
        // Red body
        {
            float defunc_1_op_res_226244 = x_226242 + x_226243;
            
            local_acc_226332 = defunc_1_op_res_226244;
        }
        // Load accum params
        {
            x_226245 = local_acc_226333;
        }
        // Load next params
        {
            x_226246 = x3w_j_226271;
        }
        // Red body
        {
            float defunc_1_op_res_226247 = x_226245 + x_226246;
            
            local_acc_226333 = defunc_1_op_res_226247;
        }
        // Load accum params
        {
            x_226248 = local_acc_226334;
        }
        // Load next params
        {
            x_226249 = x4w_j_226272;
        }
        // Red body
        {
            float defunc_1_op_res_226250 = x_226248 + x_226249;
            
            local_acc_226334 = defunc_1_op_res_226250;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_226319.mem)[flat_tid_226234] =
        local_acc_226330;
    ((float *) reduce_stage_1_tid_res_arr_mem_226321.mem)[flat_tid_226234] =
        local_acc_226331;
    ((float *) reduce_stage_1_tid_res_arr_mem_226323.mem)[flat_tid_226234] =
        local_acc_226332;
    ((float *) reduce_stage_1_tid_res_arr_mem_226325.mem)[flat_tid_226234] =
        local_acc_226333;
    ((float *) reduce_stage_1_tid_res_arr_mem_226327.mem)[flat_tid_226234] =
        local_acc_226334;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229316_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229316_end -
                 futhark_mc_segred_stage_1_parloop_229316_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229316_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229316_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229316_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229309(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226234 = tid;
    int num_tasks_226318 = info.nsubtasks;
    struct futhark_mc_task_229308 *futhark_mc_task_229308 =
                                  (struct futhark_mc_task_229308 *) args;
    struct futhark_context *ctx = futhark_mc_task_229308->ctx;
    uint64_t futhark_mc_segred_task_229309_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229309_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229308->free_n_196692;
    int64_t gtid_207509 = futhark_mc_task_229308->free_gtid_207509;
    int64_t x_207514 = futhark_mc_task_229308->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229308->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_task_229308->free_mem_213046,
                                  .size =0, .references =NULL};
    int64_t x_225900 = futhark_mc_task_229308->free_x_225900;
    float x_225901 = futhark_mc_task_229308->free_x_225901;
    int64_t defunc_0_g_res_225904 =
            futhark_mc_task_229308->free_defunc_0_g_res_225904;
    float defunc_2_reduce_res_225905 =
          *futhark_mc_task_229308->retval_defunc_2_reduce_res_225905;
    float defunc_2_reduce_res_225906 =
          *futhark_mc_task_229308->retval_defunc_2_reduce_res_225906;
    float defunc_2_reduce_res_225907 =
          *futhark_mc_task_229308->retval_defunc_2_reduce_res_225907;
    float defunc_2_reduce_res_225908 =
          *futhark_mc_task_229308->retval_defunc_2_reduce_res_225908;
    float defunc_2_reduce_res_225909 =
          *futhark_mc_task_229308->retval_defunc_2_reduce_res_225909;
    size_t reduce_stage_1_tid_res_arr_mem_226319_cached_sizze_229310 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226319 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_226321_cached_sizze_229311 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226321 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_226323_cached_sizze_229312 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226323 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_226325_cached_sizze_229313 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226325 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_226327_cached_sizze_229314 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226327 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_226319_cached_sizze_229310 <
        (size_t) ((int64_t) 4 * num_tasks_226318)) {
        reduce_stage_1_tid_res_arr_mem_226319 =
            realloc(reduce_stage_1_tid_res_arr_mem_226319, (int64_t) 4 *
                    num_tasks_226318);
        reduce_stage_1_tid_res_arr_mem_226319_cached_sizze_229310 =
            (int64_t) 4 * num_tasks_226318;
    }
    if (reduce_stage_1_tid_res_arr_mem_226321_cached_sizze_229311 <
        (size_t) ((int64_t) 4 * num_tasks_226318)) {
        reduce_stage_1_tid_res_arr_mem_226321 =
            realloc(reduce_stage_1_tid_res_arr_mem_226321, (int64_t) 4 *
                    num_tasks_226318);
        reduce_stage_1_tid_res_arr_mem_226321_cached_sizze_229311 =
            (int64_t) 4 * num_tasks_226318;
    }
    if (reduce_stage_1_tid_res_arr_mem_226323_cached_sizze_229312 <
        (size_t) ((int64_t) 4 * num_tasks_226318)) {
        reduce_stage_1_tid_res_arr_mem_226323 =
            realloc(reduce_stage_1_tid_res_arr_mem_226323, (int64_t) 4 *
                    num_tasks_226318);
        reduce_stage_1_tid_res_arr_mem_226323_cached_sizze_229312 =
            (int64_t) 4 * num_tasks_226318;
    }
    if (reduce_stage_1_tid_res_arr_mem_226325_cached_sizze_229313 <
        (size_t) ((int64_t) 4 * num_tasks_226318)) {
        reduce_stage_1_tid_res_arr_mem_226325 =
            realloc(reduce_stage_1_tid_res_arr_mem_226325, (int64_t) 4 *
                    num_tasks_226318);
        reduce_stage_1_tid_res_arr_mem_226325_cached_sizze_229313 =
            (int64_t) 4 * num_tasks_226318;
    }
    if (reduce_stage_1_tid_res_arr_mem_226327_cached_sizze_229314 <
        (size_t) ((int64_t) 4 * num_tasks_226318)) {
        reduce_stage_1_tid_res_arr_mem_226327 =
            realloc(reduce_stage_1_tid_res_arr_mem_226327, (int64_t) 4 *
                    num_tasks_226318);
        reduce_stage_1_tid_res_arr_mem_226327_cached_sizze_229314 =
            (int64_t) 4 * num_tasks_226318;
    }
    
    int64_t iter_226329;
    struct futhark_mc_segred_stage_1_parloop_struct_229315
    futhark_mc_segred_stage_1_parloop_struct_229315;
    
    futhark_mc_segred_stage_1_parloop_struct_229315.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_gtid_207509 =
        gtid_207509;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_x_207514 = x_207514;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_mem_213046 =
        mem_213046.mem;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_x_225900 = x_225900;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_x_225901 = x_225901;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_defunc_0_g_res_225904 =
        defunc_0_g_res_225904;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_reduce_stage_1_tid_res_arr_mem_226319 =
        reduce_stage_1_tid_res_arr_mem_226319;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_reduce_stage_1_tid_res_arr_mem_226321 =
        reduce_stage_1_tid_res_arr_mem_226321;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_reduce_stage_1_tid_res_arr_mem_226323 =
        reduce_stage_1_tid_res_arr_mem_226323;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_reduce_stage_1_tid_res_arr_mem_226325 =
        reduce_stage_1_tid_res_arr_mem_226325;
    futhark_mc_segred_stage_1_parloop_struct_229315.free_reduce_stage_1_tid_res_arr_mem_226327 =
        reduce_stage_1_tid_res_arr_mem_226327;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229316_task;
    
    futhark_mc_segred_stage_1_parloop_229316_task.name =
        "futhark_mc_segred_stage_1_parloop_229316";
    futhark_mc_segred_stage_1_parloop_229316_task.fn =
        futhark_mc_segred_stage_1_parloop_229316;
    futhark_mc_segred_stage_1_parloop_229316_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229315;
    futhark_mc_segred_stage_1_parloop_229316_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229316_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229316_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229316_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229316_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229316_task);
    
    if (futhark_mc_segred_stage_1_parloop_229316_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229316_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229316_total_end -
                 futhark_mc_segred_stage_1_parloop_229316_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229316_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229316_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229316_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_225905 = 0.0F;
        defunc_2_reduce_res_225906 = 0.0F;
        defunc_2_reduce_res_225907 = 0.0F;
        defunc_2_reduce_res_225908 = 0.0F;
        defunc_2_reduce_res_225909 = 0.0F;
    }
    
    float x_226335;
    float x_226336;
    float x_226338;
    float x_226339;
    float x_226341;
    float x_226342;
    float x_226344;
    float x_226345;
    float x_226347;
    float x_226348;
    
    for (int32_t i_226350 = 0; i_226350 < num_tasks_226318; i_226350++) {
        flat_tid_226234 = i_226350;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_226335 = defunc_2_reduce_res_225905;
            }
            // load next params
            {
                x_226336 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226319)[flat_tid_226234];
            }
            // red body
            {
                float defunc_1_op_res_226337 = x_226335 + x_226336;
                
                defunc_2_reduce_res_225905 = defunc_1_op_res_226337;
            }
            // load acc params
            {
                x_226338 = defunc_2_reduce_res_225906;
            }
            // load next params
            {
                x_226339 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226321)[flat_tid_226234];
            }
            // red body
            {
                float defunc_1_op_res_226340 = x_226338 + x_226339;
                
                defunc_2_reduce_res_225906 = defunc_1_op_res_226340;
            }
            // load acc params
            {
                x_226341 = defunc_2_reduce_res_225907;
            }
            // load next params
            {
                x_226342 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226323)[flat_tid_226234];
            }
            // red body
            {
                float defunc_1_op_res_226343 = x_226341 + x_226342;
                
                defunc_2_reduce_res_225907 = defunc_1_op_res_226343;
            }
            // load acc params
            {
                x_226344 = defunc_2_reduce_res_225908;
            }
            // load next params
            {
                x_226345 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226325)[flat_tid_226234];
            }
            // red body
            {
                float defunc_1_op_res_226346 = x_226344 + x_226345;
                
                defunc_2_reduce_res_225908 = defunc_1_op_res_226346;
            }
            // load acc params
            {
                x_226347 = defunc_2_reduce_res_225909;
            }
            // load next params
            {
                x_226348 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226327)[flat_tid_226234];
            }
            // red body
            {
                float defunc_1_op_res_226349 = x_226347 + x_226348;
                
                defunc_2_reduce_res_225909 = defunc_1_op_res_226349;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_226319);
        free(reduce_stage_1_tid_res_arr_mem_226321);
        free(reduce_stage_1_tid_res_arr_mem_226323);
        free(reduce_stage_1_tid_res_arr_mem_226325);
        free(reduce_stage_1_tid_res_arr_mem_226327);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229309_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229309_end -
                 futhark_mc_segred_task_229309_start;
        
        ctx->futhark_mc_segred_task_229309_runs[tid]++;
        ctx->futhark_mc_segred_task_229309_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229309_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229308->retval_defunc_2_reduce_res_225905 =
            defunc_2_reduce_res_225905;
        *futhark_mc_task_229308->retval_defunc_2_reduce_res_225906 =
            defunc_2_reduce_res_225906;
        *futhark_mc_task_229308->retval_defunc_2_reduce_res_225907 =
            defunc_2_reduce_res_225907;
        *futhark_mc_task_229308->retval_defunc_2_reduce_res_225908 =
            defunc_2_reduce_res_225908;
        *futhark_mc_task_229308->retval_defunc_2_reduce_res_225909 =
            defunc_2_reduce_res_225909;
    }
    return err;
}
struct futhark_mc_task_229317 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
    int64_t free_x_225900;
    float free_x_225901;
    int64_t free_defunc_0_g_res_225904;
    float free_a12_225969;
    float free_b12_225970;
    float free_c12_225971;
    float free_b2_225972;
    float free_c2_225973;
    float *retval_defunc_2_reduce_res_225974;
    float *retval_defunc_2_reduce_res_225975;
};
struct futhark_mc_segred_stage_1_parloop_struct_229321 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207509;
    int64_t free_x_207514;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213046;
    unsigned char *free_mem_213049;
    int64_t free_x_225900;
    float free_x_225901;
    int64_t free_defunc_0_g_res_225904;
    float free_a12_225969;
    float free_b12_225970;
    float free_c12_225971;
    float free_b2_225972;
    float free_c2_225973;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226352;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226354;
};
static int futhark_mc_segred_stage_1_parloop_229322(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_226273,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229321
    *futhark_mc_segred_stage_1_parloop_struct_229321 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229321 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229321->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229322_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229322_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229321->free_n_196692;
    int64_t gtid_207509 =
            futhark_mc_segred_stage_1_parloop_struct_229321->free_gtid_207509;
    int64_t x_207514 =
            futhark_mc_segred_stage_1_parloop_struct_229321->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229321->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229321->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229321->free_mem_213049,
                                  .size =0, .references =NULL};
    int64_t x_225900 =
            futhark_mc_segred_stage_1_parloop_struct_229321->free_x_225900;
    float x_225901 =
          futhark_mc_segred_stage_1_parloop_struct_229321->free_x_225901;
    int64_t defunc_0_g_res_225904 =
            futhark_mc_segred_stage_1_parloop_struct_229321->free_defunc_0_g_res_225904;
    float a12_225969 =
          futhark_mc_segred_stage_1_parloop_struct_229321->free_a12_225969;
    float b12_225970 =
          futhark_mc_segred_stage_1_parloop_struct_229321->free_b12_225970;
    float c12_225971 =
          futhark_mc_segred_stage_1_parloop_struct_229321->free_c12_225971;
    float b2_225972 =
          futhark_mc_segred_stage_1_parloop_struct_229321->free_b2_225972;
    float c2_225973 =
          futhark_mc_segred_stage_1_parloop_struct_229321->free_c2_225973;
    struct memblock reduce_stage_1_tid_res_arr_mem_226352 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226352",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229321->free_reduce_stage_1_tid_res_arr_mem_226352,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_226354 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226354",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229321->free_reduce_stage_1_tid_res_arr_mem_226354,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226356 = start;
    float x_226275;
    float x_226276;
    float x_226278;
    float x_226279;
    float local_acc_226357 = 0.0F;
    float local_acc_226358 = 0.0F;
    
    for (; iter_226356 < end; iter_226356++) {
        int64_t gtid_226274 = iter_226356;
        bool cond_226281 = sle64(x_207514, gtid_226274);
        int64_t defunc_0_f_res_226282;
        
        if (cond_226281) {
            defunc_0_f_res_226282 = (int64_t) 0;
        } else {
            int64_t i_226283 = add64(x_225900, gtid_226274);
            int64_t defunc_0_add_arg_226284;
            
            defunc_0_add_arg_226284 = ((int64_t *) mem_210394.mem)[gtid_207509 *
                                                                   n_196692 +
                                                                   i_226283];
            
            int64_t defunc_1_add_res_226285 = add64((int64_t) 1,
                                                    defunc_0_add_arg_226284);
            
            defunc_0_f_res_226282 = defunc_1_add_res_226285;
        }
        
        float defunc_0_f_res_226286;
        
        if (cond_226281) {
            defunc_0_f_res_226286 = 0.0F;
        } else {
            int64_t i_226287 = add64(x_225900, gtid_226274);
            float defunc_0_add_arg_226288;
            
            defunc_0_add_arg_226288 = ((float *) mem_213046.mem)[i_226287];
            defunc_0_f_res_226286 = defunc_0_add_arg_226288;
        }
        
        int64_t binop_p_226289 = sub64(defunc_0_f_res_226282,
                                       defunc_0_g_res_225904);
        float defunc_0_f_res_226290 = sitofp_i64_f32(binop_p_226289);
        float abs_res_226291 = (float) fabs(defunc_0_f_res_226290);
        float tmp1_226292 = abs_res_226291 / x_225901;
        float x_226293 = tmp1_226292 * tmp1_226292;
        float y_226294 = tmp1_226292 * x_226293;
        float tmp2_226295 = 1.0F - y_226294;
        float x_226296 = tmp2_226295 * tmp2_226295;
        float tmp3_226297 = tmp2_226295 * x_226296;
        float tmp4_226298 = defunc_0_f_res_226286 * tmp3_226297;
        float defunc_1_f_res_226299 = defunc_0_f_res_226290 * tmp4_226298;
        float defunc_1_f_res_226300 = defunc_0_f_res_226290 *
              defunc_1_f_res_226299;
        float defunc_0_f_res_226301;
        
        if (cond_226281) {
            defunc_0_f_res_226301 = 0.0F;
        } else {
            int64_t i_226302 = add64(x_225900, gtid_226274);
            float defunc_0_add_arg_226303;
            
            defunc_0_add_arg_226303 = ((float *) mem_213049.mem)[i_226302];
            defunc_0_f_res_226301 = defunc_0_add_arg_226303;
        }
        
        float x_226304 = a12_225969 * tmp4_226298;
        float y_226305 = b12_225970 * defunc_1_f_res_226299;
        float x_226306 = x_226304 + y_226305;
        float y_226307 = c12_225971 * defunc_1_f_res_226300;
        float x_226308 = x_226306 + y_226307;
        float defunc_9_fit_fun_res_226309 = defunc_0_f_res_226301 * x_226308;
        float x_226310 = b12_225970 * tmp4_226298;
        float y_226311 = b2_225972 * defunc_1_f_res_226299;
        float x_226312 = x_226310 + y_226311;
        float y_226313 = c2_225973 * defunc_1_f_res_226300;
        float x_226314 = x_226312 + y_226313;
        float defunc_9_slope_fun_res_226315 = defunc_0_f_res_226301 * x_226314;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_226275 = local_acc_226357;
        }
        // Load next params
        {
            x_226276 = defunc_9_fit_fun_res_226309;
        }
        // Red body
        {
            float defunc_1_op_res_226277 = x_226275 + x_226276;
            
            local_acc_226357 = defunc_1_op_res_226277;
        }
        // Load accum params
        {
            x_226278 = local_acc_226358;
        }
        // Load next params
        {
            x_226279 = defunc_9_slope_fun_res_226315;
        }
        // Red body
        {
            float defunc_1_op_res_226280 = x_226278 + x_226279;
            
            local_acc_226358 = defunc_1_op_res_226280;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_226352.mem)[flat_tid_226273] =
        local_acc_226357;
    ((float *) reduce_stage_1_tid_res_arr_mem_226354.mem)[flat_tid_226273] =
        local_acc_226358;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229322_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229322_end -
                 futhark_mc_segred_stage_1_parloop_229322_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229322_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229322_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229322_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229318(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226273 = tid;
    int num_tasks_226351 = info.nsubtasks;
    struct futhark_mc_task_229317 *futhark_mc_task_229317 =
                                  (struct futhark_mc_task_229317 *) args;
    struct futhark_context *ctx = futhark_mc_task_229317->ctx;
    uint64_t futhark_mc_segred_task_229318_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229318_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229317->free_n_196692;
    int64_t gtid_207509 = futhark_mc_task_229317->free_gtid_207509;
    int64_t x_207514 = futhark_mc_task_229317->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229317->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_task_229317->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_task_229317->free_mem_213049,
                                  .size =0, .references =NULL};
    int64_t x_225900 = futhark_mc_task_229317->free_x_225900;
    float x_225901 = futhark_mc_task_229317->free_x_225901;
    int64_t defunc_0_g_res_225904 =
            futhark_mc_task_229317->free_defunc_0_g_res_225904;
    float a12_225969 = futhark_mc_task_229317->free_a12_225969;
    float b12_225970 = futhark_mc_task_229317->free_b12_225970;
    float c12_225971 = futhark_mc_task_229317->free_c12_225971;
    float b2_225972 = futhark_mc_task_229317->free_b2_225972;
    float c2_225973 = futhark_mc_task_229317->free_c2_225973;
    float defunc_2_reduce_res_225974 =
          *futhark_mc_task_229317->retval_defunc_2_reduce_res_225974;
    float defunc_2_reduce_res_225975 =
          *futhark_mc_task_229317->retval_defunc_2_reduce_res_225975;
    size_t reduce_stage_1_tid_res_arr_mem_226352_cached_sizze_229319 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226352 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_226354_cached_sizze_229320 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226354 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_226352_cached_sizze_229319 <
        (size_t) ((int64_t) 4 * num_tasks_226351)) {
        reduce_stage_1_tid_res_arr_mem_226352 =
            realloc(reduce_stage_1_tid_res_arr_mem_226352, (int64_t) 4 *
                    num_tasks_226351);
        reduce_stage_1_tid_res_arr_mem_226352_cached_sizze_229319 =
            (int64_t) 4 * num_tasks_226351;
    }
    if (reduce_stage_1_tid_res_arr_mem_226354_cached_sizze_229320 <
        (size_t) ((int64_t) 4 * num_tasks_226351)) {
        reduce_stage_1_tid_res_arr_mem_226354 =
            realloc(reduce_stage_1_tid_res_arr_mem_226354, (int64_t) 4 *
                    num_tasks_226351);
        reduce_stage_1_tid_res_arr_mem_226354_cached_sizze_229320 =
            (int64_t) 4 * num_tasks_226351;
    }
    
    int64_t iter_226356;
    struct futhark_mc_segred_stage_1_parloop_struct_229321
    futhark_mc_segred_stage_1_parloop_struct_229321;
    
    futhark_mc_segred_stage_1_parloop_struct_229321.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_gtid_207509 =
        gtid_207509;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_x_207514 = x_207514;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_mem_213046 =
        mem_213046.mem;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_mem_213049 =
        mem_213049.mem;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_x_225900 = x_225900;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_x_225901 = x_225901;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_defunc_0_g_res_225904 =
        defunc_0_g_res_225904;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_a12_225969 =
        a12_225969;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_b12_225970 =
        b12_225970;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_c12_225971 =
        c12_225971;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_b2_225972 = b2_225972;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_c2_225973 = c2_225973;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_reduce_stage_1_tid_res_arr_mem_226352 =
        reduce_stage_1_tid_res_arr_mem_226352;
    futhark_mc_segred_stage_1_parloop_struct_229321.free_reduce_stage_1_tid_res_arr_mem_226354 =
        reduce_stage_1_tid_res_arr_mem_226354;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229322_task;
    
    futhark_mc_segred_stage_1_parloop_229322_task.name =
        "futhark_mc_segred_stage_1_parloop_229322";
    futhark_mc_segred_stage_1_parloop_229322_task.fn =
        futhark_mc_segred_stage_1_parloop_229322;
    futhark_mc_segred_stage_1_parloop_229322_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229321;
    futhark_mc_segred_stage_1_parloop_229322_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229322_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229322_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229322_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229322_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229322_task);
    
    if (futhark_mc_segred_stage_1_parloop_229322_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229322_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229322_total_end -
                 futhark_mc_segred_stage_1_parloop_229322_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229322_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229322_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229322_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_225974 = 0.0F;
        defunc_2_reduce_res_225975 = 0.0F;
    }
    
    float x_226359;
    float x_226360;
    float x_226362;
    float x_226363;
    
    for (int32_t i_226365 = 0; i_226365 < num_tasks_226351; i_226365++) {
        flat_tid_226273 = i_226365;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_226359 = defunc_2_reduce_res_225974;
            }
            // load next params
            {
                x_226360 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226352)[flat_tid_226273];
            }
            // red body
            {
                float defunc_1_op_res_226361 = x_226359 + x_226360;
                
                defunc_2_reduce_res_225974 = defunc_1_op_res_226361;
            }
            // load acc params
            {
                x_226362 = defunc_2_reduce_res_225975;
            }
            // load next params
            {
                x_226363 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226354)[flat_tid_226273];
            }
            // red body
            {
                float defunc_1_op_res_226364 = x_226362 + x_226363;
                
                defunc_2_reduce_res_225975 = defunc_1_op_res_226364;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_226352);
        free(reduce_stage_1_tid_res_arr_mem_226354);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229318_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229318_end -
                 futhark_mc_segred_task_229318_start;
        
        ctx->futhark_mc_segred_task_229318_runs[tid]++;
        ctx->futhark_mc_segred_task_229318_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229318_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229317->retval_defunc_2_reduce_res_225974 =
            defunc_2_reduce_res_225974;
        *futhark_mc_task_229317->retval_defunc_2_reduce_res_225975 =
            defunc_2_reduce_res_225975;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229307(void *args, int64_t start,
                                            int64_t end, int flat_tid_225898,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229306
    *futhark_mc_segmap_parloop_struct_229306 =
    (struct futhark_mc_segmap_parloop_struct_229306 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229306->ctx;
    uint64_t futhark_mc_segmap_parloop_229307_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229307_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229306->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229306->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229306->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229306->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229306->free_i_196779;
    int64_t gtid_207509 =
            futhark_mc_segmap_parloop_struct_229306->free_gtid_207509;
    int64_t x_207514 = futhark_mc_segmap_parloop_struct_229306->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_213049,
                                  .size =0, .references =NULL};
    struct memblock mem_213052 = {.desc ="mem_213052", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_213052,
                                  .size =0, .references =NULL};
    struct memblock mem_213055 = {.desc ="mem_213055", .mem =
                                  futhark_mc_segmap_parloop_struct_229306->free_mem_213055,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226233 = start;
    
    for (; iter_226233 < end; iter_226233++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226316 = t_n_m_196759;
        int64_t gtid_225899 = iter_226233;
        int64_t remnant_226317 = iter_226233 - gtid_225899;
        int64_t x_225900;
        
        x_225900 = ((int64_t *) mem_210889.mem)[gtid_207509 * t_n_m_196759 +
                                                gtid_225899];
        
        float x_225901;
        
        x_225901 = ((float *) mem_210893.mem)[gtid_207509 * t_n_m_196759 +
                                              gtid_225899];
        
        int64_t min_arg_225902 = mul64(jump_t_196702, gtid_225899);
        int64_t min_res_225903 = smin64(i_196779, min_arg_225902);
        int64_t defunc_0_g_res_225904 = add64((int64_t) 1, min_res_225903);
        float defunc_2_reduce_res_225905;
        float defunc_2_reduce_res_225906;
        float defunc_2_reduce_res_225907;
        float defunc_2_reduce_res_225908;
        float defunc_2_reduce_res_225909;
        int64_t flat_tid_226234 = (int64_t) 0;
        int32_t num_tasks_226318;
        
        defunc_2_reduce_res_225905 = 0.0F;
        defunc_2_reduce_res_225906 = 0.0F;
        defunc_2_reduce_res_225907 = 0.0F;
        defunc_2_reduce_res_225908 = 0.0F;
        defunc_2_reduce_res_225909 = 0.0F;
        
        struct futhark_mc_task_229308 futhark_mc_task_229308;
        
        futhark_mc_task_229308.ctx = ctx;
        futhark_mc_task_229308.free_n_196692 = n_196692;
        futhark_mc_task_229308.free_gtid_207509 = gtid_207509;
        futhark_mc_task_229308.free_x_207514 = x_207514;
        futhark_mc_task_229308.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229308.free_mem_213046 = mem_213046.mem;
        futhark_mc_task_229308.free_x_225900 = x_225900;
        futhark_mc_task_229308.free_x_225901 = x_225901;
        futhark_mc_task_229308.free_defunc_0_g_res_225904 =
            defunc_0_g_res_225904;
        futhark_mc_task_229308.retval_defunc_2_reduce_res_225905 =
            &defunc_2_reduce_res_225905;
        futhark_mc_task_229308.retval_defunc_2_reduce_res_225906 =
            &defunc_2_reduce_res_225906;
        futhark_mc_task_229308.retval_defunc_2_reduce_res_225907 =
            &defunc_2_reduce_res_225907;
        futhark_mc_task_229308.retval_defunc_2_reduce_res_225908 =
            &defunc_2_reduce_res_225908;
        futhark_mc_task_229308.retval_defunc_2_reduce_res_225909 =
            &defunc_2_reduce_res_225909;
        
        struct scheduler_segop futhark_mc_task_229308_task;
        
        futhark_mc_task_229308_task.args = &futhark_mc_task_229308;
        futhark_mc_task_229308_task.top_level_fn =
            futhark_mc_segred_task_229309;
        futhark_mc_task_229308_task.name = "futhark_mc_segred_task_229309";
        futhark_mc_task_229308_task.iterations = q_t_196696;
        futhark_mc_task_229308_task.task_time =
            &ctx->futhark_mc_segred_task_229309_total_time;
        futhark_mc_task_229308_task.task_iter =
            &ctx->futhark_mc_segred_task_229309_total_iter;
        futhark_mc_task_229308_task.sched = STATIC;
        futhark_mc_task_229308_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229309_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229308_task);
        
        if (futhark_mc_segred_task_229309_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_225949 = defunc_2_reduce_res_225907 *
              defunc_2_reduce_res_225909;
        float y_225950 = defunc_2_reduce_res_225908 *
              defunc_2_reduce_res_225908;
        float a12_225951 = x_225949 - y_225950;
        float x_225952 = defunc_2_reduce_res_225907 *
              defunc_2_reduce_res_225908;
        float y_225953 = defunc_2_reduce_res_225906 *
              defunc_2_reduce_res_225909;
        float b12_225954 = x_225952 - y_225953;
        float x_225955 = defunc_2_reduce_res_225906 *
              defunc_2_reduce_res_225908;
        float y_225956 = defunc_2_reduce_res_225907 *
              defunc_2_reduce_res_225907;
        float c12_225957 = x_225955 - y_225956;
        float x_225958 = defunc_2_reduce_res_225905 *
              defunc_2_reduce_res_225909;
        float b2_225959 = x_225958 - y_225956;
        float x_225960 = defunc_2_reduce_res_225906 *
              defunc_2_reduce_res_225907;
        float y_225961 = defunc_2_reduce_res_225905 *
              defunc_2_reduce_res_225908;
        float c2_225962 = x_225960 - y_225961;
        float x_225963 = defunc_2_reduce_res_225905 * a12_225951;
        float y_225964 = defunc_2_reduce_res_225906 * b12_225954;
        float x_225965 = x_225963 + y_225964;
        float y_225966 = defunc_2_reduce_res_225907 * c12_225957;
        float y_225967 = x_225965 + y_225966;
        float det_225968 = 1.0F / y_225967;
        float a12_225969 = a12_225951 * det_225968;
        float b12_225970 = b12_225954 * det_225968;
        float c12_225971 = c12_225957 * det_225968;
        float b2_225972 = b2_225959 * det_225968;
        float c2_225973 = c2_225962 * det_225968;
        float defunc_2_reduce_res_225974;
        float defunc_2_reduce_res_225975;
        int64_t flat_tid_226273 = (int64_t) 0;
        int32_t num_tasks_226351;
        
        defunc_2_reduce_res_225974 = 0.0F;
        defunc_2_reduce_res_225975 = 0.0F;
        
        struct futhark_mc_task_229317 futhark_mc_task_229317;
        
        futhark_mc_task_229317.ctx = ctx;
        futhark_mc_task_229317.free_n_196692 = n_196692;
        futhark_mc_task_229317.free_gtid_207509 = gtid_207509;
        futhark_mc_task_229317.free_x_207514 = x_207514;
        futhark_mc_task_229317.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229317.free_mem_213046 = mem_213046.mem;
        futhark_mc_task_229317.free_mem_213049 = mem_213049.mem;
        futhark_mc_task_229317.free_x_225900 = x_225900;
        futhark_mc_task_229317.free_x_225901 = x_225901;
        futhark_mc_task_229317.free_defunc_0_g_res_225904 =
            defunc_0_g_res_225904;
        futhark_mc_task_229317.free_a12_225969 = a12_225969;
        futhark_mc_task_229317.free_b12_225970 = b12_225970;
        futhark_mc_task_229317.free_c12_225971 = c12_225971;
        futhark_mc_task_229317.free_b2_225972 = b2_225972;
        futhark_mc_task_229317.free_c2_225973 = c2_225973;
        futhark_mc_task_229317.retval_defunc_2_reduce_res_225974 =
            &defunc_2_reduce_res_225974;
        futhark_mc_task_229317.retval_defunc_2_reduce_res_225975 =
            &defunc_2_reduce_res_225975;
        
        struct scheduler_segop futhark_mc_task_229317_task;
        
        futhark_mc_task_229317_task.args = &futhark_mc_task_229317;
        futhark_mc_task_229317_task.top_level_fn =
            futhark_mc_segred_task_229318;
        futhark_mc_task_229317_task.name = "futhark_mc_segred_task_229318";
        futhark_mc_task_229317_task.iterations = q_t_196696;
        futhark_mc_task_229317_task.task_time =
            &ctx->futhark_mc_segred_task_229318_total_time;
        futhark_mc_task_229317_task.task_iter =
            &ctx->futhark_mc_segred_task_229318_total_iter;
        futhark_mc_task_229317_task.sched = STATIC;
        futhark_mc_task_229317_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229318_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229317_task);
        
        if (futhark_mc_segred_task_229318_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_213052.mem)[gtid_225899] = defunc_2_reduce_res_225974;
        ((float *) mem_213055.mem)[gtid_225899] = defunc_2_reduce_res_225975;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229307_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229307_end -
                 futhark_mc_segmap_parloop_229307_start;
        
        ctx->futhark_mc_segmap_parloop_229307_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229307_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229307_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229305(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_225898 = tid;
    int num_tasks_226149 = info.nsubtasks;
    struct futhark_mc_task_229301 *futhark_mc_task_229301 =
                                  (struct futhark_mc_task_229301 *) args;
    struct futhark_context *ctx = futhark_mc_task_229301->ctx;
    uint64_t futhark_mc_segmap_nested_task_229305_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229305_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229301->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229301->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229301->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229301->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229301->free_i_196779;
    int64_t gtid_207509 = futhark_mc_task_229301->free_gtid_207509;
    int64_t x_207514 = futhark_mc_task_229301->free_x_207514;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229301->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229301->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229301->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213046 = {.desc ="mem_213046", .mem =
                                  futhark_mc_task_229301->free_mem_213046,
                                  .size =0, .references =NULL};
    struct memblock mem_213049 = {.desc ="mem_213049", .mem =
                                  futhark_mc_task_229301->free_mem_213049,
                                  .size =0, .references =NULL};
    struct memblock mem_213052 = {.desc ="mem_213052", .mem =
                                  futhark_mc_task_229301->free_mem_213052,
                                  .size =0, .references =NULL};
    struct memblock mem_213055 = {.desc ="mem_213055", .mem =
                                  futhark_mc_task_229301->free_mem_213055,
                                  .size =0, .references =NULL};
    int64_t iter_226233;
    struct futhark_mc_segmap_parloop_struct_229306
    futhark_mc_segmap_parloop_struct_229306;
    
    futhark_mc_segmap_parloop_struct_229306.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229306.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229306.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229306.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229306.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229306.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229306.free_gtid_207509 = gtid_207509;
    futhark_mc_segmap_parloop_struct_229306.free_x_207514 = x_207514;
    futhark_mc_segmap_parloop_struct_229306.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229306.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229306.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229306.free_mem_213046 = mem_213046.mem;
    futhark_mc_segmap_parloop_struct_229306.free_mem_213049 = mem_213049.mem;
    futhark_mc_segmap_parloop_struct_229306.free_mem_213052 = mem_213052.mem;
    futhark_mc_segmap_parloop_struct_229306.free_mem_213055 = mem_213055.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229307_task;
    
    futhark_mc_segmap_parloop_229307_task.name =
        "futhark_mc_segmap_parloop_229307";
    futhark_mc_segmap_parloop_229307_task.fn = futhark_mc_segmap_parloop_229307;
    futhark_mc_segmap_parloop_229307_task.args =
        &futhark_mc_segmap_parloop_struct_229306;
    futhark_mc_segmap_parloop_229307_task.iterations = iterations;
    futhark_mc_segmap_parloop_229307_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229307_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229307_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229307_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229307_task);
    
    if (futhark_mc_segmap_parloop_229307_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229307_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229307_total_end -
                 futhark_mc_segmap_parloop_229307_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229307_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229307_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229307_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229305_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229305_end -
                 futhark_mc_segmap_nested_task_229305_start;
        
        ctx->futhark_mc_segmap_nested_task_229305_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229305_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229305_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229287(void *args, int64_t start,
                                            int64_t end, int flat_tid_207508,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229286
    *futhark_mc_segmap_parloop_struct_229286 =
    (struct futhark_mc_segmap_parloop_struct_229286 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229286->ctx;
    uint64_t futhark_mc_segmap_parloop_229287_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229287_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229286->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229286->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229286->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229286->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229286->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229286->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229286->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229286->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229286->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229286->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229286->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229286->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229286->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213134 = {.desc ="mem_213134", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_213134,
                                  .size =0, .references =NULL};
    struct memblock mem_213138 = {.desc ="mem_213138", .mem =
                                  futhark_mc_segmap_parloop_struct_229286->free_mem_213138,
                                  .size =0, .references =NULL};
    size_t mem_213043_cached_sizze_229288 = 0;
    unsigned char *mem_213043 = NULL;
    size_t mem_213046_cached_sizze_229289 = 0;
    unsigned char *mem_213046 = NULL;
    size_t mem_213049_cached_sizze_229290 = 0;
    unsigned char *mem_213049 = NULL;
    size_t mem_213052_cached_sizze_229291 = 0;
    unsigned char *mem_213052 = NULL;
    size_t mem_213055_cached_sizze_229292 = 0;
    unsigned char *mem_213055 = NULL;
    int64_t iterations = end - start;
    int64_t iter_225878 = start;
    
    if (mem_213043_cached_sizze_229288 < (size_t) bytes_210949) {
        mem_213043 = realloc(mem_213043, bytes_210949);
        mem_213043_cached_sizze_229288 = bytes_210949;
    }
    if (mem_213046_cached_sizze_229289 < (size_t) bytes_210949) {
        mem_213046 = realloc(mem_213046, bytes_210949);
        mem_213046_cached_sizze_229289 = bytes_210949;
    }
    if (mem_213049_cached_sizze_229290 < (size_t) bytes_210949) {
        mem_213049 = realloc(mem_213049, bytes_210949);
        mem_213049_cached_sizze_229290 = bytes_210949;
    }
    if (mem_213052_cached_sizze_229291 < (size_t) bytes_210836) {
        mem_213052 = realloc(mem_213052, bytes_210836);
        mem_213052_cached_sizze_229291 = bytes_210836;
    }
    if (mem_213055_cached_sizze_229292 < (size_t) bytes_210836) {
        mem_213055 = realloc(mem_213055, bytes_210836);
        mem_213055_cached_sizze_229292 = bytes_210836;
    }
    for (; iter_225878 < end; iter_225878++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226131 = m_196691;
        int64_t gtid_207509 = iter_225878;
        int64_t remnant_226132 = iter_225878 - gtid_207509;
        int64_t x_207514;
        
        x_207514 = ((int64_t *) mem_210397.mem)[gtid_207509];
        
        int64_t flat_tid_225879 = (int64_t) 0;
        int32_t num_tasks_226133;
        struct futhark_mc_task_229293 futhark_mc_task_229293;
        
        futhark_mc_task_229293.ctx = ctx;
        futhark_mc_task_229293.free_n_196692 = n_196692;
        futhark_mc_task_229293.free_gtid_207509 = gtid_207509;
        futhark_mc_task_229293.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229293.free_mem_212862 = mem_212862.mem;
        futhark_mc_task_229293.free_mem_213043 = mem_213043;
        
        struct scheduler_segop futhark_mc_task_229293_task;
        
        futhark_mc_task_229293_task.args = &futhark_mc_task_229293;
        futhark_mc_task_229293_task.top_level_fn =
            futhark_mc_segmap_task_229294;
        futhark_mc_task_229293_task.name = "futhark_mc_segmap_task_229294";
        futhark_mc_task_229293_task.iterations = n_196692;
        futhark_mc_task_229293_task.task_time =
            &ctx->futhark_mc_segmap_task_229294_total_time;
        futhark_mc_task_229293_task.task_iter =
            &ctx->futhark_mc_segmap_task_229294_total_iter;
        futhark_mc_task_229293_task.sched = STATIC;
        futhark_mc_task_229293_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229294_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229293_task);
        
        if (futhark_mc_segmap_task_229294_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_225884 = (int64_t) 0;
        int32_t num_tasks_226137;
        struct futhark_mc_task_229297 futhark_mc_task_229297;
        
        futhark_mc_task_229297.ctx = ctx;
        futhark_mc_task_229297.free_n_196692 = n_196692;
        futhark_mc_task_229297.free_gtid_207509 = gtid_207509;
        futhark_mc_task_229297.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229297.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229297.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229297.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229297.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229297.free_mem_213043 = mem_213043;
        futhark_mc_task_229297.free_mem_213046 = mem_213046;
        futhark_mc_task_229297.free_mem_213049 = mem_213049;
        
        struct scheduler_segop futhark_mc_task_229297_task;
        
        futhark_mc_task_229297_task.args = &futhark_mc_task_229297;
        futhark_mc_task_229297_task.top_level_fn =
            futhark_mc_segmap_task_229298;
        futhark_mc_task_229297_task.name = "futhark_mc_segmap_task_229298";
        futhark_mc_task_229297_task.iterations = n_196692;
        futhark_mc_task_229297_task.task_time =
            &ctx->futhark_mc_segmap_task_229298_total_time;
        futhark_mc_task_229297_task.task_iter =
            &ctx->futhark_mc_segmap_task_229298_total_iter;
        futhark_mc_task_229297_task.sched = STATIC;
        futhark_mc_task_229297_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229298_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229297_task);
        
        if (futhark_mc_segmap_task_229298_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_226019 = (int64_t) 0;
        int32_t num_tasks_226149;
        int64_t flat_tid_225898 = (int64_t) 0;
        struct futhark_mc_task_229301 futhark_mc_task_229301;
        
        futhark_mc_task_229301.ctx = ctx;
        futhark_mc_task_229301.free_n_196692 = n_196692;
        futhark_mc_task_229301.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229301.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229301.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229301.free_i_196779 = i_196779;
        futhark_mc_task_229301.free_gtid_207509 = gtid_207509;
        futhark_mc_task_229301.free_x_207514 = x_207514;
        futhark_mc_task_229301.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229301.free_mem_210889 = mem_210889.mem;
        futhark_mc_task_229301.free_mem_210893 = mem_210893.mem;
        futhark_mc_task_229301.free_mem_213046 = mem_213046;
        futhark_mc_task_229301.free_mem_213049 = mem_213049;
        futhark_mc_task_229301.free_mem_213052 = mem_213052;
        futhark_mc_task_229301.free_mem_213055 = mem_213055;
        
        struct scheduler_segop futhark_mc_task_229301_task;
        
        futhark_mc_task_229301_task.args = &futhark_mc_task_229301;
        futhark_mc_task_229301_task.top_level_fn =
            futhark_mc_segmap_task_229302;
        futhark_mc_task_229301_task.name = "futhark_mc_segmap_task_229302";
        futhark_mc_task_229301_task.iterations = t_n_m_196759;
        futhark_mc_task_229301_task.task_time =
            &ctx->futhark_mc_segmap_task_229302_total_time;
        futhark_mc_task_229301_task.task_iter =
            &ctx->futhark_mc_segmap_task_229302_total_iter;
        futhark_mc_task_229301_task.sched = STATIC;
        futhark_mc_task_229301_task.nested_fn =
            futhark_mc_segmap_nested_task_229305;
        
        int futhark_mc_segmap_task_229302_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229301_task);
        
        if (futhark_mc_segmap_task_229302_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213134.mem + gtid_207509 * t_n_m_196759 * (int64_t) 4,
                    mem_213052 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213138.mem + gtid_207509 * t_n_m_196759 * (int64_t) 4,
                    mem_213055 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213043);
    free(mem_213046);
    free(mem_213049);
    free(mem_213052);
    free(mem_213055);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229287_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229287_end -
                 futhark_mc_segmap_parloop_229287_start;
        
        ctx->futhark_mc_segmap_parloop_229287_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229287_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229287_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229285(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207508 = tid;
    int num_tasks_225724 = info.nsubtasks;
    struct futhark_mc_task_229276 *futhark_mc_task_229276 =
                                  (struct futhark_mc_task_229276 *) args;
    struct futhark_context *ctx = futhark_mc_task_229276->ctx;
    uint64_t futhark_mc_segmap_nested_task_229285_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229285_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229276->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229276->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229276->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229276->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229276->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229276->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229276->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229276->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229276->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229276->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229276->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229276->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229276->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229276->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229276->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229276->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229276->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229276->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213134 = {.desc ="mem_213134", .mem =
                                  futhark_mc_task_229276->free_mem_213134,
                                  .size =0, .references =NULL};
    struct memblock mem_213138 = {.desc ="mem_213138", .mem =
                                  futhark_mc_task_229276->free_mem_213138,
                                  .size =0, .references =NULL};
    int64_t iter_225878;
    struct futhark_mc_segmap_parloop_struct_229286
    futhark_mc_segmap_parloop_struct_229286;
    
    futhark_mc_segmap_parloop_struct_229286.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229286.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229286.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229286.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229286.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229286.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229286.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229286.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229286.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229286.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229286.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229286.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229286.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229286.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229286.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229286.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229286.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229286.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229286.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229286.free_mem_213134 = mem_213134.mem;
    futhark_mc_segmap_parloop_struct_229286.free_mem_213138 = mem_213138.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229287_task;
    
    futhark_mc_segmap_parloop_229287_task.name =
        "futhark_mc_segmap_parloop_229287";
    futhark_mc_segmap_parloop_229287_task.fn = futhark_mc_segmap_parloop_229287;
    futhark_mc_segmap_parloop_229287_task.args =
        &futhark_mc_segmap_parloop_struct_229286;
    futhark_mc_segmap_parloop_229287_task.iterations = iterations;
    futhark_mc_segmap_parloop_229287_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229287_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229287_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229287_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229287_task);
    
    if (futhark_mc_segmap_parloop_229287_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229287_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229287_total_end -
                 futhark_mc_segmap_parloop_229287_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229287_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229287_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229287_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229285_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229285_end -
                 futhark_mc_segmap_nested_task_229285_start;
        
        ctx->futhark_mc_segmap_nested_task_229285_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229285_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229285_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229323 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213157;
    unsigned char *free_mem_213255;
};
struct futhark_mc_segmap_parloop_struct_229325 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213157;
    unsigned char *free_mem_213255;
};
static int futhark_mc_segmap_parloop_229326(void *args, int64_t start,
                                            int64_t end, int flat_tid_207785,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229325
    *futhark_mc_segmap_parloop_struct_229325 =
    (struct futhark_mc_segmap_parloop_struct_229325 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229325->ctx;
    uint64_t futhark_mc_segmap_parloop_229326_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229326_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229325->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229325->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229325->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229325->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229325->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229325->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229325->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229325->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229325->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229325->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229325->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229325->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229325->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229325->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229325->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229325->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229325->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229325->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 =
            futhark_mc_segmap_parloop_struct_229325->free_bytes_213157;
    struct memblock mem_213255 = {.desc ="mem_213255", .mem =
                                  futhark_mc_segmap_parloop_struct_229325->free_mem_213255,
                                  .size =0, .references =NULL};
    size_t mem_213179_cached_sizze_229327 = 0;
    unsigned char *mem_213179 = NULL;
    size_t mem_213194_cached_sizze_229328 = 0;
    unsigned char *mem_213194 = NULL;
    size_t mem_213197_cached_sizze_229329 = 0;
    unsigned char *mem_213197 = NULL;
    size_t mem_213224_cached_sizze_229330 = 0;
    unsigned char *mem_213224 = NULL;
    size_t mem_213234_cached_sizze_229331 = 0;
    unsigned char *mem_213234 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226369 = start;
    
    if (mem_213179_cached_sizze_229327 < (size_t) bytes_210949) {
        mem_213179 = realloc(mem_213179, bytes_210949);
        mem_213179_cached_sizze_229327 = bytes_210949;
    }
    if (mem_213194_cached_sizze_229328 < (size_t) bytes_210949) {
        mem_213194 = realloc(mem_213194, bytes_210949);
        mem_213194_cached_sizze_229328 = bytes_210949;
    }
    if (mem_213197_cached_sizze_229329 < (size_t) bytes_210949) {
        mem_213197 = realloc(mem_213197, bytes_210949);
        mem_213197_cached_sizze_229329 = bytes_210949;
    }
    if (mem_213224_cached_sizze_229330 < (size_t) bytes_210836) {
        mem_213224 = realloc(mem_213224, bytes_210836);
        mem_213224_cached_sizze_229330 = bytes_210836;
    }
    if (mem_213234_cached_sizze_229331 < (size_t) bytes_213157) {
        mem_213234 = realloc(mem_213234, bytes_213157);
        mem_213234_cached_sizze_229331 = bytes_213157;
    }
    for (; iter_226369 < end; iter_226369++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226439 = m_196691;
        int64_t gtid_207786 = iter_226369;
        int64_t remnant_226440 = iter_226369 - gtid_207786;
        int64_t x_199337;
        
        x_199337 = ((int64_t *) mem_210397.mem)[gtid_207786];
        for (int64_t i_226370 = 0; i_226370 < n_196692; i_226370++) {
            float x_226372;
            
            x_226372 = ((float *) Y_mem_210354.mem)[gtid_207786 * n_196692 +
                                                    i_226370];
            
            float x_226373;
            
            x_226373 = ((float *) mem_212862.mem)[gtid_207786 * n_196692 +
                                                  i_226370];
            
            float defunc_1_f_res_226374 = x_226372 - x_226373;
            
            ((float *) mem_213179)[i_226370] = defunc_1_f_res_226374;
        }
        for (int64_t i_226376 = 0; i_226376 < n_196692; i_226376++) {
            int64_t x_226379;
            
            x_226379 = ((int64_t *) mem_210394.mem)[gtid_207786 * n_196692 +
                                                    i_226376];
            
            bool cond_226380 = sle64((int64_t) 0, x_226379);
            float defunc_0_f_res_226381;
            
            if (cond_226380) {
                bool y_226382 = slt64(x_226379, n_196692);
                bool bounds_check_226383 = cond_226380 && y_226382;
                bool index_certs_226384;
                
                if (!bounds_check_226383) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_226379,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_226385;
                
                defunc_0_f_res_t_res_226385 = ((float *) mem_213179)[x_226379];
                defunc_0_f_res_226381 = defunc_0_f_res_t_res_226385;
            } else {
                defunc_0_f_res_226381 = 0.0F;
            }
            
            float defunc_0_f_res_226386;
            
            if (cond_226380) {
                bool y_226387 = slt64(x_226379, n_196692);
                bool bounds_check_226388 = cond_226380 && y_226387;
                bool index_certs_226389;
                
                if (!bounds_check_226388) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_226379,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_226390;
                
                defunc_0_f_res_t_res_226390 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_207786 *
                                                      ctx_param_ext_210921 +
                                                      x_226379 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_226386 = defunc_0_f_res_t_res_226390;
            } else {
                defunc_0_f_res_226386 = 0.0F;
            }
            ((float *) mem_213194)[i_226376] = defunc_0_f_res_226386;
            ((float *) mem_213197)[i_226376] = defunc_0_f_res_226381;
        }
        for (int64_t i_226393 = 0; i_226393 < t_n_m_196759; i_226393++) {
            int64_t x_226395;
            
            x_226395 = ((int64_t *) mem_210889.mem)[gtid_207786 * t_n_m_196759 +
                                                    i_226393];
            
            float x_226396;
            
            x_226396 = ((float *) mem_210893.mem)[gtid_207786 * t_n_m_196759 +
                                                  i_226393];
            
            int64_t min_arg_226397 = mul64(jump_t_196702, i_226393);
            int64_t min_res_226398 = smin64(i_196779, min_arg_226397);
            int64_t defunc_0_g_res_226399 = add64((int64_t) 1, min_res_226398);
            float defunc_2_reduce_res_226401;
            float redout_226404 = 0.0F;
            
            for (int64_t i_226403 = 0; i_226403 < q_t_196696; i_226403++) {
                bool cond_226406 = sle64(x_199337, i_226403);
                int64_t defunc_0_f_res_226407;
                
                if (cond_226406) {
                    defunc_0_f_res_226407 = (int64_t) 0;
                } else {
                    int64_t i_226408 = add64(x_226395, i_226403);
                    int64_t defunc_0_add_arg_226409;
                    
                    defunc_0_add_arg_226409 =
                        ((int64_t *) mem_210394.mem)[gtid_207786 * n_196692 +
                                                     i_226408];
                    
                    int64_t defunc_1_add_res_226410 = add64((int64_t) 1,
                                                            defunc_0_add_arg_226409);
                    
                    defunc_0_f_res_226407 = defunc_1_add_res_226410;
                }
                
                float defunc_0_f_res_226411;
                
                if (cond_226406) {
                    defunc_0_f_res_226411 = 0.0F;
                } else {
                    int64_t i_226412 = add64(x_226395, i_226403);
                    float defunc_0_add_arg_226413;
                    
                    defunc_0_add_arg_226413 = ((float *) mem_213194)[i_226412];
                    defunc_0_f_res_226411 = defunc_0_add_arg_226413;
                }
                
                int64_t binop_p_226414 = sub64(defunc_0_f_res_226407,
                                               defunc_0_g_res_226399);
                float defunc_0_f_res_226415 = sitofp_i64_f32(binop_p_226414);
                float abs_res_226416 = (float) fabs(defunc_0_f_res_226415);
                float tmp1_226417 = abs_res_226416 / x_226396;
                float x_226418 = tmp1_226417 * tmp1_226417;
                float y_226419 = tmp1_226417 * x_226418;
                float tmp2_226420 = 1.0F - y_226419;
                float x_226421 = tmp2_226420 * tmp2_226420;
                float tmp3_226422 = tmp2_226420 * x_226421;
                float tmp4_226423 = defunc_0_f_res_226411 * tmp3_226422;
                float defunc_1_op_res_226424 = tmp4_226423 + redout_226404;
                
                ((float *) mem_213234)[i_226403] = tmp4_226423;
                
                float redout_tmp_226445 = defunc_1_op_res_226424;
                
                redout_226404 = redout_tmp_226445;
            }
            defunc_2_reduce_res_226401 = redout_226404;
            
            float a0_226426 = 1.0F / defunc_2_reduce_res_226401;
            float defunc_2_reduce_res_226427;
            float redout_226429 = 0.0F;
            
            for (int64_t i_226428 = 0; i_226428 < q_t_196696; i_226428++) {
                float x_226430;
                
                x_226430 = ((float *) mem_213234)[i_226428];
                
                bool cond_226431 = sle64(x_199337, i_226428);
                float defunc_0_f_res_226432;
                
                if (cond_226431) {
                    defunc_0_f_res_226432 = 0.0F;
                } else {
                    int64_t i_226433 = add64(x_226395, i_226428);
                    float defunc_0_add_arg_226434;
                    
                    defunc_0_add_arg_226434 = ((float *) mem_213197)[i_226433];
                    defunc_0_f_res_226432 = defunc_0_add_arg_226434;
                }
                
                float x_226435 = a0_226426 * x_226430;
                float defunc_9_fit_fun_res_226436 = defunc_0_f_res_226432 *
                      x_226435;
                float defunc_1_op_res_226437 = defunc_9_fit_fun_res_226436 +
                      redout_226429;
                float redout_tmp_226447 = defunc_1_op_res_226437;
                
                redout_226429 = redout_tmp_226447;
            }
            defunc_2_reduce_res_226427 = redout_226429;
            ((float *) mem_213224)[i_226393] = defunc_2_reduce_res_226427;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213255.mem + gtid_207786 * t_n_m_196759 * (int64_t) 4,
                    mem_213224 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213179);
    free(mem_213194);
    free(mem_213197);
    free(mem_213224);
    free(mem_213234);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229326_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229326_end -
                 futhark_mc_segmap_parloop_229326_start;
        
        ctx->futhark_mc_segmap_parloop_229326_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229326_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229326_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229324(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207785 = tid;
    int num_tasks_226368 = info.nsubtasks;
    struct futhark_mc_task_229323 *futhark_mc_task_229323 =
                                  (struct futhark_mc_task_229323 *) args;
    struct futhark_context *ctx = futhark_mc_task_229323->ctx;
    uint64_t futhark_mc_segmap_task_229324_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229324_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229323->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229323->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229323->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229323->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229323->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229323->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229323->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229323->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229323->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229323->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229323->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229323->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229323->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229323->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229323->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229323->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229323->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229323->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 = futhark_mc_task_229323->free_bytes_213157;
    struct memblock mem_213255 = {.desc ="mem_213255", .mem =
                                  futhark_mc_task_229323->free_mem_213255,
                                  .size =0, .references =NULL};
    int64_t iter_226369;
    struct futhark_mc_segmap_parloop_struct_229325
    futhark_mc_segmap_parloop_struct_229325;
    
    futhark_mc_segmap_parloop_struct_229325.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229325.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229325.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229325.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229325.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229325.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229325.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229325.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229325.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229325.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229325.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229325.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229325.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229325.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229325.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229325.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229325.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229325.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229325.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229325.free_bytes_213157 = bytes_213157;
    futhark_mc_segmap_parloop_struct_229325.free_mem_213255 = mem_213255.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229326_task;
    
    futhark_mc_segmap_parloop_229326_task.name =
        "futhark_mc_segmap_parloop_229326";
    futhark_mc_segmap_parloop_229326_task.fn = futhark_mc_segmap_parloop_229326;
    futhark_mc_segmap_parloop_229326_task.args =
        &futhark_mc_segmap_parloop_struct_229325;
    futhark_mc_segmap_parloop_229326_task.iterations = iterations;
    futhark_mc_segmap_parloop_229326_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229326_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229326_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229326_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229326_task);
    
    if (futhark_mc_segmap_parloop_229326_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229326_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229326_total_end -
                 futhark_mc_segmap_parloop_229326_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229326_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229326_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229326_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229324_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229324_end -
                 futhark_mc_segmap_task_229324_start;
        
        ctx->futhark_mc_segmap_task_229324_runs[tid]++;
        ctx->futhark_mc_segmap_task_229324_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229324_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229333 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213157;
    unsigned char *free_mem_213255;
};
struct futhark_mc_task_229339 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207851;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213149;
};
struct futhark_mc_segmap_parloop_struct_229341 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207851;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213149;
};
static int futhark_mc_segmap_parloop_229342(void *args, int64_t start,
                                            int64_t end, int flat_tid_226449,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229341
    *futhark_mc_segmap_parloop_struct_229341 =
    (struct futhark_mc_segmap_parloop_struct_229341 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229341->ctx;
    uint64_t futhark_mc_segmap_parloop_229342_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229342_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229341->free_n_196692;
    int64_t gtid_207851 =
            futhark_mc_segmap_parloop_struct_229341->free_gtid_207851;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229341->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229341->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213149 = {.desc ="mem_213149", .mem =
                                  futhark_mc_segmap_parloop_struct_229341->free_mem_213149,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226564 = start;
    
    for (; iter_226564 < end; iter_226564++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226565 = n_196692;
        int64_t gtid_226450 = iter_226564;
        int64_t remnant_226566 = iter_226564 - gtid_226450;
        float x_226451;
        
        x_226451 = ((float *) Y_mem_210354.mem)[gtid_207851 * n_196692 +
                                                gtid_226450];
        
        float x_226452;
        
        x_226452 = ((float *) mem_212862.mem)[gtid_207851 * n_196692 +
                                              gtid_226450];
        
        float defunc_1_f_res_226453 = x_226451 - x_226452;
        
        ((float *) mem_213149.mem)[gtid_226450] = defunc_1_f_res_226453;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229342_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229342_end -
                 futhark_mc_segmap_parloop_229342_start;
        
        ctx->futhark_mc_segmap_parloop_229342_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229342_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229342_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229340(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226449 = tid;
    int num_tasks_226563 = info.nsubtasks;
    struct futhark_mc_task_229339 *futhark_mc_task_229339 =
                                  (struct futhark_mc_task_229339 *) args;
    struct futhark_context *ctx = futhark_mc_task_229339->ctx;
    uint64_t futhark_mc_segmap_task_229340_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229340_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229339->free_n_196692;
    int64_t gtid_207851 = futhark_mc_task_229339->free_gtid_207851;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229339->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229339->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213149 = {.desc ="mem_213149", .mem =
                                  futhark_mc_task_229339->free_mem_213149,
                                  .size =0, .references =NULL};
    int64_t iter_226564;
    struct futhark_mc_segmap_parloop_struct_229341
    futhark_mc_segmap_parloop_struct_229341;
    
    futhark_mc_segmap_parloop_struct_229341.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229341.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229341.free_gtid_207851 = gtid_207851;
    futhark_mc_segmap_parloop_struct_229341.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229341.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229341.free_mem_213149 = mem_213149.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229342_task;
    
    futhark_mc_segmap_parloop_229342_task.name =
        "futhark_mc_segmap_parloop_229342";
    futhark_mc_segmap_parloop_229342_task.fn = futhark_mc_segmap_parloop_229342;
    futhark_mc_segmap_parloop_229342_task.args =
        &futhark_mc_segmap_parloop_struct_229341;
    futhark_mc_segmap_parloop_229342_task.iterations = iterations;
    futhark_mc_segmap_parloop_229342_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229342_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229342_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229342_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229342_task);
    
    if (futhark_mc_segmap_parloop_229342_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229342_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229342_total_end -
                 futhark_mc_segmap_parloop_229342_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229342_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229342_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229342_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229340_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229340_end -
                 futhark_mc_segmap_task_229340_start;
        
        ctx->futhark_mc_segmap_task_229340_runs[tid]++;
        ctx->futhark_mc_segmap_task_229340_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229340_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229343 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207851;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213149;
    unsigned char *free_mem_213152;
    unsigned char *free_mem_213155;
};
struct futhark_mc_segmap_parloop_struct_229345 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207851;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213149;
    unsigned char *free_mem_213152;
    unsigned char *free_mem_213155;
};
static int futhark_mc_segmap_parloop_229346(void *args, int64_t start,
                                            int64_t end, int flat_tid_226454,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229345
    *futhark_mc_segmap_parloop_struct_229345 =
    (struct futhark_mc_segmap_parloop_struct_229345 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229345->ctx;
    uint64_t futhark_mc_segmap_parloop_229346_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229346_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229345->free_n_196692;
    int64_t gtid_207851 =
            futhark_mc_segmap_parloop_struct_229345->free_gtid_207851;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229345->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229345->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229345->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229345->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229345->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213149 = {.desc ="mem_213149", .mem =
                                  futhark_mc_segmap_parloop_struct_229345->free_mem_213149,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_segmap_parloop_struct_229345->free_mem_213152,
                                  .size =0, .references =NULL};
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_segmap_parloop_struct_229345->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226568 = start;
    
    for (; iter_226568 < end; iter_226568++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226577 = n_196692;
        int64_t gtid_226455 = iter_226568;
        int64_t remnant_226578 = iter_226568 - gtid_226455;
        int64_t x_226456;
        
        x_226456 = ((int64_t *) mem_210394.mem)[gtid_207851 * n_196692 +
                                                gtid_226455];
        
        bool cond_226457 = sle64((int64_t) 0, x_226456);
        float defunc_0_f_res_226458;
        
        if (cond_226457) {
            bool y_226569 = slt64(x_226456, n_196692);
            bool bounds_check_226570 = cond_226457 && y_226569;
            bool index_certs_226571;
            
            if (!bounds_check_226570) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_226456,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_226572;
            
            defunc_0_f_res_t_res_226572 = ((float *) mem_213149.mem)[x_226456];
            defunc_0_f_res_226458 = defunc_0_f_res_t_res_226572;
        } else {
            defunc_0_f_res_226458 = 0.0F;
        }
        
        float defunc_0_f_res_226463;
        
        if (cond_226457) {
            bool y_226573 = slt64(x_226456, n_196692);
            bool bounds_check_226574 = cond_226457 && y_226573;
            bool index_certs_226575;
            
            if (!bounds_check_226574) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_226456,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_226576;
            
            defunc_0_f_res_t_res_226576 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_207851 *
                                                  ctx_param_ext_210921 +
                                                  x_226456 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_226463 = defunc_0_f_res_t_res_226576;
        } else {
            defunc_0_f_res_226463 = 0.0F;
        }
        ((float *) mem_213152.mem)[gtid_226455] = defunc_0_f_res_226463;
        ((float *) mem_213155.mem)[gtid_226455] = defunc_0_f_res_226458;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229346_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229346_end -
                 futhark_mc_segmap_parloop_229346_start;
        
        ctx->futhark_mc_segmap_parloop_229346_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229346_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229346_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229344(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226454 = tid;
    int num_tasks_226567 = info.nsubtasks;
    struct futhark_mc_task_229343 *futhark_mc_task_229343 =
                                  (struct futhark_mc_task_229343 *) args;
    struct futhark_context *ctx = futhark_mc_task_229343->ctx;
    uint64_t futhark_mc_segmap_task_229344_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229344_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229343->free_n_196692;
    int64_t gtid_207851 = futhark_mc_task_229343->free_gtid_207851;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229343->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229343->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229343->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229343->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229343->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213149 = {.desc ="mem_213149", .mem =
                                  futhark_mc_task_229343->free_mem_213149,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_task_229343->free_mem_213152,
                                  .size =0, .references =NULL};
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_task_229343->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t iter_226568;
    struct futhark_mc_segmap_parloop_struct_229345
    futhark_mc_segmap_parloop_struct_229345;
    
    futhark_mc_segmap_parloop_struct_229345.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229345.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229345.free_gtid_207851 = gtid_207851;
    futhark_mc_segmap_parloop_struct_229345.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229345.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229345.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229345.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229345.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229345.free_mem_213149 = mem_213149.mem;
    futhark_mc_segmap_parloop_struct_229345.free_mem_213152 = mem_213152.mem;
    futhark_mc_segmap_parloop_struct_229345.free_mem_213155 = mem_213155.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229346_task;
    
    futhark_mc_segmap_parloop_229346_task.name =
        "futhark_mc_segmap_parloop_229346";
    futhark_mc_segmap_parloop_229346_task.fn = futhark_mc_segmap_parloop_229346;
    futhark_mc_segmap_parloop_229346_task.args =
        &futhark_mc_segmap_parloop_struct_229345;
    futhark_mc_segmap_parloop_229346_task.iterations = iterations;
    futhark_mc_segmap_parloop_229346_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229346_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229346_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229346_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229346_task);
    
    if (futhark_mc_segmap_parloop_229346_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229346_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229346_total_end -
                 futhark_mc_segmap_parloop_229346_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229346_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229346_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229346_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229344_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229344_end -
                 futhark_mc_segmap_task_229344_start;
        
        ctx->futhark_mc_segmap_task_229344_runs[tid]++;
        ctx->futhark_mc_segmap_task_229344_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229344_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229347 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207851;
    int64_t free_x_207856;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213152;
    unsigned char *free_mem_213155;
    int64_t free_bytes_213157;
    unsigned char *free_mem_213176;
};
struct futhark_mc_segmap_parloop_struct_229349 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207851;
    int64_t free_x_207856;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213152;
    unsigned char *free_mem_213155;
    int64_t free_bytes_213157;
    unsigned char *free_mem_213176;
};
static int futhark_mc_segmap_parloop_229350(void *args, int64_t start,
                                            int64_t end, int flat_tid_226515,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229349
    *futhark_mc_segmap_parloop_struct_229349 =
    (struct futhark_mc_segmap_parloop_struct_229349 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229349->ctx;
    uint64_t futhark_mc_segmap_parloop_229350_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229350_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229349->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229349->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229349->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229349->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229349->free_i_196779;
    int64_t gtid_207851 =
            futhark_mc_segmap_parloop_struct_229349->free_gtid_207851;
    int64_t x_207856 = futhark_mc_segmap_parloop_struct_229349->free_x_207856;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229349->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229349->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229349->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_segmap_parloop_struct_229349->free_mem_213152,
                                  .size =0, .references =NULL};
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_segmap_parloop_struct_229349->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 =
            futhark_mc_segmap_parloop_struct_229349->free_bytes_213157;
    struct memblock mem_213176 = {.desc ="mem_213176", .mem =
                                  futhark_mc_segmap_parloop_struct_229349->free_mem_213176,
                                  .size =0, .references =NULL};
    size_t mem_226522_cached_sizze_229351 = 0;
    unsigned char *mem_226522 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226580 = start;
    
    if (mem_226522_cached_sizze_229351 < (size_t) bytes_213157) {
        mem_226522 = realloc(mem_226522, bytes_213157);
        mem_226522_cached_sizze_229351 = bytes_213157;
    }
    for (; iter_226580 < end; iter_226580++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226614 = t_n_m_196759;
        int64_t gtid_226516 = iter_226580;
        int64_t remnant_226615 = iter_226580 - gtid_226516;
        int64_t x_226517;
        
        x_226517 = ((int64_t *) mem_210889.mem)[gtid_207851 * t_n_m_196759 +
                                                gtid_226516];
        
        float x_226518;
        
        x_226518 = ((float *) mem_210893.mem)[gtid_207851 * t_n_m_196759 +
                                              gtid_226516];
        
        int64_t min_arg_226519 = mul64(jump_t_196702, gtid_226516);
        int64_t min_res_226520 = smin64(i_196779, min_arg_226519);
        int64_t defunc_0_g_res_226521 = add64((int64_t) 1, min_res_226520);
        float defunc_2_reduce_res_226524;
        float redout_226582 = 0.0F;
        
        for (int64_t i_226581 = 0; i_226581 < q_t_196696; i_226581++) {
            bool cond_226584 = sle64(x_207856, i_226581);
            int64_t defunc_0_f_res_226585;
            
            if (cond_226584) {
                defunc_0_f_res_226585 = (int64_t) 0;
            } else {
                int64_t i_226586 = add64(x_226517, i_226581);
                int64_t defunc_0_add_arg_226587;
                
                defunc_0_add_arg_226587 =
                    ((int64_t *) mem_210394.mem)[gtid_207851 * n_196692 +
                                                 i_226586];
                
                int64_t defunc_1_add_res_226588 = add64((int64_t) 1,
                                                        defunc_0_add_arg_226587);
                
                defunc_0_f_res_226585 = defunc_1_add_res_226588;
            }
            
            float defunc_0_f_res_226589;
            
            if (cond_226584) {
                defunc_0_f_res_226589 = 0.0F;
            } else {
                int64_t i_226590 = add64(x_226517, i_226581);
                float defunc_0_add_arg_226591;
                
                defunc_0_add_arg_226591 = ((float *) mem_213152.mem)[i_226590];
                defunc_0_f_res_226589 = defunc_0_add_arg_226591;
            }
            
            int64_t binop_p_226592 = sub64(defunc_0_f_res_226585,
                                           defunc_0_g_res_226521);
            float defunc_0_f_res_226593 = sitofp_i64_f32(binop_p_226592);
            float abs_res_226594 = (float) fabs(defunc_0_f_res_226593);
            float tmp1_226595 = abs_res_226594 / x_226518;
            float x_226596 = tmp1_226595 * tmp1_226595;
            float y_226597 = tmp1_226595 * x_226596;
            float tmp2_226598 = 1.0F - y_226597;
            float x_226599 = tmp2_226598 * tmp2_226598;
            float tmp3_226600 = tmp2_226598 * x_226599;
            float tmp4_226601 = defunc_0_f_res_226589 * tmp3_226600;
            float defunc_1_op_res_226602 = tmp4_226601 + redout_226582;
            
            ((float *) mem_226522)[i_226581] = tmp4_226601;
            
            float redout_tmp_226616 = defunc_1_op_res_226602;
            
            redout_226582 = redout_tmp_226616;
        }
        defunc_2_reduce_res_226524 = redout_226582;
        
        float a0_226549 = 1.0F / defunc_2_reduce_res_226524;
        float defunc_2_reduce_res_226550;
        float redout_226605 = 0.0F;
        
        for (int64_t i_226604 = 0; i_226604 < q_t_196696; i_226604++) {
            float x_226606;
            
            x_226606 = ((float *) mem_226522)[i_226604];
            
            bool cond_226607 = sle64(x_207856, i_226604);
            float defunc_0_f_res_226608;
            
            if (cond_226607) {
                defunc_0_f_res_226608 = 0.0F;
            } else {
                int64_t i_226609 = add64(x_226517, i_226604);
                float defunc_0_add_arg_226610;
                
                defunc_0_add_arg_226610 = ((float *) mem_213155.mem)[i_226609];
                defunc_0_f_res_226608 = defunc_0_add_arg_226610;
            }
            
            float x_226611 = a0_226549 * x_226606;
            float defunc_9_fit_fun_res_226612 = defunc_0_f_res_226608 *
                  x_226611;
            float defunc_1_op_res_226613 = defunc_9_fit_fun_res_226612 +
                  redout_226605;
            float redout_tmp_226618 = defunc_1_op_res_226613;
            
            redout_226605 = redout_tmp_226618;
        }
        defunc_2_reduce_res_226550 = redout_226605;
        ((float *) mem_213176.mem)[gtid_226516] = defunc_2_reduce_res_226550;
    }
    
  cleanup:
    { }
    free(mem_226522);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229350_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229350_end -
                 futhark_mc_segmap_parloop_229350_start;
        
        ctx->futhark_mc_segmap_parloop_229350_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229350_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229350_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229348(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226515 = tid;
    int num_tasks_226579 = info.nsubtasks;
    struct futhark_mc_task_229347 *futhark_mc_task_229347 =
                                  (struct futhark_mc_task_229347 *) args;
    struct futhark_context *ctx = futhark_mc_task_229347->ctx;
    uint64_t futhark_mc_segmap_task_229348_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229348_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229347->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229347->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229347->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229347->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229347->free_i_196779;
    int64_t gtid_207851 = futhark_mc_task_229347->free_gtid_207851;
    int64_t x_207856 = futhark_mc_task_229347->free_x_207856;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229347->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229347->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229347->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_task_229347->free_mem_213152,
                                  .size =0, .references =NULL};
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_task_229347->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 = futhark_mc_task_229347->free_bytes_213157;
    struct memblock mem_213176 = {.desc ="mem_213176", .mem =
                                  futhark_mc_task_229347->free_mem_213176,
                                  .size =0, .references =NULL};
    int64_t iter_226580;
    struct futhark_mc_segmap_parloop_struct_229349
    futhark_mc_segmap_parloop_struct_229349;
    
    futhark_mc_segmap_parloop_struct_229349.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229349.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229349.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229349.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229349.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229349.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229349.free_gtid_207851 = gtid_207851;
    futhark_mc_segmap_parloop_struct_229349.free_x_207856 = x_207856;
    futhark_mc_segmap_parloop_struct_229349.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229349.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229349.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229349.free_mem_213152 = mem_213152.mem;
    futhark_mc_segmap_parloop_struct_229349.free_mem_213155 = mem_213155.mem;
    futhark_mc_segmap_parloop_struct_229349.free_bytes_213157 = bytes_213157;
    futhark_mc_segmap_parloop_struct_229349.free_mem_213176 = mem_213176.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229350_task;
    
    futhark_mc_segmap_parloop_229350_task.name =
        "futhark_mc_segmap_parloop_229350";
    futhark_mc_segmap_parloop_229350_task.fn = futhark_mc_segmap_parloop_229350;
    futhark_mc_segmap_parloop_229350_task.args =
        &futhark_mc_segmap_parloop_struct_229349;
    futhark_mc_segmap_parloop_229350_task.iterations = iterations;
    futhark_mc_segmap_parloop_229350_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229350_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229350_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229350_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229350_task);
    
    if (futhark_mc_segmap_parloop_229350_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229350_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229350_total_end -
                 futhark_mc_segmap_parloop_229350_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229350_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229350_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229350_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229348_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229348_end -
                 futhark_mc_segmap_task_229348_start;
        
        ctx->futhark_mc_segmap_task_229348_runs[tid]++;
        ctx->futhark_mc_segmap_task_229348_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229348_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229353 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_207851;
    int64_t free_x_207856;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213152;
    unsigned char *free_mem_213155;
    int64_t free_bytes_213157;
    unsigned char *free_mem_213176;
};
struct futhark_mc_task_229356 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207851;
    int64_t free_x_207856;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213152;
    int64_t free_x_226470;
    float free_x_226471;
    int64_t free_defunc_0_g_res_226474;
    float *retval_defunc_2_reduce_res_226476;
    unsigned char *retval_mem_226475;
};
struct futhark_mc_segred_stage_1_parloop_struct_229359 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_207851;
    int64_t free_x_207856;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213152;
    int64_t free_x_226470;
    float free_x_226471;
    int64_t free_defunc_0_g_res_226474;
    unsigned char *free_mem_226475;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226658;
};
static int futhark_mc_segred_stage_1_parloop_229360(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_226620,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229359
    *futhark_mc_segred_stage_1_parloop_struct_229359 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229359 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229359->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229360_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229360_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229359->free_n_196692;
    int64_t gtid_207851 =
            futhark_mc_segred_stage_1_parloop_struct_229359->free_gtid_207851;
    int64_t x_207856 =
            futhark_mc_segred_stage_1_parloop_struct_229359->free_x_207856;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229359->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229359->free_mem_213152,
                                  .size =0, .references =NULL};
    int64_t x_226470 =
            futhark_mc_segred_stage_1_parloop_struct_229359->free_x_226470;
    float x_226471 =
          futhark_mc_segred_stage_1_parloop_struct_229359->free_x_226471;
    int64_t defunc_0_g_res_226474 =
            futhark_mc_segred_stage_1_parloop_struct_229359->free_defunc_0_g_res_226474;
    struct memblock mem_226475 = {.desc ="mem_226475", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229359->free_mem_226475,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_226658 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226658",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229359->free_reduce_stage_1_tid_res_arr_mem_226658,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226660 = start;
    float x_226622;
    float x_226623;
    float local_acc_226661 = 0.0F;
    
    for (; iter_226660 < end; iter_226660++) {
        int64_t gtid_226621 = iter_226660;
        bool cond_226625 = sle64(x_207856, gtid_226621);
        int64_t defunc_0_f_res_226626;
        
        if (cond_226625) {
            defunc_0_f_res_226626 = (int64_t) 0;
        } else {
            int64_t i_226627 = add64(x_226470, gtid_226621);
            int64_t defunc_0_add_arg_226628;
            
            defunc_0_add_arg_226628 = ((int64_t *) mem_210394.mem)[gtid_207851 *
                                                                   n_196692 +
                                                                   i_226627];
            
            int64_t defunc_1_add_res_226629 = add64((int64_t) 1,
                                                    defunc_0_add_arg_226628);
            
            defunc_0_f_res_226626 = defunc_1_add_res_226629;
        }
        
        float defunc_0_f_res_226630;
        
        if (cond_226625) {
            defunc_0_f_res_226630 = 0.0F;
        } else {
            int64_t i_226631 = add64(x_226470, gtid_226621);
            float defunc_0_add_arg_226632;
            
            defunc_0_add_arg_226632 = ((float *) mem_213152.mem)[i_226631];
            defunc_0_f_res_226630 = defunc_0_add_arg_226632;
        }
        
        int64_t binop_p_226633 = sub64(defunc_0_f_res_226626,
                                       defunc_0_g_res_226474);
        float defunc_0_f_res_226634 = sitofp_i64_f32(binop_p_226633);
        float abs_res_226635 = (float) fabs(defunc_0_f_res_226634);
        float tmp1_226636 = abs_res_226635 / x_226471;
        float x_226637 = tmp1_226636 * tmp1_226636;
        float y_226638 = tmp1_226636 * x_226637;
        float tmp2_226639 = 1.0F - y_226638;
        float x_226640 = tmp2_226639 * tmp2_226639;
        float tmp3_226641 = tmp2_226639 * x_226640;
        float tmp4_226642 = defunc_0_f_res_226630 * tmp3_226641;
        
        // save map-out results
        {
            ((float *) mem_226475.mem)[gtid_226621] = tmp4_226642;
        }
        // Load accum params
        {
            x_226622 = local_acc_226661;
        }
        // Load next params
        {
            x_226623 = tmp4_226642;
        }
        // Red body
        {
            float defunc_1_op_res_226624 = x_226622 + x_226623;
            
            local_acc_226661 = defunc_1_op_res_226624;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_226658.mem)[flat_tid_226620] =
        local_acc_226661;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229360_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229360_end -
                 futhark_mc_segred_stage_1_parloop_229360_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229360_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229360_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229360_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229357(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226620 = tid;
    int num_tasks_226657 = info.nsubtasks;
    struct futhark_mc_task_229356 *futhark_mc_task_229356 =
                                  (struct futhark_mc_task_229356 *) args;
    struct futhark_context *ctx = futhark_mc_task_229356->ctx;
    uint64_t futhark_mc_segred_task_229357_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229357_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229356->free_n_196692;
    int64_t gtid_207851 = futhark_mc_task_229356->free_gtid_207851;
    int64_t x_207856 = futhark_mc_task_229356->free_x_207856;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229356->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_task_229356->free_mem_213152,
                                  .size =0, .references =NULL};
    int64_t x_226470 = futhark_mc_task_229356->free_x_226470;
    float x_226471 = futhark_mc_task_229356->free_x_226471;
    int64_t defunc_0_g_res_226474 =
            futhark_mc_task_229356->free_defunc_0_g_res_226474;
    float defunc_2_reduce_res_226476 =
          *futhark_mc_task_229356->retval_defunc_2_reduce_res_226476;
    struct memblock mem_226475 = {.desc ="mem_226475", .mem =
                                  futhark_mc_task_229356->retval_mem_226475,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_226658_cached_sizze_229358 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226658 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_226658_cached_sizze_229358 <
        (size_t) ((int64_t) 4 * num_tasks_226657)) {
        reduce_stage_1_tid_res_arr_mem_226658 =
            realloc(reduce_stage_1_tid_res_arr_mem_226658, (int64_t) 4 *
                    num_tasks_226657);
        reduce_stage_1_tid_res_arr_mem_226658_cached_sizze_229358 =
            (int64_t) 4 * num_tasks_226657;
    }
    
    int64_t iter_226660;
    struct futhark_mc_segred_stage_1_parloop_struct_229359
    futhark_mc_segred_stage_1_parloop_struct_229359;
    
    futhark_mc_segred_stage_1_parloop_struct_229359.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_gtid_207851 =
        gtid_207851;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_x_207856 = x_207856;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_mem_213152 =
        mem_213152.mem;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_x_226470 = x_226470;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_x_226471 = x_226471;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_defunc_0_g_res_226474 =
        defunc_0_g_res_226474;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_mem_226475 =
        mem_226475.mem;
    futhark_mc_segred_stage_1_parloop_struct_229359.free_reduce_stage_1_tid_res_arr_mem_226658 =
        reduce_stage_1_tid_res_arr_mem_226658;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229360_task;
    
    futhark_mc_segred_stage_1_parloop_229360_task.name =
        "futhark_mc_segred_stage_1_parloop_229360";
    futhark_mc_segred_stage_1_parloop_229360_task.fn =
        futhark_mc_segred_stage_1_parloop_229360;
    futhark_mc_segred_stage_1_parloop_229360_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229359;
    futhark_mc_segred_stage_1_parloop_229360_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229360_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229360_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229360_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229360_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229360_task);
    
    if (futhark_mc_segred_stage_1_parloop_229360_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229360_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229360_total_end -
                 futhark_mc_segred_stage_1_parloop_229360_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229360_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229360_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229360_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_226476 = 0.0F;
    }
    
    float x_226662;
    float x_226663;
    
    for (int32_t i_226665 = 0; i_226665 < num_tasks_226657; i_226665++) {
        flat_tid_226620 = i_226665;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_226662 = defunc_2_reduce_res_226476;
            }
            // load next params
            {
                x_226663 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226658)[flat_tid_226620];
            }
            // red body
            {
                float defunc_1_op_res_226664 = x_226662 + x_226663;
                
                defunc_2_reduce_res_226476 = defunc_1_op_res_226664;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_226658);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229357_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229357_end -
                 futhark_mc_segred_task_229357_start;
        
        ctx->futhark_mc_segred_task_229357_runs[tid]++;
        ctx->futhark_mc_segred_task_229357_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229357_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229356->retval_defunc_2_reduce_res_226476 =
            defunc_2_reduce_res_226476;
        futhark_mc_task_229356->retval_mem_226475 = mem_226475.mem;
    }
    return err;
}
struct futhark_mc_task_229361 {
    struct futhark_context *ctx;
    int64_t free_x_207856;
    unsigned char *free_mem_213155;
    int64_t free_x_226470;
    unsigned char *free_mem_226475;
    float free_a0_226501;
    float *retval_defunc_2_reduce_res_226502;
};
struct futhark_mc_segred_stage_1_parloop_struct_229364 {
    struct futhark_context *ctx;
    int64_t free_x_207856;
    unsigned char *free_mem_213155;
    int64_t free_x_226470;
    unsigned char *free_mem_226475;
    float free_a0_226501;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_226667;
};
static int futhark_mc_segred_stage_1_parloop_229365(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_226643,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229364
    *futhark_mc_segred_stage_1_parloop_struct_229364 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229364 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229364->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229365_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229365_start = get_wall_time();
    
    int64_t x_207856 =
            futhark_mc_segred_stage_1_parloop_struct_229364->free_x_207856;
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229364->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t x_226470 =
            futhark_mc_segred_stage_1_parloop_struct_229364->free_x_226470;
    struct memblock mem_226475 = {.desc ="mem_226475", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229364->free_mem_226475,
                                  .size =0, .references =NULL};
    float a0_226501 =
          futhark_mc_segred_stage_1_parloop_struct_229364->free_a0_226501;
    struct memblock reduce_stage_1_tid_res_arr_mem_226667 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_226667",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229364->free_reduce_stage_1_tid_res_arr_mem_226667,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226669 = start;
    float x_226645;
    float x_226646;
    float local_acc_226670 = 0.0F;
    
    for (; iter_226669 < end; iter_226669++) {
        int64_t gtid_226644 = iter_226669;
        float x_226648;
        
        x_226648 = ((float *) mem_226475.mem)[gtid_226644];
        
        bool cond_226649 = sle64(x_207856, gtid_226644);
        float defunc_0_f_res_226650;
        
        if (cond_226649) {
            defunc_0_f_res_226650 = 0.0F;
        } else {
            int64_t i_226651 = add64(x_226470, gtid_226644);
            float defunc_0_add_arg_226652;
            
            defunc_0_add_arg_226652 = ((float *) mem_213155.mem)[i_226651];
            defunc_0_f_res_226650 = defunc_0_add_arg_226652;
        }
        
        float x_226653 = a0_226501 * x_226648;
        float defunc_9_fit_fun_res_226654 = defunc_0_f_res_226650 * x_226653;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_226645 = local_acc_226670;
        }
        // Load next params
        {
            x_226646 = defunc_9_fit_fun_res_226654;
        }
        // Red body
        {
            float defunc_1_op_res_226647 = x_226645 + x_226646;
            
            local_acc_226670 = defunc_1_op_res_226647;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_226667.mem)[flat_tid_226643] =
        local_acc_226670;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229365_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229365_end -
                 futhark_mc_segred_stage_1_parloop_229365_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229365_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229365_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229365_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229362(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226643 = tid;
    int num_tasks_226666 = info.nsubtasks;
    struct futhark_mc_task_229361 *futhark_mc_task_229361 =
                                  (struct futhark_mc_task_229361 *) args;
    struct futhark_context *ctx = futhark_mc_task_229361->ctx;
    uint64_t futhark_mc_segred_task_229362_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229362_start = get_wall_time();
    
    int64_t x_207856 = futhark_mc_task_229361->free_x_207856;
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_task_229361->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t x_226470 = futhark_mc_task_229361->free_x_226470;
    struct memblock mem_226475 = {.desc ="mem_226475", .mem =
                                  futhark_mc_task_229361->free_mem_226475,
                                  .size =0, .references =NULL};
    float a0_226501 = futhark_mc_task_229361->free_a0_226501;
    float defunc_2_reduce_res_226502 =
          *futhark_mc_task_229361->retval_defunc_2_reduce_res_226502;
    size_t reduce_stage_1_tid_res_arr_mem_226667_cached_sizze_229363 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_226667 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_226667_cached_sizze_229363 <
        (size_t) ((int64_t) 4 * num_tasks_226666)) {
        reduce_stage_1_tid_res_arr_mem_226667 =
            realloc(reduce_stage_1_tid_res_arr_mem_226667, (int64_t) 4 *
                    num_tasks_226666);
        reduce_stage_1_tid_res_arr_mem_226667_cached_sizze_229363 =
            (int64_t) 4 * num_tasks_226666;
    }
    
    int64_t iter_226669;
    struct futhark_mc_segred_stage_1_parloop_struct_229364
    futhark_mc_segred_stage_1_parloop_struct_229364;
    
    futhark_mc_segred_stage_1_parloop_struct_229364.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229364.free_x_207856 = x_207856;
    futhark_mc_segred_stage_1_parloop_struct_229364.free_mem_213155 =
        mem_213155.mem;
    futhark_mc_segred_stage_1_parloop_struct_229364.free_x_226470 = x_226470;
    futhark_mc_segred_stage_1_parloop_struct_229364.free_mem_226475 =
        mem_226475.mem;
    futhark_mc_segred_stage_1_parloop_struct_229364.free_a0_226501 = a0_226501;
    futhark_mc_segred_stage_1_parloop_struct_229364.free_reduce_stage_1_tid_res_arr_mem_226667 =
        reduce_stage_1_tid_res_arr_mem_226667;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229365_task;
    
    futhark_mc_segred_stage_1_parloop_229365_task.name =
        "futhark_mc_segred_stage_1_parloop_229365";
    futhark_mc_segred_stage_1_parloop_229365_task.fn =
        futhark_mc_segred_stage_1_parloop_229365;
    futhark_mc_segred_stage_1_parloop_229365_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229364;
    futhark_mc_segred_stage_1_parloop_229365_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229365_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229365_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229365_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229365_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229365_task);
    
    if (futhark_mc_segred_stage_1_parloop_229365_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229365_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229365_total_end -
                 futhark_mc_segred_stage_1_parloop_229365_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229365_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229365_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229365_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_226502 = 0.0F;
    }
    
    float x_226671;
    float x_226672;
    
    for (int32_t i_226674 = 0; i_226674 < num_tasks_226666; i_226674++) {
        flat_tid_226643 = i_226674;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_226671 = defunc_2_reduce_res_226502;
            }
            // load next params
            {
                x_226672 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_226667)[flat_tid_226643];
            }
            // red body
            {
                float defunc_1_op_res_226673 = x_226671 + x_226672;
                
                defunc_2_reduce_res_226502 = defunc_1_op_res_226673;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_226667);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229362_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229362_end -
                 futhark_mc_segred_task_229362_start;
        
        ctx->futhark_mc_segred_task_229362_runs[tid]++;
        ctx->futhark_mc_segred_task_229362_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229362_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229361->retval_defunc_2_reduce_res_226502 =
            defunc_2_reduce_res_226502;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229354(void *args, int64_t start,
                                            int64_t end, int flat_tid_226468,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229353
    *futhark_mc_segmap_parloop_struct_229353 =
    (struct futhark_mc_segmap_parloop_struct_229353 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229353->ctx;
    uint64_t futhark_mc_segmap_parloop_229354_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229354_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229353->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229353->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229353->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229353->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229353->free_i_196779;
    int64_t gtid_207851 =
            futhark_mc_segmap_parloop_struct_229353->free_gtid_207851;
    int64_t x_207856 = futhark_mc_segmap_parloop_struct_229353->free_x_207856;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229353->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229353->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229353->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_segmap_parloop_struct_229353->free_mem_213152,
                                  .size =0, .references =NULL};
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_segmap_parloop_struct_229353->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 =
            futhark_mc_segmap_parloop_struct_229353->free_bytes_213157;
    struct memblock mem_213176 = {.desc ="mem_213176", .mem =
                                  futhark_mc_segmap_parloop_struct_229353->free_mem_213176,
                                  .size =0, .references =NULL};
    size_t mem_226475_cached_sizze_229355 = 0;
    unsigned char *mem_226475 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226619 = start;
    
    if (mem_226475_cached_sizze_229355 < (size_t) bytes_213157) {
        mem_226475 = realloc(mem_226475, bytes_213157);
        mem_226475_cached_sizze_229355 = bytes_213157;
    }
    for (; iter_226619 < end; iter_226619++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226655 = t_n_m_196759;
        int64_t gtid_226469 = iter_226619;
        int64_t remnant_226656 = iter_226619 - gtid_226469;
        int64_t x_226470;
        
        x_226470 = ((int64_t *) mem_210889.mem)[gtid_207851 * t_n_m_196759 +
                                                gtid_226469];
        
        float x_226471;
        
        x_226471 = ((float *) mem_210893.mem)[gtid_207851 * t_n_m_196759 +
                                              gtid_226469];
        
        int64_t min_arg_226472 = mul64(jump_t_196702, gtid_226469);
        int64_t min_res_226473 = smin64(i_196779, min_arg_226472);
        int64_t defunc_0_g_res_226474 = add64((int64_t) 1, min_res_226473);
        float defunc_2_reduce_res_226476;
        int64_t flat_tid_226620 = (int64_t) 0;
        int32_t num_tasks_226657;
        
        defunc_2_reduce_res_226476 = 0.0F;
        
        struct futhark_mc_task_229356 futhark_mc_task_229356;
        
        futhark_mc_task_229356.ctx = ctx;
        futhark_mc_task_229356.free_n_196692 = n_196692;
        futhark_mc_task_229356.free_gtid_207851 = gtid_207851;
        futhark_mc_task_229356.free_x_207856 = x_207856;
        futhark_mc_task_229356.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229356.free_mem_213152 = mem_213152.mem;
        futhark_mc_task_229356.free_x_226470 = x_226470;
        futhark_mc_task_229356.free_x_226471 = x_226471;
        futhark_mc_task_229356.free_defunc_0_g_res_226474 =
            defunc_0_g_res_226474;
        futhark_mc_task_229356.retval_defunc_2_reduce_res_226476 =
            &defunc_2_reduce_res_226476;
        futhark_mc_task_229356.retval_mem_226475 = mem_226475;
        
        struct scheduler_segop futhark_mc_task_229356_task;
        
        futhark_mc_task_229356_task.args = &futhark_mc_task_229356;
        futhark_mc_task_229356_task.top_level_fn =
            futhark_mc_segred_task_229357;
        futhark_mc_task_229356_task.name = "futhark_mc_segred_task_229357";
        futhark_mc_task_229356_task.iterations = q_t_196696;
        futhark_mc_task_229356_task.task_time =
            &ctx->futhark_mc_segred_task_229357_total_time;
        futhark_mc_task_229356_task.task_iter =
            &ctx->futhark_mc_segred_task_229357_total_iter;
        futhark_mc_task_229356_task.sched = STATIC;
        futhark_mc_task_229356_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229357_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229356_task);
        
        if (futhark_mc_segred_task_229357_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float a0_226501 = 1.0F / defunc_2_reduce_res_226476;
        float defunc_2_reduce_res_226502;
        int64_t flat_tid_226643 = (int64_t) 0;
        int32_t num_tasks_226666;
        
        defunc_2_reduce_res_226502 = 0.0F;
        
        struct futhark_mc_task_229361 futhark_mc_task_229361;
        
        futhark_mc_task_229361.ctx = ctx;
        futhark_mc_task_229361.free_x_207856 = x_207856;
        futhark_mc_task_229361.free_mem_213155 = mem_213155.mem;
        futhark_mc_task_229361.free_x_226470 = x_226470;
        futhark_mc_task_229361.free_mem_226475 = mem_226475;
        futhark_mc_task_229361.free_a0_226501 = a0_226501;
        futhark_mc_task_229361.retval_defunc_2_reduce_res_226502 =
            &defunc_2_reduce_res_226502;
        
        struct scheduler_segop futhark_mc_task_229361_task;
        
        futhark_mc_task_229361_task.args = &futhark_mc_task_229361;
        futhark_mc_task_229361_task.top_level_fn =
            futhark_mc_segred_task_229362;
        futhark_mc_task_229361_task.name = "futhark_mc_segred_task_229362";
        futhark_mc_task_229361_task.iterations = q_t_196696;
        futhark_mc_task_229361_task.task_time =
            &ctx->futhark_mc_segred_task_229362_total_time;
        futhark_mc_task_229361_task.task_iter =
            &ctx->futhark_mc_segred_task_229362_total_iter;
        futhark_mc_task_229361_task.sched = STATIC;
        futhark_mc_task_229361_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229362_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229361_task);
        
        if (futhark_mc_segred_task_229362_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_213176.mem)[gtid_226469] = defunc_2_reduce_res_226502;
    }
    
  cleanup:
    { }
    free(mem_226475);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229354_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229354_end -
                 futhark_mc_segmap_parloop_229354_start;
        
        ctx->futhark_mc_segmap_parloop_229354_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229354_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229354_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229352(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226468 = tid;
    int num_tasks_226579 = info.nsubtasks;
    struct futhark_mc_task_229347 *futhark_mc_task_229347 =
                                  (struct futhark_mc_task_229347 *) args;
    struct futhark_context *ctx = futhark_mc_task_229347->ctx;
    uint64_t futhark_mc_segmap_nested_task_229352_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229352_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229347->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229347->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229347->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229347->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229347->free_i_196779;
    int64_t gtid_207851 = futhark_mc_task_229347->free_gtid_207851;
    int64_t x_207856 = futhark_mc_task_229347->free_x_207856;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229347->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229347->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229347->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213152 = {.desc ="mem_213152", .mem =
                                  futhark_mc_task_229347->free_mem_213152,
                                  .size =0, .references =NULL};
    struct memblock mem_213155 = {.desc ="mem_213155", .mem =
                                  futhark_mc_task_229347->free_mem_213155,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 = futhark_mc_task_229347->free_bytes_213157;
    struct memblock mem_213176 = {.desc ="mem_213176", .mem =
                                  futhark_mc_task_229347->free_mem_213176,
                                  .size =0, .references =NULL};
    int64_t iter_226619;
    struct futhark_mc_segmap_parloop_struct_229353
    futhark_mc_segmap_parloop_struct_229353;
    
    futhark_mc_segmap_parloop_struct_229353.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229353.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229353.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229353.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229353.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229353.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229353.free_gtid_207851 = gtid_207851;
    futhark_mc_segmap_parloop_struct_229353.free_x_207856 = x_207856;
    futhark_mc_segmap_parloop_struct_229353.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229353.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229353.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229353.free_mem_213152 = mem_213152.mem;
    futhark_mc_segmap_parloop_struct_229353.free_mem_213155 = mem_213155.mem;
    futhark_mc_segmap_parloop_struct_229353.free_bytes_213157 = bytes_213157;
    futhark_mc_segmap_parloop_struct_229353.free_mem_213176 = mem_213176.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229354_task;
    
    futhark_mc_segmap_parloop_229354_task.name =
        "futhark_mc_segmap_parloop_229354";
    futhark_mc_segmap_parloop_229354_task.fn = futhark_mc_segmap_parloop_229354;
    futhark_mc_segmap_parloop_229354_task.args =
        &futhark_mc_segmap_parloop_struct_229353;
    futhark_mc_segmap_parloop_229354_task.iterations = iterations;
    futhark_mc_segmap_parloop_229354_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229354_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229354_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229354_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229354_task);
    
    if (futhark_mc_segmap_parloop_229354_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229354_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229354_total_end -
                 futhark_mc_segmap_parloop_229354_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229354_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229354_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229354_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229352_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229352_end -
                 futhark_mc_segmap_nested_task_229352_start;
        
        ctx->futhark_mc_segmap_nested_task_229352_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229352_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229352_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229334(void *args, int64_t start,
                                            int64_t end, int flat_tid_207850,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229333
    *futhark_mc_segmap_parloop_struct_229333 =
    (struct futhark_mc_segmap_parloop_struct_229333 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229333->ctx;
    uint64_t futhark_mc_segmap_parloop_229334_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229334_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229333->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229333->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229333->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229333->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229333->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229333->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229333->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229333->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229333->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229333->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229333->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229333->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229333->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229333->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229333->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229333->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229333->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229333->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 =
            futhark_mc_segmap_parloop_struct_229333->free_bytes_213157;
    struct memblock mem_213255 = {.desc ="mem_213255", .mem =
                                  futhark_mc_segmap_parloop_struct_229333->free_mem_213255,
                                  .size =0, .references =NULL};
    size_t mem_213149_cached_sizze_229335 = 0;
    unsigned char *mem_213149 = NULL;
    size_t mem_213152_cached_sizze_229336 = 0;
    unsigned char *mem_213152 = NULL;
    size_t mem_213155_cached_sizze_229337 = 0;
    unsigned char *mem_213155 = NULL;
    size_t mem_213176_cached_sizze_229338 = 0;
    unsigned char *mem_213176 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226448 = start;
    
    if (mem_213149_cached_sizze_229335 < (size_t) bytes_210949) {
        mem_213149 = realloc(mem_213149, bytes_210949);
        mem_213149_cached_sizze_229335 = bytes_210949;
    }
    if (mem_213152_cached_sizze_229336 < (size_t) bytes_210949) {
        mem_213152 = realloc(mem_213152, bytes_210949);
        mem_213152_cached_sizze_229336 = bytes_210949;
    }
    if (mem_213155_cached_sizze_229337 < (size_t) bytes_210949) {
        mem_213155 = realloc(mem_213155, bytes_210949);
        mem_213155_cached_sizze_229337 = bytes_210949;
    }
    if (mem_213176_cached_sizze_229338 < (size_t) bytes_210836) {
        mem_213176 = realloc(mem_213176, bytes_210836);
        mem_213176_cached_sizze_229338 = bytes_210836;
    }
    for (; iter_226448 < end; iter_226448++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226561 = m_196691;
        int64_t gtid_207851 = iter_226448;
        int64_t remnant_226562 = iter_226448 - gtid_207851;
        int64_t x_207856;
        
        x_207856 = ((int64_t *) mem_210397.mem)[gtid_207851];
        
        int64_t flat_tid_226449 = (int64_t) 0;
        int32_t num_tasks_226563;
        struct futhark_mc_task_229339 futhark_mc_task_229339;
        
        futhark_mc_task_229339.ctx = ctx;
        futhark_mc_task_229339.free_n_196692 = n_196692;
        futhark_mc_task_229339.free_gtid_207851 = gtid_207851;
        futhark_mc_task_229339.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229339.free_mem_212862 = mem_212862.mem;
        futhark_mc_task_229339.free_mem_213149 = mem_213149;
        
        struct scheduler_segop futhark_mc_task_229339_task;
        
        futhark_mc_task_229339_task.args = &futhark_mc_task_229339;
        futhark_mc_task_229339_task.top_level_fn =
            futhark_mc_segmap_task_229340;
        futhark_mc_task_229339_task.name = "futhark_mc_segmap_task_229340";
        futhark_mc_task_229339_task.iterations = n_196692;
        futhark_mc_task_229339_task.task_time =
            &ctx->futhark_mc_segmap_task_229340_total_time;
        futhark_mc_task_229339_task.task_iter =
            &ctx->futhark_mc_segmap_task_229340_total_iter;
        futhark_mc_task_229339_task.sched = STATIC;
        futhark_mc_task_229339_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229340_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229339_task);
        
        if (futhark_mc_segmap_task_229340_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_226454 = (int64_t) 0;
        int32_t num_tasks_226567;
        struct futhark_mc_task_229343 futhark_mc_task_229343;
        
        futhark_mc_task_229343.ctx = ctx;
        futhark_mc_task_229343.free_n_196692 = n_196692;
        futhark_mc_task_229343.free_gtid_207851 = gtid_207851;
        futhark_mc_task_229343.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229343.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229343.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229343.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229343.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229343.free_mem_213149 = mem_213149;
        futhark_mc_task_229343.free_mem_213152 = mem_213152;
        futhark_mc_task_229343.free_mem_213155 = mem_213155;
        
        struct scheduler_segop futhark_mc_task_229343_task;
        
        futhark_mc_task_229343_task.args = &futhark_mc_task_229343;
        futhark_mc_task_229343_task.top_level_fn =
            futhark_mc_segmap_task_229344;
        futhark_mc_task_229343_task.name = "futhark_mc_segmap_task_229344";
        futhark_mc_task_229343_task.iterations = n_196692;
        futhark_mc_task_229343_task.task_time =
            &ctx->futhark_mc_segmap_task_229344_total_time;
        futhark_mc_task_229343_task.task_iter =
            &ctx->futhark_mc_segmap_task_229344_total_iter;
        futhark_mc_task_229343_task.sched = STATIC;
        futhark_mc_task_229343_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229344_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229343_task);
        
        if (futhark_mc_segmap_task_229344_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_226515 = (int64_t) 0;
        int32_t num_tasks_226579;
        int64_t flat_tid_226468 = (int64_t) 0;
        struct futhark_mc_task_229347 futhark_mc_task_229347;
        
        futhark_mc_task_229347.ctx = ctx;
        futhark_mc_task_229347.free_n_196692 = n_196692;
        futhark_mc_task_229347.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229347.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229347.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229347.free_i_196779 = i_196779;
        futhark_mc_task_229347.free_gtid_207851 = gtid_207851;
        futhark_mc_task_229347.free_x_207856 = x_207856;
        futhark_mc_task_229347.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229347.free_mem_210889 = mem_210889.mem;
        futhark_mc_task_229347.free_mem_210893 = mem_210893.mem;
        futhark_mc_task_229347.free_mem_213152 = mem_213152;
        futhark_mc_task_229347.free_mem_213155 = mem_213155;
        futhark_mc_task_229347.free_bytes_213157 = bytes_213157;
        futhark_mc_task_229347.free_mem_213176 = mem_213176;
        
        struct scheduler_segop futhark_mc_task_229347_task;
        
        futhark_mc_task_229347_task.args = &futhark_mc_task_229347;
        futhark_mc_task_229347_task.top_level_fn =
            futhark_mc_segmap_task_229348;
        futhark_mc_task_229347_task.name = "futhark_mc_segmap_task_229348";
        futhark_mc_task_229347_task.iterations = t_n_m_196759;
        futhark_mc_task_229347_task.task_time =
            &ctx->futhark_mc_segmap_task_229348_total_time;
        futhark_mc_task_229347_task.task_iter =
            &ctx->futhark_mc_segmap_task_229348_total_iter;
        futhark_mc_task_229347_task.sched = STATIC;
        futhark_mc_task_229347_task.nested_fn =
            futhark_mc_segmap_nested_task_229352;
        
        int futhark_mc_segmap_task_229348_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229347_task);
        
        if (futhark_mc_segmap_task_229348_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213255.mem + gtid_207851 * t_n_m_196759 * (int64_t) 4,
                    mem_213176 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213149);
    free(mem_213152);
    free(mem_213155);
    free(mem_213176);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229334_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229334_end -
                 futhark_mc_segmap_parloop_229334_start;
        
        ctx->futhark_mc_segmap_parloop_229334_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229334_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229334_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229332(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207850 = tid;
    int num_tasks_226368 = info.nsubtasks;
    struct futhark_mc_task_229323 *futhark_mc_task_229323 =
                                  (struct futhark_mc_task_229323 *) args;
    struct futhark_context *ctx = futhark_mc_task_229323->ctx;
    uint64_t futhark_mc_segmap_nested_task_229332_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229332_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229323->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229323->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229323->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229323->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229323->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229323->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229323->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229323->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229323->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229323->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229323->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229323->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229323->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229323->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229323->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229323->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229323->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229323->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213157 = futhark_mc_task_229323->free_bytes_213157;
    struct memblock mem_213255 = {.desc ="mem_213255", .mem =
                                  futhark_mc_task_229323->free_mem_213255,
                                  .size =0, .references =NULL};
    int64_t iter_226448;
    struct futhark_mc_segmap_parloop_struct_229333
    futhark_mc_segmap_parloop_struct_229333;
    
    futhark_mc_segmap_parloop_struct_229333.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229333.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229333.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229333.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229333.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229333.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229333.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229333.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229333.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229333.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229333.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229333.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229333.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229333.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229333.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229333.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229333.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229333.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229333.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229333.free_bytes_213157 = bytes_213157;
    futhark_mc_segmap_parloop_struct_229333.free_mem_213255 = mem_213255.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229334_task;
    
    futhark_mc_segmap_parloop_229334_task.name =
        "futhark_mc_segmap_parloop_229334";
    futhark_mc_segmap_parloop_229334_task.fn = futhark_mc_segmap_parloop_229334;
    futhark_mc_segmap_parloop_229334_task.args =
        &futhark_mc_segmap_parloop_struct_229333;
    futhark_mc_segmap_parloop_229334_task.iterations = iterations;
    futhark_mc_segmap_parloop_229334_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229334_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229334_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229334_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229334_task);
    
    if (futhark_mc_segmap_parloop_229334_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229334_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229334_total_end -
                 futhark_mc_segmap_parloop_229334_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229334_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229334_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229334_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229332_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229332_end -
                 futhark_mc_segmap_nested_task_229332_start;
        
        ctx->futhark_mc_segmap_nested_task_229332_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229332_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229332_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229366 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213266;
    unsigned char *free_mem_213415;
    unsigned char *free_mem_213419;
};
struct futhark_mc_segmap_parloop_struct_229368 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213266;
    unsigned char *free_mem_213415;
    unsigned char *free_mem_213419;
};
static int futhark_mc_segmap_parloop_229369(void *args, int64_t start,
                                            int64_t end, int flat_tid_207976,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229368
    *futhark_mc_segmap_parloop_struct_229368 =
    (struct futhark_mc_segmap_parloop_struct_229368 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229368->ctx;
    uint64_t futhark_mc_segmap_parloop_229369_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229369_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229368->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229368->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229368->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229368->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229368->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229368->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229368->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229368->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229368->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229368->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229368->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229368->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229368->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 =
            futhark_mc_segmap_parloop_struct_229368->free_bytes_213266;
    struct memblock mem_213415 = {.desc ="mem_213415", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_213415,
                                  .size =0, .references =NULL};
    struct memblock mem_213419 = {.desc ="mem_213419", .mem =
                                  futhark_mc_segmap_parloop_struct_229368->free_mem_213419,
                                  .size =0, .references =NULL};
    size_t mem_213309_cached_sizze_229370 = 0;
    unsigned char *mem_213309 = NULL;
    size_t mem_213324_cached_sizze_229371 = 0;
    unsigned char *mem_213324 = NULL;
    size_t mem_213327_cached_sizze_229372 = 0;
    unsigned char *mem_213327 = NULL;
    size_t mem_213354_cached_sizze_229373 = 0;
    unsigned char *mem_213354 = NULL;
    size_t mem_213357_cached_sizze_229374 = 0;
    unsigned char *mem_213357 = NULL;
    size_t mem_213374_cached_sizze_229375 = 0;
    unsigned char *mem_213374 = NULL;
    size_t mem_213377_cached_sizze_229376 = 0;
    unsigned char *mem_213377 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226676 = start;
    
    if (mem_213309_cached_sizze_229370 < (size_t) bytes_210949) {
        mem_213309 = realloc(mem_213309, bytes_210949);
        mem_213309_cached_sizze_229370 = bytes_210949;
    }
    if (mem_213324_cached_sizze_229371 < (size_t) bytes_210949) {
        mem_213324 = realloc(mem_213324, bytes_210949);
        mem_213324_cached_sizze_229371 = bytes_210949;
    }
    if (mem_213327_cached_sizze_229372 < (size_t) bytes_210949) {
        mem_213327 = realloc(mem_213327, bytes_210949);
        mem_213327_cached_sizze_229372 = bytes_210949;
    }
    if (mem_213354_cached_sizze_229373 < (size_t) bytes_210836) {
        mem_213354 = realloc(mem_213354, bytes_210836);
        mem_213354_cached_sizze_229373 = bytes_210836;
    }
    if (mem_213357_cached_sizze_229374 < (size_t) bytes_210836) {
        mem_213357 = realloc(mem_213357, bytes_210836);
        mem_213357_cached_sizze_229374 = bytes_210836;
    }
    if (mem_213374_cached_sizze_229375 < (size_t) bytes_213266) {
        mem_213374 = realloc(mem_213374, bytes_213266);
        mem_213374_cached_sizze_229375 = bytes_213266;
    }
    if (mem_213377_cached_sizze_229376 < (size_t) bytes_213266) {
        mem_213377 = realloc(mem_213377, bytes_213266);
        mem_213377_cached_sizze_229376 = bytes_213266;
    }
    for (; iter_226676 < end; iter_226676++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226777 = m_196691;
        int64_t gtid_207977 = iter_226676;
        int64_t remnant_226778 = iter_226676 - gtid_207977;
        int64_t x_199414;
        
        x_199414 = ((int64_t *) mem_210397.mem)[gtid_207977];
        for (int64_t i_226677 = 0; i_226677 < n_196692; i_226677++) {
            float x_226679;
            
            x_226679 = ((float *) Y_mem_210354.mem)[gtid_207977 * n_196692 +
                                                    i_226677];
            
            float x_226680;
            
            x_226680 = ((float *) mem_212862.mem)[gtid_207977 * n_196692 +
                                                  i_226677];
            
            float defunc_1_f_res_226681 = x_226679 - x_226680;
            
            ((float *) mem_213309)[i_226677] = defunc_1_f_res_226681;
        }
        for (int64_t i_226683 = 0; i_226683 < n_196692; i_226683++) {
            int64_t x_226686;
            
            x_226686 = ((int64_t *) mem_210394.mem)[gtid_207977 * n_196692 +
                                                    i_226683];
            
            bool cond_226687 = sle64((int64_t) 0, x_226686);
            float defunc_0_f_res_226688;
            
            if (cond_226687) {
                bool y_226689 = slt64(x_226686, n_196692);
                bool bounds_check_226690 = cond_226687 && y_226689;
                bool index_certs_226691;
                
                if (!bounds_check_226690) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_226686,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_226692;
                
                defunc_0_f_res_t_res_226692 = ((float *) mem_213309)[x_226686];
                defunc_0_f_res_226688 = defunc_0_f_res_t_res_226692;
            } else {
                defunc_0_f_res_226688 = 0.0F;
            }
            
            float defunc_0_f_res_226693;
            
            if (cond_226687) {
                bool y_226694 = slt64(x_226686, n_196692);
                bool bounds_check_226695 = cond_226687 && y_226694;
                bool index_certs_226696;
                
                if (!bounds_check_226695) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_226686,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_226697;
                
                defunc_0_f_res_t_res_226697 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_207977 *
                                                      ctx_param_ext_210921 +
                                                      x_226686 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_226693 = defunc_0_f_res_t_res_226697;
            } else {
                defunc_0_f_res_226693 = 0.0F;
            }
            ((float *) mem_213324)[i_226683] = defunc_0_f_res_226693;
            ((float *) mem_213327)[i_226683] = defunc_0_f_res_226688;
        }
        for (int64_t i_226700 = 0; i_226700 < t_n_m_196759; i_226700++) {
            int64_t x_226703;
            
            x_226703 = ((int64_t *) mem_210889.mem)[gtid_207977 * t_n_m_196759 +
                                                    i_226700];
            
            float x_226704;
            
            x_226704 = ((float *) mem_210893.mem)[gtid_207977 * t_n_m_196759 +
                                                  i_226700];
            
            int64_t min_arg_226705 = mul64(jump_t_196702, i_226700);
            int64_t min_res_226706 = smin64(i_196779, min_arg_226705);
            int64_t defunc_0_g_res_226707 = add64((int64_t) 1, min_res_226706);
            float defunc_2_reduce_res_226710;
            float defunc_2_reduce_res_226711;
            float defunc_2_reduce_res_226712;
            float redout_226716;
            float redout_226717;
            float redout_226718;
            
            redout_226716 = 0.0F;
            redout_226717 = 0.0F;
            redout_226718 = 0.0F;
            for (int64_t i_226715 = 0; i_226715 < q_t_196696; i_226715++) {
                bool cond_226721 = sle64(x_199414, i_226715);
                int64_t defunc_0_f_res_226722;
                
                if (cond_226721) {
                    defunc_0_f_res_226722 = (int64_t) 0;
                } else {
                    int64_t i_226723 = add64(x_226703, i_226715);
                    int64_t defunc_0_add_arg_226724;
                    
                    defunc_0_add_arg_226724 =
                        ((int64_t *) mem_210394.mem)[gtid_207977 * n_196692 +
                                                     i_226723];
                    
                    int64_t defunc_1_add_res_226725 = add64((int64_t) 1,
                                                            defunc_0_add_arg_226724);
                    
                    defunc_0_f_res_226722 = defunc_1_add_res_226725;
                }
                
                float defunc_0_f_res_226726;
                
                if (cond_226721) {
                    defunc_0_f_res_226726 = 0.0F;
                } else {
                    int64_t i_226727 = add64(x_226703, i_226715);
                    float defunc_0_add_arg_226728;
                    
                    defunc_0_add_arg_226728 = ((float *) mem_213324)[i_226727];
                    defunc_0_f_res_226726 = defunc_0_add_arg_226728;
                }
                
                int64_t binop_p_226729 = sub64(defunc_0_f_res_226722,
                                               defunc_0_g_res_226707);
                float defunc_0_f_res_226730 = sitofp_i64_f32(binop_p_226729);
                float abs_res_226731 = (float) fabs(defunc_0_f_res_226730);
                float tmp1_226732 = abs_res_226731 / x_226704;
                float x_226733 = tmp1_226732 * tmp1_226732;
                float y_226734 = tmp1_226732 * x_226733;
                float tmp2_226735 = 1.0F - y_226734;
                float x_226736 = tmp2_226735 * tmp2_226735;
                float tmp3_226737 = tmp2_226735 * x_226736;
                float tmp4_226738 = defunc_0_f_res_226726 * tmp3_226737;
                float defunc_1_f_res_226739 = defunc_0_f_res_226730 *
                      tmp4_226738;
                float defunc_1_f_res_226740 = defunc_0_f_res_226730 *
                      defunc_1_f_res_226739;
                float defunc_1_op_res_226741 = tmp4_226738 + redout_226716;
                float defunc_1_op_res_226742 = defunc_1_f_res_226739 +
                      redout_226717;
                float defunc_1_op_res_226743 = defunc_1_f_res_226740 +
                      redout_226718;
                
                ((float *) mem_213374)[i_226715] = defunc_1_f_res_226739;
                ((float *) mem_213377)[i_226715] = tmp4_226738;
                
                float redout_tmp_226784 = defunc_1_op_res_226741;
                float redout_tmp_226785 = defunc_1_op_res_226742;
                float redout_tmp_226786 = defunc_1_op_res_226743;
                
                redout_226716 = redout_tmp_226784;
                redout_226717 = redout_tmp_226785;
                redout_226718 = redout_tmp_226786;
            }
            defunc_2_reduce_res_226710 = redout_226716;
            defunc_2_reduce_res_226711 = redout_226717;
            defunc_2_reduce_res_226712 = redout_226718;
            
            float x_226746 = defunc_2_reduce_res_226710 *
                  defunc_2_reduce_res_226712;
            float y_226747 = defunc_2_reduce_res_226711 *
                  defunc_2_reduce_res_226711;
            float y_226748 = x_226746 - y_226747;
            float det1_226749 = 1.0F / y_226748;
            float a11_226750 = defunc_2_reduce_res_226712 * det1_226749;
            float x_226751 = 0.0F - defunc_2_reduce_res_226711;
            float b11_226752 = det1_226749 * x_226751;
            float c11_226753 = defunc_2_reduce_res_226710 * det1_226749;
            float defunc_2_reduce_res_226754;
            float defunc_2_reduce_res_226755;
            float redout_226757;
            float redout_226758;
            
            redout_226757 = 0.0F;
            redout_226758 = 0.0F;
            for (int64_t i_226756 = 0; i_226756 < q_t_196696; i_226756++) {
                float x_226759;
                
                x_226759 = ((float *) mem_213377)[i_226756];
                
                float x_226760;
                
                x_226760 = ((float *) mem_213374)[i_226756];
                
                bool cond_226761 = sle64(x_199414, i_226756);
                float defunc_0_f_res_226762;
                
                if (cond_226761) {
                    defunc_0_f_res_226762 = 0.0F;
                } else {
                    int64_t i_226763 = add64(x_226703, i_226756);
                    float defunc_0_add_arg_226764;
                    
                    defunc_0_add_arg_226764 = ((float *) mem_213327)[i_226763];
                    defunc_0_f_res_226762 = defunc_0_add_arg_226764;
                }
                
                float x_226765 = a11_226750 * x_226759;
                float y_226766 = b11_226752 * x_226760;
                float x_226767 = x_226765 + y_226766;
                float defunc_9_fit_fun_res_226768 = defunc_0_f_res_226762 *
                      x_226767;
                float x_226769 = b11_226752 * x_226759;
                float y_226770 = c11_226753 * x_226760;
                float x_226771 = x_226769 + y_226770;
                float defunc_9_slope_fun_res_226772 = defunc_0_f_res_226762 *
                      x_226771;
                float defunc_1_op_res_226773 = defunc_9_fit_fun_res_226768 +
                      redout_226757;
                float defunc_1_op_res_226774 = defunc_9_slope_fun_res_226772 +
                      redout_226758;
                float redout_tmp_226789 = defunc_1_op_res_226773;
                float redout_tmp_226790 = defunc_1_op_res_226774;
                
                redout_226757 = redout_tmp_226789;
                redout_226758 = redout_tmp_226790;
            }
            defunc_2_reduce_res_226754 = redout_226757;
            defunc_2_reduce_res_226755 = redout_226758;
            ((float *) mem_213354)[i_226700] = defunc_2_reduce_res_226754;
            ((float *) mem_213357)[i_226700] = defunc_2_reduce_res_226755;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213415.mem + gtid_207977 * t_n_m_196759 * (int64_t) 4,
                    mem_213354 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213419.mem + gtid_207977 * t_n_m_196759 * (int64_t) 4,
                    mem_213357 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213309);
    free(mem_213324);
    free(mem_213327);
    free(mem_213354);
    free(mem_213357);
    free(mem_213374);
    free(mem_213377);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229369_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229369_end -
                 futhark_mc_segmap_parloop_229369_start;
        
        ctx->futhark_mc_segmap_parloop_229369_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229369_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229369_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229367(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_207976 = tid;
    int num_tasks_226675 = info.nsubtasks;
    struct futhark_mc_task_229366 *futhark_mc_task_229366 =
                                  (struct futhark_mc_task_229366 *) args;
    struct futhark_context *ctx = futhark_mc_task_229366->ctx;
    uint64_t futhark_mc_segmap_task_229367_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229367_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229366->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229366->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229366->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229366->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229366->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229366->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229366->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229366->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229366->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229366->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229366->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229366->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229366->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229366->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229366->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229366->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229366->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229366->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 = futhark_mc_task_229366->free_bytes_213266;
    struct memblock mem_213415 = {.desc ="mem_213415", .mem =
                                  futhark_mc_task_229366->free_mem_213415,
                                  .size =0, .references =NULL};
    struct memblock mem_213419 = {.desc ="mem_213419", .mem =
                                  futhark_mc_task_229366->free_mem_213419,
                                  .size =0, .references =NULL};
    int64_t iter_226676;
    struct futhark_mc_segmap_parloop_struct_229368
    futhark_mc_segmap_parloop_struct_229368;
    
    futhark_mc_segmap_parloop_struct_229368.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229368.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229368.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229368.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229368.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229368.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229368.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229368.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229368.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229368.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229368.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229368.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229368.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229368.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229368.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229368.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229368.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229368.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229368.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229368.free_bytes_213266 = bytes_213266;
    futhark_mc_segmap_parloop_struct_229368.free_mem_213415 = mem_213415.mem;
    futhark_mc_segmap_parloop_struct_229368.free_mem_213419 = mem_213419.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229369_task;
    
    futhark_mc_segmap_parloop_229369_task.name =
        "futhark_mc_segmap_parloop_229369";
    futhark_mc_segmap_parloop_229369_task.fn = futhark_mc_segmap_parloop_229369;
    futhark_mc_segmap_parloop_229369_task.args =
        &futhark_mc_segmap_parloop_struct_229368;
    futhark_mc_segmap_parloop_229369_task.iterations = iterations;
    futhark_mc_segmap_parloop_229369_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229369_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229369_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229369_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229369_task);
    
    if (futhark_mc_segmap_parloop_229369_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229369_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229369_total_end -
                 futhark_mc_segmap_parloop_229369_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229369_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229369_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229369_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229367_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229367_end -
                 futhark_mc_segmap_task_229367_start;
        
        ctx->futhark_mc_segmap_task_229367_runs[tid]++;
        ctx->futhark_mc_segmap_task_229367_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229367_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229378 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213266;
    unsigned char *free_mem_213415;
    unsigned char *free_mem_213419;
};
struct futhark_mc_task_229385 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208071;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213258;
};
struct futhark_mc_segmap_parloop_struct_229387 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208071;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213258;
};
static int futhark_mc_segmap_parloop_229388(void *args, int64_t start,
                                            int64_t end, int flat_tid_226792,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229387
    *futhark_mc_segmap_parloop_struct_229387 =
    (struct futhark_mc_segmap_parloop_struct_229387 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229387->ctx;
    uint64_t futhark_mc_segmap_parloop_229388_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229388_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229387->free_n_196692;
    int64_t gtid_208071 =
            futhark_mc_segmap_parloop_struct_229387->free_gtid_208071;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229387->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229387->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213258 = {.desc ="mem_213258", .mem =
                                  futhark_mc_segmap_parloop_struct_229387->free_mem_213258,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226967 = start;
    
    for (; iter_226967 < end; iter_226967++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226968 = n_196692;
        int64_t gtid_226793 = iter_226967;
        int64_t remnant_226969 = iter_226967 - gtid_226793;
        float x_226794;
        
        x_226794 = ((float *) Y_mem_210354.mem)[gtid_208071 * n_196692 +
                                                gtid_226793];
        
        float x_226795;
        
        x_226795 = ((float *) mem_212862.mem)[gtid_208071 * n_196692 +
                                              gtid_226793];
        
        float defunc_1_f_res_226796 = x_226794 - x_226795;
        
        ((float *) mem_213258.mem)[gtid_226793] = defunc_1_f_res_226796;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229388_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229388_end -
                 futhark_mc_segmap_parloop_229388_start;
        
        ctx->futhark_mc_segmap_parloop_229388_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229388_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229388_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229386(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226792 = tid;
    int num_tasks_226966 = info.nsubtasks;
    struct futhark_mc_task_229385 *futhark_mc_task_229385 =
                                  (struct futhark_mc_task_229385 *) args;
    struct futhark_context *ctx = futhark_mc_task_229385->ctx;
    uint64_t futhark_mc_segmap_task_229386_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229386_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229385->free_n_196692;
    int64_t gtid_208071 = futhark_mc_task_229385->free_gtid_208071;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229385->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229385->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213258 = {.desc ="mem_213258", .mem =
                                  futhark_mc_task_229385->free_mem_213258,
                                  .size =0, .references =NULL};
    int64_t iter_226967;
    struct futhark_mc_segmap_parloop_struct_229387
    futhark_mc_segmap_parloop_struct_229387;
    
    futhark_mc_segmap_parloop_struct_229387.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229387.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229387.free_gtid_208071 = gtid_208071;
    futhark_mc_segmap_parloop_struct_229387.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229387.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229387.free_mem_213258 = mem_213258.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229388_task;
    
    futhark_mc_segmap_parloop_229388_task.name =
        "futhark_mc_segmap_parloop_229388";
    futhark_mc_segmap_parloop_229388_task.fn = futhark_mc_segmap_parloop_229388;
    futhark_mc_segmap_parloop_229388_task.args =
        &futhark_mc_segmap_parloop_struct_229387;
    futhark_mc_segmap_parloop_229388_task.iterations = iterations;
    futhark_mc_segmap_parloop_229388_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229388_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229388_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229388_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229388_task);
    
    if (futhark_mc_segmap_parloop_229388_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229388_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229388_total_end -
                 futhark_mc_segmap_parloop_229388_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229388_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229388_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229388_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229386_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229386_end -
                 futhark_mc_segmap_task_229386_start;
        
        ctx->futhark_mc_segmap_task_229386_runs[tid]++;
        ctx->futhark_mc_segmap_task_229386_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229386_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229389 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208071;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213258;
    unsigned char *free_mem_213261;
    unsigned char *free_mem_213264;
};
struct futhark_mc_segmap_parloop_struct_229391 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208071;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213258;
    unsigned char *free_mem_213261;
    unsigned char *free_mem_213264;
};
static int futhark_mc_segmap_parloop_229392(void *args, int64_t start,
                                            int64_t end, int flat_tid_226797,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229391
    *futhark_mc_segmap_parloop_struct_229391 =
    (struct futhark_mc_segmap_parloop_struct_229391 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229391->ctx;
    uint64_t futhark_mc_segmap_parloop_229392_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229392_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229391->free_n_196692;
    int64_t gtid_208071 =
            futhark_mc_segmap_parloop_struct_229391->free_gtid_208071;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229391->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229391->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229391->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229391->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229391->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213258 = {.desc ="mem_213258", .mem =
                                  futhark_mc_segmap_parloop_struct_229391->free_mem_213258,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_segmap_parloop_struct_229391->free_mem_213261,
                                  .size =0, .references =NULL};
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_segmap_parloop_struct_229391->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_226971 = start;
    
    for (; iter_226971 < end; iter_226971++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226980 = n_196692;
        int64_t gtid_226798 = iter_226971;
        int64_t remnant_226981 = iter_226971 - gtid_226798;
        int64_t x_226799;
        
        x_226799 = ((int64_t *) mem_210394.mem)[gtid_208071 * n_196692 +
                                                gtid_226798];
        
        bool cond_226800 = sle64((int64_t) 0, x_226799);
        float defunc_0_f_res_226801;
        
        if (cond_226800) {
            bool y_226972 = slt64(x_226799, n_196692);
            bool bounds_check_226973 = cond_226800 && y_226972;
            bool index_certs_226974;
            
            if (!bounds_check_226973) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_226799,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_226975;
            
            defunc_0_f_res_t_res_226975 = ((float *) mem_213258.mem)[x_226799];
            defunc_0_f_res_226801 = defunc_0_f_res_t_res_226975;
        } else {
            defunc_0_f_res_226801 = 0.0F;
        }
        
        float defunc_0_f_res_226806;
        
        if (cond_226800) {
            bool y_226976 = slt64(x_226799, n_196692);
            bool bounds_check_226977 = cond_226800 && y_226976;
            bool index_certs_226978;
            
            if (!bounds_check_226977) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_226799,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_226979;
            
            defunc_0_f_res_t_res_226979 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_208071 *
                                                  ctx_param_ext_210921 +
                                                  x_226799 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_226806 = defunc_0_f_res_t_res_226979;
        } else {
            defunc_0_f_res_226806 = 0.0F;
        }
        ((float *) mem_213261.mem)[gtid_226798] = defunc_0_f_res_226806;
        ((float *) mem_213264.mem)[gtid_226798] = defunc_0_f_res_226801;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229392_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229392_end -
                 futhark_mc_segmap_parloop_229392_start;
        
        ctx->futhark_mc_segmap_parloop_229392_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229392_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229392_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229390(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226797 = tid;
    int num_tasks_226970 = info.nsubtasks;
    struct futhark_mc_task_229389 *futhark_mc_task_229389 =
                                  (struct futhark_mc_task_229389 *) args;
    struct futhark_context *ctx = futhark_mc_task_229389->ctx;
    uint64_t futhark_mc_segmap_task_229390_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229390_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229389->free_n_196692;
    int64_t gtid_208071 = futhark_mc_task_229389->free_gtid_208071;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229389->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229389->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229389->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229389->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229389->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213258 = {.desc ="mem_213258", .mem =
                                  futhark_mc_task_229389->free_mem_213258,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_task_229389->free_mem_213261,
                                  .size =0, .references =NULL};
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_task_229389->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t iter_226971;
    struct futhark_mc_segmap_parloop_struct_229391
    futhark_mc_segmap_parloop_struct_229391;
    
    futhark_mc_segmap_parloop_struct_229391.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229391.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229391.free_gtid_208071 = gtid_208071;
    futhark_mc_segmap_parloop_struct_229391.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229391.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229391.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229391.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229391.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229391.free_mem_213258 = mem_213258.mem;
    futhark_mc_segmap_parloop_struct_229391.free_mem_213261 = mem_213261.mem;
    futhark_mc_segmap_parloop_struct_229391.free_mem_213264 = mem_213264.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229392_task;
    
    futhark_mc_segmap_parloop_229392_task.name =
        "futhark_mc_segmap_parloop_229392";
    futhark_mc_segmap_parloop_229392_task.fn = futhark_mc_segmap_parloop_229392;
    futhark_mc_segmap_parloop_229392_task.args =
        &futhark_mc_segmap_parloop_struct_229391;
    futhark_mc_segmap_parloop_229392_task.iterations = iterations;
    futhark_mc_segmap_parloop_229392_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229392_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229392_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229392_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229392_task);
    
    if (futhark_mc_segmap_parloop_229392_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229392_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229392_total_end -
                 futhark_mc_segmap_parloop_229392_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229392_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229392_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229392_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229390_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229390_end -
                 futhark_mc_segmap_task_229390_start;
        
        ctx->futhark_mc_segmap_task_229390_runs[tid]++;
        ctx->futhark_mc_segmap_task_229390_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229390_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229393 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_208071;
    int64_t free_x_208076;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213261;
    unsigned char *free_mem_213264;
    int64_t free_bytes_213266;
    unsigned char *free_mem_213303;
    unsigned char *free_mem_213306;
};
struct futhark_mc_segmap_parloop_struct_229395 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_208071;
    int64_t free_x_208076;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213261;
    unsigned char *free_mem_213264;
    int64_t free_bytes_213266;
    unsigned char *free_mem_213303;
    unsigned char *free_mem_213306;
};
static int futhark_mc_segmap_parloop_229396(void *args, int64_t start,
                                            int64_t end, int flat_tid_226888,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229395
    *futhark_mc_segmap_parloop_struct_229395 =
    (struct futhark_mc_segmap_parloop_struct_229395 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229395->ctx;
    uint64_t futhark_mc_segmap_parloop_229396_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229396_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229395->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229395->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229395->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229395->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229395->free_i_196779;
    int64_t gtid_208071 =
            futhark_mc_segmap_parloop_struct_229395->free_gtid_208071;
    int64_t x_208076 = futhark_mc_segmap_parloop_struct_229395->free_x_208076;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_213261,
                                  .size =0, .references =NULL};
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 =
            futhark_mc_segmap_parloop_struct_229395->free_bytes_213266;
    struct memblock mem_213303 = {.desc ="mem_213303", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_213303,
                                  .size =0, .references =NULL};
    struct memblock mem_213306 = {.desc ="mem_213306", .mem =
                                  futhark_mc_segmap_parloop_struct_229395->free_mem_213306,
                                  .size =0, .references =NULL};
    size_t mem_226895_cached_sizze_229397 = 0;
    unsigned char *mem_226895 = NULL;
    size_t mem_226897_cached_sizze_229398 = 0;
    unsigned char *mem_226897 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226983 = start;
    
    if (mem_226895_cached_sizze_229397 < (size_t) bytes_213266) {
        mem_226895 = realloc(mem_226895, bytes_213266);
        mem_226895_cached_sizze_229397 = bytes_213266;
    }
    if (mem_226897_cached_sizze_229398 < (size_t) bytes_213266) {
        mem_226897 = realloc(mem_226897, bytes_213266);
        mem_226897_cached_sizze_229398 = bytes_213266;
    }
    for (; iter_226983 < end; iter_226983++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227034 = t_n_m_196759;
        int64_t gtid_226889 = iter_226983;
        int64_t remnant_227035 = iter_226983 - gtid_226889;
        int64_t x_226890;
        
        x_226890 = ((int64_t *) mem_210889.mem)[gtid_208071 * t_n_m_196759 +
                                                gtid_226889];
        
        float x_226891;
        
        x_226891 = ((float *) mem_210893.mem)[gtid_208071 * t_n_m_196759 +
                                              gtid_226889];
        
        int64_t min_arg_226892 = mul64(jump_t_196702, gtid_226889);
        int64_t min_res_226893 = smin64(i_196779, min_arg_226892);
        int64_t defunc_0_g_res_226894 = add64((int64_t) 1, min_res_226893);
        float defunc_2_reduce_res_226899;
        float defunc_2_reduce_res_226900;
        float defunc_2_reduce_res_226901;
        float redout_226985;
        float redout_226986;
        float redout_226987;
        
        redout_226985 = 0.0F;
        redout_226986 = 0.0F;
        redout_226987 = 0.0F;
        for (int64_t i_226984 = 0; i_226984 < q_t_196696; i_226984++) {
            bool cond_226990 = sle64(x_208076, i_226984);
            int64_t defunc_0_f_res_226991;
            
            if (cond_226990) {
                defunc_0_f_res_226991 = (int64_t) 0;
            } else {
                int64_t i_226992 = add64(x_226890, i_226984);
                int64_t defunc_0_add_arg_226993;
                
                defunc_0_add_arg_226993 =
                    ((int64_t *) mem_210394.mem)[gtid_208071 * n_196692 +
                                                 i_226992];
                
                int64_t defunc_1_add_res_226994 = add64((int64_t) 1,
                                                        defunc_0_add_arg_226993);
                
                defunc_0_f_res_226991 = defunc_1_add_res_226994;
            }
            
            float defunc_0_f_res_226995;
            
            if (cond_226990) {
                defunc_0_f_res_226995 = 0.0F;
            } else {
                int64_t i_226996 = add64(x_226890, i_226984);
                float defunc_0_add_arg_226997;
                
                defunc_0_add_arg_226997 = ((float *) mem_213261.mem)[i_226996];
                defunc_0_f_res_226995 = defunc_0_add_arg_226997;
            }
            
            int64_t binop_p_226998 = sub64(defunc_0_f_res_226991,
                                           defunc_0_g_res_226894);
            float defunc_0_f_res_226999 = sitofp_i64_f32(binop_p_226998);
            float abs_res_227000 = (float) fabs(defunc_0_f_res_226999);
            float tmp1_227001 = abs_res_227000 / x_226891;
            float x_227002 = tmp1_227001 * tmp1_227001;
            float y_227003 = tmp1_227001 * x_227002;
            float tmp2_227004 = 1.0F - y_227003;
            float x_227005 = tmp2_227004 * tmp2_227004;
            float tmp3_227006 = tmp2_227004 * x_227005;
            float tmp4_227007 = defunc_0_f_res_226995 * tmp3_227006;
            float defunc_1_f_res_227008 = defunc_0_f_res_226999 * tmp4_227007;
            float defunc_1_f_res_227009 = defunc_0_f_res_226999 *
                  defunc_1_f_res_227008;
            float defunc_1_op_res_227010 = tmp4_227007 + redout_226985;
            float defunc_1_op_res_227011 = defunc_1_f_res_227008 +
                  redout_226986;
            float defunc_1_op_res_227012 = defunc_1_f_res_227009 +
                  redout_226987;
            
            ((float *) mem_226895)[i_226984] = defunc_1_f_res_227008;
            ((float *) mem_226897)[i_226984] = tmp4_227007;
            
            float redout_tmp_227036 = defunc_1_op_res_227010;
            float redout_tmp_227037 = defunc_1_op_res_227011;
            float redout_tmp_227038 = defunc_1_op_res_227012;
            
            redout_226985 = redout_tmp_227036;
            redout_226986 = redout_tmp_227037;
            redout_226987 = redout_tmp_227038;
        }
        defunc_2_reduce_res_226899 = redout_226985;
        defunc_2_reduce_res_226900 = redout_226986;
        defunc_2_reduce_res_226901 = redout_226987;
        
        float x_226935 = defunc_2_reduce_res_226899 *
              defunc_2_reduce_res_226901;
        float y_226936 = defunc_2_reduce_res_226900 *
              defunc_2_reduce_res_226900;
        float y_226937 = x_226935 - y_226936;
        float det1_226938 = 1.0F / y_226937;
        float a11_226939 = defunc_2_reduce_res_226901 * det1_226938;
        float x_226940 = 0.0F - defunc_2_reduce_res_226900;
        float b11_226941 = det1_226938 * x_226940;
        float c11_226942 = defunc_2_reduce_res_226899 * det1_226938;
        float defunc_2_reduce_res_226943;
        float defunc_2_reduce_res_226944;
        float redout_227016;
        float redout_227017;
        
        redout_227016 = 0.0F;
        redout_227017 = 0.0F;
        for (int64_t i_227015 = 0; i_227015 < q_t_196696; i_227015++) {
            float x_227018;
            
            x_227018 = ((float *) mem_226897)[i_227015];
            
            float x_227019;
            
            x_227019 = ((float *) mem_226895)[i_227015];
            
            bool cond_227020 = sle64(x_208076, i_227015);
            float defunc_0_f_res_227021;
            
            if (cond_227020) {
                defunc_0_f_res_227021 = 0.0F;
            } else {
                int64_t i_227022 = add64(x_226890, i_227015);
                float defunc_0_add_arg_227023;
                
                defunc_0_add_arg_227023 = ((float *) mem_213264.mem)[i_227022];
                defunc_0_f_res_227021 = defunc_0_add_arg_227023;
            }
            
            float x_227024 = a11_226939 * x_227018;
            float y_227025 = b11_226941 * x_227019;
            float x_227026 = x_227024 + y_227025;
            float defunc_9_fit_fun_res_227027 = defunc_0_f_res_227021 *
                  x_227026;
            float x_227028 = b11_226941 * x_227018;
            float y_227029 = c11_226942 * x_227019;
            float x_227030 = x_227028 + y_227029;
            float defunc_9_slope_fun_res_227031 = defunc_0_f_res_227021 *
                  x_227030;
            float defunc_1_op_res_227032 = defunc_9_fit_fun_res_227027 +
                  redout_227016;
            float defunc_1_op_res_227033 = defunc_9_slope_fun_res_227031 +
                  redout_227017;
            float redout_tmp_227041 = defunc_1_op_res_227032;
            float redout_tmp_227042 = defunc_1_op_res_227033;
            
            redout_227016 = redout_tmp_227041;
            redout_227017 = redout_tmp_227042;
        }
        defunc_2_reduce_res_226943 = redout_227016;
        defunc_2_reduce_res_226944 = redout_227017;
        ((float *) mem_213303.mem)[gtid_226889] = defunc_2_reduce_res_226943;
        ((float *) mem_213306.mem)[gtid_226889] = defunc_2_reduce_res_226944;
    }
    
  cleanup:
    { }
    free(mem_226895);
    free(mem_226897);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229396_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229396_end -
                 futhark_mc_segmap_parloop_229396_start;
        
        ctx->futhark_mc_segmap_parloop_229396_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229396_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229396_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229394(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226888 = tid;
    int num_tasks_226982 = info.nsubtasks;
    struct futhark_mc_task_229393 *futhark_mc_task_229393 =
                                  (struct futhark_mc_task_229393 *) args;
    struct futhark_context *ctx = futhark_mc_task_229393->ctx;
    uint64_t futhark_mc_segmap_task_229394_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229394_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229393->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229393->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229393->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229393->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229393->free_i_196779;
    int64_t gtid_208071 = futhark_mc_task_229393->free_gtid_208071;
    int64_t x_208076 = futhark_mc_task_229393->free_x_208076;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229393->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229393->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229393->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_task_229393->free_mem_213261,
                                  .size =0, .references =NULL};
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_task_229393->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 = futhark_mc_task_229393->free_bytes_213266;
    struct memblock mem_213303 = {.desc ="mem_213303", .mem =
                                  futhark_mc_task_229393->free_mem_213303,
                                  .size =0, .references =NULL};
    struct memblock mem_213306 = {.desc ="mem_213306", .mem =
                                  futhark_mc_task_229393->free_mem_213306,
                                  .size =0, .references =NULL};
    int64_t iter_226983;
    struct futhark_mc_segmap_parloop_struct_229395
    futhark_mc_segmap_parloop_struct_229395;
    
    futhark_mc_segmap_parloop_struct_229395.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229395.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229395.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229395.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229395.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229395.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229395.free_gtid_208071 = gtid_208071;
    futhark_mc_segmap_parloop_struct_229395.free_x_208076 = x_208076;
    futhark_mc_segmap_parloop_struct_229395.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229395.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229395.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229395.free_mem_213261 = mem_213261.mem;
    futhark_mc_segmap_parloop_struct_229395.free_mem_213264 = mem_213264.mem;
    futhark_mc_segmap_parloop_struct_229395.free_bytes_213266 = bytes_213266;
    futhark_mc_segmap_parloop_struct_229395.free_mem_213303 = mem_213303.mem;
    futhark_mc_segmap_parloop_struct_229395.free_mem_213306 = mem_213306.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229396_task;
    
    futhark_mc_segmap_parloop_229396_task.name =
        "futhark_mc_segmap_parloop_229396";
    futhark_mc_segmap_parloop_229396_task.fn = futhark_mc_segmap_parloop_229396;
    futhark_mc_segmap_parloop_229396_task.args =
        &futhark_mc_segmap_parloop_struct_229395;
    futhark_mc_segmap_parloop_229396_task.iterations = iterations;
    futhark_mc_segmap_parloop_229396_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229396_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229396_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229396_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229396_task);
    
    if (futhark_mc_segmap_parloop_229396_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229396_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229396_total_end -
                 futhark_mc_segmap_parloop_229396_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229396_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229396_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229396_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229394_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229394_end -
                 futhark_mc_segmap_task_229394_start;
        
        ctx->futhark_mc_segmap_task_229394_runs[tid]++;
        ctx->futhark_mc_segmap_task_229394_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229394_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229400 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_208071;
    int64_t free_x_208076;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213261;
    unsigned char *free_mem_213264;
    int64_t free_bytes_213266;
    unsigned char *free_mem_213303;
    unsigned char *free_mem_213306;
};
struct futhark_mc_task_229404 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208071;
    int64_t free_x_208076;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213261;
    int64_t free_x_226813;
    float free_x_226814;
    int64_t free_defunc_0_g_res_226817;
    float *retval_defunc_2_reduce_res_226820;
    float *retval_defunc_2_reduce_res_226821;
    float *retval_defunc_2_reduce_res_226822;
    unsigned char *retval_mem_226818;
    unsigned char *retval_mem_226819;
};
struct futhark_mc_segred_stage_1_parloop_struct_229409 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208071;
    int64_t free_x_208076;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213261;
    int64_t free_x_226813;
    float free_x_226814;
    int64_t free_defunc_0_g_res_226817;
    unsigned char *free_mem_226818;
    unsigned char *free_mem_226819;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227100;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227102;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227104;
};
static int futhark_mc_segred_stage_1_parloop_229410(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_227044,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229409
    *futhark_mc_segred_stage_1_parloop_struct_229409 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229409 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229409->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229410_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229410_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229409->free_n_196692;
    int64_t gtid_208071 =
            futhark_mc_segred_stage_1_parloop_struct_229409->free_gtid_208071;
    int64_t x_208076 =
            futhark_mc_segred_stage_1_parloop_struct_229409->free_x_208076;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229409->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229409->free_mem_213261,
                                  .size =0, .references =NULL};
    int64_t x_226813 =
            futhark_mc_segred_stage_1_parloop_struct_229409->free_x_226813;
    float x_226814 =
          futhark_mc_segred_stage_1_parloop_struct_229409->free_x_226814;
    int64_t defunc_0_g_res_226817 =
            futhark_mc_segred_stage_1_parloop_struct_229409->free_defunc_0_g_res_226817;
    struct memblock mem_226818 = {.desc ="mem_226818", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229409->free_mem_226818,
                                  .size =0, .references =NULL};
    struct memblock mem_226819 = {.desc ="mem_226819", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229409->free_mem_226819,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227100 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227100",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229409->free_reduce_stage_1_tid_res_arr_mem_227100,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227102 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227102",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229409->free_reduce_stage_1_tid_res_arr_mem_227102,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227104 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227104",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229409->free_reduce_stage_1_tid_res_arr_mem_227104,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227106 = start;
    float x_227046;
    float x_227047;
    float x_227049;
    float x_227050;
    float x_227052;
    float x_227053;
    float local_acc_227107 = 0.0F;
    float local_acc_227108 = 0.0F;
    float local_acc_227109 = 0.0F;
    
    for (; iter_227106 < end; iter_227106++) {
        int64_t gtid_227045 = iter_227106;
        bool cond_227055 = sle64(x_208076, gtid_227045);
        int64_t defunc_0_f_res_227056;
        
        if (cond_227055) {
            defunc_0_f_res_227056 = (int64_t) 0;
        } else {
            int64_t i_227057 = add64(x_226813, gtid_227045);
            int64_t defunc_0_add_arg_227058;
            
            defunc_0_add_arg_227058 = ((int64_t *) mem_210394.mem)[gtid_208071 *
                                                                   n_196692 +
                                                                   i_227057];
            
            int64_t defunc_1_add_res_227059 = add64((int64_t) 1,
                                                    defunc_0_add_arg_227058);
            
            defunc_0_f_res_227056 = defunc_1_add_res_227059;
        }
        
        float defunc_0_f_res_227060;
        
        if (cond_227055) {
            defunc_0_f_res_227060 = 0.0F;
        } else {
            int64_t i_227061 = add64(x_226813, gtid_227045);
            float defunc_0_add_arg_227062;
            
            defunc_0_add_arg_227062 = ((float *) mem_213261.mem)[i_227061];
            defunc_0_f_res_227060 = defunc_0_add_arg_227062;
        }
        
        int64_t binop_p_227063 = sub64(defunc_0_f_res_227056,
                                       defunc_0_g_res_226817);
        float defunc_0_f_res_227064 = sitofp_i64_f32(binop_p_227063);
        float abs_res_227065 = (float) fabs(defunc_0_f_res_227064);
        float tmp1_227066 = abs_res_227065 / x_226814;
        float x_227067 = tmp1_227066 * tmp1_227066;
        float y_227068 = tmp1_227066 * x_227067;
        float tmp2_227069 = 1.0F - y_227068;
        float x_227070 = tmp2_227069 * tmp2_227069;
        float tmp3_227071 = tmp2_227069 * x_227070;
        float tmp4_227072 = defunc_0_f_res_227060 * tmp3_227071;
        float defunc_1_f_res_227073 = defunc_0_f_res_227064 * tmp4_227072;
        float defunc_1_f_res_227074 = defunc_0_f_res_227064 *
              defunc_1_f_res_227073;
        
        // save map-out results
        {
            ((float *) mem_226818.mem)[gtid_227045] = defunc_1_f_res_227073;
            ((float *) mem_226819.mem)[gtid_227045] = tmp4_227072;
        }
        // Load accum params
        {
            x_227046 = local_acc_227107;
        }
        // Load next params
        {
            x_227047 = tmp4_227072;
        }
        // Red body
        {
            float defunc_1_op_res_227048 = x_227046 + x_227047;
            
            local_acc_227107 = defunc_1_op_res_227048;
        }
        // Load accum params
        {
            x_227049 = local_acc_227108;
        }
        // Load next params
        {
            x_227050 = defunc_1_f_res_227073;
        }
        // Red body
        {
            float defunc_1_op_res_227051 = x_227049 + x_227050;
            
            local_acc_227108 = defunc_1_op_res_227051;
        }
        // Load accum params
        {
            x_227052 = local_acc_227109;
        }
        // Load next params
        {
            x_227053 = defunc_1_f_res_227074;
        }
        // Red body
        {
            float defunc_1_op_res_227054 = x_227052 + x_227053;
            
            local_acc_227109 = defunc_1_op_res_227054;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_227100.mem)[flat_tid_227044] =
        local_acc_227107;
    ((float *) reduce_stage_1_tid_res_arr_mem_227102.mem)[flat_tid_227044] =
        local_acc_227108;
    ((float *) reduce_stage_1_tid_res_arr_mem_227104.mem)[flat_tid_227044] =
        local_acc_227109;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229410_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229410_end -
                 futhark_mc_segred_stage_1_parloop_229410_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229410_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229410_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229410_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229405(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227044 = tid;
    int num_tasks_227099 = info.nsubtasks;
    struct futhark_mc_task_229404 *futhark_mc_task_229404 =
                                  (struct futhark_mc_task_229404 *) args;
    struct futhark_context *ctx = futhark_mc_task_229404->ctx;
    uint64_t futhark_mc_segred_task_229405_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229405_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229404->free_n_196692;
    int64_t gtid_208071 = futhark_mc_task_229404->free_gtid_208071;
    int64_t x_208076 = futhark_mc_task_229404->free_x_208076;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229404->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_task_229404->free_mem_213261,
                                  .size =0, .references =NULL};
    int64_t x_226813 = futhark_mc_task_229404->free_x_226813;
    float x_226814 = futhark_mc_task_229404->free_x_226814;
    int64_t defunc_0_g_res_226817 =
            futhark_mc_task_229404->free_defunc_0_g_res_226817;
    float defunc_2_reduce_res_226820 =
          *futhark_mc_task_229404->retval_defunc_2_reduce_res_226820;
    float defunc_2_reduce_res_226821 =
          *futhark_mc_task_229404->retval_defunc_2_reduce_res_226821;
    float defunc_2_reduce_res_226822 =
          *futhark_mc_task_229404->retval_defunc_2_reduce_res_226822;
    struct memblock mem_226818 = {.desc ="mem_226818", .mem =
                                  futhark_mc_task_229404->retval_mem_226818,
                                  .size =0, .references =NULL};
    struct memblock mem_226819 = {.desc ="mem_226819", .mem =
                                  futhark_mc_task_229404->retval_mem_226819,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_227100_cached_sizze_229406 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227100 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227102_cached_sizze_229407 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227102 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227104_cached_sizze_229408 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227104 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_227100_cached_sizze_229406 <
        (size_t) ((int64_t) 4 * num_tasks_227099)) {
        reduce_stage_1_tid_res_arr_mem_227100 =
            realloc(reduce_stage_1_tid_res_arr_mem_227100, (int64_t) 4 *
                    num_tasks_227099);
        reduce_stage_1_tid_res_arr_mem_227100_cached_sizze_229406 =
            (int64_t) 4 * num_tasks_227099;
    }
    if (reduce_stage_1_tid_res_arr_mem_227102_cached_sizze_229407 <
        (size_t) ((int64_t) 4 * num_tasks_227099)) {
        reduce_stage_1_tid_res_arr_mem_227102 =
            realloc(reduce_stage_1_tid_res_arr_mem_227102, (int64_t) 4 *
                    num_tasks_227099);
        reduce_stage_1_tid_res_arr_mem_227102_cached_sizze_229407 =
            (int64_t) 4 * num_tasks_227099;
    }
    if (reduce_stage_1_tid_res_arr_mem_227104_cached_sizze_229408 <
        (size_t) ((int64_t) 4 * num_tasks_227099)) {
        reduce_stage_1_tid_res_arr_mem_227104 =
            realloc(reduce_stage_1_tid_res_arr_mem_227104, (int64_t) 4 *
                    num_tasks_227099);
        reduce_stage_1_tid_res_arr_mem_227104_cached_sizze_229408 =
            (int64_t) 4 * num_tasks_227099;
    }
    
    int64_t iter_227106;
    struct futhark_mc_segred_stage_1_parloop_struct_229409
    futhark_mc_segred_stage_1_parloop_struct_229409;
    
    futhark_mc_segred_stage_1_parloop_struct_229409.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_gtid_208071 =
        gtid_208071;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_x_208076 = x_208076;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_mem_210394 =
        mem_210394.mem;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_mem_213261 =
        mem_213261.mem;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_x_226813 = x_226813;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_x_226814 = x_226814;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_defunc_0_g_res_226817 =
        defunc_0_g_res_226817;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_mem_226818 =
        mem_226818.mem;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_mem_226819 =
        mem_226819.mem;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_reduce_stage_1_tid_res_arr_mem_227100 =
        reduce_stage_1_tid_res_arr_mem_227100;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_reduce_stage_1_tid_res_arr_mem_227102 =
        reduce_stage_1_tid_res_arr_mem_227102;
    futhark_mc_segred_stage_1_parloop_struct_229409.free_reduce_stage_1_tid_res_arr_mem_227104 =
        reduce_stage_1_tid_res_arr_mem_227104;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229410_task;
    
    futhark_mc_segred_stage_1_parloop_229410_task.name =
        "futhark_mc_segred_stage_1_parloop_229410";
    futhark_mc_segred_stage_1_parloop_229410_task.fn =
        futhark_mc_segred_stage_1_parloop_229410;
    futhark_mc_segred_stage_1_parloop_229410_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229409;
    futhark_mc_segred_stage_1_parloop_229410_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229410_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229410_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229410_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229410_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229410_task);
    
    if (futhark_mc_segred_stage_1_parloop_229410_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229410_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229410_total_end -
                 futhark_mc_segred_stage_1_parloop_229410_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229410_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229410_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229410_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_226820 = 0.0F;
        defunc_2_reduce_res_226821 = 0.0F;
        defunc_2_reduce_res_226822 = 0.0F;
    }
    
    float x_227110;
    float x_227111;
    float x_227113;
    float x_227114;
    float x_227116;
    float x_227117;
    
    for (int32_t i_227119 = 0; i_227119 < num_tasks_227099; i_227119++) {
        flat_tid_227044 = i_227119;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_227110 = defunc_2_reduce_res_226820;
            }
            // load next params
            {
                x_227111 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227100)[flat_tid_227044];
            }
            // red body
            {
                float defunc_1_op_res_227112 = x_227110 + x_227111;
                
                defunc_2_reduce_res_226820 = defunc_1_op_res_227112;
            }
            // load acc params
            {
                x_227113 = defunc_2_reduce_res_226821;
            }
            // load next params
            {
                x_227114 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227102)[flat_tid_227044];
            }
            // red body
            {
                float defunc_1_op_res_227115 = x_227113 + x_227114;
                
                defunc_2_reduce_res_226821 = defunc_1_op_res_227115;
            }
            // load acc params
            {
                x_227116 = defunc_2_reduce_res_226822;
            }
            // load next params
            {
                x_227117 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227104)[flat_tid_227044];
            }
            // red body
            {
                float defunc_1_op_res_227118 = x_227116 + x_227117;
                
                defunc_2_reduce_res_226822 = defunc_1_op_res_227118;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_227100);
        free(reduce_stage_1_tid_res_arr_mem_227102);
        free(reduce_stage_1_tid_res_arr_mem_227104);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229405_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229405_end -
                 futhark_mc_segred_task_229405_start;
        
        ctx->futhark_mc_segred_task_229405_runs[tid]++;
        ctx->futhark_mc_segred_task_229405_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229405_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229404->retval_defunc_2_reduce_res_226820 =
            defunc_2_reduce_res_226820;
        *futhark_mc_task_229404->retval_defunc_2_reduce_res_226821 =
            defunc_2_reduce_res_226821;
        *futhark_mc_task_229404->retval_defunc_2_reduce_res_226822 =
            defunc_2_reduce_res_226822;
        futhark_mc_task_229404->retval_mem_226818 = mem_226818.mem;
        futhark_mc_task_229404->retval_mem_226819 = mem_226819.mem;
    }
    return err;
}
struct futhark_mc_task_229411 {
    struct futhark_context *ctx;
    int64_t free_x_208076;
    unsigned char *free_mem_213264;
    int64_t free_x_226813;
    unsigned char *free_mem_226818;
    unsigned char *free_mem_226819;
    float free_a11_226860;
    float free_b11_226862;
    float free_c11_226863;
    float *retval_defunc_2_reduce_res_226864;
    float *retval_defunc_2_reduce_res_226865;
};
struct futhark_mc_segred_stage_1_parloop_struct_229415 {
    struct futhark_context *ctx;
    int64_t free_x_208076;
    unsigned char *free_mem_213264;
    int64_t free_x_226813;
    unsigned char *free_mem_226818;
    unsigned char *free_mem_226819;
    float free_a11_226860;
    float free_b11_226862;
    float free_c11_226863;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227121;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227123;
};
static int futhark_mc_segred_stage_1_parloop_229416(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_227075,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229415
    *futhark_mc_segred_stage_1_parloop_struct_229415 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229415 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229415->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229416_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229416_start = get_wall_time();
    
    int64_t x_208076 =
            futhark_mc_segred_stage_1_parloop_struct_229415->free_x_208076;
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229415->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t x_226813 =
            futhark_mc_segred_stage_1_parloop_struct_229415->free_x_226813;
    struct memblock mem_226818 = {.desc ="mem_226818", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229415->free_mem_226818,
                                  .size =0, .references =NULL};
    struct memblock mem_226819 = {.desc ="mem_226819", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229415->free_mem_226819,
                                  .size =0, .references =NULL};
    float a11_226860 =
          futhark_mc_segred_stage_1_parloop_struct_229415->free_a11_226860;
    float b11_226862 =
          futhark_mc_segred_stage_1_parloop_struct_229415->free_b11_226862;
    float c11_226863 =
          futhark_mc_segred_stage_1_parloop_struct_229415->free_c11_226863;
    struct memblock reduce_stage_1_tid_res_arr_mem_227121 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227121",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229415->free_reduce_stage_1_tid_res_arr_mem_227121,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227123 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227123",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229415->free_reduce_stage_1_tid_res_arr_mem_227123,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227125 = start;
    float x_227077;
    float x_227078;
    float x_227080;
    float x_227081;
    float local_acc_227126 = 0.0F;
    float local_acc_227127 = 0.0F;
    
    for (; iter_227125 < end; iter_227125++) {
        int64_t gtid_227076 = iter_227125;
        float x_227083;
        
        x_227083 = ((float *) mem_226819.mem)[gtid_227076];
        
        float x_227084;
        
        x_227084 = ((float *) mem_226818.mem)[gtid_227076];
        
        bool cond_227085 = sle64(x_208076, gtid_227076);
        float defunc_0_f_res_227086;
        
        if (cond_227085) {
            defunc_0_f_res_227086 = 0.0F;
        } else {
            int64_t i_227087 = add64(x_226813, gtid_227076);
            float defunc_0_add_arg_227088;
            
            defunc_0_add_arg_227088 = ((float *) mem_213264.mem)[i_227087];
            defunc_0_f_res_227086 = defunc_0_add_arg_227088;
        }
        
        float x_227089 = a11_226860 * x_227083;
        float y_227090 = b11_226862 * x_227084;
        float x_227091 = x_227089 + y_227090;
        float defunc_9_fit_fun_res_227092 = defunc_0_f_res_227086 * x_227091;
        float x_227093 = b11_226862 * x_227083;
        float y_227094 = c11_226863 * x_227084;
        float x_227095 = x_227093 + y_227094;
        float defunc_9_slope_fun_res_227096 = defunc_0_f_res_227086 * x_227095;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_227077 = local_acc_227126;
        }
        // Load next params
        {
            x_227078 = defunc_9_fit_fun_res_227092;
        }
        // Red body
        {
            float defunc_1_op_res_227079 = x_227077 + x_227078;
            
            local_acc_227126 = defunc_1_op_res_227079;
        }
        // Load accum params
        {
            x_227080 = local_acc_227127;
        }
        // Load next params
        {
            x_227081 = defunc_9_slope_fun_res_227096;
        }
        // Red body
        {
            float defunc_1_op_res_227082 = x_227080 + x_227081;
            
            local_acc_227127 = defunc_1_op_res_227082;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_227121.mem)[flat_tid_227075] =
        local_acc_227126;
    ((float *) reduce_stage_1_tid_res_arr_mem_227123.mem)[flat_tid_227075] =
        local_acc_227127;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229416_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229416_end -
                 futhark_mc_segred_stage_1_parloop_229416_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229416_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229416_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229416_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229412(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227075 = tid;
    int num_tasks_227120 = info.nsubtasks;
    struct futhark_mc_task_229411 *futhark_mc_task_229411 =
                                  (struct futhark_mc_task_229411 *) args;
    struct futhark_context *ctx = futhark_mc_task_229411->ctx;
    uint64_t futhark_mc_segred_task_229412_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229412_start = get_wall_time();
    
    int64_t x_208076 = futhark_mc_task_229411->free_x_208076;
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_task_229411->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t x_226813 = futhark_mc_task_229411->free_x_226813;
    struct memblock mem_226818 = {.desc ="mem_226818", .mem =
                                  futhark_mc_task_229411->free_mem_226818,
                                  .size =0, .references =NULL};
    struct memblock mem_226819 = {.desc ="mem_226819", .mem =
                                  futhark_mc_task_229411->free_mem_226819,
                                  .size =0, .references =NULL};
    float a11_226860 = futhark_mc_task_229411->free_a11_226860;
    float b11_226862 = futhark_mc_task_229411->free_b11_226862;
    float c11_226863 = futhark_mc_task_229411->free_c11_226863;
    float defunc_2_reduce_res_226864 =
          *futhark_mc_task_229411->retval_defunc_2_reduce_res_226864;
    float defunc_2_reduce_res_226865 =
          *futhark_mc_task_229411->retval_defunc_2_reduce_res_226865;
    size_t reduce_stage_1_tid_res_arr_mem_227121_cached_sizze_229413 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227121 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227123_cached_sizze_229414 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227123 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_227121_cached_sizze_229413 <
        (size_t) ((int64_t) 4 * num_tasks_227120)) {
        reduce_stage_1_tid_res_arr_mem_227121 =
            realloc(reduce_stage_1_tid_res_arr_mem_227121, (int64_t) 4 *
                    num_tasks_227120);
        reduce_stage_1_tid_res_arr_mem_227121_cached_sizze_229413 =
            (int64_t) 4 * num_tasks_227120;
    }
    if (reduce_stage_1_tid_res_arr_mem_227123_cached_sizze_229414 <
        (size_t) ((int64_t) 4 * num_tasks_227120)) {
        reduce_stage_1_tid_res_arr_mem_227123 =
            realloc(reduce_stage_1_tid_res_arr_mem_227123, (int64_t) 4 *
                    num_tasks_227120);
        reduce_stage_1_tid_res_arr_mem_227123_cached_sizze_229414 =
            (int64_t) 4 * num_tasks_227120;
    }
    
    int64_t iter_227125;
    struct futhark_mc_segred_stage_1_parloop_struct_229415
    futhark_mc_segred_stage_1_parloop_struct_229415;
    
    futhark_mc_segred_stage_1_parloop_struct_229415.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_x_208076 = x_208076;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_mem_213264 =
        mem_213264.mem;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_x_226813 = x_226813;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_mem_226818 =
        mem_226818.mem;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_mem_226819 =
        mem_226819.mem;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_a11_226860 =
        a11_226860;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_b11_226862 =
        b11_226862;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_c11_226863 =
        c11_226863;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_reduce_stage_1_tid_res_arr_mem_227121 =
        reduce_stage_1_tid_res_arr_mem_227121;
    futhark_mc_segred_stage_1_parloop_struct_229415.free_reduce_stage_1_tid_res_arr_mem_227123 =
        reduce_stage_1_tid_res_arr_mem_227123;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229416_task;
    
    futhark_mc_segred_stage_1_parloop_229416_task.name =
        "futhark_mc_segred_stage_1_parloop_229416";
    futhark_mc_segred_stage_1_parloop_229416_task.fn =
        futhark_mc_segred_stage_1_parloop_229416;
    futhark_mc_segred_stage_1_parloop_229416_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229415;
    futhark_mc_segred_stage_1_parloop_229416_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229416_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229416_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229416_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229416_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229416_task);
    
    if (futhark_mc_segred_stage_1_parloop_229416_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229416_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229416_total_end -
                 futhark_mc_segred_stage_1_parloop_229416_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229416_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229416_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229416_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_226864 = 0.0F;
        defunc_2_reduce_res_226865 = 0.0F;
    }
    
    float x_227128;
    float x_227129;
    float x_227131;
    float x_227132;
    
    for (int32_t i_227134 = 0; i_227134 < num_tasks_227120; i_227134++) {
        flat_tid_227075 = i_227134;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_227128 = defunc_2_reduce_res_226864;
            }
            // load next params
            {
                x_227129 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227121)[flat_tid_227075];
            }
            // red body
            {
                float defunc_1_op_res_227130 = x_227128 + x_227129;
                
                defunc_2_reduce_res_226864 = defunc_1_op_res_227130;
            }
            // load acc params
            {
                x_227131 = defunc_2_reduce_res_226865;
            }
            // load next params
            {
                x_227132 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227123)[flat_tid_227075];
            }
            // red body
            {
                float defunc_1_op_res_227133 = x_227131 + x_227132;
                
                defunc_2_reduce_res_226865 = defunc_1_op_res_227133;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_227121);
        free(reduce_stage_1_tid_res_arr_mem_227123);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229412_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229412_end -
                 futhark_mc_segred_task_229412_start;
        
        ctx->futhark_mc_segred_task_229412_runs[tid]++;
        ctx->futhark_mc_segred_task_229412_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229412_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229411->retval_defunc_2_reduce_res_226864 =
            defunc_2_reduce_res_226864;
        *futhark_mc_task_229411->retval_defunc_2_reduce_res_226865 =
            defunc_2_reduce_res_226865;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229401(void *args, int64_t start,
                                            int64_t end, int flat_tid_226811,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229400
    *futhark_mc_segmap_parloop_struct_229400 =
    (struct futhark_mc_segmap_parloop_struct_229400 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229400->ctx;
    uint64_t futhark_mc_segmap_parloop_229401_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229401_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229400->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229400->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229400->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229400->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229400->free_i_196779;
    int64_t gtid_208071 =
            futhark_mc_segmap_parloop_struct_229400->free_gtid_208071;
    int64_t x_208076 = futhark_mc_segmap_parloop_struct_229400->free_x_208076;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_213261,
                                  .size =0, .references =NULL};
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 =
            futhark_mc_segmap_parloop_struct_229400->free_bytes_213266;
    struct memblock mem_213303 = {.desc ="mem_213303", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_213303,
                                  .size =0, .references =NULL};
    struct memblock mem_213306 = {.desc ="mem_213306", .mem =
                                  futhark_mc_segmap_parloop_struct_229400->free_mem_213306,
                                  .size =0, .references =NULL};
    size_t mem_226818_cached_sizze_229402 = 0;
    unsigned char *mem_226818 = NULL;
    size_t mem_226819_cached_sizze_229403 = 0;
    unsigned char *mem_226819 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227043 = start;
    
    if (mem_226818_cached_sizze_229402 < (size_t) bytes_213266) {
        mem_226818 = realloc(mem_226818, bytes_213266);
        mem_226818_cached_sizze_229402 = bytes_213266;
    }
    if (mem_226819_cached_sizze_229403 < (size_t) bytes_213266) {
        mem_226819 = realloc(mem_226819, bytes_213266);
        mem_226819_cached_sizze_229403 = bytes_213266;
    }
    for (; iter_227043 < end; iter_227043++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227097 = t_n_m_196759;
        int64_t gtid_226812 = iter_227043;
        int64_t remnant_227098 = iter_227043 - gtid_226812;
        int64_t x_226813;
        
        x_226813 = ((int64_t *) mem_210889.mem)[gtid_208071 * t_n_m_196759 +
                                                gtid_226812];
        
        float x_226814;
        
        x_226814 = ((float *) mem_210893.mem)[gtid_208071 * t_n_m_196759 +
                                              gtid_226812];
        
        int64_t min_arg_226815 = mul64(jump_t_196702, gtid_226812);
        int64_t min_res_226816 = smin64(i_196779, min_arg_226815);
        int64_t defunc_0_g_res_226817 = add64((int64_t) 1, min_res_226816);
        float defunc_2_reduce_res_226820;
        float defunc_2_reduce_res_226821;
        float defunc_2_reduce_res_226822;
        int64_t flat_tid_227044 = (int64_t) 0;
        int32_t num_tasks_227099;
        
        defunc_2_reduce_res_226820 = 0.0F;
        defunc_2_reduce_res_226821 = 0.0F;
        defunc_2_reduce_res_226822 = 0.0F;
        
        struct futhark_mc_task_229404 futhark_mc_task_229404;
        
        futhark_mc_task_229404.ctx = ctx;
        futhark_mc_task_229404.free_n_196692 = n_196692;
        futhark_mc_task_229404.free_gtid_208071 = gtid_208071;
        futhark_mc_task_229404.free_x_208076 = x_208076;
        futhark_mc_task_229404.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229404.free_mem_213261 = mem_213261.mem;
        futhark_mc_task_229404.free_x_226813 = x_226813;
        futhark_mc_task_229404.free_x_226814 = x_226814;
        futhark_mc_task_229404.free_defunc_0_g_res_226817 =
            defunc_0_g_res_226817;
        futhark_mc_task_229404.retval_defunc_2_reduce_res_226820 =
            &defunc_2_reduce_res_226820;
        futhark_mc_task_229404.retval_defunc_2_reduce_res_226821 =
            &defunc_2_reduce_res_226821;
        futhark_mc_task_229404.retval_defunc_2_reduce_res_226822 =
            &defunc_2_reduce_res_226822;
        futhark_mc_task_229404.retval_mem_226818 = mem_226818;
        futhark_mc_task_229404.retval_mem_226819 = mem_226819;
        
        struct scheduler_segop futhark_mc_task_229404_task;
        
        futhark_mc_task_229404_task.args = &futhark_mc_task_229404;
        futhark_mc_task_229404_task.top_level_fn =
            futhark_mc_segred_task_229405;
        futhark_mc_task_229404_task.name = "futhark_mc_segred_task_229405";
        futhark_mc_task_229404_task.iterations = q_t_196696;
        futhark_mc_task_229404_task.task_time =
            &ctx->futhark_mc_segred_task_229405_total_time;
        futhark_mc_task_229404_task.task_iter =
            &ctx->futhark_mc_segred_task_229405_total_iter;
        futhark_mc_task_229404_task.sched = STATIC;
        futhark_mc_task_229404_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229405_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229404_task);
        
        if (futhark_mc_segred_task_229405_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_226856 = defunc_2_reduce_res_226820 *
              defunc_2_reduce_res_226822;
        float y_226857 = defunc_2_reduce_res_226821 *
              defunc_2_reduce_res_226821;
        float y_226858 = x_226856 - y_226857;
        float det1_226859 = 1.0F / y_226858;
        float a11_226860 = defunc_2_reduce_res_226822 * det1_226859;
        float x_226861 = 0.0F - defunc_2_reduce_res_226821;
        float b11_226862 = det1_226859 * x_226861;
        float c11_226863 = defunc_2_reduce_res_226820 * det1_226859;
        float defunc_2_reduce_res_226864;
        float defunc_2_reduce_res_226865;
        int64_t flat_tid_227075 = (int64_t) 0;
        int32_t num_tasks_227120;
        
        defunc_2_reduce_res_226864 = 0.0F;
        defunc_2_reduce_res_226865 = 0.0F;
        
        struct futhark_mc_task_229411 futhark_mc_task_229411;
        
        futhark_mc_task_229411.ctx = ctx;
        futhark_mc_task_229411.free_x_208076 = x_208076;
        futhark_mc_task_229411.free_mem_213264 = mem_213264.mem;
        futhark_mc_task_229411.free_x_226813 = x_226813;
        futhark_mc_task_229411.free_mem_226818 = mem_226818;
        futhark_mc_task_229411.free_mem_226819 = mem_226819;
        futhark_mc_task_229411.free_a11_226860 = a11_226860;
        futhark_mc_task_229411.free_b11_226862 = b11_226862;
        futhark_mc_task_229411.free_c11_226863 = c11_226863;
        futhark_mc_task_229411.retval_defunc_2_reduce_res_226864 =
            &defunc_2_reduce_res_226864;
        futhark_mc_task_229411.retval_defunc_2_reduce_res_226865 =
            &defunc_2_reduce_res_226865;
        
        struct scheduler_segop futhark_mc_task_229411_task;
        
        futhark_mc_task_229411_task.args = &futhark_mc_task_229411;
        futhark_mc_task_229411_task.top_level_fn =
            futhark_mc_segred_task_229412;
        futhark_mc_task_229411_task.name = "futhark_mc_segred_task_229412";
        futhark_mc_task_229411_task.iterations = q_t_196696;
        futhark_mc_task_229411_task.task_time =
            &ctx->futhark_mc_segred_task_229412_total_time;
        futhark_mc_task_229411_task.task_iter =
            &ctx->futhark_mc_segred_task_229412_total_iter;
        futhark_mc_task_229411_task.sched = STATIC;
        futhark_mc_task_229411_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229412_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229411_task);
        
        if (futhark_mc_segred_task_229412_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_213303.mem)[gtid_226812] = defunc_2_reduce_res_226864;
        ((float *) mem_213306.mem)[gtid_226812] = defunc_2_reduce_res_226865;
    }
    
  cleanup:
    { }
    free(mem_226818);
    free(mem_226819);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229401_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229401_end -
                 futhark_mc_segmap_parloop_229401_start;
        
        ctx->futhark_mc_segmap_parloop_229401_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229401_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229401_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229399(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_226811 = tid;
    int num_tasks_226982 = info.nsubtasks;
    struct futhark_mc_task_229393 *futhark_mc_task_229393 =
                                  (struct futhark_mc_task_229393 *) args;
    struct futhark_context *ctx = futhark_mc_task_229393->ctx;
    uint64_t futhark_mc_segmap_nested_task_229399_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229399_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229393->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229393->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229393->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229393->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229393->free_i_196779;
    int64_t gtid_208071 = futhark_mc_task_229393->free_gtid_208071;
    int64_t x_208076 = futhark_mc_task_229393->free_x_208076;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229393->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229393->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229393->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213261 = {.desc ="mem_213261", .mem =
                                  futhark_mc_task_229393->free_mem_213261,
                                  .size =0, .references =NULL};
    struct memblock mem_213264 = {.desc ="mem_213264", .mem =
                                  futhark_mc_task_229393->free_mem_213264,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 = futhark_mc_task_229393->free_bytes_213266;
    struct memblock mem_213303 = {.desc ="mem_213303", .mem =
                                  futhark_mc_task_229393->free_mem_213303,
                                  .size =0, .references =NULL};
    struct memblock mem_213306 = {.desc ="mem_213306", .mem =
                                  futhark_mc_task_229393->free_mem_213306,
                                  .size =0, .references =NULL};
    int64_t iter_227043;
    struct futhark_mc_segmap_parloop_struct_229400
    futhark_mc_segmap_parloop_struct_229400;
    
    futhark_mc_segmap_parloop_struct_229400.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229400.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229400.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229400.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229400.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229400.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229400.free_gtid_208071 = gtid_208071;
    futhark_mc_segmap_parloop_struct_229400.free_x_208076 = x_208076;
    futhark_mc_segmap_parloop_struct_229400.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229400.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229400.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229400.free_mem_213261 = mem_213261.mem;
    futhark_mc_segmap_parloop_struct_229400.free_mem_213264 = mem_213264.mem;
    futhark_mc_segmap_parloop_struct_229400.free_bytes_213266 = bytes_213266;
    futhark_mc_segmap_parloop_struct_229400.free_mem_213303 = mem_213303.mem;
    futhark_mc_segmap_parloop_struct_229400.free_mem_213306 = mem_213306.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229401_task;
    
    futhark_mc_segmap_parloop_229401_task.name =
        "futhark_mc_segmap_parloop_229401";
    futhark_mc_segmap_parloop_229401_task.fn = futhark_mc_segmap_parloop_229401;
    futhark_mc_segmap_parloop_229401_task.args =
        &futhark_mc_segmap_parloop_struct_229400;
    futhark_mc_segmap_parloop_229401_task.iterations = iterations;
    futhark_mc_segmap_parloop_229401_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229401_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229401_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229401_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229401_task);
    
    if (futhark_mc_segmap_parloop_229401_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229401_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229401_total_end -
                 futhark_mc_segmap_parloop_229401_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229401_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229401_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229401_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229399_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229399_end -
                 futhark_mc_segmap_nested_task_229399_start;
        
        ctx->futhark_mc_segmap_nested_task_229399_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229399_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229399_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229379(void *args, int64_t start,
                                            int64_t end, int flat_tid_208070,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229378
    *futhark_mc_segmap_parloop_struct_229378 =
    (struct futhark_mc_segmap_parloop_struct_229378 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229378->ctx;
    uint64_t futhark_mc_segmap_parloop_229379_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229379_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229378->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229378->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229378->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229378->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229378->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229378->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229378->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229378->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229378->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229378->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229378->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229378->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229378->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 =
            futhark_mc_segmap_parloop_struct_229378->free_bytes_213266;
    struct memblock mem_213415 = {.desc ="mem_213415", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_213415,
                                  .size =0, .references =NULL};
    struct memblock mem_213419 = {.desc ="mem_213419", .mem =
                                  futhark_mc_segmap_parloop_struct_229378->free_mem_213419,
                                  .size =0, .references =NULL};
    size_t mem_213258_cached_sizze_229380 = 0;
    unsigned char *mem_213258 = NULL;
    size_t mem_213261_cached_sizze_229381 = 0;
    unsigned char *mem_213261 = NULL;
    size_t mem_213264_cached_sizze_229382 = 0;
    unsigned char *mem_213264 = NULL;
    size_t mem_213303_cached_sizze_229383 = 0;
    unsigned char *mem_213303 = NULL;
    size_t mem_213306_cached_sizze_229384 = 0;
    unsigned char *mem_213306 = NULL;
    int64_t iterations = end - start;
    int64_t iter_226791 = start;
    
    if (mem_213258_cached_sizze_229380 < (size_t) bytes_210949) {
        mem_213258 = realloc(mem_213258, bytes_210949);
        mem_213258_cached_sizze_229380 = bytes_210949;
    }
    if (mem_213261_cached_sizze_229381 < (size_t) bytes_210949) {
        mem_213261 = realloc(mem_213261, bytes_210949);
        mem_213261_cached_sizze_229381 = bytes_210949;
    }
    if (mem_213264_cached_sizze_229382 < (size_t) bytes_210949) {
        mem_213264 = realloc(mem_213264, bytes_210949);
        mem_213264_cached_sizze_229382 = bytes_210949;
    }
    if (mem_213303_cached_sizze_229383 < (size_t) bytes_210836) {
        mem_213303 = realloc(mem_213303, bytes_210836);
        mem_213303_cached_sizze_229383 = bytes_210836;
    }
    if (mem_213306_cached_sizze_229384 < (size_t) bytes_210836) {
        mem_213306 = realloc(mem_213306, bytes_210836);
        mem_213306_cached_sizze_229384 = bytes_210836;
    }
    for (; iter_226791 < end; iter_226791++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_226964 = m_196691;
        int64_t gtid_208071 = iter_226791;
        int64_t remnant_226965 = iter_226791 - gtid_208071;
        int64_t x_208076;
        
        x_208076 = ((int64_t *) mem_210397.mem)[gtid_208071];
        
        int64_t flat_tid_226792 = (int64_t) 0;
        int32_t num_tasks_226966;
        struct futhark_mc_task_229385 futhark_mc_task_229385;
        
        futhark_mc_task_229385.ctx = ctx;
        futhark_mc_task_229385.free_n_196692 = n_196692;
        futhark_mc_task_229385.free_gtid_208071 = gtid_208071;
        futhark_mc_task_229385.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229385.free_mem_212862 = mem_212862.mem;
        futhark_mc_task_229385.free_mem_213258 = mem_213258;
        
        struct scheduler_segop futhark_mc_task_229385_task;
        
        futhark_mc_task_229385_task.args = &futhark_mc_task_229385;
        futhark_mc_task_229385_task.top_level_fn =
            futhark_mc_segmap_task_229386;
        futhark_mc_task_229385_task.name = "futhark_mc_segmap_task_229386";
        futhark_mc_task_229385_task.iterations = n_196692;
        futhark_mc_task_229385_task.task_time =
            &ctx->futhark_mc_segmap_task_229386_total_time;
        futhark_mc_task_229385_task.task_iter =
            &ctx->futhark_mc_segmap_task_229386_total_iter;
        futhark_mc_task_229385_task.sched = STATIC;
        futhark_mc_task_229385_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229386_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229385_task);
        
        if (futhark_mc_segmap_task_229386_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_226797 = (int64_t) 0;
        int32_t num_tasks_226970;
        struct futhark_mc_task_229389 futhark_mc_task_229389;
        
        futhark_mc_task_229389.ctx = ctx;
        futhark_mc_task_229389.free_n_196692 = n_196692;
        futhark_mc_task_229389.free_gtid_208071 = gtid_208071;
        futhark_mc_task_229389.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229389.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229389.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229389.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229389.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229389.free_mem_213258 = mem_213258;
        futhark_mc_task_229389.free_mem_213261 = mem_213261;
        futhark_mc_task_229389.free_mem_213264 = mem_213264;
        
        struct scheduler_segop futhark_mc_task_229389_task;
        
        futhark_mc_task_229389_task.args = &futhark_mc_task_229389;
        futhark_mc_task_229389_task.top_level_fn =
            futhark_mc_segmap_task_229390;
        futhark_mc_task_229389_task.name = "futhark_mc_segmap_task_229390";
        futhark_mc_task_229389_task.iterations = n_196692;
        futhark_mc_task_229389_task.task_time =
            &ctx->futhark_mc_segmap_task_229390_total_time;
        futhark_mc_task_229389_task.task_iter =
            &ctx->futhark_mc_segmap_task_229390_total_iter;
        futhark_mc_task_229389_task.sched = STATIC;
        futhark_mc_task_229389_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229390_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229389_task);
        
        if (futhark_mc_segmap_task_229390_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_226888 = (int64_t) 0;
        int32_t num_tasks_226982;
        int64_t flat_tid_226811 = (int64_t) 0;
        struct futhark_mc_task_229393 futhark_mc_task_229393;
        
        futhark_mc_task_229393.ctx = ctx;
        futhark_mc_task_229393.free_n_196692 = n_196692;
        futhark_mc_task_229393.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229393.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229393.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229393.free_i_196779 = i_196779;
        futhark_mc_task_229393.free_gtid_208071 = gtid_208071;
        futhark_mc_task_229393.free_x_208076 = x_208076;
        futhark_mc_task_229393.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229393.free_mem_210889 = mem_210889.mem;
        futhark_mc_task_229393.free_mem_210893 = mem_210893.mem;
        futhark_mc_task_229393.free_mem_213261 = mem_213261;
        futhark_mc_task_229393.free_mem_213264 = mem_213264;
        futhark_mc_task_229393.free_bytes_213266 = bytes_213266;
        futhark_mc_task_229393.free_mem_213303 = mem_213303;
        futhark_mc_task_229393.free_mem_213306 = mem_213306;
        
        struct scheduler_segop futhark_mc_task_229393_task;
        
        futhark_mc_task_229393_task.args = &futhark_mc_task_229393;
        futhark_mc_task_229393_task.top_level_fn =
            futhark_mc_segmap_task_229394;
        futhark_mc_task_229393_task.name = "futhark_mc_segmap_task_229394";
        futhark_mc_task_229393_task.iterations = t_n_m_196759;
        futhark_mc_task_229393_task.task_time =
            &ctx->futhark_mc_segmap_task_229394_total_time;
        futhark_mc_task_229393_task.task_iter =
            &ctx->futhark_mc_segmap_task_229394_total_iter;
        futhark_mc_task_229393_task.sched = STATIC;
        futhark_mc_task_229393_task.nested_fn =
            futhark_mc_segmap_nested_task_229399;
        
        int futhark_mc_segmap_task_229394_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229393_task);
        
        if (futhark_mc_segmap_task_229394_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213415.mem + gtid_208071 * t_n_m_196759 * (int64_t) 4,
                    mem_213303 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213419.mem + gtid_208071 * t_n_m_196759 * (int64_t) 4,
                    mem_213306 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213258);
    free(mem_213261);
    free(mem_213264);
    free(mem_213303);
    free(mem_213306);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229379_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229379_end -
                 futhark_mc_segmap_parloop_229379_start;
        
        ctx->futhark_mc_segmap_parloop_229379_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229379_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229379_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229377(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208070 = tid;
    int num_tasks_226675 = info.nsubtasks;
    struct futhark_mc_task_229366 *futhark_mc_task_229366 =
                                  (struct futhark_mc_task_229366 *) args;
    struct futhark_context *ctx = futhark_mc_task_229366->ctx;
    uint64_t futhark_mc_segmap_nested_task_229377_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229377_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229366->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229366->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229366->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229366->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229366->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229366->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229366->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229366->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229366->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229366->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229366->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229366->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229366->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229366->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229366->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229366->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229366->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229366->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213266 = futhark_mc_task_229366->free_bytes_213266;
    struct memblock mem_213415 = {.desc ="mem_213415", .mem =
                                  futhark_mc_task_229366->free_mem_213415,
                                  .size =0, .references =NULL};
    struct memblock mem_213419 = {.desc ="mem_213419", .mem =
                                  futhark_mc_task_229366->free_mem_213419,
                                  .size =0, .references =NULL};
    int64_t iter_226791;
    struct futhark_mc_segmap_parloop_struct_229378
    futhark_mc_segmap_parloop_struct_229378;
    
    futhark_mc_segmap_parloop_struct_229378.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229378.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229378.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229378.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229378.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229378.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229378.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229378.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229378.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229378.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229378.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229378.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229378.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229378.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229378.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229378.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229378.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229378.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229378.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229378.free_bytes_213266 = bytes_213266;
    futhark_mc_segmap_parloop_struct_229378.free_mem_213415 = mem_213415.mem;
    futhark_mc_segmap_parloop_struct_229378.free_mem_213419 = mem_213419.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229379_task;
    
    futhark_mc_segmap_parloop_229379_task.name =
        "futhark_mc_segmap_parloop_229379";
    futhark_mc_segmap_parloop_229379_task.fn = futhark_mc_segmap_parloop_229379;
    futhark_mc_segmap_parloop_229379_task.args =
        &futhark_mc_segmap_parloop_struct_229378;
    futhark_mc_segmap_parloop_229379_task.iterations = iterations;
    futhark_mc_segmap_parloop_229379_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229379_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229379_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229379_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229379_task);
    
    if (futhark_mc_segmap_parloop_229379_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229379_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229379_total_end -
                 futhark_mc_segmap_parloop_229379_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229379_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229379_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229379_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229377_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229377_end -
                 futhark_mc_segmap_nested_task_229377_start;
        
        ctx->futhark_mc_segmap_nested_task_229377_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229377_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229377_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229417 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213430;
    unsigned char *free_mem_213645;
    unsigned char *free_mem_213649;
};
struct futhark_mc_segmap_parloop_struct_229419 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213430;
    unsigned char *free_mem_213645;
    unsigned char *free_mem_213649;
};
static int futhark_mc_segmap_parloop_229420(void *args, int64_t start,
                                            int64_t end, int flat_tid_208255,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229419
    *futhark_mc_segmap_parloop_struct_229419 =
    (struct futhark_mc_segmap_parloop_struct_229419 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229419->ctx;
    uint64_t futhark_mc_segmap_parloop_229420_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229420_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229419->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229419->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229419->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229419->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229419->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229419->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229419->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229419->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229419->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229419->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229419->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229419->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229419->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 =
            futhark_mc_segmap_parloop_struct_229419->free_bytes_213430;
    struct memblock mem_213645 = {.desc ="mem_213645", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_213645,
                                  .size =0, .references =NULL};
    struct memblock mem_213649 = {.desc ="mem_213649", .mem =
                                  futhark_mc_segmap_parloop_struct_229419->free_mem_213649,
                                  .size =0, .references =NULL};
    size_t mem_213509_cached_sizze_229421 = 0;
    unsigned char *mem_213509 = NULL;
    size_t mem_213524_cached_sizze_229422 = 0;
    unsigned char *mem_213524 = NULL;
    size_t mem_213527_cached_sizze_229423 = 0;
    unsigned char *mem_213527 = NULL;
    size_t mem_213554_cached_sizze_229424 = 0;
    unsigned char *mem_213554 = NULL;
    size_t mem_213557_cached_sizze_229425 = 0;
    unsigned char *mem_213557 = NULL;
    size_t mem_213574_cached_sizze_229426 = 0;
    unsigned char *mem_213574 = NULL;
    size_t mem_213577_cached_sizze_229427 = 0;
    unsigned char *mem_213577 = NULL;
    size_t mem_213604_cached_sizze_229428 = 0;
    unsigned char *mem_213604 = NULL;
    size_t mem_213607_cached_sizze_229429 = 0;
    unsigned char *mem_213607 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227136 = start;
    
    if (mem_213509_cached_sizze_229421 < (size_t) bytes_210949) {
        mem_213509 = realloc(mem_213509, bytes_210949);
        mem_213509_cached_sizze_229421 = bytes_210949;
    }
    if (mem_213524_cached_sizze_229422 < (size_t) bytes_210949) {
        mem_213524 = realloc(mem_213524, bytes_210949);
        mem_213524_cached_sizze_229422 = bytes_210949;
    }
    if (mem_213527_cached_sizze_229423 < (size_t) bytes_210949) {
        mem_213527 = realloc(mem_213527, bytes_210949);
        mem_213527_cached_sizze_229423 = bytes_210949;
    }
    if (mem_213554_cached_sizze_229424 < (size_t) bytes_210836) {
        mem_213554 = realloc(mem_213554, bytes_210836);
        mem_213554_cached_sizze_229424 = bytes_210836;
    }
    if (mem_213557_cached_sizze_229425 < (size_t) bytes_210836) {
        mem_213557 = realloc(mem_213557, bytes_210836);
        mem_213557_cached_sizze_229425 = bytes_210836;
    }
    if (mem_213574_cached_sizze_229426 < (size_t) bytes_213430) {
        mem_213574 = realloc(mem_213574, bytes_213430);
        mem_213574_cached_sizze_229426 = bytes_213430;
    }
    if (mem_213577_cached_sizze_229427 < (size_t) bytes_213430) {
        mem_213577 = realloc(mem_213577, bytes_213430);
        mem_213577_cached_sizze_229427 = bytes_213430;
    }
    if (mem_213604_cached_sizze_229428 < (size_t) bytes_213430) {
        mem_213604 = realloc(mem_213604, bytes_213430);
        mem_213604_cached_sizze_229428 = bytes_213430;
    }
    if (mem_213607_cached_sizze_229429 < (size_t) bytes_213430) {
        mem_213607 = realloc(mem_213607, bytes_213430);
        mem_213607_cached_sizze_229429 = bytes_213430;
    }
    for (; iter_227136 < end; iter_227136++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227278 = m_196691;
        int64_t gtid_208256 = iter_227136;
        int64_t remnant_227279 = iter_227136 - gtid_208256;
        int64_t x_199546;
        
        x_199546 = ((int64_t *) mem_210397.mem)[gtid_208256];
        for (int64_t i_227137 = 0; i_227137 < n_196692; i_227137++) {
            float x_227139;
            
            x_227139 = ((float *) Y_mem_210354.mem)[gtid_208256 * n_196692 +
                                                    i_227137];
            
            float x_227140;
            
            x_227140 = ((float *) mem_212862.mem)[gtid_208256 * n_196692 +
                                                  i_227137];
            
            float defunc_1_f_res_227141 = x_227139 - x_227140;
            
            ((float *) mem_213509)[i_227137] = defunc_1_f_res_227141;
        }
        for (int64_t i_227143 = 0; i_227143 < n_196692; i_227143++) {
            int64_t x_227146;
            
            x_227146 = ((int64_t *) mem_210394.mem)[gtid_208256 * n_196692 +
                                                    i_227143];
            
            bool cond_227147 = sle64((int64_t) 0, x_227146);
            float defunc_0_f_res_227148;
            
            if (cond_227147) {
                bool y_227149 = slt64(x_227146, n_196692);
                bool bounds_check_227150 = cond_227147 && y_227149;
                bool index_certs_227151;
                
                if (!bounds_check_227150) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_227146,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_227152;
                
                defunc_0_f_res_t_res_227152 = ((float *) mem_213509)[x_227146];
                defunc_0_f_res_227148 = defunc_0_f_res_t_res_227152;
            } else {
                defunc_0_f_res_227148 = 0.0F;
            }
            
            float defunc_0_f_res_227153;
            
            if (cond_227147) {
                bool y_227154 = slt64(x_227146, n_196692);
                bool bounds_check_227155 = cond_227147 && y_227154;
                bool index_certs_227156;
                
                if (!bounds_check_227155) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_227146,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_227157;
                
                defunc_0_f_res_t_res_227157 =
                    ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                     (gtid_208256 *
                                                      ctx_param_ext_210921 +
                                                      x_227146 *
                                                      ctx_param_ext_210923)];
                defunc_0_f_res_227153 = defunc_0_f_res_t_res_227157;
            } else {
                defunc_0_f_res_227153 = 0.0F;
            }
            ((float *) mem_213524)[i_227143] = defunc_0_f_res_227153;
            ((float *) mem_213527)[i_227143] = defunc_0_f_res_227148;
        }
        for (int64_t i_227160 = 0; i_227160 < t_n_m_196759; i_227160++) {
            int64_t x_227163;
            
            x_227163 = ((int64_t *) mem_210889.mem)[gtid_208256 * t_n_m_196759 +
                                                    i_227160];
            
            float x_227164;
            
            x_227164 = ((float *) mem_210893.mem)[gtid_208256 * t_n_m_196759 +
                                                  i_227160];
            
            int64_t min_arg_227165 = mul64(jump_t_196702, i_227160);
            int64_t min_res_227166 = smin64(i_196779, min_arg_227165);
            int64_t defunc_0_g_res_227167 = add64((int64_t) 1, min_res_227166);
            
            for (int64_t i_227172 = 0; i_227172 < q_t_196696; i_227172++) {
                bool cond_227175 = sle64(x_199546, i_227172);
                int64_t defunc_0_f_res_227176;
                
                if (cond_227175) {
                    defunc_0_f_res_227176 = (int64_t) 0;
                } else {
                    int64_t i_227177 = add64(x_227163, i_227172);
                    int64_t defunc_0_add_arg_227178;
                    
                    defunc_0_add_arg_227178 =
                        ((int64_t *) mem_210394.mem)[gtid_208256 * n_196692 +
                                                     i_227177];
                    
                    int64_t defunc_1_add_res_227179 = add64((int64_t) 1,
                                                            defunc_0_add_arg_227178);
                    
                    defunc_0_f_res_227176 = defunc_1_add_res_227179;
                }
                
                float defunc_0_f_res_227180;
                
                if (cond_227175) {
                    defunc_0_f_res_227180 = 0.0F;
                } else {
                    int64_t i_227181 = add64(x_227163, i_227172);
                    float defunc_0_add_arg_227182;
                    
                    defunc_0_add_arg_227182 = ((float *) mem_213524)[i_227181];
                    defunc_0_f_res_227180 = defunc_0_add_arg_227182;
                }
                
                int64_t binop_p_227183 = sub64(defunc_0_f_res_227176,
                                               defunc_0_g_res_227167);
                float defunc_0_f_res_227184 = sitofp_i64_f32(binop_p_227183);
                float abs_res_227185 = (float) fabs(defunc_0_f_res_227184);
                float tmp1_227186 = abs_res_227185 / x_227164;
                float x_227187 = tmp1_227186 * tmp1_227186;
                float y_227188 = tmp1_227186 * x_227187;
                float tmp2_227189 = 1.0F - y_227188;
                float x_227190 = tmp2_227189 * tmp2_227189;
                float tmp3_227191 = tmp2_227189 * x_227190;
                float tmp4_227192 = defunc_0_f_res_227180 * tmp3_227191;
                
                ((float *) mem_213574)[i_227172] = defunc_0_f_res_227184;
                ((float *) mem_213577)[i_227172] = tmp4_227192;
            }
            
            float defunc_2_reduce_res_227197;
            float defunc_2_reduce_res_227198;
            float defunc_2_reduce_res_227199;
            float defunc_2_reduce_res_227200;
            float defunc_2_reduce_res_227201;
            float redout_227205;
            float redout_227206;
            float redout_227207;
            float redout_227208;
            float redout_227209;
            
            redout_227205 = 0.0F;
            redout_227206 = 0.0F;
            redout_227207 = 0.0F;
            redout_227208 = 0.0F;
            redout_227209 = 0.0F;
            for (int64_t i_227204 = 0; i_227204 < q_t_196696; i_227204++) {
                float x_227212;
                
                x_227212 = ((float *) mem_213574)[i_227204];
                
                float x_227213;
                
                x_227213 = ((float *) mem_213577)[i_227204];
                
                float defunc_1_f_res_227214 = x_227212 * x_227213;
                float defunc_1_f_res_227215 = x_227212 * defunc_1_f_res_227214;
                float defunc_1_f_res_227216 = x_227212 * defunc_1_f_res_227215;
                float defunc_1_f_res_227217 = x_227212 * defunc_1_f_res_227216;
                float defunc_1_op_res_227218 = x_227213 + redout_227205;
                float defunc_1_op_res_227219 = defunc_1_f_res_227214 +
                      redout_227206;
                float defunc_1_op_res_227220 = defunc_1_f_res_227215 +
                      redout_227207;
                float defunc_1_op_res_227221 = defunc_1_f_res_227216 +
                      redout_227208;
                float defunc_1_op_res_227222 = defunc_1_f_res_227217 +
                      redout_227209;
                
                ((float *) mem_213604)[i_227204] = defunc_1_f_res_227215;
                ((float *) mem_213607)[i_227204] = defunc_1_f_res_227214;
                
                float redout_tmp_227287 = defunc_1_op_res_227218;
                float redout_tmp_227288 = defunc_1_op_res_227219;
                float redout_tmp_227289 = defunc_1_op_res_227220;
                float redout_tmp_227290 = defunc_1_op_res_227221;
                float redout_tmp_227291 = defunc_1_op_res_227222;
                
                redout_227205 = redout_tmp_227287;
                redout_227206 = redout_tmp_227288;
                redout_227207 = redout_tmp_227289;
                redout_227208 = redout_tmp_227290;
                redout_227209 = redout_tmp_227291;
            }
            defunc_2_reduce_res_227197 = redout_227205;
            defunc_2_reduce_res_227198 = redout_227206;
            defunc_2_reduce_res_227199 = redout_227207;
            defunc_2_reduce_res_227200 = redout_227208;
            defunc_2_reduce_res_227201 = redout_227209;
            
            float x_227225 = defunc_2_reduce_res_227199 *
                  defunc_2_reduce_res_227201;
            float y_227226 = defunc_2_reduce_res_227200 *
                  defunc_2_reduce_res_227200;
            float a12_227227 = x_227225 - y_227226;
            float x_227228 = defunc_2_reduce_res_227199 *
                  defunc_2_reduce_res_227200;
            float y_227229 = defunc_2_reduce_res_227198 *
                  defunc_2_reduce_res_227201;
            float b12_227230 = x_227228 - y_227229;
            float x_227231 = defunc_2_reduce_res_227198 *
                  defunc_2_reduce_res_227200;
            float y_227232 = defunc_2_reduce_res_227199 *
                  defunc_2_reduce_res_227199;
            float c12_227233 = x_227231 - y_227232;
            float x_227234 = defunc_2_reduce_res_227197 *
                  defunc_2_reduce_res_227201;
            float b2_227235 = x_227234 - y_227232;
            float x_227236 = defunc_2_reduce_res_227198 *
                  defunc_2_reduce_res_227199;
            float y_227237 = defunc_2_reduce_res_227197 *
                  defunc_2_reduce_res_227200;
            float c2_227238 = x_227236 - y_227237;
            float x_227239 = defunc_2_reduce_res_227197 * a12_227227;
            float y_227240 = defunc_2_reduce_res_227198 * b12_227230;
            float x_227241 = x_227239 + y_227240;
            float y_227242 = defunc_2_reduce_res_227199 * c12_227233;
            float y_227243 = x_227241 + y_227242;
            float det_227244 = 1.0F / y_227243;
            float a12_227245 = a12_227227 * det_227244;
            float b12_227246 = b12_227230 * det_227244;
            float c12_227247 = c12_227233 * det_227244;
            float b2_227248 = b2_227235 * det_227244;
            float c2_227249 = c2_227238 * det_227244;
            float defunc_2_reduce_res_227250;
            float defunc_2_reduce_res_227251;
            float redout_227253;
            float redout_227254;
            
            redout_227253 = 0.0F;
            redout_227254 = 0.0F;
            for (int64_t i_227252 = 0; i_227252 < q_t_196696; i_227252++) {
                float x_227255;
                
                x_227255 = ((float *) mem_213577)[i_227252];
                
                float x_227256;
                
                x_227256 = ((float *) mem_213607)[i_227252];
                
                float x_227257;
                
                x_227257 = ((float *) mem_213604)[i_227252];
                
                bool cond_227258 = sle64(x_199546, i_227252);
                float defunc_0_f_res_227259;
                
                if (cond_227258) {
                    defunc_0_f_res_227259 = 0.0F;
                } else {
                    int64_t i_227260 = add64(x_227163, i_227252);
                    float defunc_0_add_arg_227261;
                    
                    defunc_0_add_arg_227261 = ((float *) mem_213527)[i_227260];
                    defunc_0_f_res_227259 = defunc_0_add_arg_227261;
                }
                
                float x_227262 = a12_227245 * x_227255;
                float y_227263 = b12_227246 * x_227256;
                float x_227264 = x_227262 + y_227263;
                float y_227265 = c12_227247 * x_227257;
                float x_227266 = x_227264 + y_227265;
                float defunc_9_fit_fun_res_227267 = defunc_0_f_res_227259 *
                      x_227266;
                float x_227268 = b12_227246 * x_227255;
                float y_227269 = b2_227248 * x_227256;
                float x_227270 = x_227268 + y_227269;
                float y_227271 = c2_227249 * x_227257;
                float x_227272 = x_227270 + y_227271;
                float defunc_9_slope_fun_res_227273 = defunc_0_f_res_227259 *
                      x_227272;
                float defunc_1_op_res_227274 = defunc_9_fit_fun_res_227267 +
                      redout_227253;
                float defunc_1_op_res_227275 = defunc_9_slope_fun_res_227273 +
                      redout_227254;
                float redout_tmp_227294 = defunc_1_op_res_227274;
                float redout_tmp_227295 = defunc_1_op_res_227275;
                
                redout_227253 = redout_tmp_227294;
                redout_227254 = redout_tmp_227295;
            }
            defunc_2_reduce_res_227250 = redout_227253;
            defunc_2_reduce_res_227251 = redout_227254;
            ((float *) mem_213554)[i_227160] = defunc_2_reduce_res_227250;
            ((float *) mem_213557)[i_227160] = defunc_2_reduce_res_227251;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213645.mem + gtid_208256 * t_n_m_196759 * (int64_t) 4,
                    mem_213554 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213649.mem + gtid_208256 * t_n_m_196759 * (int64_t) 4,
                    mem_213557 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213509);
    free(mem_213524);
    free(mem_213527);
    free(mem_213554);
    free(mem_213557);
    free(mem_213574);
    free(mem_213577);
    free(mem_213604);
    free(mem_213607);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229420_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229420_end -
                 futhark_mc_segmap_parloop_229420_start;
        
        ctx->futhark_mc_segmap_parloop_229420_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229420_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229420_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229418(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208255 = tid;
    int num_tasks_227135 = info.nsubtasks;
    struct futhark_mc_task_229417 *futhark_mc_task_229417 =
                                  (struct futhark_mc_task_229417 *) args;
    struct futhark_context *ctx = futhark_mc_task_229417->ctx;
    uint64_t futhark_mc_segmap_task_229418_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229418_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229417->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229417->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229417->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229417->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229417->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229417->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229417->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229417->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229417->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229417->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229417->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229417->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229417->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229417->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229417->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229417->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229417->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229417->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 = futhark_mc_task_229417->free_bytes_213430;
    struct memblock mem_213645 = {.desc ="mem_213645", .mem =
                                  futhark_mc_task_229417->free_mem_213645,
                                  .size =0, .references =NULL};
    struct memblock mem_213649 = {.desc ="mem_213649", .mem =
                                  futhark_mc_task_229417->free_mem_213649,
                                  .size =0, .references =NULL};
    int64_t iter_227136;
    struct futhark_mc_segmap_parloop_struct_229419
    futhark_mc_segmap_parloop_struct_229419;
    
    futhark_mc_segmap_parloop_struct_229419.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229419.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229419.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229419.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229419.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229419.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229419.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229419.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229419.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229419.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229419.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229419.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229419.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229419.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229419.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229419.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229419.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229419.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229419.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229419.free_bytes_213430 = bytes_213430;
    futhark_mc_segmap_parloop_struct_229419.free_mem_213645 = mem_213645.mem;
    futhark_mc_segmap_parloop_struct_229419.free_mem_213649 = mem_213649.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229420_task;
    
    futhark_mc_segmap_parloop_229420_task.name =
        "futhark_mc_segmap_parloop_229420";
    futhark_mc_segmap_parloop_229420_task.fn = futhark_mc_segmap_parloop_229420;
    futhark_mc_segmap_parloop_229420_task.args =
        &futhark_mc_segmap_parloop_struct_229419;
    futhark_mc_segmap_parloop_229420_task.iterations = iterations;
    futhark_mc_segmap_parloop_229420_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229420_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229420_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229420_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229420_task);
    
    if (futhark_mc_segmap_parloop_229420_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229420_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229420_total_end -
                 futhark_mc_segmap_parloop_229420_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229420_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229420_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229420_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229418_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229418_end -
                 futhark_mc_segmap_task_229418_start;
        
        ctx->futhark_mc_segmap_task_229418_runs[tid]++;
        ctx->futhark_mc_segmap_task_229418_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229418_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229431 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210397;
    int64_t free_bytes_210836;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    int64_t free_bytes_210949;
    unsigned char *free_mem_212862;
    int64_t free_bytes_213430;
    unsigned char *free_mem_213645;
    unsigned char *free_mem_213649;
};
struct futhark_mc_task_229438 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208390;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213422;
};
struct futhark_mc_segmap_parloop_struct_229440 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208390;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_212862;
    unsigned char *free_mem_213422;
};
static int futhark_mc_segmap_parloop_229441(void *args, int64_t start,
                                            int64_t end, int flat_tid_227297,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229440
    *futhark_mc_segmap_parloop_struct_229440 =
    (struct futhark_mc_segmap_parloop_struct_229440 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229440->ctx;
    uint64_t futhark_mc_segmap_parloop_229441_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229441_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229440->free_n_196692;
    int64_t gtid_208390 =
            futhark_mc_segmap_parloop_struct_229440->free_gtid_208390;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229440->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229440->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213422 = {.desc ="mem_213422", .mem =
                                  futhark_mc_segmap_parloop_struct_229440->free_mem_213422,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227555 = start;
    
    for (; iter_227555 < end; iter_227555++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227556 = n_196692;
        int64_t gtid_227298 = iter_227555;
        int64_t remnant_227557 = iter_227555 - gtid_227298;
        float x_227299;
        
        x_227299 = ((float *) Y_mem_210354.mem)[gtid_208390 * n_196692 +
                                                gtid_227298];
        
        float x_227300;
        
        x_227300 = ((float *) mem_212862.mem)[gtid_208390 * n_196692 +
                                              gtid_227298];
        
        float defunc_1_f_res_227301 = x_227299 - x_227300;
        
        ((float *) mem_213422.mem)[gtid_227298] = defunc_1_f_res_227301;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229441_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229441_end -
                 futhark_mc_segmap_parloop_229441_start;
        
        ctx->futhark_mc_segmap_parloop_229441_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229441_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229441_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229439(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227297 = tid;
    int num_tasks_227554 = info.nsubtasks;
    struct futhark_mc_task_229438 *futhark_mc_task_229438 =
                                  (struct futhark_mc_task_229438 *) args;
    struct futhark_context *ctx = futhark_mc_task_229438->ctx;
    uint64_t futhark_mc_segmap_task_229439_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229439_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229438->free_n_196692;
    int64_t gtid_208390 = futhark_mc_task_229438->free_gtid_208390;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229438->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229438->free_mem_212862,
                                  .size =0, .references =NULL};
    struct memblock mem_213422 = {.desc ="mem_213422", .mem =
                                  futhark_mc_task_229438->free_mem_213422,
                                  .size =0, .references =NULL};
    int64_t iter_227555;
    struct futhark_mc_segmap_parloop_struct_229440
    futhark_mc_segmap_parloop_struct_229440;
    
    futhark_mc_segmap_parloop_struct_229440.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229440.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229440.free_gtid_208390 = gtid_208390;
    futhark_mc_segmap_parloop_struct_229440.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229440.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229440.free_mem_213422 = mem_213422.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229441_task;
    
    futhark_mc_segmap_parloop_229441_task.name =
        "futhark_mc_segmap_parloop_229441";
    futhark_mc_segmap_parloop_229441_task.fn = futhark_mc_segmap_parloop_229441;
    futhark_mc_segmap_parloop_229441_task.args =
        &futhark_mc_segmap_parloop_struct_229440;
    futhark_mc_segmap_parloop_229441_task.iterations = iterations;
    futhark_mc_segmap_parloop_229441_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229441_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229441_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229441_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229441_task);
    
    if (futhark_mc_segmap_parloop_229441_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229441_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229441_total_end -
                 futhark_mc_segmap_parloop_229441_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229441_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229441_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229441_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229439_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229439_end -
                 futhark_mc_segmap_task_229439_start;
        
        ctx->futhark_mc_segmap_task_229439_runs[tid]++;
        ctx->futhark_mc_segmap_task_229439_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229439_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229442 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208390;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213422;
    unsigned char *free_mem_213425;
    unsigned char *free_mem_213428;
};
struct futhark_mc_segmap_parloop_struct_229444 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208390;
    unsigned char *free_mem_210394;
    int64_t free_ctx_param_ext_210920;
    int64_t free_ctx_param_ext_210921;
    int64_t free_ctx_param_ext_210923;
    unsigned char *free_mem_param_210925;
    unsigned char *free_mem_213422;
    unsigned char *free_mem_213425;
    unsigned char *free_mem_213428;
};
static int futhark_mc_segmap_parloop_229445(void *args, int64_t start,
                                            int64_t end, int flat_tid_227302,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229444
    *futhark_mc_segmap_parloop_struct_229444 =
    (struct futhark_mc_segmap_parloop_struct_229444 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229444->ctx;
    uint64_t futhark_mc_segmap_parloop_229445_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229445_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229444->free_n_196692;
    int64_t gtid_208390 =
            futhark_mc_segmap_parloop_struct_229444->free_gtid_208390;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229444->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229444->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229444->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229444->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229444->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213422 = {.desc ="mem_213422", .mem =
                                  futhark_mc_segmap_parloop_struct_229444->free_mem_213422,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_segmap_parloop_struct_229444->free_mem_213425,
                                  .size =0, .references =NULL};
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_segmap_parloop_struct_229444->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227559 = start;
    
    for (; iter_227559 < end; iter_227559++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227568 = n_196692;
        int64_t gtid_227303 = iter_227559;
        int64_t remnant_227569 = iter_227559 - gtid_227303;
        int64_t x_227304;
        
        x_227304 = ((int64_t *) mem_210394.mem)[gtid_208390 * n_196692 +
                                                gtid_227303];
        
        bool cond_227305 = sle64((int64_t) 0, x_227304);
        float defunc_0_f_res_227306;
        
        if (cond_227305) {
            bool y_227560 = slt64(x_227304, n_196692);
            bool bounds_check_227561 = cond_227305 && y_227560;
            bool index_certs_227562;
            
            if (!bounds_check_227561) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_227304,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_227563;
            
            defunc_0_f_res_t_res_227563 = ((float *) mem_213422.mem)[x_227304];
            defunc_0_f_res_227306 = defunc_0_f_res_t_res_227563;
        } else {
            defunc_0_f_res_227306 = 0.0F;
        }
        
        float defunc_0_f_res_227311;
        
        if (cond_227305) {
            bool y_227564 = slt64(x_227304, n_196692);
            bool bounds_check_227565 = cond_227305 && y_227564;
            bool index_certs_227566;
            
            if (!bounds_check_227565) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_227304,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:401:3-415:29\n   #8  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_227567;
            
            defunc_0_f_res_t_res_227567 =
                ((float *) mem_param_210925.mem)[ctx_param_ext_210920 +
                                                 (gtid_208390 *
                                                  ctx_param_ext_210921 +
                                                  x_227304 *
                                                  ctx_param_ext_210923)];
            defunc_0_f_res_227311 = defunc_0_f_res_t_res_227567;
        } else {
            defunc_0_f_res_227311 = 0.0F;
        }
        ((float *) mem_213425.mem)[gtid_227303] = defunc_0_f_res_227311;
        ((float *) mem_213428.mem)[gtid_227303] = defunc_0_f_res_227306;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229445_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229445_end -
                 futhark_mc_segmap_parloop_229445_start;
        
        ctx->futhark_mc_segmap_parloop_229445_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229445_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229445_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229443(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227302 = tid;
    int num_tasks_227558 = info.nsubtasks;
    struct futhark_mc_task_229442 *futhark_mc_task_229442 =
                                  (struct futhark_mc_task_229442 *) args;
    struct futhark_context *ctx = futhark_mc_task_229442->ctx;
    uint64_t futhark_mc_segmap_task_229443_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229443_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229442->free_n_196692;
    int64_t gtid_208390 = futhark_mc_task_229442->free_gtid_208390;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229442->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229442->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229442->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229442->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229442->free_mem_param_210925,
                                        .size =0, .references =NULL};
    struct memblock mem_213422 = {.desc ="mem_213422", .mem =
                                  futhark_mc_task_229442->free_mem_213422,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_task_229442->free_mem_213425,
                                  .size =0, .references =NULL};
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_task_229442->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t iter_227559;
    struct futhark_mc_segmap_parloop_struct_229444
    futhark_mc_segmap_parloop_struct_229444;
    
    futhark_mc_segmap_parloop_struct_229444.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229444.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229444.free_gtid_208390 = gtid_208390;
    futhark_mc_segmap_parloop_struct_229444.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229444.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229444.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229444.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229444.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229444.free_mem_213422 = mem_213422.mem;
    futhark_mc_segmap_parloop_struct_229444.free_mem_213425 = mem_213425.mem;
    futhark_mc_segmap_parloop_struct_229444.free_mem_213428 = mem_213428.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229445_task;
    
    futhark_mc_segmap_parloop_229445_task.name =
        "futhark_mc_segmap_parloop_229445";
    futhark_mc_segmap_parloop_229445_task.fn = futhark_mc_segmap_parloop_229445;
    futhark_mc_segmap_parloop_229445_task.args =
        &futhark_mc_segmap_parloop_struct_229444;
    futhark_mc_segmap_parloop_229445_task.iterations = iterations;
    futhark_mc_segmap_parloop_229445_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229445_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229445_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229445_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229445_task);
    
    if (futhark_mc_segmap_parloop_229445_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229445_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229445_total_end -
                 futhark_mc_segmap_parloop_229445_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229445_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229445_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229445_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229443_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229443_end -
                 futhark_mc_segmap_task_229443_start;
        
        ctx->futhark_mc_segmap_task_229443_runs[tid]++;
        ctx->futhark_mc_segmap_task_229443_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229443_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229446 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_208390;
    int64_t free_x_208395;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213425;
    unsigned char *free_mem_213428;
    int64_t free_bytes_213430;
    unsigned char *free_mem_213503;
    unsigned char *free_mem_213506;
};
struct futhark_mc_segmap_parloop_struct_229448 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_208390;
    int64_t free_x_208395;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213425;
    unsigned char *free_mem_213428;
    int64_t free_bytes_213430;
    unsigned char *free_mem_213503;
    unsigned char *free_mem_213506;
};
static int futhark_mc_segmap_parloop_229449(void *args, int64_t start,
                                            int64_t end, int flat_tid_227433,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229448
    *futhark_mc_segmap_parloop_struct_229448 =
    (struct futhark_mc_segmap_parloop_struct_229448 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229448->ctx;
    uint64_t futhark_mc_segmap_parloop_229449_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229449_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229448->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229448->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229448->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229448->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229448->free_i_196779;
    int64_t gtid_208390 =
            futhark_mc_segmap_parloop_struct_229448->free_gtid_208390;
    int64_t x_208395 = futhark_mc_segmap_parloop_struct_229448->free_x_208395;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_213425,
                                  .size =0, .references =NULL};
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 =
            futhark_mc_segmap_parloop_struct_229448->free_bytes_213430;
    struct memblock mem_213503 = {.desc ="mem_213503", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_213503,
                                  .size =0, .references =NULL};
    struct memblock mem_213506 = {.desc ="mem_213506", .mem =
                                  futhark_mc_segmap_parloop_struct_229448->free_mem_213506,
                                  .size =0, .references =NULL};
    size_t mem_227440_cached_sizze_229450 = 0;
    unsigned char *mem_227440 = NULL;
    size_t mem_227442_cached_sizze_229451 = 0;
    unsigned char *mem_227442 = NULL;
    size_t mem_227469_cached_sizze_229452 = 0;
    unsigned char *mem_227469 = NULL;
    size_t mem_227471_cached_sizze_229453 = 0;
    unsigned char *mem_227471 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227571 = start;
    
    if (mem_227440_cached_sizze_229450 < (size_t) bytes_213430) {
        mem_227440 = realloc(mem_227440, bytes_213430);
        mem_227440_cached_sizze_229450 = bytes_213430;
    }
    if (mem_227442_cached_sizze_229451 < (size_t) bytes_213430) {
        mem_227442 = realloc(mem_227442, bytes_213430);
        mem_227442_cached_sizze_229451 = bytes_213430;
    }
    if (mem_227469_cached_sizze_229452 < (size_t) bytes_213430) {
        mem_227469 = realloc(mem_227469, bytes_213430);
        mem_227469_cached_sizze_229452 = bytes_213430;
    }
    if (mem_227471_cached_sizze_229453 < (size_t) bytes_213430) {
        mem_227471 = realloc(mem_227471, bytes_213430);
        mem_227471_cached_sizze_229453 = bytes_213430;
    }
    for (; iter_227571 < end; iter_227571++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227640 = t_n_m_196759;
        int64_t gtid_227434 = iter_227571;
        int64_t remnant_227641 = iter_227571 - gtid_227434;
        int64_t x_227435;
        
        x_227435 = ((int64_t *) mem_210889.mem)[gtid_208390 * t_n_m_196759 +
                                                gtid_227434];
        
        float x_227436;
        
        x_227436 = ((float *) mem_210893.mem)[gtid_208390 * t_n_m_196759 +
                                              gtid_227434];
        
        int64_t min_arg_227437 = mul64(jump_t_196702, gtid_227434);
        int64_t min_res_227438 = smin64(i_196779, min_arg_227437);
        int64_t defunc_0_g_res_227439 = add64((int64_t) 1, min_res_227438);
        
        for (int64_t i_227572 = 0; i_227572 < q_t_196696; i_227572++) {
            bool cond_227575 = sle64(x_208395, i_227572);
            int64_t defunc_0_f_res_227576;
            
            if (cond_227575) {
                defunc_0_f_res_227576 = (int64_t) 0;
            } else {
                int64_t i_227577 = add64(x_227435, i_227572);
                int64_t defunc_0_add_arg_227578;
                
                defunc_0_add_arg_227578 =
                    ((int64_t *) mem_210394.mem)[gtid_208390 * n_196692 +
                                                 i_227577];
                
                int64_t defunc_1_add_res_227579 = add64((int64_t) 1,
                                                        defunc_0_add_arg_227578);
                
                defunc_0_f_res_227576 = defunc_1_add_res_227579;
            }
            
            float defunc_0_f_res_227580;
            
            if (cond_227575) {
                defunc_0_f_res_227580 = 0.0F;
            } else {
                int64_t i_227581 = add64(x_227435, i_227572);
                float defunc_0_add_arg_227582;
                
                defunc_0_add_arg_227582 = ((float *) mem_213425.mem)[i_227581];
                defunc_0_f_res_227580 = defunc_0_add_arg_227582;
            }
            
            int64_t binop_p_227583 = sub64(defunc_0_f_res_227576,
                                           defunc_0_g_res_227439);
            float defunc_0_f_res_227584 = sitofp_i64_f32(binop_p_227583);
            float abs_res_227585 = (float) fabs(defunc_0_f_res_227584);
            float tmp1_227586 = abs_res_227585 / x_227436;
            float x_227587 = tmp1_227586 * tmp1_227586;
            float y_227588 = tmp1_227586 * x_227587;
            float tmp2_227589 = 1.0F - y_227588;
            float x_227590 = tmp2_227589 * tmp2_227589;
            float tmp3_227591 = tmp2_227589 * x_227590;
            float tmp4_227592 = defunc_0_f_res_227580 * tmp3_227591;
            
            ((float *) mem_227440)[i_227572] = defunc_0_f_res_227584;
            ((float *) mem_227442)[i_227572] = tmp4_227592;
        }
        
        float defunc_2_reduce_res_227473;
        float defunc_2_reduce_res_227474;
        float defunc_2_reduce_res_227475;
        float defunc_2_reduce_res_227476;
        float defunc_2_reduce_res_227477;
        float redout_227596;
        float redout_227597;
        float redout_227598;
        float redout_227599;
        float redout_227600;
        
        redout_227596 = 0.0F;
        redout_227597 = 0.0F;
        redout_227598 = 0.0F;
        redout_227599 = 0.0F;
        redout_227600 = 0.0F;
        for (int64_t i_227595 = 0; i_227595 < q_t_196696; i_227595++) {
            float x_227603;
            
            x_227603 = ((float *) mem_227440)[i_227595];
            
            float x_227604;
            
            x_227604 = ((float *) mem_227442)[i_227595];
            
            float defunc_1_f_res_227605 = x_227603 * x_227604;
            float defunc_1_f_res_227606 = x_227603 * defunc_1_f_res_227605;
            float defunc_1_f_res_227607 = x_227603 * defunc_1_f_res_227606;
            float defunc_1_f_res_227608 = x_227603 * defunc_1_f_res_227607;
            float defunc_1_op_res_227609 = x_227604 + redout_227596;
            float defunc_1_op_res_227610 = defunc_1_f_res_227605 +
                  redout_227597;
            float defunc_1_op_res_227611 = defunc_1_f_res_227606 +
                  redout_227598;
            float defunc_1_op_res_227612 = defunc_1_f_res_227607 +
                  redout_227599;
            float defunc_1_op_res_227613 = defunc_1_f_res_227608 +
                  redout_227600;
            
            ((float *) mem_227469)[i_227595] = defunc_1_f_res_227606;
            ((float *) mem_227471)[i_227595] = defunc_1_f_res_227605;
            
            float redout_tmp_227644 = defunc_1_op_res_227609;
            float redout_tmp_227645 = defunc_1_op_res_227610;
            float redout_tmp_227646 = defunc_1_op_res_227611;
            float redout_tmp_227647 = defunc_1_op_res_227612;
            float redout_tmp_227648 = defunc_1_op_res_227613;
            
            redout_227596 = redout_tmp_227644;
            redout_227597 = redout_tmp_227645;
            redout_227598 = redout_tmp_227646;
            redout_227599 = redout_tmp_227647;
            redout_227600 = redout_tmp_227648;
        }
        defunc_2_reduce_res_227473 = redout_227596;
        defunc_2_reduce_res_227474 = redout_227597;
        defunc_2_reduce_res_227475 = redout_227598;
        defunc_2_reduce_res_227476 = redout_227599;
        defunc_2_reduce_res_227477 = redout_227600;
        
        float x_227501 = defunc_2_reduce_res_227475 *
              defunc_2_reduce_res_227477;
        float y_227502 = defunc_2_reduce_res_227476 *
              defunc_2_reduce_res_227476;
        float a12_227503 = x_227501 - y_227502;
        float x_227504 = defunc_2_reduce_res_227475 *
              defunc_2_reduce_res_227476;
        float y_227505 = defunc_2_reduce_res_227474 *
              defunc_2_reduce_res_227477;
        float b12_227506 = x_227504 - y_227505;
        float x_227507 = defunc_2_reduce_res_227474 *
              defunc_2_reduce_res_227476;
        float y_227508 = defunc_2_reduce_res_227475 *
              defunc_2_reduce_res_227475;
        float c12_227509 = x_227507 - y_227508;
        float x_227510 = defunc_2_reduce_res_227473 *
              defunc_2_reduce_res_227477;
        float b2_227511 = x_227510 - y_227508;
        float x_227512 = defunc_2_reduce_res_227474 *
              defunc_2_reduce_res_227475;
        float y_227513 = defunc_2_reduce_res_227473 *
              defunc_2_reduce_res_227476;
        float c2_227514 = x_227512 - y_227513;
        float x_227515 = defunc_2_reduce_res_227473 * a12_227503;
        float y_227516 = defunc_2_reduce_res_227474 * b12_227506;
        float x_227517 = x_227515 + y_227516;
        float y_227518 = defunc_2_reduce_res_227475 * c12_227509;
        float y_227519 = x_227517 + y_227518;
        float det_227520 = 1.0F / y_227519;
        float a12_227521 = a12_227503 * det_227520;
        float b12_227522 = b12_227506 * det_227520;
        float c12_227523 = c12_227509 * det_227520;
        float b2_227524 = b2_227511 * det_227520;
        float c2_227525 = c2_227514 * det_227520;
        float defunc_2_reduce_res_227526;
        float defunc_2_reduce_res_227527;
        float redout_227617;
        float redout_227618;
        
        redout_227617 = 0.0F;
        redout_227618 = 0.0F;
        for (int64_t i_227616 = 0; i_227616 < q_t_196696; i_227616++) {
            float x_227619;
            
            x_227619 = ((float *) mem_227442)[i_227616];
            
            float x_227620;
            
            x_227620 = ((float *) mem_227471)[i_227616];
            
            float x_227621;
            
            x_227621 = ((float *) mem_227469)[i_227616];
            
            bool cond_227622 = sle64(x_208395, i_227616);
            float defunc_0_f_res_227623;
            
            if (cond_227622) {
                defunc_0_f_res_227623 = 0.0F;
            } else {
                int64_t i_227624 = add64(x_227435, i_227616);
                float defunc_0_add_arg_227625;
                
                defunc_0_add_arg_227625 = ((float *) mem_213428.mem)[i_227624];
                defunc_0_f_res_227623 = defunc_0_add_arg_227625;
            }
            
            float x_227626 = a12_227521 * x_227619;
            float y_227627 = b12_227522 * x_227620;
            float x_227628 = x_227626 + y_227627;
            float y_227629 = c12_227523 * x_227621;
            float x_227630 = x_227628 + y_227629;
            float defunc_9_fit_fun_res_227631 = defunc_0_f_res_227623 *
                  x_227630;
            float x_227632 = b12_227522 * x_227619;
            float y_227633 = b2_227524 * x_227620;
            float x_227634 = x_227632 + y_227633;
            float y_227635 = c2_227525 * x_227621;
            float x_227636 = x_227634 + y_227635;
            float defunc_9_slope_fun_res_227637 = defunc_0_f_res_227623 *
                  x_227636;
            float defunc_1_op_res_227638 = defunc_9_fit_fun_res_227631 +
                  redout_227617;
            float defunc_1_op_res_227639 = defunc_9_slope_fun_res_227637 +
                  redout_227618;
            float redout_tmp_227651 = defunc_1_op_res_227638;
            float redout_tmp_227652 = defunc_1_op_res_227639;
            
            redout_227617 = redout_tmp_227651;
            redout_227618 = redout_tmp_227652;
        }
        defunc_2_reduce_res_227526 = redout_227617;
        defunc_2_reduce_res_227527 = redout_227618;
        ((float *) mem_213503.mem)[gtid_227434] = defunc_2_reduce_res_227526;
        ((float *) mem_213506.mem)[gtid_227434] = defunc_2_reduce_res_227527;
    }
    
  cleanup:
    { }
    free(mem_227440);
    free(mem_227442);
    free(mem_227469);
    free(mem_227471);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229449_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229449_end -
                 futhark_mc_segmap_parloop_229449_start;
        
        ctx->futhark_mc_segmap_parloop_229449_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229449_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229449_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229447(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227433 = tid;
    int num_tasks_227570 = info.nsubtasks;
    struct futhark_mc_task_229446 *futhark_mc_task_229446 =
                                  (struct futhark_mc_task_229446 *) args;
    struct futhark_context *ctx = futhark_mc_task_229446->ctx;
    uint64_t futhark_mc_segmap_task_229447_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229447_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229446->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229446->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229446->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229446->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229446->free_i_196779;
    int64_t gtid_208390 = futhark_mc_task_229446->free_gtid_208390;
    int64_t x_208395 = futhark_mc_task_229446->free_x_208395;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229446->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229446->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229446->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_task_229446->free_mem_213425,
                                  .size =0, .references =NULL};
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_task_229446->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 = futhark_mc_task_229446->free_bytes_213430;
    struct memblock mem_213503 = {.desc ="mem_213503", .mem =
                                  futhark_mc_task_229446->free_mem_213503,
                                  .size =0, .references =NULL};
    struct memblock mem_213506 = {.desc ="mem_213506", .mem =
                                  futhark_mc_task_229446->free_mem_213506,
                                  .size =0, .references =NULL};
    int64_t iter_227571;
    struct futhark_mc_segmap_parloop_struct_229448
    futhark_mc_segmap_parloop_struct_229448;
    
    futhark_mc_segmap_parloop_struct_229448.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229448.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229448.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229448.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229448.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229448.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229448.free_gtid_208390 = gtid_208390;
    futhark_mc_segmap_parloop_struct_229448.free_x_208395 = x_208395;
    futhark_mc_segmap_parloop_struct_229448.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229448.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229448.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229448.free_mem_213425 = mem_213425.mem;
    futhark_mc_segmap_parloop_struct_229448.free_mem_213428 = mem_213428.mem;
    futhark_mc_segmap_parloop_struct_229448.free_bytes_213430 = bytes_213430;
    futhark_mc_segmap_parloop_struct_229448.free_mem_213503 = mem_213503.mem;
    futhark_mc_segmap_parloop_struct_229448.free_mem_213506 = mem_213506.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229449_task;
    
    futhark_mc_segmap_parloop_229449_task.name =
        "futhark_mc_segmap_parloop_229449";
    futhark_mc_segmap_parloop_229449_task.fn = futhark_mc_segmap_parloop_229449;
    futhark_mc_segmap_parloop_229449_task.args =
        &futhark_mc_segmap_parloop_struct_229448;
    futhark_mc_segmap_parloop_229449_task.iterations = iterations;
    futhark_mc_segmap_parloop_229449_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229449_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229449_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229449_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229449_task);
    
    if (futhark_mc_segmap_parloop_229449_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229449_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229449_total_end -
                 futhark_mc_segmap_parloop_229449_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229449_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229449_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229449_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229447_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229447_end -
                 futhark_mc_segmap_task_229447_start;
        
        ctx->futhark_mc_segmap_task_229447_runs[tid]++;
        ctx->futhark_mc_segmap_task_229447_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229447_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229455 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_gtid_208390;
    int64_t free_x_208395;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_210889;
    unsigned char *free_mem_210893;
    unsigned char *free_mem_213425;
    unsigned char *free_mem_213428;
    int64_t free_bytes_213430;
    unsigned char *free_mem_213503;
    unsigned char *free_mem_213506;
};
struct futhark_mc_task_229461 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_gtid_208390;
    int64_t free_x_208395;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213425;
    int64_t free_x_227318;
    float free_x_227319;
    int64_t free_defunc_0_g_res_227322;
    unsigned char *free_mem_227323;
    unsigned char *free_mem_227324;
};
struct futhark_mc_segmap_parloop_struct_229463 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_q_t_196696;
    int64_t free_gtid_208390;
    int64_t free_x_208395;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213425;
    int64_t free_x_227318;
    float free_x_227319;
    int64_t free_defunc_0_g_res_227322;
    unsigned char *free_mem_227323;
    unsigned char *free_mem_227324;
};
static int futhark_mc_segmap_parloop_229464(void *args, int64_t start,
                                            int64_t end, int flat_tid_227654,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229463
    *futhark_mc_segmap_parloop_struct_229463 =
    (struct futhark_mc_segmap_parloop_struct_229463 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229463->ctx;
    uint64_t futhark_mc_segmap_parloop_229464_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229464_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229463->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229463->free_q_t_196696;
    int64_t gtid_208390 =
            futhark_mc_segmap_parloop_struct_229463->free_gtid_208390;
    int64_t x_208395 = futhark_mc_segmap_parloop_struct_229463->free_x_208395;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229463->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_segmap_parloop_struct_229463->free_mem_213425,
                                  .size =0, .references =NULL};
    int64_t x_227318 = futhark_mc_segmap_parloop_struct_229463->free_x_227318;
    float x_227319 = futhark_mc_segmap_parloop_struct_229463->free_x_227319;
    int64_t defunc_0_g_res_227322 =
            futhark_mc_segmap_parloop_struct_229463->free_defunc_0_g_res_227322;
    struct memblock mem_227323 = {.desc ="mem_227323", .mem =
                                  futhark_mc_segmap_parloop_struct_229463->free_mem_227323,
                                  .size =0, .references =NULL};
    struct memblock mem_227324 = {.desc ="mem_227324", .mem =
                                  futhark_mc_segmap_parloop_struct_229463->free_mem_227324,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227727 = start;
    
    for (; iter_227727 < end; iter_227727++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227733 = q_t_196696;
        int64_t gtid_227655 = iter_227727;
        int64_t remnant_227734 = iter_227727 - gtid_227655;
        bool cond_227656 = sle64(x_208395, gtid_227655);
        int64_t defunc_0_f_res_227657;
        
        if (cond_227656) {
            defunc_0_f_res_227657 = (int64_t) 0;
        } else {
            int64_t i_227728 = add64(x_227318, gtid_227655);
            int64_t defunc_0_add_arg_227729;
            
            defunc_0_add_arg_227729 = ((int64_t *) mem_210394.mem)[gtid_208390 *
                                                                   n_196692 +
                                                                   i_227728];
            
            int64_t defunc_1_add_res_227730 = add64((int64_t) 1,
                                                    defunc_0_add_arg_227729);
            
            defunc_0_f_res_227657 = defunc_1_add_res_227730;
        }
        
        float defunc_0_f_res_227661;
        
        if (cond_227656) {
            defunc_0_f_res_227661 = 0.0F;
        } else {
            int64_t i_227731 = add64(x_227318, gtid_227655);
            float defunc_0_add_arg_227732;
            
            defunc_0_add_arg_227732 = ((float *) mem_213425.mem)[i_227731];
            defunc_0_f_res_227661 = defunc_0_add_arg_227732;
        }
        
        int64_t binop_p_227664 = sub64(defunc_0_f_res_227657,
                                       defunc_0_g_res_227322);
        float defunc_0_f_res_227665 = sitofp_i64_f32(binop_p_227664);
        float abs_res_227666 = (float) fabs(defunc_0_f_res_227665);
        float tmp1_227667 = abs_res_227666 / x_227319;
        float x_227668 = tmp1_227667 * tmp1_227667;
        float y_227669 = tmp1_227667 * x_227668;
        float tmp2_227670 = 1.0F - y_227669;
        float x_227671 = tmp2_227670 * tmp2_227670;
        float tmp3_227672 = tmp2_227670 * x_227671;
        float tmp4_227673 = defunc_0_f_res_227661 * tmp3_227672;
        
        ((float *) mem_227323.mem)[gtid_227655] = defunc_0_f_res_227665;
        ((float *) mem_227324.mem)[gtid_227655] = tmp4_227673;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229464_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229464_end -
                 futhark_mc_segmap_parloop_229464_start;
        
        ctx->futhark_mc_segmap_parloop_229464_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229464_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229464_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229462(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227654 = tid;
    int num_tasks_227726 = info.nsubtasks;
    struct futhark_mc_task_229461 *futhark_mc_task_229461 =
                                  (struct futhark_mc_task_229461 *) args;
    struct futhark_context *ctx = futhark_mc_task_229461->ctx;
    uint64_t futhark_mc_segmap_task_229462_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229462_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229461->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229461->free_q_t_196696;
    int64_t gtid_208390 = futhark_mc_task_229461->free_gtid_208390;
    int64_t x_208395 = futhark_mc_task_229461->free_x_208395;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229461->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_task_229461->free_mem_213425,
                                  .size =0, .references =NULL};
    int64_t x_227318 = futhark_mc_task_229461->free_x_227318;
    float x_227319 = futhark_mc_task_229461->free_x_227319;
    int64_t defunc_0_g_res_227322 =
            futhark_mc_task_229461->free_defunc_0_g_res_227322;
    struct memblock mem_227323 = {.desc ="mem_227323", .mem =
                                  futhark_mc_task_229461->free_mem_227323,
                                  .size =0, .references =NULL};
    struct memblock mem_227324 = {.desc ="mem_227324", .mem =
                                  futhark_mc_task_229461->free_mem_227324,
                                  .size =0, .references =NULL};
    int64_t iter_227727;
    struct futhark_mc_segmap_parloop_struct_229463
    futhark_mc_segmap_parloop_struct_229463;
    
    futhark_mc_segmap_parloop_struct_229463.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229463.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229463.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229463.free_gtid_208390 = gtid_208390;
    futhark_mc_segmap_parloop_struct_229463.free_x_208395 = x_208395;
    futhark_mc_segmap_parloop_struct_229463.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229463.free_mem_213425 = mem_213425.mem;
    futhark_mc_segmap_parloop_struct_229463.free_x_227318 = x_227318;
    futhark_mc_segmap_parloop_struct_229463.free_x_227319 = x_227319;
    futhark_mc_segmap_parloop_struct_229463.free_defunc_0_g_res_227322 =
        defunc_0_g_res_227322;
    futhark_mc_segmap_parloop_struct_229463.free_mem_227323 = mem_227323.mem;
    futhark_mc_segmap_parloop_struct_229463.free_mem_227324 = mem_227324.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229464_task;
    
    futhark_mc_segmap_parloop_229464_task.name =
        "futhark_mc_segmap_parloop_229464";
    futhark_mc_segmap_parloop_229464_task.fn = futhark_mc_segmap_parloop_229464;
    futhark_mc_segmap_parloop_229464_task.args =
        &futhark_mc_segmap_parloop_struct_229463;
    futhark_mc_segmap_parloop_229464_task.iterations = iterations;
    futhark_mc_segmap_parloop_229464_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229464_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229464_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229464_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229464_task);
    
    if (futhark_mc_segmap_parloop_229464_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229464_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229464_total_end -
                 futhark_mc_segmap_parloop_229464_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229464_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229464_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229464_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229462_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229462_end -
                 futhark_mc_segmap_task_229462_start;
        
        ctx->futhark_mc_segmap_task_229462_runs[tid]++;
        ctx->futhark_mc_segmap_task_229462_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229462_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229465 {
    struct futhark_context *ctx;
    unsigned char *free_mem_227323;
    unsigned char *free_mem_227324;
    float *retval_defunc_2_reduce_res_227349;
    float *retval_defunc_2_reduce_res_227350;
    float *retval_defunc_2_reduce_res_227351;
    float *retval_defunc_2_reduce_res_227352;
    float *retval_defunc_2_reduce_res_227353;
    unsigned char *retval_mem_227347;
    unsigned char *retval_mem_227348;
};
struct futhark_mc_segred_stage_1_parloop_struct_229472 {
    struct futhark_context *ctx;
    unsigned char *free_mem_227323;
    unsigned char *free_mem_227324;
    unsigned char *free_mem_227347;
    unsigned char *free_mem_227348;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227736;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227738;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227740;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227742;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227744;
};
static int futhark_mc_segred_stage_1_parloop_229473(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_227674,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229472
    *futhark_mc_segred_stage_1_parloop_struct_229472 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229472 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229472->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229473_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229473_start = get_wall_time();
    
    struct memblock mem_227323 = {.desc ="mem_227323", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229472->free_mem_227323,
                                  .size =0, .references =NULL};
    struct memblock mem_227324 = {.desc ="mem_227324", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229472->free_mem_227324,
                                  .size =0, .references =NULL};
    struct memblock mem_227347 = {.desc ="mem_227347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229472->free_mem_227347,
                                  .size =0, .references =NULL};
    struct memblock mem_227348 = {.desc ="mem_227348", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229472->free_mem_227348,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227736 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227736",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229472->free_reduce_stage_1_tid_res_arr_mem_227736,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227738 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227738",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229472->free_reduce_stage_1_tid_res_arr_mem_227738,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227740 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227740",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229472->free_reduce_stage_1_tid_res_arr_mem_227740,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227742 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227742",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229472->free_reduce_stage_1_tid_res_arr_mem_227742,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227744 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227744",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229472->free_reduce_stage_1_tid_res_arr_mem_227744,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227746 = start;
    float x_227676;
    float x_227677;
    float x_227679;
    float x_227680;
    float x_227682;
    float x_227683;
    float x_227685;
    float x_227686;
    float x_227688;
    float x_227689;
    float local_acc_227747 = 0.0F;
    float local_acc_227748 = 0.0F;
    float local_acc_227749 = 0.0F;
    float local_acc_227750 = 0.0F;
    float local_acc_227751 = 0.0F;
    
    for (; iter_227746 < end; iter_227746++) {
        int64_t gtid_227675 = iter_227746;
        float x_227691;
        
        x_227691 = ((float *) mem_227323.mem)[gtid_227675];
        
        float x_227692;
        
        x_227692 = ((float *) mem_227324.mem)[gtid_227675];
        
        float defunc_1_f_res_227693 = x_227691 * x_227692;
        float defunc_1_f_res_227694 = x_227691 * defunc_1_f_res_227693;
        float defunc_1_f_res_227695 = x_227691 * defunc_1_f_res_227694;
        float defunc_1_f_res_227696 = x_227691 * defunc_1_f_res_227695;
        
        // save map-out results
        {
            ((float *) mem_227347.mem)[gtid_227675] = defunc_1_f_res_227694;
            ((float *) mem_227348.mem)[gtid_227675] = defunc_1_f_res_227693;
        }
        // Load accum params
        {
            x_227676 = local_acc_227747;
        }
        // Load next params
        {
            x_227677 = x_227692;
        }
        // Red body
        {
            float defunc_1_op_res_227678 = x_227676 + x_227677;
            
            local_acc_227747 = defunc_1_op_res_227678;
        }
        // Load accum params
        {
            x_227679 = local_acc_227748;
        }
        // Load next params
        {
            x_227680 = defunc_1_f_res_227693;
        }
        // Red body
        {
            float defunc_1_op_res_227681 = x_227679 + x_227680;
            
            local_acc_227748 = defunc_1_op_res_227681;
        }
        // Load accum params
        {
            x_227682 = local_acc_227749;
        }
        // Load next params
        {
            x_227683 = defunc_1_f_res_227694;
        }
        // Red body
        {
            float defunc_1_op_res_227684 = x_227682 + x_227683;
            
            local_acc_227749 = defunc_1_op_res_227684;
        }
        // Load accum params
        {
            x_227685 = local_acc_227750;
        }
        // Load next params
        {
            x_227686 = defunc_1_f_res_227695;
        }
        // Red body
        {
            float defunc_1_op_res_227687 = x_227685 + x_227686;
            
            local_acc_227750 = defunc_1_op_res_227687;
        }
        // Load accum params
        {
            x_227688 = local_acc_227751;
        }
        // Load next params
        {
            x_227689 = defunc_1_f_res_227696;
        }
        // Red body
        {
            float defunc_1_op_res_227690 = x_227688 + x_227689;
            
            local_acc_227751 = defunc_1_op_res_227690;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_227736.mem)[flat_tid_227674] =
        local_acc_227747;
    ((float *) reduce_stage_1_tid_res_arr_mem_227738.mem)[flat_tid_227674] =
        local_acc_227748;
    ((float *) reduce_stage_1_tid_res_arr_mem_227740.mem)[flat_tid_227674] =
        local_acc_227749;
    ((float *) reduce_stage_1_tid_res_arr_mem_227742.mem)[flat_tid_227674] =
        local_acc_227750;
    ((float *) reduce_stage_1_tid_res_arr_mem_227744.mem)[flat_tid_227674] =
        local_acc_227751;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229473_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229473_end -
                 futhark_mc_segred_stage_1_parloop_229473_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229473_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229473_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229473_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229466(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227674 = tid;
    int num_tasks_227735 = info.nsubtasks;
    struct futhark_mc_task_229465 *futhark_mc_task_229465 =
                                  (struct futhark_mc_task_229465 *) args;
    struct futhark_context *ctx = futhark_mc_task_229465->ctx;
    uint64_t futhark_mc_segred_task_229466_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229466_start = get_wall_time();
    
    struct memblock mem_227323 = {.desc ="mem_227323", .mem =
                                  futhark_mc_task_229465->free_mem_227323,
                                  .size =0, .references =NULL};
    struct memblock mem_227324 = {.desc ="mem_227324", .mem =
                                  futhark_mc_task_229465->free_mem_227324,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_227349 =
          *futhark_mc_task_229465->retval_defunc_2_reduce_res_227349;
    float defunc_2_reduce_res_227350 =
          *futhark_mc_task_229465->retval_defunc_2_reduce_res_227350;
    float defunc_2_reduce_res_227351 =
          *futhark_mc_task_229465->retval_defunc_2_reduce_res_227351;
    float defunc_2_reduce_res_227352 =
          *futhark_mc_task_229465->retval_defunc_2_reduce_res_227352;
    float defunc_2_reduce_res_227353 =
          *futhark_mc_task_229465->retval_defunc_2_reduce_res_227353;
    struct memblock mem_227347 = {.desc ="mem_227347", .mem =
                                  futhark_mc_task_229465->retval_mem_227347,
                                  .size =0, .references =NULL};
    struct memblock mem_227348 = {.desc ="mem_227348", .mem =
                                  futhark_mc_task_229465->retval_mem_227348,
                                  .size =0, .references =NULL};
    size_t reduce_stage_1_tid_res_arr_mem_227736_cached_sizze_229467 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227736 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227738_cached_sizze_229468 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227738 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227740_cached_sizze_229469 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227740 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227742_cached_sizze_229470 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227742 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227744_cached_sizze_229471 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227744 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_227736_cached_sizze_229467 <
        (size_t) ((int64_t) 4 * num_tasks_227735)) {
        reduce_stage_1_tid_res_arr_mem_227736 =
            realloc(reduce_stage_1_tid_res_arr_mem_227736, (int64_t) 4 *
                    num_tasks_227735);
        reduce_stage_1_tid_res_arr_mem_227736_cached_sizze_229467 =
            (int64_t) 4 * num_tasks_227735;
    }
    if (reduce_stage_1_tid_res_arr_mem_227738_cached_sizze_229468 <
        (size_t) ((int64_t) 4 * num_tasks_227735)) {
        reduce_stage_1_tid_res_arr_mem_227738 =
            realloc(reduce_stage_1_tid_res_arr_mem_227738, (int64_t) 4 *
                    num_tasks_227735);
        reduce_stage_1_tid_res_arr_mem_227738_cached_sizze_229468 =
            (int64_t) 4 * num_tasks_227735;
    }
    if (reduce_stage_1_tid_res_arr_mem_227740_cached_sizze_229469 <
        (size_t) ((int64_t) 4 * num_tasks_227735)) {
        reduce_stage_1_tid_res_arr_mem_227740 =
            realloc(reduce_stage_1_tid_res_arr_mem_227740, (int64_t) 4 *
                    num_tasks_227735);
        reduce_stage_1_tid_res_arr_mem_227740_cached_sizze_229469 =
            (int64_t) 4 * num_tasks_227735;
    }
    if (reduce_stage_1_tid_res_arr_mem_227742_cached_sizze_229470 <
        (size_t) ((int64_t) 4 * num_tasks_227735)) {
        reduce_stage_1_tid_res_arr_mem_227742 =
            realloc(reduce_stage_1_tid_res_arr_mem_227742, (int64_t) 4 *
                    num_tasks_227735);
        reduce_stage_1_tid_res_arr_mem_227742_cached_sizze_229470 =
            (int64_t) 4 * num_tasks_227735;
    }
    if (reduce_stage_1_tid_res_arr_mem_227744_cached_sizze_229471 <
        (size_t) ((int64_t) 4 * num_tasks_227735)) {
        reduce_stage_1_tid_res_arr_mem_227744 =
            realloc(reduce_stage_1_tid_res_arr_mem_227744, (int64_t) 4 *
                    num_tasks_227735);
        reduce_stage_1_tid_res_arr_mem_227744_cached_sizze_229471 =
            (int64_t) 4 * num_tasks_227735;
    }
    
    int64_t iter_227746;
    struct futhark_mc_segred_stage_1_parloop_struct_229472
    futhark_mc_segred_stage_1_parloop_struct_229472;
    
    futhark_mc_segred_stage_1_parloop_struct_229472.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_mem_227323 =
        mem_227323.mem;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_mem_227324 =
        mem_227324.mem;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_mem_227347 =
        mem_227347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_mem_227348 =
        mem_227348.mem;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_reduce_stage_1_tid_res_arr_mem_227736 =
        reduce_stage_1_tid_res_arr_mem_227736;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_reduce_stage_1_tid_res_arr_mem_227738 =
        reduce_stage_1_tid_res_arr_mem_227738;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_reduce_stage_1_tid_res_arr_mem_227740 =
        reduce_stage_1_tid_res_arr_mem_227740;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_reduce_stage_1_tid_res_arr_mem_227742 =
        reduce_stage_1_tid_res_arr_mem_227742;
    futhark_mc_segred_stage_1_parloop_struct_229472.free_reduce_stage_1_tid_res_arr_mem_227744 =
        reduce_stage_1_tid_res_arr_mem_227744;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229473_task;
    
    futhark_mc_segred_stage_1_parloop_229473_task.name =
        "futhark_mc_segred_stage_1_parloop_229473";
    futhark_mc_segred_stage_1_parloop_229473_task.fn =
        futhark_mc_segred_stage_1_parloop_229473;
    futhark_mc_segred_stage_1_parloop_229473_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229472;
    futhark_mc_segred_stage_1_parloop_229473_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229473_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229473_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229473_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229473_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229473_task);
    
    if (futhark_mc_segred_stage_1_parloop_229473_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229473_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229473_total_end -
                 futhark_mc_segred_stage_1_parloop_229473_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229473_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229473_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229473_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_227349 = 0.0F;
        defunc_2_reduce_res_227350 = 0.0F;
        defunc_2_reduce_res_227351 = 0.0F;
        defunc_2_reduce_res_227352 = 0.0F;
        defunc_2_reduce_res_227353 = 0.0F;
    }
    
    float x_227752;
    float x_227753;
    float x_227755;
    float x_227756;
    float x_227758;
    float x_227759;
    float x_227761;
    float x_227762;
    float x_227764;
    float x_227765;
    
    for (int32_t i_227767 = 0; i_227767 < num_tasks_227735; i_227767++) {
        flat_tid_227674 = i_227767;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_227752 = defunc_2_reduce_res_227349;
            }
            // load next params
            {
                x_227753 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227736)[flat_tid_227674];
            }
            // red body
            {
                float defunc_1_op_res_227754 = x_227752 + x_227753;
                
                defunc_2_reduce_res_227349 = defunc_1_op_res_227754;
            }
            // load acc params
            {
                x_227755 = defunc_2_reduce_res_227350;
            }
            // load next params
            {
                x_227756 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227738)[flat_tid_227674];
            }
            // red body
            {
                float defunc_1_op_res_227757 = x_227755 + x_227756;
                
                defunc_2_reduce_res_227350 = defunc_1_op_res_227757;
            }
            // load acc params
            {
                x_227758 = defunc_2_reduce_res_227351;
            }
            // load next params
            {
                x_227759 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227740)[flat_tid_227674];
            }
            // red body
            {
                float defunc_1_op_res_227760 = x_227758 + x_227759;
                
                defunc_2_reduce_res_227351 = defunc_1_op_res_227760;
            }
            // load acc params
            {
                x_227761 = defunc_2_reduce_res_227352;
            }
            // load next params
            {
                x_227762 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227742)[flat_tid_227674];
            }
            // red body
            {
                float defunc_1_op_res_227763 = x_227761 + x_227762;
                
                defunc_2_reduce_res_227352 = defunc_1_op_res_227763;
            }
            // load acc params
            {
                x_227764 = defunc_2_reduce_res_227353;
            }
            // load next params
            {
                x_227765 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227744)[flat_tid_227674];
            }
            // red body
            {
                float defunc_1_op_res_227766 = x_227764 + x_227765;
                
                defunc_2_reduce_res_227353 = defunc_1_op_res_227766;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_227736);
        free(reduce_stage_1_tid_res_arr_mem_227738);
        free(reduce_stage_1_tid_res_arr_mem_227740);
        free(reduce_stage_1_tid_res_arr_mem_227742);
        free(reduce_stage_1_tid_res_arr_mem_227744);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229466_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229466_end -
                 futhark_mc_segred_task_229466_start;
        
        ctx->futhark_mc_segred_task_229466_runs[tid]++;
        ctx->futhark_mc_segred_task_229466_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229466_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229465->retval_defunc_2_reduce_res_227349 =
            defunc_2_reduce_res_227349;
        *futhark_mc_task_229465->retval_defunc_2_reduce_res_227350 =
            defunc_2_reduce_res_227350;
        *futhark_mc_task_229465->retval_defunc_2_reduce_res_227351 =
            defunc_2_reduce_res_227351;
        *futhark_mc_task_229465->retval_defunc_2_reduce_res_227352 =
            defunc_2_reduce_res_227352;
        *futhark_mc_task_229465->retval_defunc_2_reduce_res_227353 =
            defunc_2_reduce_res_227353;
        futhark_mc_task_229465->retval_mem_227347 = mem_227347.mem;
        futhark_mc_task_229465->retval_mem_227348 = mem_227348.mem;
    }
    return err;
}
struct futhark_mc_task_229474 {
    struct futhark_context *ctx;
    int64_t free_x_208395;
    unsigned char *free_mem_213428;
    int64_t free_x_227318;
    unsigned char *free_mem_227324;
    unsigned char *free_mem_227347;
    unsigned char *free_mem_227348;
    float free_a12_227399;
    float free_b12_227400;
    float free_c12_227401;
    float free_b2_227402;
    float free_c2_227403;
    float *retval_defunc_2_reduce_res_227404;
    float *retval_defunc_2_reduce_res_227405;
};
struct futhark_mc_segred_stage_1_parloop_struct_229478 {
    struct futhark_context *ctx;
    int64_t free_x_208395;
    unsigned char *free_mem_213428;
    int64_t free_x_227318;
    unsigned char *free_mem_227324;
    unsigned char *free_mem_227347;
    unsigned char *free_mem_227348;
    float free_a12_227399;
    float free_b12_227400;
    float free_c12_227401;
    float free_b2_227402;
    float free_c2_227403;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227769;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_227771;
};
static int futhark_mc_segred_stage_1_parloop_229479(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_227697,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229478
    *futhark_mc_segred_stage_1_parloop_struct_229478 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229478 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229478->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229479_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229479_start = get_wall_time();
    
    int64_t x_208395 =
            futhark_mc_segred_stage_1_parloop_struct_229478->free_x_208395;
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229478->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t x_227318 =
            futhark_mc_segred_stage_1_parloop_struct_229478->free_x_227318;
    struct memblock mem_227324 = {.desc ="mem_227324", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229478->free_mem_227324,
                                  .size =0, .references =NULL};
    struct memblock mem_227347 = {.desc ="mem_227347", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229478->free_mem_227347,
                                  .size =0, .references =NULL};
    struct memblock mem_227348 = {.desc ="mem_227348", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229478->free_mem_227348,
                                  .size =0, .references =NULL};
    float a12_227399 =
          futhark_mc_segred_stage_1_parloop_struct_229478->free_a12_227399;
    float b12_227400 =
          futhark_mc_segred_stage_1_parloop_struct_229478->free_b12_227400;
    float c12_227401 =
          futhark_mc_segred_stage_1_parloop_struct_229478->free_c12_227401;
    float b2_227402 =
          futhark_mc_segred_stage_1_parloop_struct_229478->free_b2_227402;
    float c2_227403 =
          futhark_mc_segred_stage_1_parloop_struct_229478->free_c2_227403;
    struct memblock reduce_stage_1_tid_res_arr_mem_227769 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227769",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229478->free_reduce_stage_1_tid_res_arr_mem_227769,
                                                             .size =0,
                                                             .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_227771 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_227771",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229478->free_reduce_stage_1_tid_res_arr_mem_227771,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227773 = start;
    float x_227699;
    float x_227700;
    float x_227702;
    float x_227703;
    float local_acc_227774 = 0.0F;
    float local_acc_227775 = 0.0F;
    
    for (; iter_227773 < end; iter_227773++) {
        int64_t gtid_227698 = iter_227773;
        float x_227705;
        
        x_227705 = ((float *) mem_227324.mem)[gtid_227698];
        
        float x_227706;
        
        x_227706 = ((float *) mem_227348.mem)[gtid_227698];
        
        float x_227707;
        
        x_227707 = ((float *) mem_227347.mem)[gtid_227698];
        
        bool cond_227708 = sle64(x_208395, gtid_227698);
        float defunc_0_f_res_227709;
        
        if (cond_227708) {
            defunc_0_f_res_227709 = 0.0F;
        } else {
            int64_t i_227710 = add64(x_227318, gtid_227698);
            float defunc_0_add_arg_227711;
            
            defunc_0_add_arg_227711 = ((float *) mem_213428.mem)[i_227710];
            defunc_0_f_res_227709 = defunc_0_add_arg_227711;
        }
        
        float x_227712 = a12_227399 * x_227705;
        float y_227713 = b12_227400 * x_227706;
        float x_227714 = x_227712 + y_227713;
        float y_227715 = c12_227401 * x_227707;
        float x_227716 = x_227714 + y_227715;
        float defunc_9_fit_fun_res_227717 = defunc_0_f_res_227709 * x_227716;
        float x_227718 = b12_227400 * x_227705;
        float y_227719 = b2_227402 * x_227706;
        float x_227720 = x_227718 + y_227719;
        float y_227721 = c2_227403 * x_227707;
        float x_227722 = x_227720 + y_227721;
        float defunc_9_slope_fun_res_227723 = defunc_0_f_res_227709 * x_227722;
        
        // save map-out results
        { }
        // Load accum params
        {
            x_227699 = local_acc_227774;
        }
        // Load next params
        {
            x_227700 = defunc_9_fit_fun_res_227717;
        }
        // Red body
        {
            float defunc_1_op_res_227701 = x_227699 + x_227700;
            
            local_acc_227774 = defunc_1_op_res_227701;
        }
        // Load accum params
        {
            x_227702 = local_acc_227775;
        }
        // Load next params
        {
            x_227703 = defunc_9_slope_fun_res_227723;
        }
        // Red body
        {
            float defunc_1_op_res_227704 = x_227702 + x_227703;
            
            local_acc_227775 = defunc_1_op_res_227704;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_227769.mem)[flat_tid_227697] =
        local_acc_227774;
    ((float *) reduce_stage_1_tid_res_arr_mem_227771.mem)[flat_tid_227697] =
        local_acc_227775;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229479_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229479_end -
                 futhark_mc_segred_stage_1_parloop_229479_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229479_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229479_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229479_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229475(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227697 = tid;
    int num_tasks_227768 = info.nsubtasks;
    struct futhark_mc_task_229474 *futhark_mc_task_229474 =
                                  (struct futhark_mc_task_229474 *) args;
    struct futhark_context *ctx = futhark_mc_task_229474->ctx;
    uint64_t futhark_mc_segred_task_229475_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229475_start = get_wall_time();
    
    int64_t x_208395 = futhark_mc_task_229474->free_x_208395;
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_task_229474->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t x_227318 = futhark_mc_task_229474->free_x_227318;
    struct memblock mem_227324 = {.desc ="mem_227324", .mem =
                                  futhark_mc_task_229474->free_mem_227324,
                                  .size =0, .references =NULL};
    struct memblock mem_227347 = {.desc ="mem_227347", .mem =
                                  futhark_mc_task_229474->free_mem_227347,
                                  .size =0, .references =NULL};
    struct memblock mem_227348 = {.desc ="mem_227348", .mem =
                                  futhark_mc_task_229474->free_mem_227348,
                                  .size =0, .references =NULL};
    float a12_227399 = futhark_mc_task_229474->free_a12_227399;
    float b12_227400 = futhark_mc_task_229474->free_b12_227400;
    float c12_227401 = futhark_mc_task_229474->free_c12_227401;
    float b2_227402 = futhark_mc_task_229474->free_b2_227402;
    float c2_227403 = futhark_mc_task_229474->free_c2_227403;
    float defunc_2_reduce_res_227404 =
          *futhark_mc_task_229474->retval_defunc_2_reduce_res_227404;
    float defunc_2_reduce_res_227405 =
          *futhark_mc_task_229474->retval_defunc_2_reduce_res_227405;
    size_t reduce_stage_1_tid_res_arr_mem_227769_cached_sizze_229476 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227769 = NULL;
    size_t reduce_stage_1_tid_res_arr_mem_227771_cached_sizze_229477 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_227771 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_227769_cached_sizze_229476 <
        (size_t) ((int64_t) 4 * num_tasks_227768)) {
        reduce_stage_1_tid_res_arr_mem_227769 =
            realloc(reduce_stage_1_tid_res_arr_mem_227769, (int64_t) 4 *
                    num_tasks_227768);
        reduce_stage_1_tid_res_arr_mem_227769_cached_sizze_229476 =
            (int64_t) 4 * num_tasks_227768;
    }
    if (reduce_stage_1_tid_res_arr_mem_227771_cached_sizze_229477 <
        (size_t) ((int64_t) 4 * num_tasks_227768)) {
        reduce_stage_1_tid_res_arr_mem_227771 =
            realloc(reduce_stage_1_tid_res_arr_mem_227771, (int64_t) 4 *
                    num_tasks_227768);
        reduce_stage_1_tid_res_arr_mem_227771_cached_sizze_229477 =
            (int64_t) 4 * num_tasks_227768;
    }
    
    int64_t iter_227773;
    struct futhark_mc_segred_stage_1_parloop_struct_229478
    futhark_mc_segred_stage_1_parloop_struct_229478;
    
    futhark_mc_segred_stage_1_parloop_struct_229478.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_x_208395 = x_208395;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_mem_213428 =
        mem_213428.mem;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_x_227318 = x_227318;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_mem_227324 =
        mem_227324.mem;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_mem_227347 =
        mem_227347.mem;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_mem_227348 =
        mem_227348.mem;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_a12_227399 =
        a12_227399;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_b12_227400 =
        b12_227400;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_c12_227401 =
        c12_227401;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_b2_227402 = b2_227402;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_c2_227403 = c2_227403;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_reduce_stage_1_tid_res_arr_mem_227769 =
        reduce_stage_1_tid_res_arr_mem_227769;
    futhark_mc_segred_stage_1_parloop_struct_229478.free_reduce_stage_1_tid_res_arr_mem_227771 =
        reduce_stage_1_tid_res_arr_mem_227771;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229479_task;
    
    futhark_mc_segred_stage_1_parloop_229479_task.name =
        "futhark_mc_segred_stage_1_parloop_229479";
    futhark_mc_segred_stage_1_parloop_229479_task.fn =
        futhark_mc_segred_stage_1_parloop_229479;
    futhark_mc_segred_stage_1_parloop_229479_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229478;
    futhark_mc_segred_stage_1_parloop_229479_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229479_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229479_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229479_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229479_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229479_task);
    
    if (futhark_mc_segred_stage_1_parloop_229479_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229479_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229479_total_end -
                 futhark_mc_segred_stage_1_parloop_229479_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229479_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229479_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229479_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_227404 = 0.0F;
        defunc_2_reduce_res_227405 = 0.0F;
    }
    
    float x_227776;
    float x_227777;
    float x_227779;
    float x_227780;
    
    for (int32_t i_227782 = 0; i_227782 < num_tasks_227768; i_227782++) {
        flat_tid_227697 = i_227782;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_227776 = defunc_2_reduce_res_227404;
            }
            // load next params
            {
                x_227777 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227769)[flat_tid_227697];
            }
            // red body
            {
                float defunc_1_op_res_227778 = x_227776 + x_227777;
                
                defunc_2_reduce_res_227404 = defunc_1_op_res_227778;
            }
            // load acc params
            {
                x_227779 = defunc_2_reduce_res_227405;
            }
            // load next params
            {
                x_227780 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_227771)[flat_tid_227697];
            }
            // red body
            {
                float defunc_1_op_res_227781 = x_227779 + x_227780;
                
                defunc_2_reduce_res_227405 = defunc_1_op_res_227781;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_227769);
        free(reduce_stage_1_tid_res_arr_mem_227771);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229475_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229475_end -
                 futhark_mc_segred_task_229475_start;
        
        ctx->futhark_mc_segred_task_229475_runs[tid]++;
        ctx->futhark_mc_segred_task_229475_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229475_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229474->retval_defunc_2_reduce_res_227404 =
            defunc_2_reduce_res_227404;
        *futhark_mc_task_229474->retval_defunc_2_reduce_res_227405 =
            defunc_2_reduce_res_227405;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229456(void *args, int64_t start,
                                            int64_t end, int flat_tid_227316,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229455
    *futhark_mc_segmap_parloop_struct_229455 =
    (struct futhark_mc_segmap_parloop_struct_229455 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229455->ctx;
    uint64_t futhark_mc_segmap_parloop_229456_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229456_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229455->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229455->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229455->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229455->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229455->free_i_196779;
    int64_t gtid_208390 =
            futhark_mc_segmap_parloop_struct_229455->free_gtid_208390;
    int64_t x_208395 = futhark_mc_segmap_parloop_struct_229455->free_x_208395;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_213425,
                                  .size =0, .references =NULL};
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 =
            futhark_mc_segmap_parloop_struct_229455->free_bytes_213430;
    struct memblock mem_213503 = {.desc ="mem_213503", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_213503,
                                  .size =0, .references =NULL};
    struct memblock mem_213506 = {.desc ="mem_213506", .mem =
                                  futhark_mc_segmap_parloop_struct_229455->free_mem_213506,
                                  .size =0, .references =NULL};
    size_t mem_227323_cached_sizze_229457 = 0;
    unsigned char *mem_227323 = NULL;
    size_t mem_227324_cached_sizze_229458 = 0;
    unsigned char *mem_227324 = NULL;
    size_t mem_227347_cached_sizze_229459 = 0;
    unsigned char *mem_227347 = NULL;
    size_t mem_227348_cached_sizze_229460 = 0;
    unsigned char *mem_227348 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227653 = start;
    
    if (mem_227323_cached_sizze_229457 < (size_t) bytes_213430) {
        mem_227323 = realloc(mem_227323, bytes_213430);
        mem_227323_cached_sizze_229457 = bytes_213430;
    }
    if (mem_227324_cached_sizze_229458 < (size_t) bytes_213430) {
        mem_227324 = realloc(mem_227324, bytes_213430);
        mem_227324_cached_sizze_229458 = bytes_213430;
    }
    if (mem_227347_cached_sizze_229459 < (size_t) bytes_213430) {
        mem_227347 = realloc(mem_227347, bytes_213430);
        mem_227347_cached_sizze_229459 = bytes_213430;
    }
    if (mem_227348_cached_sizze_229460 < (size_t) bytes_213430) {
        mem_227348 = realloc(mem_227348, bytes_213430);
        mem_227348_cached_sizze_229460 = bytes_213430;
    }
    for (; iter_227653 < end; iter_227653++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227724 = t_n_m_196759;
        int64_t gtid_227317 = iter_227653;
        int64_t remnant_227725 = iter_227653 - gtid_227317;
        int64_t x_227318;
        
        x_227318 = ((int64_t *) mem_210889.mem)[gtid_208390 * t_n_m_196759 +
                                                gtid_227317];
        
        float x_227319;
        
        x_227319 = ((float *) mem_210893.mem)[gtid_208390 * t_n_m_196759 +
                                              gtid_227317];
        
        int64_t min_arg_227320 = mul64(jump_t_196702, gtid_227317);
        int64_t min_res_227321 = smin64(i_196779, min_arg_227320);
        int64_t defunc_0_g_res_227322 = add64((int64_t) 1, min_res_227321);
        int64_t flat_tid_227654 = (int64_t) 0;
        int32_t num_tasks_227726;
        struct futhark_mc_task_229461 futhark_mc_task_229461;
        
        futhark_mc_task_229461.ctx = ctx;
        futhark_mc_task_229461.free_n_196692 = n_196692;
        futhark_mc_task_229461.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229461.free_gtid_208390 = gtid_208390;
        futhark_mc_task_229461.free_x_208395 = x_208395;
        futhark_mc_task_229461.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229461.free_mem_213425 = mem_213425.mem;
        futhark_mc_task_229461.free_x_227318 = x_227318;
        futhark_mc_task_229461.free_x_227319 = x_227319;
        futhark_mc_task_229461.free_defunc_0_g_res_227322 =
            defunc_0_g_res_227322;
        futhark_mc_task_229461.free_mem_227323 = mem_227323;
        futhark_mc_task_229461.free_mem_227324 = mem_227324;
        
        struct scheduler_segop futhark_mc_task_229461_task;
        
        futhark_mc_task_229461_task.args = &futhark_mc_task_229461;
        futhark_mc_task_229461_task.top_level_fn =
            futhark_mc_segmap_task_229462;
        futhark_mc_task_229461_task.name = "futhark_mc_segmap_task_229462";
        futhark_mc_task_229461_task.iterations = q_t_196696;
        futhark_mc_task_229461_task.task_time =
            &ctx->futhark_mc_segmap_task_229462_total_time;
        futhark_mc_task_229461_task.task_iter =
            &ctx->futhark_mc_segmap_task_229462_total_iter;
        futhark_mc_task_229461_task.sched = STATIC;
        futhark_mc_task_229461_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229462_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229461_task);
        
        if (futhark_mc_segmap_task_229462_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float defunc_2_reduce_res_227349;
        float defunc_2_reduce_res_227350;
        float defunc_2_reduce_res_227351;
        float defunc_2_reduce_res_227352;
        float defunc_2_reduce_res_227353;
        int64_t flat_tid_227674 = (int64_t) 0;
        int32_t num_tasks_227735;
        
        defunc_2_reduce_res_227349 = 0.0F;
        defunc_2_reduce_res_227350 = 0.0F;
        defunc_2_reduce_res_227351 = 0.0F;
        defunc_2_reduce_res_227352 = 0.0F;
        defunc_2_reduce_res_227353 = 0.0F;
        
        struct futhark_mc_task_229465 futhark_mc_task_229465;
        
        futhark_mc_task_229465.ctx = ctx;
        futhark_mc_task_229465.free_mem_227323 = mem_227323;
        futhark_mc_task_229465.free_mem_227324 = mem_227324;
        futhark_mc_task_229465.retval_defunc_2_reduce_res_227349 =
            &defunc_2_reduce_res_227349;
        futhark_mc_task_229465.retval_defunc_2_reduce_res_227350 =
            &defunc_2_reduce_res_227350;
        futhark_mc_task_229465.retval_defunc_2_reduce_res_227351 =
            &defunc_2_reduce_res_227351;
        futhark_mc_task_229465.retval_defunc_2_reduce_res_227352 =
            &defunc_2_reduce_res_227352;
        futhark_mc_task_229465.retval_defunc_2_reduce_res_227353 =
            &defunc_2_reduce_res_227353;
        futhark_mc_task_229465.retval_mem_227347 = mem_227347;
        futhark_mc_task_229465.retval_mem_227348 = mem_227348;
        
        struct scheduler_segop futhark_mc_task_229465_task;
        
        futhark_mc_task_229465_task.args = &futhark_mc_task_229465;
        futhark_mc_task_229465_task.top_level_fn =
            futhark_mc_segred_task_229466;
        futhark_mc_task_229465_task.name = "futhark_mc_segred_task_229466";
        futhark_mc_task_229465_task.iterations = q_t_196696;
        futhark_mc_task_229465_task.task_time =
            &ctx->futhark_mc_segred_task_229466_total_time;
        futhark_mc_task_229465_task.task_iter =
            &ctx->futhark_mc_segred_task_229466_total_iter;
        futhark_mc_task_229465_task.sched = STATIC;
        futhark_mc_task_229465_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229466_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229465_task);
        
        if (futhark_mc_segred_task_229466_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float x_227379 = defunc_2_reduce_res_227351 *
              defunc_2_reduce_res_227353;
        float y_227380 = defunc_2_reduce_res_227352 *
              defunc_2_reduce_res_227352;
        float a12_227381 = x_227379 - y_227380;
        float x_227382 = defunc_2_reduce_res_227351 *
              defunc_2_reduce_res_227352;
        float y_227383 = defunc_2_reduce_res_227350 *
              defunc_2_reduce_res_227353;
        float b12_227384 = x_227382 - y_227383;
        float x_227385 = defunc_2_reduce_res_227350 *
              defunc_2_reduce_res_227352;
        float y_227386 = defunc_2_reduce_res_227351 *
              defunc_2_reduce_res_227351;
        float c12_227387 = x_227385 - y_227386;
        float x_227388 = defunc_2_reduce_res_227349 *
              defunc_2_reduce_res_227353;
        float b2_227389 = x_227388 - y_227386;
        float x_227390 = defunc_2_reduce_res_227350 *
              defunc_2_reduce_res_227351;
        float y_227391 = defunc_2_reduce_res_227349 *
              defunc_2_reduce_res_227352;
        float c2_227392 = x_227390 - y_227391;
        float x_227393 = defunc_2_reduce_res_227349 * a12_227381;
        float y_227394 = defunc_2_reduce_res_227350 * b12_227384;
        float x_227395 = x_227393 + y_227394;
        float y_227396 = defunc_2_reduce_res_227351 * c12_227387;
        float y_227397 = x_227395 + y_227396;
        float det_227398 = 1.0F / y_227397;
        float a12_227399 = a12_227381 * det_227398;
        float b12_227400 = b12_227384 * det_227398;
        float c12_227401 = c12_227387 * det_227398;
        float b2_227402 = b2_227389 * det_227398;
        float c2_227403 = c2_227392 * det_227398;
        float defunc_2_reduce_res_227404;
        float defunc_2_reduce_res_227405;
        int64_t flat_tid_227697 = (int64_t) 0;
        int32_t num_tasks_227768;
        
        defunc_2_reduce_res_227404 = 0.0F;
        defunc_2_reduce_res_227405 = 0.0F;
        
        struct futhark_mc_task_229474 futhark_mc_task_229474;
        
        futhark_mc_task_229474.ctx = ctx;
        futhark_mc_task_229474.free_x_208395 = x_208395;
        futhark_mc_task_229474.free_mem_213428 = mem_213428.mem;
        futhark_mc_task_229474.free_x_227318 = x_227318;
        futhark_mc_task_229474.free_mem_227324 = mem_227324;
        futhark_mc_task_229474.free_mem_227347 = mem_227347;
        futhark_mc_task_229474.free_mem_227348 = mem_227348;
        futhark_mc_task_229474.free_a12_227399 = a12_227399;
        futhark_mc_task_229474.free_b12_227400 = b12_227400;
        futhark_mc_task_229474.free_c12_227401 = c12_227401;
        futhark_mc_task_229474.free_b2_227402 = b2_227402;
        futhark_mc_task_229474.free_c2_227403 = c2_227403;
        futhark_mc_task_229474.retval_defunc_2_reduce_res_227404 =
            &defunc_2_reduce_res_227404;
        futhark_mc_task_229474.retval_defunc_2_reduce_res_227405 =
            &defunc_2_reduce_res_227405;
        
        struct scheduler_segop futhark_mc_task_229474_task;
        
        futhark_mc_task_229474_task.args = &futhark_mc_task_229474;
        futhark_mc_task_229474_task.top_level_fn =
            futhark_mc_segred_task_229475;
        futhark_mc_task_229474_task.name = "futhark_mc_segred_task_229475";
        futhark_mc_task_229474_task.iterations = q_t_196696;
        futhark_mc_task_229474_task.task_time =
            &ctx->futhark_mc_segred_task_229475_total_time;
        futhark_mc_task_229474_task.task_iter =
            &ctx->futhark_mc_segred_task_229475_total_iter;
        futhark_mc_task_229474_task.sched = STATIC;
        futhark_mc_task_229474_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229475_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229474_task);
        
        if (futhark_mc_segred_task_229475_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        ((float *) mem_213503.mem)[gtid_227317] = defunc_2_reduce_res_227404;
        ((float *) mem_213506.mem)[gtid_227317] = defunc_2_reduce_res_227405;
    }
    
  cleanup:
    { }
    free(mem_227323);
    free(mem_227324);
    free(mem_227347);
    free(mem_227348);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229456_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229456_end -
                 futhark_mc_segmap_parloop_229456_start;
        
        ctx->futhark_mc_segmap_parloop_229456_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229456_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229456_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229454(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227316 = tid;
    int num_tasks_227570 = info.nsubtasks;
    struct futhark_mc_task_229446 *futhark_mc_task_229446 =
                                  (struct futhark_mc_task_229446 *) args;
    struct futhark_context *ctx = futhark_mc_task_229446->ctx;
    uint64_t futhark_mc_segmap_nested_task_229454_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229454_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229446->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229446->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229446->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229446->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229446->free_i_196779;
    int64_t gtid_208390 = futhark_mc_task_229446->free_gtid_208390;
    int64_t x_208395 = futhark_mc_task_229446->free_x_208395;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229446->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229446->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229446->free_mem_210893,
                                  .size =0, .references =NULL};
    struct memblock mem_213425 = {.desc ="mem_213425", .mem =
                                  futhark_mc_task_229446->free_mem_213425,
                                  .size =0, .references =NULL};
    struct memblock mem_213428 = {.desc ="mem_213428", .mem =
                                  futhark_mc_task_229446->free_mem_213428,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 = futhark_mc_task_229446->free_bytes_213430;
    struct memblock mem_213503 = {.desc ="mem_213503", .mem =
                                  futhark_mc_task_229446->free_mem_213503,
                                  .size =0, .references =NULL};
    struct memblock mem_213506 = {.desc ="mem_213506", .mem =
                                  futhark_mc_task_229446->free_mem_213506,
                                  .size =0, .references =NULL};
    int64_t iter_227653;
    struct futhark_mc_segmap_parloop_struct_229455
    futhark_mc_segmap_parloop_struct_229455;
    
    futhark_mc_segmap_parloop_struct_229455.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229455.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229455.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229455.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229455.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229455.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229455.free_gtid_208390 = gtid_208390;
    futhark_mc_segmap_parloop_struct_229455.free_x_208395 = x_208395;
    futhark_mc_segmap_parloop_struct_229455.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229455.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229455.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229455.free_mem_213425 = mem_213425.mem;
    futhark_mc_segmap_parloop_struct_229455.free_mem_213428 = mem_213428.mem;
    futhark_mc_segmap_parloop_struct_229455.free_bytes_213430 = bytes_213430;
    futhark_mc_segmap_parloop_struct_229455.free_mem_213503 = mem_213503.mem;
    futhark_mc_segmap_parloop_struct_229455.free_mem_213506 = mem_213506.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229456_task;
    
    futhark_mc_segmap_parloop_229456_task.name =
        "futhark_mc_segmap_parloop_229456";
    futhark_mc_segmap_parloop_229456_task.fn = futhark_mc_segmap_parloop_229456;
    futhark_mc_segmap_parloop_229456_task.args =
        &futhark_mc_segmap_parloop_struct_229455;
    futhark_mc_segmap_parloop_229456_task.iterations = iterations;
    futhark_mc_segmap_parloop_229456_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229456_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229456_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229456_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229456_task);
    
    if (futhark_mc_segmap_parloop_229456_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229456_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229456_total_end -
                 futhark_mc_segmap_parloop_229456_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229456_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229456_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229456_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229454_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229454_end -
                 futhark_mc_segmap_nested_task_229454_start;
        
        ctx->futhark_mc_segmap_nested_task_229454_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229454_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229454_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229432(void *args, int64_t start,
                                            int64_t end, int flat_tid_208389,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229431
    *futhark_mc_segmap_parloop_struct_229431 =
    (struct futhark_mc_segmap_parloop_struct_229431 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229431->ctx;
    uint64_t futhark_mc_segmap_parloop_229432_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229432_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229431->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229431->free_n_196692;
    int64_t q_t_196696 =
            futhark_mc_segmap_parloop_struct_229431->free_q_t_196696;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229431->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229431->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229431->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229431->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 =
            futhark_mc_segmap_parloop_struct_229431->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_segmap_parloop_struct_229431->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_segmap_parloop_struct_229431->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_segmap_parloop_struct_229431->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_segmap_parloop_struct_229431->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229431->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 =
            futhark_mc_segmap_parloop_struct_229431->free_bytes_213430;
    struct memblock mem_213645 = {.desc ="mem_213645", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_213645,
                                  .size =0, .references =NULL};
    struct memblock mem_213649 = {.desc ="mem_213649", .mem =
                                  futhark_mc_segmap_parloop_struct_229431->free_mem_213649,
                                  .size =0, .references =NULL};
    size_t mem_213422_cached_sizze_229433 = 0;
    unsigned char *mem_213422 = NULL;
    size_t mem_213425_cached_sizze_229434 = 0;
    unsigned char *mem_213425 = NULL;
    size_t mem_213428_cached_sizze_229435 = 0;
    unsigned char *mem_213428 = NULL;
    size_t mem_213503_cached_sizze_229436 = 0;
    unsigned char *mem_213503 = NULL;
    size_t mem_213506_cached_sizze_229437 = 0;
    unsigned char *mem_213506 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227296 = start;
    
    if (mem_213422_cached_sizze_229433 < (size_t) bytes_210949) {
        mem_213422 = realloc(mem_213422, bytes_210949);
        mem_213422_cached_sizze_229433 = bytes_210949;
    }
    if (mem_213425_cached_sizze_229434 < (size_t) bytes_210949) {
        mem_213425 = realloc(mem_213425, bytes_210949);
        mem_213425_cached_sizze_229434 = bytes_210949;
    }
    if (mem_213428_cached_sizze_229435 < (size_t) bytes_210949) {
        mem_213428 = realloc(mem_213428, bytes_210949);
        mem_213428_cached_sizze_229435 = bytes_210949;
    }
    if (mem_213503_cached_sizze_229436 < (size_t) bytes_210836) {
        mem_213503 = realloc(mem_213503, bytes_210836);
        mem_213503_cached_sizze_229436 = bytes_210836;
    }
    if (mem_213506_cached_sizze_229437 < (size_t) bytes_210836) {
        mem_213506 = realloc(mem_213506, bytes_210836);
        mem_213506_cached_sizze_229437 = bytes_210836;
    }
    for (; iter_227296 < end; iter_227296++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227552 = m_196691;
        int64_t gtid_208390 = iter_227296;
        int64_t remnant_227553 = iter_227296 - gtid_208390;
        int64_t x_208395;
        
        x_208395 = ((int64_t *) mem_210397.mem)[gtid_208390];
        
        int64_t flat_tid_227297 = (int64_t) 0;
        int32_t num_tasks_227554;
        struct futhark_mc_task_229438 futhark_mc_task_229438;
        
        futhark_mc_task_229438.ctx = ctx;
        futhark_mc_task_229438.free_n_196692 = n_196692;
        futhark_mc_task_229438.free_gtid_208390 = gtid_208390;
        futhark_mc_task_229438.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229438.free_mem_212862 = mem_212862.mem;
        futhark_mc_task_229438.free_mem_213422 = mem_213422;
        
        struct scheduler_segop futhark_mc_task_229438_task;
        
        futhark_mc_task_229438_task.args = &futhark_mc_task_229438;
        futhark_mc_task_229438_task.top_level_fn =
            futhark_mc_segmap_task_229439;
        futhark_mc_task_229438_task.name = "futhark_mc_segmap_task_229439";
        futhark_mc_task_229438_task.iterations = n_196692;
        futhark_mc_task_229438_task.task_time =
            &ctx->futhark_mc_segmap_task_229439_total_time;
        futhark_mc_task_229438_task.task_iter =
            &ctx->futhark_mc_segmap_task_229439_total_iter;
        futhark_mc_task_229438_task.sched = STATIC;
        futhark_mc_task_229438_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229439_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229438_task);
        
        if (futhark_mc_segmap_task_229439_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_227302 = (int64_t) 0;
        int32_t num_tasks_227558;
        struct futhark_mc_task_229442 futhark_mc_task_229442;
        
        futhark_mc_task_229442.ctx = ctx;
        futhark_mc_task_229442.free_n_196692 = n_196692;
        futhark_mc_task_229442.free_gtid_208390 = gtid_208390;
        futhark_mc_task_229442.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229442.free_ctx_param_ext_210920 = ctx_param_ext_210920;
        futhark_mc_task_229442.free_ctx_param_ext_210921 = ctx_param_ext_210921;
        futhark_mc_task_229442.free_ctx_param_ext_210923 = ctx_param_ext_210923;
        futhark_mc_task_229442.free_mem_param_210925 = mem_param_210925.mem;
        futhark_mc_task_229442.free_mem_213422 = mem_213422;
        futhark_mc_task_229442.free_mem_213425 = mem_213425;
        futhark_mc_task_229442.free_mem_213428 = mem_213428;
        
        struct scheduler_segop futhark_mc_task_229442_task;
        
        futhark_mc_task_229442_task.args = &futhark_mc_task_229442;
        futhark_mc_task_229442_task.top_level_fn =
            futhark_mc_segmap_task_229443;
        futhark_mc_task_229442_task.name = "futhark_mc_segmap_task_229443";
        futhark_mc_task_229442_task.iterations = n_196692;
        futhark_mc_task_229442_task.task_time =
            &ctx->futhark_mc_segmap_task_229443_total_time;
        futhark_mc_task_229442_task.task_iter =
            &ctx->futhark_mc_segmap_task_229443_total_iter;
        futhark_mc_task_229442_task.sched = STATIC;
        futhark_mc_task_229442_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229443_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229442_task);
        
        if (futhark_mc_segmap_task_229443_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_227433 = (int64_t) 0;
        int32_t num_tasks_227570;
        int64_t flat_tid_227316 = (int64_t) 0;
        struct futhark_mc_task_229446 futhark_mc_task_229446;
        
        futhark_mc_task_229446.ctx = ctx;
        futhark_mc_task_229446.free_n_196692 = n_196692;
        futhark_mc_task_229446.free_q_t_196696 = q_t_196696;
        futhark_mc_task_229446.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229446.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229446.free_i_196779 = i_196779;
        futhark_mc_task_229446.free_gtid_208390 = gtid_208390;
        futhark_mc_task_229446.free_x_208395 = x_208395;
        futhark_mc_task_229446.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229446.free_mem_210889 = mem_210889.mem;
        futhark_mc_task_229446.free_mem_210893 = mem_210893.mem;
        futhark_mc_task_229446.free_mem_213425 = mem_213425;
        futhark_mc_task_229446.free_mem_213428 = mem_213428;
        futhark_mc_task_229446.free_bytes_213430 = bytes_213430;
        futhark_mc_task_229446.free_mem_213503 = mem_213503;
        futhark_mc_task_229446.free_mem_213506 = mem_213506;
        
        struct scheduler_segop futhark_mc_task_229446_task;
        
        futhark_mc_task_229446_task.args = &futhark_mc_task_229446;
        futhark_mc_task_229446_task.top_level_fn =
            futhark_mc_segmap_task_229447;
        futhark_mc_task_229446_task.name = "futhark_mc_segmap_task_229447";
        futhark_mc_task_229446_task.iterations = t_n_m_196759;
        futhark_mc_task_229446_task.task_time =
            &ctx->futhark_mc_segmap_task_229447_total_time;
        futhark_mc_task_229446_task.task_iter =
            &ctx->futhark_mc_segmap_task_229447_total_iter;
        futhark_mc_task_229446_task.sched = STATIC;
        futhark_mc_task_229446_task.nested_fn =
            futhark_mc_segmap_nested_task_229454;
        
        int futhark_mc_segmap_task_229447_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229446_task);
        
        if (futhark_mc_segmap_task_229447_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213645.mem + gtid_208390 * t_n_m_196759 * (int64_t) 4,
                    mem_213503 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
        if (t_n_m_196759 * (int64_t) 4 > 0)
            memmove(mem_213649.mem + gtid_208390 * t_n_m_196759 * (int64_t) 4,
                    mem_213506 + (int64_t) 0, t_n_m_196759 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213422);
    free(mem_213425);
    free(mem_213428);
    free(mem_213503);
    free(mem_213506);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229432_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229432_end -
                 futhark_mc_segmap_parloop_229432_start;
        
        ctx->futhark_mc_segmap_parloop_229432_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229432_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229432_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229430(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208389 = tid;
    int num_tasks_227135 = info.nsubtasks;
    struct futhark_mc_task_229417 *futhark_mc_task_229417 =
                                  (struct futhark_mc_task_229417 *) args;
    struct futhark_context *ctx = futhark_mc_task_229417->ctx;
    uint64_t futhark_mc_segmap_nested_task_229430_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229430_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229417->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229417->free_n_196692;
    int64_t q_t_196696 = futhark_mc_task_229417->free_q_t_196696;
    int64_t jump_t_196702 = futhark_mc_task_229417->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229417->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229417->free_i_196779;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229417->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229417->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_210397 = {.desc ="mem_210397", .mem =
                                  futhark_mc_task_229417->free_mem_210397,
                                  .size =0, .references =NULL};
    int64_t bytes_210836 = futhark_mc_task_229417->free_bytes_210836;
    struct memblock mem_210889 = {.desc ="mem_210889", .mem =
                                  futhark_mc_task_229417->free_mem_210889,
                                  .size =0, .references =NULL};
    struct memblock mem_210893 = {.desc ="mem_210893", .mem =
                                  futhark_mc_task_229417->free_mem_210893,
                                  .size =0, .references =NULL};
    int64_t ctx_param_ext_210920 =
            futhark_mc_task_229417->free_ctx_param_ext_210920;
    int64_t ctx_param_ext_210921 =
            futhark_mc_task_229417->free_ctx_param_ext_210921;
    int64_t ctx_param_ext_210923 =
            futhark_mc_task_229417->free_ctx_param_ext_210923;
    struct memblock mem_param_210925 = {.desc ="mem_param_210925", .mem =
                                        futhark_mc_task_229417->free_mem_param_210925,
                                        .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229417->free_bytes_210949;
    struct memblock mem_212862 = {.desc ="mem_212862", .mem =
                                  futhark_mc_task_229417->free_mem_212862,
                                  .size =0, .references =NULL};
    int64_t bytes_213430 = futhark_mc_task_229417->free_bytes_213430;
    struct memblock mem_213645 = {.desc ="mem_213645", .mem =
                                  futhark_mc_task_229417->free_mem_213645,
                                  .size =0, .references =NULL};
    struct memblock mem_213649 = {.desc ="mem_213649", .mem =
                                  futhark_mc_task_229417->free_mem_213649,
                                  .size =0, .references =NULL};
    int64_t iter_227296;
    struct futhark_mc_segmap_parloop_struct_229431
    futhark_mc_segmap_parloop_struct_229431;
    
    futhark_mc_segmap_parloop_struct_229431.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229431.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229431.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229431.free_q_t_196696 = q_t_196696;
    futhark_mc_segmap_parloop_struct_229431.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229431.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229431.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229431.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229431.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229431.free_mem_210397 = mem_210397.mem;
    futhark_mc_segmap_parloop_struct_229431.free_bytes_210836 = bytes_210836;
    futhark_mc_segmap_parloop_struct_229431.free_mem_210889 = mem_210889.mem;
    futhark_mc_segmap_parloop_struct_229431.free_mem_210893 = mem_210893.mem;
    futhark_mc_segmap_parloop_struct_229431.free_ctx_param_ext_210920 =
        ctx_param_ext_210920;
    futhark_mc_segmap_parloop_struct_229431.free_ctx_param_ext_210921 =
        ctx_param_ext_210921;
    futhark_mc_segmap_parloop_struct_229431.free_ctx_param_ext_210923 =
        ctx_param_ext_210923;
    futhark_mc_segmap_parloop_struct_229431.free_mem_param_210925 =
        mem_param_210925.mem;
    futhark_mc_segmap_parloop_struct_229431.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229431.free_mem_212862 = mem_212862.mem;
    futhark_mc_segmap_parloop_struct_229431.free_bytes_213430 = bytes_213430;
    futhark_mc_segmap_parloop_struct_229431.free_mem_213645 = mem_213645.mem;
    futhark_mc_segmap_parloop_struct_229431.free_mem_213649 = mem_213649.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229432_task;
    
    futhark_mc_segmap_parloop_229432_task.name =
        "futhark_mc_segmap_parloop_229432";
    futhark_mc_segmap_parloop_229432_task.fn = futhark_mc_segmap_parloop_229432;
    futhark_mc_segmap_parloop_229432_task.args =
        &futhark_mc_segmap_parloop_struct_229431;
    futhark_mc_segmap_parloop_229432_task.iterations = iterations;
    futhark_mc_segmap_parloop_229432_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229432_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229432_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229432_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229432_task);
    
    if (futhark_mc_segmap_parloop_229432_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229432_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229432_total_end -
                 futhark_mc_segmap_parloop_229432_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229432_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229432_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229432_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229430_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229430_end -
                 futhark_mc_segmap_nested_task_229430_start;
        
        ctx->futhark_mc_segmap_nested_task_229430_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229430_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229430_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229480 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_y_199696;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213654;
    unsigned char *free_ext_mem_213655;
    unsigned char *free_mem_213677;
};
struct futhark_mc_segmap_parloop_struct_229482 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_y_199696;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213654;
    unsigned char *free_ext_mem_213655;
    unsigned char *free_mem_213677;
};
static int futhark_mc_segmap_parloop_229483(void *args, int64_t start,
                                            int64_t end, int flat_tid_208648,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229482
    *futhark_mc_segmap_parloop_struct_229482 =
    (struct futhark_mc_segmap_parloop_struct_229482 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229482->ctx;
    uint64_t futhark_mc_segmap_parloop_229483_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229483_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229482->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229482->free_n_196692;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229482->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229482->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229482->free_i_196779;
    int64_t y_199696 = futhark_mc_segmap_parloop_struct_229482->free_y_199696;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229482->free_bytes_210949;
    struct memblock ext_mem_213654 = {.desc ="ext_mem_213654", .mem =
                                      futhark_mc_segmap_parloop_struct_229482->free_ext_mem_213654,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213655 = {.desc ="ext_mem_213655", .mem =
                                      futhark_mc_segmap_parloop_struct_229482->free_ext_mem_213655,
                                      .size =0, .references =NULL};
    struct memblock mem_213677 = {.desc ="mem_213677", .mem =
                                  futhark_mc_segmap_parloop_struct_229482->free_mem_213677,
                                  .size =0, .references =NULL};
    size_t mem_213661_cached_sizze_229484 = 0;
    unsigned char *mem_213661 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227784 = start;
    
    if (mem_213661_cached_sizze_229484 < (size_t) bytes_210949) {
        mem_213661 = realloc(mem_213661, bytes_210949);
        mem_213661_cached_sizze_229484 = bytes_210949;
    }
    for (; iter_227784 < end; iter_227784++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227834 = m_196691;
        int64_t gtid_208649 = iter_227784;
        int64_t remnant_227835 = iter_227784 - gtid_208649;
        
        for (int64_t i_227785 = 0; i_227785 < n_196692; i_227785++) {
            int64_t m_v_227787 = sdiv64(i_227785, jump_t_196702);
            bool cond_227788 = m_v_227787 == y_199696;
            int64_t j_227789;
            
            if (cond_227788) {
                int64_t j_t_res_227790 = sub64(m_v_227787, (int64_t) 1);
                
                j_227789 = j_t_res_227790;
            } else {
                j_227789 = m_v_227787;
            }
            
            int64_t min_arg_227791 = mul64(jump_t_196702, j_227789);
            int64_t min_res_227792 = smin64(i_196779, min_arg_227791);
            int64_t defunc_0_m_fun_arg_227793 = add64((int64_t) 1, j_227789);
            int64_t min_arg_227794 = mul64(jump_t_196702,
                                           defunc_0_m_fun_arg_227793);
            int64_t min_res_227795 = smin64(i_196779, min_arg_227794);
            int64_t i64_arg_227796 = sub64(min_res_227795, min_res_227792);
            float i64_res_227797 = sitofp_i64_f32(i64_arg_227796);
            int64_t i64_arg_227798 = sub64(i_227785, min_res_227792);
            float i64_res_227799 = sitofp_i64_f32(i64_arg_227798);
            float u_227800 = i64_res_227799 / i64_res_227797;
            float u2_227801 = u_227800 * u_227800;
            float u3_227802 = u_227800 * u2_227801;
            float x_227803 = 2.0F * u3_227802;
            float y_227804 = 3.0F * u2_227801;
            float x_227805 = x_227803 - y_227804;
            float x_227806 = 1.0F + x_227805;
            bool x_227807 = sle64((int64_t) 0, j_227789);
            bool y_227808 = slt64(j_227789, t_n_m_196759);
            bool bounds_check_227809 = x_227807 && y_227808;
            bool index_certs_227810;
            
            if (!bounds_check_227809) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) j_227789,
                              "] out of bounds for array of shape [",
                              (long long) t_n_m_196759, "].",
                              "-> #0  loess.fut:535:27-33\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float y_227811;
            
            y_227811 = ((float *) ext_mem_213655.mem)[gtid_208649 *
                                                      t_n_m_196759 + j_227789];
            
            float x_227812 = x_227806 * y_227811;
            float x_227813 = y_227804 - x_227803;
            bool x_227814 = sle64((int64_t) 0, defunc_0_m_fun_arg_227793);
            bool y_227815 = slt64(defunc_0_m_fun_arg_227793, t_n_m_196759);
            bool bounds_check_227816 = x_227814 && y_227815;
            bool index_certs_227817;
            
            if (!bounds_check_227816) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) defunc_0_m_fun_arg_227793,
                              "] out of bounds for array of shape [",
                              (long long) t_n_m_196759, "].",
                              "-> #0  loess.fut:536:27-37\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float y_227818;
            
            y_227818 = ((float *) ext_mem_213655.mem)[gtid_208649 *
                                                      t_n_m_196759 +
                                                      defunc_0_m_fun_arg_227793];
            
            float y_227819 = x_227813 * y_227818;
            float x_227820 = x_227812 + y_227819;
            float y_227821 = 2.0F * u2_227801;
            float x_227822 = u3_227802 - y_227821;
            float x_227823 = u_227800 + x_227822;
            float y_227824;
            
            y_227824 = ((float *) ext_mem_213654.mem)[gtid_208649 *
                                                      t_n_m_196759 + j_227789];
            
            float x_227825 = x_227823 * y_227824;
            float y_227826 = i64_res_227797 * x_227825;
            float x_227827 = x_227820 + y_227826;
            float x_227828 = u3_227802 - u2_227801;
            float y_227829;
            
            y_227829 = ((float *) ext_mem_213654.mem)[gtid_208649 *
                                                      t_n_m_196759 +
                                                      defunc_0_m_fun_arg_227793];
            
            float x_227830 = x_227828 * y_227829;
            float y_227831 = i64_res_227797 * x_227830;
            float defunc_4_interpolate_proc_res_227832 = x_227827 + y_227831;
            
            ((float *) mem_213661)[i_227785] =
                defunc_4_interpolate_proc_res_227832;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213677.mem + gtid_208649 * n_196692 * (int64_t) 4,
                    mem_213661 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213661);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229483_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229483_end -
                 futhark_mc_segmap_parloop_229483_start;
        
        ctx->futhark_mc_segmap_parloop_229483_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229483_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229483_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229481(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208648 = tid;
    int num_tasks_227783 = info.nsubtasks;
    struct futhark_mc_task_229480 *futhark_mc_task_229480 =
                                  (struct futhark_mc_task_229480 *) args;
    struct futhark_context *ctx = futhark_mc_task_229480->ctx;
    uint64_t futhark_mc_segmap_task_229481_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229481_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229480->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229480->free_n_196692;
    int64_t jump_t_196702 = futhark_mc_task_229480->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229480->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229480->free_i_196779;
    int64_t y_199696 = futhark_mc_task_229480->free_y_199696;
    int64_t bytes_210949 = futhark_mc_task_229480->free_bytes_210949;
    struct memblock ext_mem_213654 = {.desc ="ext_mem_213654", .mem =
                                      futhark_mc_task_229480->free_ext_mem_213654,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213655 = {.desc ="ext_mem_213655", .mem =
                                      futhark_mc_task_229480->free_ext_mem_213655,
                                      .size =0, .references =NULL};
    struct memblock mem_213677 = {.desc ="mem_213677", .mem =
                                  futhark_mc_task_229480->free_mem_213677,
                                  .size =0, .references =NULL};
    int64_t iter_227784;
    struct futhark_mc_segmap_parloop_struct_229482
    futhark_mc_segmap_parloop_struct_229482;
    
    futhark_mc_segmap_parloop_struct_229482.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229482.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229482.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229482.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229482.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229482.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229482.free_y_199696 = y_199696;
    futhark_mc_segmap_parloop_struct_229482.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229482.free_ext_mem_213654 =
        ext_mem_213654.mem;
    futhark_mc_segmap_parloop_struct_229482.free_ext_mem_213655 =
        ext_mem_213655.mem;
    futhark_mc_segmap_parloop_struct_229482.free_mem_213677 = mem_213677.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229483_task;
    
    futhark_mc_segmap_parloop_229483_task.name =
        "futhark_mc_segmap_parloop_229483";
    futhark_mc_segmap_parloop_229483_task.fn = futhark_mc_segmap_parloop_229483;
    futhark_mc_segmap_parloop_229483_task.args =
        &futhark_mc_segmap_parloop_struct_229482;
    futhark_mc_segmap_parloop_229483_task.iterations = iterations;
    futhark_mc_segmap_parloop_229483_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229483_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229483_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229483_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229483_task);
    
    if (futhark_mc_segmap_parloop_229483_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229483_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229483_total_end -
                 futhark_mc_segmap_parloop_229483_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229483_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229483_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229483_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229481_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229481_end -
                 futhark_mc_segmap_task_229481_start;
        
        ctx->futhark_mc_segmap_task_229481_runs[tid]++;
        ctx->futhark_mc_segmap_task_229481_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229481_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229486 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_y_199696;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213654;
    unsigned char *free_ext_mem_213655;
    unsigned char *free_mem_213677;
};
struct futhark_mc_task_229489 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_y_199696;
    int64_t free_gtid_208655;
    unsigned char *free_ext_mem_213654;
    unsigned char *free_ext_mem_213655;
    unsigned char *free_mem_213658;
};
struct futhark_mc_segmap_parloop_struct_229491 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_jump_t_196702;
    int64_t free_t_n_m_196759;
    int64_t free_i_196779;
    int64_t free_y_199696;
    int64_t free_gtid_208655;
    unsigned char *free_ext_mem_213654;
    unsigned char *free_ext_mem_213655;
    unsigned char *free_mem_213658;
};
static int futhark_mc_segmap_parloop_229492(void *args, int64_t start,
                                            int64_t end, int flat_tid_227838,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229491
    *futhark_mc_segmap_parloop_struct_229491 =
    (struct futhark_mc_segmap_parloop_struct_229491 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229491->ctx;
    uint64_t futhark_mc_segmap_parloop_229492_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229492_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229491->free_n_196692;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229491->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229491->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229491->free_i_196779;
    int64_t y_199696 = futhark_mc_segmap_parloop_struct_229491->free_y_199696;
    int64_t gtid_208655 =
            futhark_mc_segmap_parloop_struct_229491->free_gtid_208655;
    struct memblock ext_mem_213654 = {.desc ="ext_mem_213654", .mem =
                                      futhark_mc_segmap_parloop_struct_229491->free_ext_mem_213654,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213655 = {.desc ="ext_mem_213655", .mem =
                                      futhark_mc_segmap_parloop_struct_229491->free_ext_mem_213655,
                                      .size =0, .references =NULL};
    struct memblock mem_213658 = {.desc ="mem_213658", .mem =
                                  futhark_mc_segmap_parloop_struct_229491->free_mem_213658,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227889 = start;
    
    for (; iter_227889 < end; iter_227889++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227891 = n_196692;
        int64_t gtid_227839 = iter_227889;
        int64_t remnant_227892 = iter_227889 - gtid_227839;
        int64_t m_v_227840 = sdiv64(gtid_227839, jump_t_196702);
        bool cond_227841 = m_v_227840 == y_199696;
        int64_t j_227842;
        
        if (cond_227841) {
            int64_t j_t_res_227890 = sub64(m_v_227840, (int64_t) 1);
            
            j_227842 = j_t_res_227890;
        } else {
            j_227842 = m_v_227840;
        }
        
        int64_t min_arg_227844 = mul64(jump_t_196702, j_227842);
        int64_t min_res_227845 = smin64(i_196779, min_arg_227844);
        int64_t defunc_0_m_fun_arg_227846 = add64((int64_t) 1, j_227842);
        int64_t min_arg_227847 = mul64(jump_t_196702,
                                       defunc_0_m_fun_arg_227846);
        int64_t min_res_227848 = smin64(i_196779, min_arg_227847);
        int64_t i64_arg_227849 = sub64(min_res_227848, min_res_227845);
        float i64_res_227850 = sitofp_i64_f32(i64_arg_227849);
        int64_t i64_arg_227851 = sub64(gtid_227839, min_res_227845);
        float i64_res_227852 = sitofp_i64_f32(i64_arg_227851);
        float u_227853 = i64_res_227852 / i64_res_227850;
        float u2_227854 = u_227853 * u_227853;
        float u3_227855 = u_227853 * u2_227854;
        float x_227856 = 2.0F * u3_227855;
        float y_227857 = 3.0F * u2_227854;
        float x_227858 = x_227856 - y_227857;
        float x_227859 = 1.0F + x_227858;
        bool x_227860 = sle64((int64_t) 0, j_227842);
        bool y_227861 = slt64(j_227842, t_n_m_196759);
        bool bounds_check_227862 = x_227860 && y_227861;
        bool index_certs_227863;
        
        if (!bounds_check_227862) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [", (long long) j_227842,
                                   "] out of bounds for array of shape [",
                                   (long long) t_n_m_196759, "].",
                                   "-> #0  loess.fut:535:27-33\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        float y_227864;
        
        y_227864 = ((float *) ext_mem_213655.mem)[gtid_208655 * t_n_m_196759 +
                                                  j_227842];
        
        float x_227865 = x_227859 * y_227864;
        float x_227866 = y_227857 - x_227856;
        bool x_227867 = sle64((int64_t) 0, defunc_0_m_fun_arg_227846);
        bool y_227868 = slt64(defunc_0_m_fun_arg_227846, t_n_m_196759);
        bool bounds_check_227869 = x_227867 && y_227868;
        bool index_certs_227870;
        
        if (!bounds_check_227869) {
            ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                   "Index [",
                                   (long long) defunc_0_m_fun_arg_227846,
                                   "] out of bounds for array of shape [",
                                   (long long) t_n_m_196759, "].",
                                   "-> #0  loess.fut:536:27-37\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
            err = 1;
            goto cleanup;
        }
        
        float y_227871;
        
        y_227871 = ((float *) ext_mem_213655.mem)[gtid_208655 * t_n_m_196759 +
                                                  defunc_0_m_fun_arg_227846];
        
        float y_227872 = x_227866 * y_227871;
        float x_227873 = x_227865 + y_227872;
        float y_227874 = 2.0F * u2_227854;
        float x_227875 = u3_227855 - y_227874;
        float x_227876 = u_227853 + x_227875;
        float y_227877;
        
        y_227877 = ((float *) ext_mem_213654.mem)[gtid_208655 * t_n_m_196759 +
                                                  j_227842];
        
        float x_227878 = x_227876 * y_227877;
        float y_227879 = i64_res_227850 * x_227878;
        float x_227880 = x_227873 + y_227879;
        float x_227881 = u3_227855 - u2_227854;
        float y_227882;
        
        y_227882 = ((float *) ext_mem_213654.mem)[gtid_208655 * t_n_m_196759 +
                                                  defunc_0_m_fun_arg_227846];
        
        float x_227883 = x_227881 * y_227882;
        float y_227884 = i64_res_227850 * x_227883;
        float defunc_4_interpolate_proc_res_227885 = x_227880 + y_227884;
        
        ((float *) mem_213658.mem)[gtid_227839] =
            defunc_4_interpolate_proc_res_227885;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229492_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229492_end -
                 futhark_mc_segmap_parloop_229492_start;
        
        ctx->futhark_mc_segmap_parloop_229492_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229492_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229492_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229490(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227838 = tid;
    int num_tasks_227888 = info.nsubtasks;
    struct futhark_mc_task_229489 *futhark_mc_task_229489 =
                                  (struct futhark_mc_task_229489 *) args;
    struct futhark_context *ctx = futhark_mc_task_229489->ctx;
    uint64_t futhark_mc_segmap_task_229490_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229490_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229489->free_n_196692;
    int64_t jump_t_196702 = futhark_mc_task_229489->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229489->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229489->free_i_196779;
    int64_t y_199696 = futhark_mc_task_229489->free_y_199696;
    int64_t gtid_208655 = futhark_mc_task_229489->free_gtid_208655;
    struct memblock ext_mem_213654 = {.desc ="ext_mem_213654", .mem =
                                      futhark_mc_task_229489->free_ext_mem_213654,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213655 = {.desc ="ext_mem_213655", .mem =
                                      futhark_mc_task_229489->free_ext_mem_213655,
                                      .size =0, .references =NULL};
    struct memblock mem_213658 = {.desc ="mem_213658", .mem =
                                  futhark_mc_task_229489->free_mem_213658,
                                  .size =0, .references =NULL};
    int64_t iter_227889;
    struct futhark_mc_segmap_parloop_struct_229491
    futhark_mc_segmap_parloop_struct_229491;
    
    futhark_mc_segmap_parloop_struct_229491.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229491.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229491.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229491.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229491.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229491.free_y_199696 = y_199696;
    futhark_mc_segmap_parloop_struct_229491.free_gtid_208655 = gtid_208655;
    futhark_mc_segmap_parloop_struct_229491.free_ext_mem_213654 =
        ext_mem_213654.mem;
    futhark_mc_segmap_parloop_struct_229491.free_ext_mem_213655 =
        ext_mem_213655.mem;
    futhark_mc_segmap_parloop_struct_229491.free_mem_213658 = mem_213658.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229492_task;
    
    futhark_mc_segmap_parloop_229492_task.name =
        "futhark_mc_segmap_parloop_229492";
    futhark_mc_segmap_parloop_229492_task.fn = futhark_mc_segmap_parloop_229492;
    futhark_mc_segmap_parloop_229492_task.args =
        &futhark_mc_segmap_parloop_struct_229491;
    futhark_mc_segmap_parloop_229492_task.iterations = iterations;
    futhark_mc_segmap_parloop_229492_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229492_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229492_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229492_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229492_task);
    
    if (futhark_mc_segmap_parloop_229492_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229492_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229492_total_end -
                 futhark_mc_segmap_parloop_229492_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229492_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229492_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229492_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229490_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229490_end -
                 futhark_mc_segmap_task_229490_start;
        
        ctx->futhark_mc_segmap_task_229490_runs[tid]++;
        ctx->futhark_mc_segmap_task_229490_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229490_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229487(void *args, int64_t start,
                                            int64_t end, int flat_tid_208654,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229486
    *futhark_mc_segmap_parloop_struct_229486 =
    (struct futhark_mc_segmap_parloop_struct_229486 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229486->ctx;
    uint64_t futhark_mc_segmap_parloop_229487_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229487_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229486->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229486->free_n_196692;
    int64_t jump_t_196702 =
            futhark_mc_segmap_parloop_struct_229486->free_jump_t_196702;
    int64_t t_n_m_196759 =
            futhark_mc_segmap_parloop_struct_229486->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229486->free_i_196779;
    int64_t y_199696 = futhark_mc_segmap_parloop_struct_229486->free_y_199696;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229486->free_bytes_210949;
    struct memblock ext_mem_213654 = {.desc ="ext_mem_213654", .mem =
                                      futhark_mc_segmap_parloop_struct_229486->free_ext_mem_213654,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213655 = {.desc ="ext_mem_213655", .mem =
                                      futhark_mc_segmap_parloop_struct_229486->free_ext_mem_213655,
                                      .size =0, .references =NULL};
    struct memblock mem_213677 = {.desc ="mem_213677", .mem =
                                  futhark_mc_segmap_parloop_struct_229486->free_mem_213677,
                                  .size =0, .references =NULL};
    size_t mem_213658_cached_sizze_229488 = 0;
    unsigned char *mem_213658 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227837 = start;
    
    if (mem_213658_cached_sizze_229488 < (size_t) bytes_210949) {
        mem_213658 = realloc(mem_213658, bytes_210949);
        mem_213658_cached_sizze_229488 = bytes_210949;
    }
    for (; iter_227837 < end; iter_227837++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227886 = m_196691;
        int64_t gtid_208655 = iter_227837;
        int64_t remnant_227887 = iter_227837 - gtid_208655;
        int64_t flat_tid_227838 = (int64_t) 0;
        int32_t num_tasks_227888;
        struct futhark_mc_task_229489 futhark_mc_task_229489;
        
        futhark_mc_task_229489.ctx = ctx;
        futhark_mc_task_229489.free_n_196692 = n_196692;
        futhark_mc_task_229489.free_jump_t_196702 = jump_t_196702;
        futhark_mc_task_229489.free_t_n_m_196759 = t_n_m_196759;
        futhark_mc_task_229489.free_i_196779 = i_196779;
        futhark_mc_task_229489.free_y_199696 = y_199696;
        futhark_mc_task_229489.free_gtid_208655 = gtid_208655;
        futhark_mc_task_229489.free_ext_mem_213654 = ext_mem_213654.mem;
        futhark_mc_task_229489.free_ext_mem_213655 = ext_mem_213655.mem;
        futhark_mc_task_229489.free_mem_213658 = mem_213658;
        
        struct scheduler_segop futhark_mc_task_229489_task;
        
        futhark_mc_task_229489_task.args = &futhark_mc_task_229489;
        futhark_mc_task_229489_task.top_level_fn =
            futhark_mc_segmap_task_229490;
        futhark_mc_task_229489_task.name = "futhark_mc_segmap_task_229490";
        futhark_mc_task_229489_task.iterations = n_196692;
        futhark_mc_task_229489_task.task_time =
            &ctx->futhark_mc_segmap_task_229490_total_time;
        futhark_mc_task_229489_task.task_iter =
            &ctx->futhark_mc_segmap_task_229490_total_iter;
        futhark_mc_task_229489_task.sched = STATIC;
        futhark_mc_task_229489_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229490_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229489_task);
        
        if (futhark_mc_segmap_task_229490_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213677.mem + gtid_208655 * n_196692 * (int64_t) 4,
                    mem_213658 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213658);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229487_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229487_end -
                 futhark_mc_segmap_parloop_229487_start;
        
        ctx->futhark_mc_segmap_parloop_229487_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229487_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229487_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229485(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208654 = tid;
    int num_tasks_227783 = info.nsubtasks;
    struct futhark_mc_task_229480 *futhark_mc_task_229480 =
                                  (struct futhark_mc_task_229480 *) args;
    struct futhark_context *ctx = futhark_mc_task_229480->ctx;
    uint64_t futhark_mc_segmap_nested_task_229485_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229485_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229480->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229480->free_n_196692;
    int64_t jump_t_196702 = futhark_mc_task_229480->free_jump_t_196702;
    int64_t t_n_m_196759 = futhark_mc_task_229480->free_t_n_m_196759;
    int64_t i_196779 = futhark_mc_task_229480->free_i_196779;
    int64_t y_199696 = futhark_mc_task_229480->free_y_199696;
    int64_t bytes_210949 = futhark_mc_task_229480->free_bytes_210949;
    struct memblock ext_mem_213654 = {.desc ="ext_mem_213654", .mem =
                                      futhark_mc_task_229480->free_ext_mem_213654,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213655 = {.desc ="ext_mem_213655", .mem =
                                      futhark_mc_task_229480->free_ext_mem_213655,
                                      .size =0, .references =NULL};
    struct memblock mem_213677 = {.desc ="mem_213677", .mem =
                                  futhark_mc_task_229480->free_mem_213677,
                                  .size =0, .references =NULL};
    int64_t iter_227837;
    struct futhark_mc_segmap_parloop_struct_229486
    futhark_mc_segmap_parloop_struct_229486;
    
    futhark_mc_segmap_parloop_struct_229486.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229486.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229486.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229486.free_jump_t_196702 = jump_t_196702;
    futhark_mc_segmap_parloop_struct_229486.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_segmap_parloop_struct_229486.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229486.free_y_199696 = y_199696;
    futhark_mc_segmap_parloop_struct_229486.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229486.free_ext_mem_213654 =
        ext_mem_213654.mem;
    futhark_mc_segmap_parloop_struct_229486.free_ext_mem_213655 =
        ext_mem_213655.mem;
    futhark_mc_segmap_parloop_struct_229486.free_mem_213677 = mem_213677.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229487_task;
    
    futhark_mc_segmap_parloop_229487_task.name =
        "futhark_mc_segmap_parloop_229487";
    futhark_mc_segmap_parloop_229487_task.fn = futhark_mc_segmap_parloop_229487;
    futhark_mc_segmap_parloop_229487_task.args =
        &futhark_mc_segmap_parloop_struct_229486;
    futhark_mc_segmap_parloop_229487_task.iterations = iterations;
    futhark_mc_segmap_parloop_229487_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229487_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229487_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229487_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229487_task);
    
    if (futhark_mc_segmap_parloop_229487_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229487_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229487_total_end -
                 futhark_mc_segmap_parloop_229487_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229487_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229487_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229487_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229485_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229485_end -
                 futhark_mc_segmap_nested_task_229485_start;
        
        ctx->futhark_mc_segmap_nested_task_229485_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229485_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229485_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229493 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213684;
    unsigned char *free_ext_mem_213685;
    int64_t free_ext_213689;
    unsigned char *free_mem_213739;
    unsigned char *free_mem_213743;
};
struct futhark_mc_segmap_parloop_struct_229495 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213684;
    unsigned char *free_ext_mem_213685;
    int64_t free_ext_213689;
    unsigned char *free_mem_213739;
    unsigned char *free_mem_213743;
};
static int futhark_mc_segmap_parloop_229496(void *args, int64_t start,
                                            int64_t end, int flat_tid_208708,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229495
    *futhark_mc_segmap_parloop_struct_229495 =
    (struct futhark_mc_segmap_parloop_struct_229495 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229495->ctx;
    uint64_t futhark_mc_segmap_parloop_229496_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229496_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229495->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229495->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229495->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229495->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229495->free_bytes_210949;
    struct memblock ext_mem_213684 = {.desc ="ext_mem_213684", .mem =
                                      futhark_mc_segmap_parloop_struct_229495->free_ext_mem_213684,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213685 = {.desc ="ext_mem_213685", .mem =
                                      futhark_mc_segmap_parloop_struct_229495->free_ext_mem_213685,
                                      .size =0, .references =NULL};
    int64_t ext_213689 =
            futhark_mc_segmap_parloop_struct_229495->free_ext_213689;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_segmap_parloop_struct_229495->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_segmap_parloop_struct_229495->free_mem_213743,
                                  .size =0, .references =NULL};
    size_t mem_213708_cached_sizze_229497 = 0;
    unsigned char *mem_213708 = NULL;
    size_t mem_213723_cached_sizze_229498 = 0;
    unsigned char *mem_213723 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227894 = start;
    
    if (mem_213708_cached_sizze_229497 < (size_t) bytes_210949) {
        mem_213708 = realloc(mem_213708, bytes_210949);
        mem_213708_cached_sizze_229497 = bytes_210949;
    }
    if (mem_213723_cached_sizze_229498 < (size_t) bytes_210949) {
        mem_213723 = realloc(mem_213723, bytes_210949);
        mem_213723_cached_sizze_229498 = bytes_210949;
    }
    for (; iter_227894 < end; iter_227894++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227916 = m_196691;
        int64_t gtid_208709 = iter_227894;
        int64_t remnant_227917 = iter_227894 - gtid_208709;
        
        for (int64_t i_227895 = 0; i_227895 < n_196692; i_227895++) {
            float x_227897;
            
            x_227897 = ((float *) Y_mem_210354.mem)[gtid_208709 * n_196692 +
                                                    i_227895];
            
            float x_227898;
            
            x_227898 = ((float *) ext_mem_213685.mem)[gtid_208709 * n_196692 +
                                                      i_227895];
            
            float x_227899;
            
            x_227899 = ((float *) ext_mem_213684.mem)[gtid_208709 * ext_213689 +
                                                      i_227895];
            
            float x_227900 = x_227897 - x_227898;
            float defunc_2_f_res_227901 = x_227900 - x_227899;
            bool isnan_res_227902;
            
            isnan_res_227902 = futrts_isnan32(defunc_2_f_res_227901);
            
            float defunc_0_f_res_227903;
            
            if (isnan_res_227902) {
                defunc_0_f_res_227903 = defunc_2_f_res_227901;
            } else {
                float abs_res_227904 = (float) fabs(defunc_2_f_res_227901);
                
                defunc_0_f_res_227903 = abs_res_227904;
            }
            ((float *) mem_213708)[i_227895] = defunc_0_f_res_227903;
        }
        for (int64_t i_227906 = 0; i_227906 < n_196692; i_227906++) {
            int64_t x_227908;
            
            x_227908 = ((int64_t *) mem_210394.mem)[gtid_208709 * n_196692 +
                                                    i_227906];
            
            bool cond_227909 = sle64((int64_t) 0, x_227908);
            float defunc_0_f_res_227910;
            
            if (cond_227909) {
                bool y_227911 = slt64(x_227908, n_196692);
                bool bounds_check_227912 = cond_227909 && y_227911;
                bool index_certs_227913;
                
                if (!bounds_check_227912) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Index [", (long long) x_227908,
                                  "] out of bounds for array of shape [",
                                  (long long) n_196692, "].",
                                  "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:401:3-415:29\n   #7  stl.fut:385:1-415:29\n");
                    err = 1;
                    goto cleanup;
                }
                
                float defunc_0_f_res_t_res_227914;
                
                defunc_0_f_res_t_res_227914 = ((float *) mem_213708)[x_227908];
                defunc_0_f_res_227910 = defunc_0_f_res_t_res_227914;
            } else {
                defunc_0_f_res_227910 = INFINITY;
            }
            ((float *) mem_213723)[i_227906] = defunc_0_f_res_227910;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213739.mem + gtid_208709 * n_196692 * (int64_t) 4,
                    mem_213723 + (int64_t) 0, n_196692 * (int64_t) 4);
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213743.mem + gtid_208709 * n_196692 * (int64_t) 4,
                    mem_213708 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213708);
    free(mem_213723);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229496_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229496_end -
                 futhark_mc_segmap_parloop_229496_start;
        
        ctx->futhark_mc_segmap_parloop_229496_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229496_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229496_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229494(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208708 = tid;
    int num_tasks_227893 = info.nsubtasks;
    struct futhark_mc_task_229493 *futhark_mc_task_229493 =
                                  (struct futhark_mc_task_229493 *) args;
    struct futhark_context *ctx = futhark_mc_task_229493->ctx;
    uint64_t futhark_mc_segmap_task_229494_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229494_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229493->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229493->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229493->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229493->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229493->free_bytes_210949;
    struct memblock ext_mem_213684 = {.desc ="ext_mem_213684", .mem =
                                      futhark_mc_task_229493->free_ext_mem_213684,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213685 = {.desc ="ext_mem_213685", .mem =
                                      futhark_mc_task_229493->free_ext_mem_213685,
                                      .size =0, .references =NULL};
    int64_t ext_213689 = futhark_mc_task_229493->free_ext_213689;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_task_229493->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_task_229493->free_mem_213743,
                                  .size =0, .references =NULL};
    int64_t iter_227894;
    struct futhark_mc_segmap_parloop_struct_229495
    futhark_mc_segmap_parloop_struct_229495;
    
    futhark_mc_segmap_parloop_struct_229495.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229495.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229495.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229495.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229495.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229495.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229495.free_ext_mem_213684 =
        ext_mem_213684.mem;
    futhark_mc_segmap_parloop_struct_229495.free_ext_mem_213685 =
        ext_mem_213685.mem;
    futhark_mc_segmap_parloop_struct_229495.free_ext_213689 = ext_213689;
    futhark_mc_segmap_parloop_struct_229495.free_mem_213739 = mem_213739.mem;
    futhark_mc_segmap_parloop_struct_229495.free_mem_213743 = mem_213743.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229496_task;
    
    futhark_mc_segmap_parloop_229496_task.name =
        "futhark_mc_segmap_parloop_229496";
    futhark_mc_segmap_parloop_229496_task.fn = futhark_mc_segmap_parloop_229496;
    futhark_mc_segmap_parloop_229496_task.args =
        &futhark_mc_segmap_parloop_struct_229495;
    futhark_mc_segmap_parloop_229496_task.iterations = iterations;
    futhark_mc_segmap_parloop_229496_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229496_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229496_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229496_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229496_task);
    
    if (futhark_mc_segmap_parloop_229496_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229496_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229496_total_end -
                 futhark_mc_segmap_parloop_229496_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229496_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229496_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229496_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229494_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229494_end -
                 futhark_mc_segmap_task_229494_start;
        
        ctx->futhark_mc_segmap_task_229494_runs[tid]++;
        ctx->futhark_mc_segmap_task_229494_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229494_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229500 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_mem_210394;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213684;
    unsigned char *free_ext_mem_213685;
    int64_t free_ext_213689;
    unsigned char *free_mem_213739;
    unsigned char *free_mem_213743;
};
struct futhark_mc_task_229504 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208717;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_ext_mem_213684;
    unsigned char *free_ext_mem_213685;
    int64_t free_ext_213689;
    unsigned char *free_mem_213702;
};
struct futhark_mc_segmap_parloop_struct_229506 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208717;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_ext_mem_213684;
    unsigned char *free_ext_mem_213685;
    int64_t free_ext_213689;
    unsigned char *free_mem_213702;
};
static int futhark_mc_segmap_parloop_229507(void *args, int64_t start,
                                            int64_t end, int flat_tid_227921,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229506
    *futhark_mc_segmap_parloop_struct_229506 =
    (struct futhark_mc_segmap_parloop_struct_229506 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229506->ctx;
    uint64_t futhark_mc_segmap_parloop_229507_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229507_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229506->free_n_196692;
    int64_t gtid_208717 =
            futhark_mc_segmap_parloop_struct_229506->free_gtid_208717;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229506->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock ext_mem_213684 = {.desc ="ext_mem_213684", .mem =
                                      futhark_mc_segmap_parloop_struct_229506->free_ext_mem_213684,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213685 = {.desc ="ext_mem_213685", .mem =
                                      futhark_mc_segmap_parloop_struct_229506->free_ext_mem_213685,
                                      .size =0, .references =NULL};
    int64_t ext_213689 =
            futhark_mc_segmap_parloop_struct_229506->free_ext_213689;
    struct memblock mem_213702 = {.desc ="mem_213702", .mem =
                                  futhark_mc_segmap_parloop_struct_229506->free_mem_213702,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227943 = start;
    
    for (; iter_227943 < end; iter_227943++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227945 = n_196692;
        int64_t gtid_227922 = iter_227943;
        int64_t remnant_227946 = iter_227943 - gtid_227922;
        float x_227923;
        
        x_227923 = ((float *) Y_mem_210354.mem)[gtid_208717 * n_196692 +
                                                gtid_227922];
        
        float x_227924;
        
        x_227924 = ((float *) ext_mem_213685.mem)[gtid_208717 * n_196692 +
                                                  gtid_227922];
        
        float x_227925;
        
        x_227925 = ((float *) ext_mem_213684.mem)[gtid_208717 * ext_213689 +
                                                  gtid_227922];
        
        float x_227926 = x_227923 - x_227924;
        float defunc_2_f_res_227927 = x_227926 - x_227925;
        bool isnan_res_227928;
        
        isnan_res_227928 = futrts_isnan32(defunc_2_f_res_227927);
        
        float defunc_0_f_res_227929;
        
        if (isnan_res_227928) {
            defunc_0_f_res_227929 = defunc_2_f_res_227927;
        } else {
            float abs_res_227944 = (float) fabs(defunc_2_f_res_227927);
            
            defunc_0_f_res_227929 = abs_res_227944;
        }
        ((float *) mem_213702.mem)[gtid_227922] = defunc_0_f_res_227929;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229507_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229507_end -
                 futhark_mc_segmap_parloop_229507_start;
        
        ctx->futhark_mc_segmap_parloop_229507_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229507_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229507_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229505(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227921 = tid;
    int num_tasks_227942 = info.nsubtasks;
    struct futhark_mc_task_229504 *futhark_mc_task_229504 =
                                  (struct futhark_mc_task_229504 *) args;
    struct futhark_context *ctx = futhark_mc_task_229504->ctx;
    uint64_t futhark_mc_segmap_task_229505_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229505_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229504->free_n_196692;
    int64_t gtid_208717 = futhark_mc_task_229504->free_gtid_208717;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229504->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock ext_mem_213684 = {.desc ="ext_mem_213684", .mem =
                                      futhark_mc_task_229504->free_ext_mem_213684,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213685 = {.desc ="ext_mem_213685", .mem =
                                      futhark_mc_task_229504->free_ext_mem_213685,
                                      .size =0, .references =NULL};
    int64_t ext_213689 = futhark_mc_task_229504->free_ext_213689;
    struct memblock mem_213702 = {.desc ="mem_213702", .mem =
                                  futhark_mc_task_229504->free_mem_213702,
                                  .size =0, .references =NULL};
    int64_t iter_227943;
    struct futhark_mc_segmap_parloop_struct_229506
    futhark_mc_segmap_parloop_struct_229506;
    
    futhark_mc_segmap_parloop_struct_229506.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229506.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229506.free_gtid_208717 = gtid_208717;
    futhark_mc_segmap_parloop_struct_229506.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229506.free_ext_mem_213684 =
        ext_mem_213684.mem;
    futhark_mc_segmap_parloop_struct_229506.free_ext_mem_213685 =
        ext_mem_213685.mem;
    futhark_mc_segmap_parloop_struct_229506.free_ext_213689 = ext_213689;
    futhark_mc_segmap_parloop_struct_229506.free_mem_213702 = mem_213702.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229507_task;
    
    futhark_mc_segmap_parloop_229507_task.name =
        "futhark_mc_segmap_parloop_229507";
    futhark_mc_segmap_parloop_229507_task.fn = futhark_mc_segmap_parloop_229507;
    futhark_mc_segmap_parloop_229507_task.args =
        &futhark_mc_segmap_parloop_struct_229506;
    futhark_mc_segmap_parloop_229507_task.iterations = iterations;
    futhark_mc_segmap_parloop_229507_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229507_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229507_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229507_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229507_task);
    
    if (futhark_mc_segmap_parloop_229507_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229507_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229507_total_end -
                 futhark_mc_segmap_parloop_229507_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229507_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229507_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229507_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229505_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229505_end -
                 futhark_mc_segmap_task_229505_start;
        
        ctx->futhark_mc_segmap_task_229505_runs[tid]++;
        ctx->futhark_mc_segmap_task_229505_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229505_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229508 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208717;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213702;
    unsigned char *free_mem_213705;
};
struct futhark_mc_segmap_parloop_struct_229510 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208717;
    unsigned char *free_mem_210394;
    unsigned char *free_mem_213702;
    unsigned char *free_mem_213705;
};
static int futhark_mc_segmap_parloop_229511(void *args, int64_t start,
                                            int64_t end, int flat_tid_227931,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229510
    *futhark_mc_segmap_parloop_struct_229510 =
    (struct futhark_mc_segmap_parloop_struct_229510 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229510->ctx;
    uint64_t futhark_mc_segmap_parloop_229511_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229511_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229510->free_n_196692;
    int64_t gtid_208717 =
            futhark_mc_segmap_parloop_struct_229510->free_gtid_208717;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229510->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213702 = {.desc ="mem_213702", .mem =
                                  futhark_mc_segmap_parloop_struct_229510->free_mem_213702,
                                  .size =0, .references =NULL};
    struct memblock mem_213705 = {.desc ="mem_213705", .mem =
                                  futhark_mc_segmap_parloop_struct_229510->free_mem_213705,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_227948 = start;
    
    for (; iter_227948 < end; iter_227948++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227953 = n_196692;
        int64_t gtid_227932 = iter_227948;
        int64_t remnant_227954 = iter_227948 - gtid_227932;
        int64_t x_227933;
        
        x_227933 = ((int64_t *) mem_210394.mem)[gtid_208717 * n_196692 +
                                                gtid_227932];
        
        bool cond_227934 = sle64((int64_t) 0, x_227933);
        float defunc_0_f_res_227935;
        
        if (cond_227934) {
            bool y_227949 = slt64(x_227933, n_196692);
            bool bounds_check_227950 = cond_227934 && y_227949;
            bool index_certs_227951;
            
            if (!bounds_check_227950) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) x_227933,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:401:3-415:29\n   #7  stl.fut:385:1-415:29\n");
                err = 1;
                goto cleanup;
            }
            
            float defunc_0_f_res_t_res_227952;
            
            defunc_0_f_res_t_res_227952 = ((float *) mem_213702.mem)[x_227933];
            defunc_0_f_res_227935 = defunc_0_f_res_t_res_227952;
        } else {
            defunc_0_f_res_227935 = INFINITY;
        }
        ((float *) mem_213705.mem)[gtid_227932] = defunc_0_f_res_227935;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229511_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229511_end -
                 futhark_mc_segmap_parloop_229511_start;
        
        ctx->futhark_mc_segmap_parloop_229511_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229511_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229511_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229509(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_227931 = tid;
    int num_tasks_227947 = info.nsubtasks;
    struct futhark_mc_task_229508 *futhark_mc_task_229508 =
                                  (struct futhark_mc_task_229508 *) args;
    struct futhark_context *ctx = futhark_mc_task_229508->ctx;
    uint64_t futhark_mc_segmap_task_229509_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229509_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229508->free_n_196692;
    int64_t gtid_208717 = futhark_mc_task_229508->free_gtid_208717;
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229508->free_mem_210394,
                                  .size =0, .references =NULL};
    struct memblock mem_213702 = {.desc ="mem_213702", .mem =
                                  futhark_mc_task_229508->free_mem_213702,
                                  .size =0, .references =NULL};
    struct memblock mem_213705 = {.desc ="mem_213705", .mem =
                                  futhark_mc_task_229508->free_mem_213705,
                                  .size =0, .references =NULL};
    int64_t iter_227948;
    struct futhark_mc_segmap_parloop_struct_229510
    futhark_mc_segmap_parloop_struct_229510;
    
    futhark_mc_segmap_parloop_struct_229510.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229510.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229510.free_gtid_208717 = gtid_208717;
    futhark_mc_segmap_parloop_struct_229510.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229510.free_mem_213702 = mem_213702.mem;
    futhark_mc_segmap_parloop_struct_229510.free_mem_213705 = mem_213705.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229511_task;
    
    futhark_mc_segmap_parloop_229511_task.name =
        "futhark_mc_segmap_parloop_229511";
    futhark_mc_segmap_parloop_229511_task.fn = futhark_mc_segmap_parloop_229511;
    futhark_mc_segmap_parloop_229511_task.args =
        &futhark_mc_segmap_parloop_struct_229510;
    futhark_mc_segmap_parloop_229511_task.iterations = iterations;
    futhark_mc_segmap_parloop_229511_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229511_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229511_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229511_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229511_task);
    
    if (futhark_mc_segmap_parloop_229511_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229511_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229511_total_end -
                 futhark_mc_segmap_parloop_229511_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229511_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229511_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229511_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229509_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229509_end -
                 futhark_mc_segmap_task_229509_start;
        
        ctx->futhark_mc_segmap_task_229509_runs[tid]++;
        ctx->futhark_mc_segmap_task_229509_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229509_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229501(void *args, int64_t start,
                                            int64_t end, int flat_tid_208716,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229500
    *futhark_mc_segmap_parloop_struct_229500 =
    (struct futhark_mc_segmap_parloop_struct_229500 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229500->ctx;
    uint64_t futhark_mc_segmap_parloop_229501_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229501_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229500->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229500->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229500->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_segmap_parloop_struct_229500->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229500->free_bytes_210949;
    struct memblock ext_mem_213684 = {.desc ="ext_mem_213684", .mem =
                                      futhark_mc_segmap_parloop_struct_229500->free_ext_mem_213684,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213685 = {.desc ="ext_mem_213685", .mem =
                                      futhark_mc_segmap_parloop_struct_229500->free_ext_mem_213685,
                                      .size =0, .references =NULL};
    int64_t ext_213689 =
            futhark_mc_segmap_parloop_struct_229500->free_ext_213689;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_segmap_parloop_struct_229500->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_segmap_parloop_struct_229500->free_mem_213743,
                                  .size =0, .references =NULL};
    size_t mem_213702_cached_sizze_229502 = 0;
    unsigned char *mem_213702 = NULL;
    size_t mem_213705_cached_sizze_229503 = 0;
    unsigned char *mem_213705 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227920 = start;
    
    if (mem_213702_cached_sizze_229502 < (size_t) bytes_210949) {
        mem_213702 = realloc(mem_213702, bytes_210949);
        mem_213702_cached_sizze_229502 = bytes_210949;
    }
    if (mem_213705_cached_sizze_229503 < (size_t) bytes_210949) {
        mem_213705 = realloc(mem_213705, bytes_210949);
        mem_213705_cached_sizze_229503 = bytes_210949;
    }
    for (; iter_227920 < end; iter_227920++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_227940 = m_196691;
        int64_t gtid_208717 = iter_227920;
        int64_t remnant_227941 = iter_227920 - gtid_208717;
        int64_t flat_tid_227921 = (int64_t) 0;
        int32_t num_tasks_227942;
        struct futhark_mc_task_229504 futhark_mc_task_229504;
        
        futhark_mc_task_229504.ctx = ctx;
        futhark_mc_task_229504.free_n_196692 = n_196692;
        futhark_mc_task_229504.free_gtid_208717 = gtid_208717;
        futhark_mc_task_229504.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229504.free_ext_mem_213684 = ext_mem_213684.mem;
        futhark_mc_task_229504.free_ext_mem_213685 = ext_mem_213685.mem;
        futhark_mc_task_229504.free_ext_213689 = ext_213689;
        futhark_mc_task_229504.free_mem_213702 = mem_213702;
        
        struct scheduler_segop futhark_mc_task_229504_task;
        
        futhark_mc_task_229504_task.args = &futhark_mc_task_229504;
        futhark_mc_task_229504_task.top_level_fn =
            futhark_mc_segmap_task_229505;
        futhark_mc_task_229504_task.name = "futhark_mc_segmap_task_229505";
        futhark_mc_task_229504_task.iterations = n_196692;
        futhark_mc_task_229504_task.task_time =
            &ctx->futhark_mc_segmap_task_229505_total_time;
        futhark_mc_task_229504_task.task_iter =
            &ctx->futhark_mc_segmap_task_229505_total_iter;
        futhark_mc_task_229504_task.sched = STATIC;
        futhark_mc_task_229504_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229505_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229504_task);
        
        if (futhark_mc_segmap_task_229505_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        int64_t flat_tid_227931 = (int64_t) 0;
        int32_t num_tasks_227947;
        struct futhark_mc_task_229508 futhark_mc_task_229508;
        
        futhark_mc_task_229508.ctx = ctx;
        futhark_mc_task_229508.free_n_196692 = n_196692;
        futhark_mc_task_229508.free_gtid_208717 = gtid_208717;
        futhark_mc_task_229508.free_mem_210394 = mem_210394.mem;
        futhark_mc_task_229508.free_mem_213702 = mem_213702;
        futhark_mc_task_229508.free_mem_213705 = mem_213705;
        
        struct scheduler_segop futhark_mc_task_229508_task;
        
        futhark_mc_task_229508_task.args = &futhark_mc_task_229508;
        futhark_mc_task_229508_task.top_level_fn =
            futhark_mc_segmap_task_229509;
        futhark_mc_task_229508_task.name = "futhark_mc_segmap_task_229509";
        futhark_mc_task_229508_task.iterations = n_196692;
        futhark_mc_task_229508_task.task_time =
            &ctx->futhark_mc_segmap_task_229509_total_time;
        futhark_mc_task_229508_task.task_iter =
            &ctx->futhark_mc_segmap_task_229509_total_iter;
        futhark_mc_task_229508_task.sched = STATIC;
        futhark_mc_task_229508_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229509_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229508_task);
        
        if (futhark_mc_segmap_task_229509_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213739.mem + gtid_208717 * n_196692 * (int64_t) 4,
                    mem_213705 + (int64_t) 0, n_196692 * (int64_t) 4);
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213743.mem + gtid_208717 * n_196692 * (int64_t) 4,
                    mem_213702 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213702);
    free(mem_213705);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229501_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229501_end -
                 futhark_mc_segmap_parloop_229501_start;
        
        ctx->futhark_mc_segmap_parloop_229501_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229501_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229501_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229499(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208716 = tid;
    int num_tasks_227893 = info.nsubtasks;
    struct futhark_mc_task_229493 *futhark_mc_task_229493 =
                                  (struct futhark_mc_task_229493 *) args;
    struct futhark_context *ctx = futhark_mc_task_229493->ctx;
    uint64_t futhark_mc_segmap_nested_task_229499_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229499_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229493->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229493->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229493->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock mem_210394 = {.desc ="mem_210394", .mem =
                                  futhark_mc_task_229493->free_mem_210394,
                                  .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229493->free_bytes_210949;
    struct memblock ext_mem_213684 = {.desc ="ext_mem_213684", .mem =
                                      futhark_mc_task_229493->free_ext_mem_213684,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213685 = {.desc ="ext_mem_213685", .mem =
                                      futhark_mc_task_229493->free_ext_mem_213685,
                                      .size =0, .references =NULL};
    int64_t ext_213689 = futhark_mc_task_229493->free_ext_213689;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_task_229493->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_task_229493->free_mem_213743,
                                  .size =0, .references =NULL};
    int64_t iter_227920;
    struct futhark_mc_segmap_parloop_struct_229500
    futhark_mc_segmap_parloop_struct_229500;
    
    futhark_mc_segmap_parloop_struct_229500.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229500.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229500.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229500.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229500.free_mem_210394 = mem_210394.mem;
    futhark_mc_segmap_parloop_struct_229500.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229500.free_ext_mem_213684 =
        ext_mem_213684.mem;
    futhark_mc_segmap_parloop_struct_229500.free_ext_mem_213685 =
        ext_mem_213685.mem;
    futhark_mc_segmap_parloop_struct_229500.free_ext_213689 = ext_213689;
    futhark_mc_segmap_parloop_struct_229500.free_mem_213739 = mem_213739.mem;
    futhark_mc_segmap_parloop_struct_229500.free_mem_213743 = mem_213743.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229501_task;
    
    futhark_mc_segmap_parloop_229501_task.name =
        "futhark_mc_segmap_parloop_229501";
    futhark_mc_segmap_parloop_229501_task.fn = futhark_mc_segmap_parloop_229501;
    futhark_mc_segmap_parloop_229501_task.args =
        &futhark_mc_segmap_parloop_struct_229500;
    futhark_mc_segmap_parloop_229501_task.iterations = iterations;
    futhark_mc_segmap_parloop_229501_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229501_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229501_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229501_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229501_task);
    
    if (futhark_mc_segmap_parloop_229501_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229501_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229501_total_end -
                 futhark_mc_segmap_parloop_229501_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229501_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229501_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229501_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229499_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229499_end -
                 futhark_mc_segmap_nested_task_229499_start;
        
        ctx->futhark_mc_segmap_nested_task_229499_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229499_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229499_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229512 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_i_196779;
    int32_t free_iters_199778;
    int64_t free_bytes_210356;
    int64_t free_bytes_210949;
    unsigned char *free_mem_213739;
    unsigned char *free_mem_213889;
    int64_t free_num_bytes_214091;
    int64_t free_num_bytes_214096;
};
struct futhark_mc_segmap_parloop_struct_229514 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_i_196779;
    int32_t free_iters_199778;
    int64_t free_bytes_210356;
    int64_t free_bytes_210949;
    unsigned char *free_mem_213739;
    unsigned char *free_mem_213889;
    int64_t free_num_bytes_214096;
};
static int futhark_mc_segmap_parloop_229515(void *args, int64_t start,
                                            int64_t end, int flat_tid_208743,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229514
    *futhark_mc_segmap_parloop_struct_229514 =
    (struct futhark_mc_segmap_parloop_struct_229514 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229514->ctx;
    uint64_t futhark_mc_segmap_parloop_229515_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229515_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229514->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229514->free_n_196692;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229514->free_i_196779;
    int32_t iters_199778 =
            futhark_mc_segmap_parloop_struct_229514->free_iters_199778;
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_229514->free_bytes_210356;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229514->free_bytes_210949;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_segmap_parloop_struct_229514->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_segmap_parloop_struct_229514->free_mem_213889,
                                  .size =0, .references =NULL};
    int64_t num_bytes_214096 =
            futhark_mc_segmap_parloop_struct_229514->free_num_bytes_214096;
    size_t mem_213793_cached_sizze_229516 = 0;
    unsigned char *mem_213793 = NULL;
    size_t mem_213796_cached_sizze_229517 = 0;
    unsigned char *mem_213796 = NULL;
    size_t mem_213799_cached_sizze_229518 = 0;
    unsigned char *mem_213799 = NULL;
    size_t mem_213802_cached_sizze_229519 = 0;
    unsigned char *mem_213802 = NULL;
    size_t mem_213805_cached_sizze_229520 = 0;
    unsigned char *mem_213805 = NULL;
    int64_t iterations = end - start;
    int64_t iter_227956 = start;
    
    if (mem_213793_cached_sizze_229516 < (size_t) bytes_210356) {
        mem_213793 = realloc(mem_213793, bytes_210356);
        mem_213793_cached_sizze_229516 = bytes_210356;
    }
    if (mem_213796_cached_sizze_229517 < (size_t) bytes_210356) {
        mem_213796 = realloc(mem_213796, bytes_210356);
        mem_213796_cached_sizze_229517 = bytes_210356;
    }
    if (mem_213799_cached_sizze_229518 < (size_t) bytes_210356) {
        mem_213799 = realloc(mem_213799, bytes_210356);
        mem_213799_cached_sizze_229518 = bytes_210356;
    }
    if (mem_213802_cached_sizze_229519 < (size_t) bytes_210356) {
        mem_213802 = realloc(mem_213802, bytes_210356);
        mem_213802_cached_sizze_229519 = bytes_210356;
    }
    if (mem_213805_cached_sizze_229520 < (size_t) bytes_210949) {
        mem_213805 = realloc(mem_213805, bytes_210949);
        mem_213805_cached_sizze_229520 = bytes_210949;
    }
    
    struct memblock mem_in_214097;
    
    mem_in_214097.references = NULL;
    if (memblock_alloc(ctx, &mem_in_214097, num_bytes_214096,
                       "mem_in_214097")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock mem_213868;
    
    mem_213868.references = NULL;
    if (memblock_alloc(ctx, &mem_213868, bytes_210949, "mem_213868")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock ext_mem_213881;
    
    ext_mem_213881.references = NULL;
    
    struct memblock ext_mem_unused_214098;
    
    ext_mem_unused_214098.references = NULL;
    
    struct memblock mem_param_227958;
    
    mem_param_227958.references = NULL;
    
    struct memblock mem_param_out_227959;
    
    mem_param_out_227959.references = NULL;
    for (; iter_227956 < end; iter_227956++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228061 = m_196691;
        int64_t gtid_208744 = iter_227956;
        int64_t remnant_228062 = iter_227956 - gtid_208744;
        
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_in_214097.mem + (int64_t) 0, mem_213739.mem +
                    gtid_208744 * n_196692 * (int64_t) 4, n_196692 *
                    (int64_t) 4);
        if (memblock_set(ctx, &mem_param_227958, &mem_in_214097,
                         "mem_in_214097") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_out_227959, &mem_213868,
                         "mem_213868") != 0)
            return 1;
        for (int32_t i_227957 = 0; i_227957 < iters_199778; i_227957++) {
            int32_t defunc_2_radix_sort_step_arg_227961 = mul32(2, i_227957);
            int32_t defunc_0_get_bit_arg_227962 = add32(1,
                                                        defunc_2_radix_sort_step_arg_227961);
            bool cond_f_res_227963 = defunc_0_get_bit_arg_227962 == 31;
            bool cond_f_res_227964 = defunc_2_radix_sort_step_arg_227961 == 31;
            int64_t discard_227970;
            int64_t discard_227971;
            int64_t discard_227972;
            int64_t discard_227973;
            int64_t scanacc_227980;
            int64_t scanacc_227981;
            int64_t scanacc_227982;
            int64_t scanacc_227983;
            
            scanacc_227980 = (int64_t) 0;
            scanacc_227981 = (int64_t) 0;
            scanacc_227982 = (int64_t) 0;
            scanacc_227983 = (int64_t) 0;
            for (int64_t i_227979 = 0; i_227979 < n_196692; i_227979++) {
                float x_227989;
                
                x_227989 = ((float *) mem_param_227958.mem)[i_227979];
                
                int32_t i32_arg_227990;
                
                i32_arg_227990 = futrts_to_bits32(x_227989);
                
                int32_t unsign_arg_227991 = ashr32(i32_arg_227990,
                                                   defunc_0_get_bit_arg_227962);
                int32_t unsign_arg_227992 = 1 & unsign_arg_227991;
                int32_t unsign_arg_227993 = ashr32(i32_arg_227990, 31);
                int32_t unsign_arg_227994 = 1 & unsign_arg_227993;
                bool cond_227995 = unsign_arg_227994 == 1;
                bool x_227996 = !cond_227995;
                bool y_227997 = cond_f_res_227963 && x_227996;
                bool cond_227998 = cond_227995 || y_227997;
                int32_t defunc_1_get_bit_res_227999;
                
                if (cond_227998) {
                    int32_t defunc_1_get_bit_res_t_res_228000 = 1 ^
                            unsign_arg_227992;
                    
                    defunc_1_get_bit_res_227999 =
                        defunc_1_get_bit_res_t_res_228000;
                } else {
                    defunc_1_get_bit_res_227999 = unsign_arg_227992;
                }
                
                int32_t x_228001 = mul32(2, defunc_1_get_bit_res_227999);
                int32_t unsign_arg_228002 = ashr32(i32_arg_227990,
                                                   defunc_2_radix_sort_step_arg_227961);
                int32_t unsign_arg_228003 = 1 & unsign_arg_228002;
                bool y_228004 = cond_f_res_227964 && x_227996;
                bool cond_228005 = cond_227995 || y_228004;
                int32_t defunc_1_get_bit_res_228006;
                
                if (cond_228005) {
                    int32_t defunc_1_get_bit_res_t_res_228007 = 1 ^
                            unsign_arg_228003;
                    
                    defunc_1_get_bit_res_228006 =
                        defunc_1_get_bit_res_t_res_228007;
                } else {
                    defunc_1_get_bit_res_228006 = unsign_arg_228003;
                }
                
                int32_t defunc_0_f_res_228008 = add32(x_228001,
                                                      defunc_1_get_bit_res_228006);
                bool cond_228009 = defunc_0_f_res_228008 == 0;
                int64_t defunc_0_f_res_228010 = btoi_bool_i64(cond_228009);
                int64_t defunc_0_f_res_228011;
                int64_t defunc_0_f_res_228012;
                int64_t defunc_0_f_res_228013;
                
                if (cond_228009) {
                    defunc_0_f_res_228011 = (int64_t) 0;
                    defunc_0_f_res_228012 = (int64_t) 0;
                    defunc_0_f_res_228013 = (int64_t) 0;
                } else {
                    bool cond_228014 = defunc_0_f_res_228008 == 1;
                    int64_t defunc_0_f_res_f_res_228015 =
                            btoi_bool_i64(cond_228014);
                    int64_t defunc_0_f_res_f_res_228016;
                    int64_t defunc_0_f_res_f_res_228017;
                    
                    if (cond_228014) {
                        defunc_0_f_res_f_res_228016 = (int64_t) 0;
                        defunc_0_f_res_f_res_228017 = (int64_t) 0;
                    } else {
                        bool cond_228018 = defunc_0_f_res_228008 == 2;
                        int64_t defunc_0_f_res_f_res_f_res_228019 =
                                btoi_bool_i64(cond_228018);
                        bool cond_neg_228020 = !cond_228018;
                        int64_t defunc_0_f_res_f_res_f_res_228021 =
                                btoi_bool_i64(cond_neg_228020);
                        
                        defunc_0_f_res_f_res_228016 =
                            defunc_0_f_res_f_res_f_res_228019;
                        defunc_0_f_res_f_res_228017 =
                            defunc_0_f_res_f_res_f_res_228021;
                    }
                    defunc_0_f_res_228011 = defunc_0_f_res_f_res_228015;
                    defunc_0_f_res_228012 = defunc_0_f_res_f_res_228016;
                    defunc_0_f_res_228013 = defunc_0_f_res_f_res_228017;
                }
                
                int64_t defunc_1_op_res_228022 = add64(defunc_0_f_res_228010,
                                                       scanacc_227980);
                int64_t defunc_1_op_res_228023 = add64(defunc_0_f_res_228011,
                                                       scanacc_227981);
                int64_t defunc_1_op_res_228024 = add64(defunc_0_f_res_228012,
                                                       scanacc_227982);
                int64_t defunc_1_op_res_228025 = add64(defunc_0_f_res_228013,
                                                       scanacc_227983);
                
                ((int64_t *) mem_213793)[i_227979] = defunc_1_op_res_228022;
                ((int64_t *) mem_213796)[i_227979] = defunc_1_op_res_228023;
                ((int64_t *) mem_213799)[i_227979] = defunc_1_op_res_228024;
                ((int64_t *) mem_213802)[i_227979] = defunc_1_op_res_228025;
                ((int32_t *) mem_213805)[i_227979] = defunc_0_f_res_228008;
                
                int64_t scanacc_tmp_228066 = defunc_1_op_res_228022;
                int64_t scanacc_tmp_228067 = defunc_1_op_res_228023;
                int64_t scanacc_tmp_228068 = defunc_1_op_res_228024;
                int64_t scanacc_tmp_228069 = defunc_1_op_res_228025;
                
                scanacc_227980 = scanacc_tmp_228066;
                scanacc_227981 = scanacc_tmp_228067;
                scanacc_227982 = scanacc_tmp_228068;
                scanacc_227983 = scanacc_tmp_228069;
            }
            discard_227970 = scanacc_227980;
            discard_227971 = scanacc_227981;
            discard_227972 = scanacc_227982;
            discard_227973 = scanacc_227983;
            
            int64_t last_res_228031;
            
            last_res_228031 = ((int64_t *) mem_213793)[i_196779];
            
            int64_t last_res_228032;
            
            last_res_228032 = ((int64_t *) mem_213796)[i_196779];
            
            int64_t last_res_228033;
            
            last_res_228033 = ((int64_t *) mem_213799)[i_196779];
            if (n_196692 * (int64_t) 4 > 0)
                memmove(mem_param_out_227959.mem + (int64_t) 0,
                        mem_param_227958.mem + (int64_t) 0, n_196692 *
                        (int64_t) 4);
            for (int64_t write_iter_228036 = 0; write_iter_228036 < n_196692;
                 write_iter_228036++) {
                int32_t write_iv_228038;
                
                write_iv_228038 = ((int32_t *) mem_213805)[write_iter_228036];
                
                bool match_lit_228039 = 0 == write_iv_228038;
                int64_t defunc_1_f_res_228040;
                
                if (match_lit_228039) {
                    int64_t write_iv_228041;
                    
                    write_iv_228041 =
                        ((int64_t *) mem_213793)[write_iter_228036];
                    
                    int64_t case_res_228042 = sub64(write_iv_228041,
                                                    (int64_t) 1);
                    
                    defunc_1_f_res_228040 = case_res_228042;
                } else {
                    bool match_lit_228043 = 1 == write_iv_228038;
                    int64_t x_228044;
                    
                    if (match_lit_228043) {
                        int64_t write_iv_228045;
                        
                        write_iv_228045 =
                            ((int64_t *) mem_213796)[write_iter_228036];
                        
                        int64_t x_228046 = add64(last_res_228031,
                                                 write_iv_228045);
                        int64_t case_res_228047 = sub64(x_228046, (int64_t) 1);
                        
                        x_228044 = case_res_228047;
                    } else {
                        bool match_lit_228048 = 2 == write_iv_228038;
                        int64_t x_228049;
                        
                        if (match_lit_228048) {
                            int64_t write_iv_228050;
                            
                            write_iv_228050 =
                                ((int64_t *) mem_213799)[write_iter_228036];
                            
                            int64_t x_228051 = add64(last_res_228031,
                                                     last_res_228032);
                            int64_t x_228052 = add64(x_228051, write_iv_228050);
                            int64_t case_res_228053 = sub64(x_228052,
                                                            (int64_t) 1);
                            
                            x_228049 = case_res_228053;
                        } else {
                            int64_t write_iv_228054;
                            
                            write_iv_228054 =
                                ((int64_t *) mem_213802)[write_iter_228036];
                            
                            int64_t x_228055 = add64(last_res_228031,
                                                     last_res_228032);
                            int64_t x_228056 = add64(last_res_228033, x_228055);
                            int64_t x_228057 = add64(x_228056, write_iv_228054);
                            int64_t defunc_1_f_res_res_228058 = sub64(x_228057,
                                                                      (int64_t) 1);
                            
                            x_228049 = defunc_1_f_res_res_228058;
                        }
                        x_228044 = x_228049;
                    }
                    defunc_1_f_res_228040 = x_228044;
                }
                if (sle64((int64_t) 0, defunc_1_f_res_228040) &&
                    slt64(defunc_1_f_res_228040, n_196692)) {
                    if ((int64_t) 4 > 0)
                        memmove(mem_param_out_227959.mem +
                                defunc_1_f_res_228040 * (int64_t) 4,
                                mem_param_227958.mem + write_iter_228036 *
                                (int64_t) 4, (int64_t) 4);
                }
            }
            
            struct memblock mem_param_tmp_228063;
            
            mem_param_tmp_228063.references = NULL;
            if (memblock_set(ctx, &mem_param_tmp_228063, &mem_param_out_227959,
                             "mem_param_out_227959") != 0)
                return 1;
            
            struct memblock mem_param_out_tmp_228064;
            
            mem_param_out_tmp_228064.references = NULL;
            if (memblock_set(ctx, &mem_param_out_tmp_228064, &mem_param_227958,
                             "mem_param_227958") != 0)
                return 1;
            if (memblock_set(ctx, &mem_param_227958, &mem_param_tmp_228063,
                             "mem_param_tmp_228063") != 0)
                return 1;
            if (memblock_set(ctx, &mem_param_out_227959,
                             &mem_param_out_tmp_228064,
                             "mem_param_out_tmp_228064") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_out_tmp_228064,
                               "mem_param_out_tmp_228064") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_tmp_228063,
                               "mem_param_tmp_228063") != 0)
                return 1;
        }
        if (memblock_set(ctx, &ext_mem_213881, &mem_param_227958,
                         "mem_param_227958") != 0)
            return 1;
        if (memblock_set(ctx, &ext_mem_unused_214098, &mem_param_out_227959,
                         "mem_param_out_227959") != 0)
            return 1;
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213889.mem + gtid_208744 * n_196692 * (int64_t) 4,
                    ext_mem_213881.mem + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213793);
    free(mem_213796);
    free(mem_213799);
    free(mem_213802);
    free(mem_213805);
    if (memblock_unref(ctx, &mem_param_out_227959, "mem_param_out_227959") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_227958, "mem_param_227958") != 0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_unused_214098, "ext_mem_unused_214098") !=
        0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_213881, "ext_mem_213881") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_213868, "mem_213868") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_in_214097, "mem_in_214097") != 0)
        return 1;
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229515_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229515_end -
                 futhark_mc_segmap_parloop_229515_start;
        
        ctx->futhark_mc_segmap_parloop_229515_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229515_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229515_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229513(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208743 = tid;
    int num_tasks_227955 = info.nsubtasks;
    struct futhark_mc_task_229512 *futhark_mc_task_229512 =
                                  (struct futhark_mc_task_229512 *) args;
    struct futhark_context *ctx = futhark_mc_task_229512->ctx;
    uint64_t futhark_mc_segmap_task_229513_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229513_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229512->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229512->free_n_196692;
    int64_t i_196779 = futhark_mc_task_229512->free_i_196779;
    int32_t iters_199778 = futhark_mc_task_229512->free_iters_199778;
    int64_t bytes_210356 = futhark_mc_task_229512->free_bytes_210356;
    int64_t bytes_210949 = futhark_mc_task_229512->free_bytes_210949;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_task_229512->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_task_229512->free_mem_213889,
                                  .size =0, .references =NULL};
    int64_t num_bytes_214091 = futhark_mc_task_229512->free_num_bytes_214091;
    int64_t num_bytes_214096 = futhark_mc_task_229512->free_num_bytes_214096;
    int64_t iter_227956;
    struct futhark_mc_segmap_parloop_struct_229514
    futhark_mc_segmap_parloop_struct_229514;
    
    futhark_mc_segmap_parloop_struct_229514.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229514.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229514.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229514.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229514.free_iters_199778 = iters_199778;
    futhark_mc_segmap_parloop_struct_229514.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_229514.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229514.free_mem_213739 = mem_213739.mem;
    futhark_mc_segmap_parloop_struct_229514.free_mem_213889 = mem_213889.mem;
    futhark_mc_segmap_parloop_struct_229514.free_num_bytes_214096 =
        num_bytes_214096;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229515_task;
    
    futhark_mc_segmap_parloop_229515_task.name =
        "futhark_mc_segmap_parloop_229515";
    futhark_mc_segmap_parloop_229515_task.fn = futhark_mc_segmap_parloop_229515;
    futhark_mc_segmap_parloop_229515_task.args =
        &futhark_mc_segmap_parloop_struct_229514;
    futhark_mc_segmap_parloop_229515_task.iterations = iterations;
    futhark_mc_segmap_parloop_229515_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229515_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229515_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229515_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229515_task);
    
    if (futhark_mc_segmap_parloop_229515_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229515_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229515_total_end -
                 futhark_mc_segmap_parloop_229515_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229515_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229515_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229515_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229513_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229513_end -
                 futhark_mc_segmap_task_229513_start;
        
        ctx->futhark_mc_segmap_task_229513_runs[tid]++;
        ctx->futhark_mc_segmap_task_229513_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229513_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229522 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_i_196779;
    int32_t free_iters_199778;
    int64_t free_bytes_210356;
    int64_t free_bytes_210949;
    unsigned char *free_mem_213739;
    unsigned char *free_mem_213889;
    int64_t free_num_bytes_214091;
};
struct futhark_mc_task_229529 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    unsigned char *free_mem_213757;
    unsigned char *free_mem_213760;
    unsigned char *free_mem_213763;
    unsigned char *free_mem_213766;
    unsigned char *free_mem_213769;
    unsigned char *free_mem_param_228078;
    int32_t free_defunc_2_radix_sort_step_arg_228081;
    int32_t free_defunc_0_get_bit_arg_228082;
    bool free_cond_f_res_228083;
    bool free_cond_f_res_228084;
};
struct futhark_mc_scan_stage_1_parloop_struct_229535 {
    struct futhark_context *ctx;
    unsigned char *free_mem_213757;
    unsigned char *free_mem_213760;
    unsigned char *free_mem_213763;
    unsigned char *free_mem_213766;
    unsigned char *free_mem_213769;
    unsigned char *free_mem_param_228078;
    int32_t free_defunc_2_radix_sort_step_arg_228081;
    int32_t free_defunc_0_get_bit_arg_228082;
    bool free_cond_f_res_228083;
    bool free_cond_f_res_228084;
};
static int futhark_mc_scan_stage_1_parloop_229536(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_228090, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_1_parloop_struct_229535
    *futhark_mc_scan_stage_1_parloop_struct_229535 =
    (struct futhark_mc_scan_stage_1_parloop_struct_229535 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_1_parloop_struct_229535->ctx;
    uint64_t futhark_mc_scan_stage_1_parloop_229536_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_229536_start = get_wall_time();
    
    struct memblock mem_213757 = {.desc ="mem_213757", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_229535->free_mem_213757,
                                  .size =0, .references =NULL};
    struct memblock mem_213760 = {.desc ="mem_213760", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_229535->free_mem_213760,
                                  .size =0, .references =NULL};
    struct memblock mem_213763 = {.desc ="mem_213763", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_229535->free_mem_213763,
                                  .size =0, .references =NULL};
    struct memblock mem_213766 = {.desc ="mem_213766", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_229535->free_mem_213766,
                                  .size =0, .references =NULL};
    struct memblock mem_213769 = {.desc ="mem_213769", .mem =
                                  futhark_mc_scan_stage_1_parloop_struct_229535->free_mem_213769,
                                  .size =0, .references =NULL};
    struct memblock mem_param_228078 = {.desc ="mem_param_228078", .mem =
                                        futhark_mc_scan_stage_1_parloop_struct_229535->free_mem_param_228078,
                                        .size =0, .references =NULL};
    int32_t defunc_2_radix_sort_step_arg_228081 =
            futhark_mc_scan_stage_1_parloop_struct_229535->free_defunc_2_radix_sort_step_arg_228081;
    int32_t defunc_0_get_bit_arg_228082 =
            futhark_mc_scan_stage_1_parloop_struct_229535->free_defunc_0_get_bit_arg_228082;
    bool cond_f_res_228083 =
         futhark_mc_scan_stage_1_parloop_struct_229535->free_cond_f_res_228083;
    bool cond_f_res_228084 =
         futhark_mc_scan_stage_1_parloop_struct_229535->free_cond_f_res_228084;
    int64_t iterations = end - start;
    int64_t iter_228172 = start;
    int64_t x_228092;
    int64_t x_228093;
    int64_t x_228094;
    int64_t x_228095;
    int64_t x_228096;
    int64_t x_228097;
    int64_t x_228098;
    int64_t x_228099;
    
    x_228092 = (int64_t) 0;
    x_228093 = (int64_t) 0;
    x_228094 = (int64_t) 0;
    x_228095 = (int64_t) 0;
    for (; iter_228172 < end; iter_228172++) {
        int64_t gtid_228091 = iter_228172;
        
        // stage 1 scan body
        {
            float x_228104;
            
            x_228104 = ((float *) mem_param_228078.mem)[gtid_228091];
            
            int32_t i32_arg_228105;
            
            i32_arg_228105 = futrts_to_bits32(x_228104);
            
            int32_t unsign_arg_228106 = ashr32(i32_arg_228105,
                                               defunc_0_get_bit_arg_228082);
            int32_t unsign_arg_228107 = 1 & unsign_arg_228106;
            int32_t unsign_arg_228108 = ashr32(i32_arg_228105, 31);
            int32_t unsign_arg_228109 = 1 & unsign_arg_228108;
            bool cond_228110 = unsign_arg_228109 == 1;
            bool x_228111 = !cond_228110;
            bool y_228112 = cond_f_res_228083 && x_228111;
            bool cond_228113 = cond_228110 || y_228112;
            int32_t defunc_1_get_bit_res_228114;
            
            if (cond_228113) {
                int32_t defunc_1_get_bit_res_t_res_228115 = 1 ^
                        unsign_arg_228107;
                
                defunc_1_get_bit_res_228114 = defunc_1_get_bit_res_t_res_228115;
            } else {
                defunc_1_get_bit_res_228114 = unsign_arg_228107;
            }
            
            int32_t x_228116 = mul32(2, defunc_1_get_bit_res_228114);
            int32_t unsign_arg_228117 = ashr32(i32_arg_228105,
                                               defunc_2_radix_sort_step_arg_228081);
            int32_t unsign_arg_228118 = 1 & unsign_arg_228117;
            bool y_228119 = cond_f_res_228084 && x_228111;
            bool cond_228120 = cond_228110 || y_228119;
            int32_t defunc_1_get_bit_res_228121;
            
            if (cond_228120) {
                int32_t defunc_1_get_bit_res_t_res_228122 = 1 ^
                        unsign_arg_228118;
                
                defunc_1_get_bit_res_228121 = defunc_1_get_bit_res_t_res_228122;
            } else {
                defunc_1_get_bit_res_228121 = unsign_arg_228118;
            }
            
            int32_t defunc_0_f_res_228123 = add32(x_228116,
                                                  defunc_1_get_bit_res_228121);
            bool cond_228124 = defunc_0_f_res_228123 == 0;
            int64_t defunc_0_f_res_228125 = btoi_bool_i64(cond_228124);
            int64_t defunc_0_f_res_228126;
            int64_t defunc_0_f_res_228127;
            int64_t defunc_0_f_res_228128;
            
            if (cond_228124) {
                defunc_0_f_res_228126 = (int64_t) 0;
                defunc_0_f_res_228127 = (int64_t) 0;
                defunc_0_f_res_228128 = (int64_t) 0;
            } else {
                bool cond_228129 = defunc_0_f_res_228123 == 1;
                int64_t defunc_0_f_res_f_res_228130 =
                        btoi_bool_i64(cond_228129);
                int64_t defunc_0_f_res_f_res_228131;
                int64_t defunc_0_f_res_f_res_228132;
                
                if (cond_228129) {
                    defunc_0_f_res_f_res_228131 = (int64_t) 0;
                    defunc_0_f_res_f_res_228132 = (int64_t) 0;
                } else {
                    bool cond_228133 = defunc_0_f_res_228123 == 2;
                    int64_t defunc_0_f_res_f_res_f_res_228134 =
                            btoi_bool_i64(cond_228133);
                    bool cond_neg_228135 = !cond_228133;
                    int64_t defunc_0_f_res_f_res_f_res_228136 =
                            btoi_bool_i64(cond_neg_228135);
                    
                    defunc_0_f_res_f_res_228131 =
                        defunc_0_f_res_f_res_f_res_228134;
                    defunc_0_f_res_f_res_228132 =
                        defunc_0_f_res_f_res_f_res_228136;
                }
                defunc_0_f_res_228126 = defunc_0_f_res_f_res_228130;
                defunc_0_f_res_228127 = defunc_0_f_res_f_res_228131;
                defunc_0_f_res_228128 = defunc_0_f_res_f_res_228132;
            }
            // write mapped values results to memory
            {
                ((int32_t *) mem_213769.mem)[gtid_228091] =
                    defunc_0_f_res_228123;
            }
            x_228092 = x_228092;
            x_228093 = x_228093;
            x_228094 = x_228094;
            x_228095 = x_228095;
            // Read next values
            {
                x_228096 = defunc_0_f_res_228125;
                x_228097 = defunc_0_f_res_228126;
                x_228098 = defunc_0_f_res_228127;
                x_228099 = defunc_0_f_res_228128;
            }
            
            int64_t defunc_1_op_res_228100 = add64(x_228092, x_228096);
            int64_t defunc_1_op_res_228101 = add64(x_228093, x_228097);
            int64_t defunc_1_op_res_228102 = add64(x_228094, x_228098);
            int64_t defunc_1_op_res_228103 = add64(x_228095, x_228099);
            
            ((int64_t *) mem_213757.mem)[gtid_228091] = defunc_1_op_res_228100;
            x_228092 = defunc_1_op_res_228100;
            ((int64_t *) mem_213760.mem)[gtid_228091] = defunc_1_op_res_228101;
            x_228093 = defunc_1_op_res_228101;
            ((int64_t *) mem_213763.mem)[gtid_228091] = defunc_1_op_res_228102;
            x_228094 = defunc_1_op_res_228102;
            ((int64_t *) mem_213766.mem)[gtid_228091] = defunc_1_op_res_228103;
            x_228095 = defunc_1_op_res_228103;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_229536_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_229536_end -
                 futhark_mc_scan_stage_1_parloop_229536_start;
        
        ctx->futhark_mc_scan_stage_1_parloop_229536_runs[tid]++;
        ctx->futhark_mc_scan_stage_1_parloop_229536_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_1_parloop_229536_iter[tid] += iterations;
    }
    return err;
}
struct futhark_mc_scan_stage_3_parloop_struct_229537 {
    struct futhark_context *ctx;
    unsigned char *free_mem_213757;
    unsigned char *free_mem_213760;
    unsigned char *free_mem_213763;
    unsigned char *free_mem_213766;
    unsigned char *free_mem_param_228078;
    int32_t free_defunc_2_radix_sort_step_arg_228081;
    int32_t free_defunc_0_get_bit_arg_228082;
    bool free_cond_f_res_228083;
    bool free_cond_f_res_228084;
};
static int futhark_mc_scan_stage_3_parloop_229538(void *args, int64_t start,
                                                  int64_t end,
                                                  int flat_tid_228090, int tid)
{
    int err = 0;
    struct futhark_mc_scan_stage_3_parloop_struct_229537
    *futhark_mc_scan_stage_3_parloop_struct_229537 =
    (struct futhark_mc_scan_stage_3_parloop_struct_229537 *) args;
    struct futhark_context *ctx =
                           futhark_mc_scan_stage_3_parloop_struct_229537->ctx;
    uint64_t futhark_mc_scan_stage_3_parloop_229538_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_3_parloop_229538_start = get_wall_time();
    
    struct memblock mem_213757 = {.desc ="mem_213757", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_229537->free_mem_213757,
                                  .size =0, .references =NULL};
    struct memblock mem_213760 = {.desc ="mem_213760", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_229537->free_mem_213760,
                                  .size =0, .references =NULL};
    struct memblock mem_213763 = {.desc ="mem_213763", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_229537->free_mem_213763,
                                  .size =0, .references =NULL};
    struct memblock mem_213766 = {.desc ="mem_213766", .mem =
                                  futhark_mc_scan_stage_3_parloop_struct_229537->free_mem_213766,
                                  .size =0, .references =NULL};
    struct memblock mem_param_228078 = {.desc ="mem_param_228078", .mem =
                                        futhark_mc_scan_stage_3_parloop_struct_229537->free_mem_param_228078,
                                        .size =0, .references =NULL};
    int32_t defunc_2_radix_sort_step_arg_228081 =
            futhark_mc_scan_stage_3_parloop_struct_229537->free_defunc_2_radix_sort_step_arg_228081;
    int32_t defunc_0_get_bit_arg_228082 =
            futhark_mc_scan_stage_3_parloop_struct_229537->free_defunc_0_get_bit_arg_228082;
    bool cond_f_res_228083 =
         futhark_mc_scan_stage_3_parloop_struct_229537->free_cond_f_res_228083;
    bool cond_f_res_228084 =
         futhark_mc_scan_stage_3_parloop_struct_229537->free_cond_f_res_228084;
    int64_t iterations = end - start;
    int64_t iter_228208 = start;
    int64_t x_228196;
    int64_t x_228197;
    int64_t x_228198;
    int64_t x_228199;
    int64_t x_228200;
    int64_t x_228201;
    int64_t x_228202;
    int64_t x_228203;
    
    if (iter_228208 == (int64_t) 0) {
        x_228196 = (int64_t) 0;
    } else {
        x_228196 = ((int64_t *) mem_213757.mem)[iter_228208 - (int64_t) 1];
    }
    if (iter_228208 == (int64_t) 0) {
        x_228197 = (int64_t) 0;
    } else {
        x_228197 = ((int64_t *) mem_213760.mem)[iter_228208 - (int64_t) 1];
    }
    if (iter_228208 == (int64_t) 0) {
        x_228198 = (int64_t) 0;
    } else {
        x_228198 = ((int64_t *) mem_213763.mem)[iter_228208 - (int64_t) 1];
    }
    if (iter_228208 == (int64_t) 0) {
        x_228199 = (int64_t) 0;
    } else {
        x_228199 = ((int64_t *) mem_213766.mem)[iter_228208 - (int64_t) 1];
    }
    for (; iter_228208 < end; iter_228208++) {
        int64_t gtid_228091 = iter_228208;
        
        // stage 3 scan body
        {
            float x_228104;
            
            x_228104 = ((float *) mem_param_228078.mem)[gtid_228091];
            
            int32_t i32_arg_228105;
            
            i32_arg_228105 = futrts_to_bits32(x_228104);
            
            int32_t unsign_arg_228106 = ashr32(i32_arg_228105,
                                               defunc_0_get_bit_arg_228082);
            int32_t unsign_arg_228107 = 1 & unsign_arg_228106;
            int32_t unsign_arg_228108 = ashr32(i32_arg_228105, 31);
            int32_t unsign_arg_228109 = 1 & unsign_arg_228108;
            bool cond_228110 = unsign_arg_228109 == 1;
            bool x_228111 = !cond_228110;
            bool y_228112 = cond_f_res_228083 && x_228111;
            bool cond_228113 = cond_228110 || y_228112;
            int32_t defunc_1_get_bit_res_228114;
            
            if (cond_228113) {
                int32_t defunc_1_get_bit_res_t_res_228115 = 1 ^
                        unsign_arg_228107;
                
                defunc_1_get_bit_res_228114 = defunc_1_get_bit_res_t_res_228115;
            } else {
                defunc_1_get_bit_res_228114 = unsign_arg_228107;
            }
            
            int32_t x_228116 = mul32(2, defunc_1_get_bit_res_228114);
            int32_t unsign_arg_228117 = ashr32(i32_arg_228105,
                                               defunc_2_radix_sort_step_arg_228081);
            int32_t unsign_arg_228118 = 1 & unsign_arg_228117;
            bool y_228119 = cond_f_res_228084 && x_228111;
            bool cond_228120 = cond_228110 || y_228119;
            int32_t defunc_1_get_bit_res_228121;
            
            if (cond_228120) {
                int32_t defunc_1_get_bit_res_t_res_228122 = 1 ^
                        unsign_arg_228118;
                
                defunc_1_get_bit_res_228121 = defunc_1_get_bit_res_t_res_228122;
            } else {
                defunc_1_get_bit_res_228121 = unsign_arg_228118;
            }
            
            int32_t defunc_0_f_res_228123 = add32(x_228116,
                                                  defunc_1_get_bit_res_228121);
            bool cond_228124 = defunc_0_f_res_228123 == 0;
            int64_t defunc_0_f_res_228125 = btoi_bool_i64(cond_228124);
            int64_t defunc_0_f_res_228126;
            int64_t defunc_0_f_res_228127;
            int64_t defunc_0_f_res_228128;
            
            if (cond_228124) {
                defunc_0_f_res_228126 = (int64_t) 0;
                defunc_0_f_res_228127 = (int64_t) 0;
                defunc_0_f_res_228128 = (int64_t) 0;
            } else {
                bool cond_228129 = defunc_0_f_res_228123 == 1;
                int64_t defunc_0_f_res_f_res_228130 =
                        btoi_bool_i64(cond_228129);
                int64_t defunc_0_f_res_f_res_228131;
                int64_t defunc_0_f_res_f_res_228132;
                
                if (cond_228129) {
                    defunc_0_f_res_f_res_228131 = (int64_t) 0;
                    defunc_0_f_res_f_res_228132 = (int64_t) 0;
                } else {
                    bool cond_228133 = defunc_0_f_res_228123 == 2;
                    int64_t defunc_0_f_res_f_res_f_res_228134 =
                            btoi_bool_i64(cond_228133);
                    bool cond_neg_228135 = !cond_228133;
                    int64_t defunc_0_f_res_f_res_f_res_228136 =
                            btoi_bool_i64(cond_neg_228135);
                    
                    defunc_0_f_res_f_res_228131 =
                        defunc_0_f_res_f_res_f_res_228134;
                    defunc_0_f_res_f_res_228132 =
                        defunc_0_f_res_f_res_f_res_228136;
                }
                defunc_0_f_res_228126 = defunc_0_f_res_f_res_228130;
                defunc_0_f_res_228127 = defunc_0_f_res_f_res_228131;
                defunc_0_f_res_228128 = defunc_0_f_res_f_res_228132;
            }
            x_228196 = x_228196;
            x_228197 = x_228197;
            x_228198 = x_228198;
            x_228199 = x_228199;
            x_228200 = defunc_0_f_res_228125;
            x_228201 = defunc_0_f_res_228126;
            x_228202 = defunc_0_f_res_228127;
            x_228203 = defunc_0_f_res_228128;
            
            int64_t defunc_1_op_res_228204 = add64(x_228196, x_228200);
            int64_t defunc_1_op_res_228205 = add64(x_228197, x_228201);
            int64_t defunc_1_op_res_228206 = add64(x_228198, x_228202);
            int64_t defunc_1_op_res_228207 = add64(x_228199, x_228203);
            
            ((int64_t *) mem_213757.mem)[gtid_228091] = defunc_1_op_res_228204;
            x_228196 = defunc_1_op_res_228204;
            ((int64_t *) mem_213760.mem)[gtid_228091] = defunc_1_op_res_228205;
            x_228197 = defunc_1_op_res_228205;
            ((int64_t *) mem_213763.mem)[gtid_228091] = defunc_1_op_res_228206;
            x_228198 = defunc_1_op_res_228206;
            ((int64_t *) mem_213766.mem)[gtid_228091] = defunc_1_op_res_228207;
            x_228199 = defunc_1_op_res_228207;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_3_parloop_229538_end = get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_3_parloop_229538_end -
                 futhark_mc_scan_stage_3_parloop_229538_start;
        
        ctx->futhark_mc_scan_stage_3_parloop_229538_runs[tid]++;
        ctx->futhark_mc_scan_stage_3_parloop_229538_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_scan_stage_3_parloop_229538_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segscan_task_229530(void *args, int64_t iterations, int tid,
                                   struct scheduler_info info)
{
    int err = 0;
    int flat_tid_228090 = tid;
    int num_tasks_228171 = info.nsubtasks;
    struct futhark_mc_task_229529 *futhark_mc_task_229529 =
                                  (struct futhark_mc_task_229529 *) args;
    struct futhark_context *ctx = futhark_mc_task_229529->ctx;
    uint64_t futhark_mc_segscan_task_229530_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segscan_task_229530_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229529->free_n_196692;
    struct memblock mem_213757 = {.desc ="mem_213757", .mem =
                                  futhark_mc_task_229529->free_mem_213757,
                                  .size =0, .references =NULL};
    struct memblock mem_213760 = {.desc ="mem_213760", .mem =
                                  futhark_mc_task_229529->free_mem_213760,
                                  .size =0, .references =NULL};
    struct memblock mem_213763 = {.desc ="mem_213763", .mem =
                                  futhark_mc_task_229529->free_mem_213763,
                                  .size =0, .references =NULL};
    struct memblock mem_213766 = {.desc ="mem_213766", .mem =
                                  futhark_mc_task_229529->free_mem_213766,
                                  .size =0, .references =NULL};
    struct memblock mem_213769 = {.desc ="mem_213769", .mem =
                                  futhark_mc_task_229529->free_mem_213769,
                                  .size =0, .references =NULL};
    struct memblock mem_param_228078 = {.desc ="mem_param_228078", .mem =
                                        futhark_mc_task_229529->free_mem_param_228078,
                                        .size =0, .references =NULL};
    int32_t defunc_2_radix_sort_step_arg_228081 =
            futhark_mc_task_229529->free_defunc_2_radix_sort_step_arg_228081;
    int32_t defunc_0_get_bit_arg_228082 =
            futhark_mc_task_229529->free_defunc_0_get_bit_arg_228082;
    bool cond_f_res_228083 = futhark_mc_task_229529->free_cond_f_res_228083;
    bool cond_f_res_228084 = futhark_mc_task_229529->free_cond_f_res_228084;
    size_t scan_stage_2_accum_mem_228187_cached_sizze_229531 = 0;
    unsigned char *scan_stage_2_accum_mem_228187 = NULL;
    size_t scan_stage_2_accum_mem_228189_cached_sizze_229532 = 0;
    unsigned char *scan_stage_2_accum_mem_228189 = NULL;
    size_t scan_stage_2_accum_mem_228191_cached_sizze_229533 = 0;
    unsigned char *scan_stage_2_accum_mem_228191 = NULL;
    size_t scan_stage_2_accum_mem_228193_cached_sizze_229534 = 0;
    unsigned char *scan_stage_2_accum_mem_228193 = NULL;
    int64_t iter_228172;
    struct futhark_mc_scan_stage_1_parloop_struct_229535
    futhark_mc_scan_stage_1_parloop_struct_229535;
    
    futhark_mc_scan_stage_1_parloop_struct_229535.ctx = ctx;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_mem_213757 =
        mem_213757.mem;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_mem_213760 =
        mem_213760.mem;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_mem_213763 =
        mem_213763.mem;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_mem_213766 =
        mem_213766.mem;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_mem_213769 =
        mem_213769.mem;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_mem_param_228078 =
        mem_param_228078.mem;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_defunc_2_radix_sort_step_arg_228081 =
        defunc_2_radix_sort_step_arg_228081;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_defunc_0_get_bit_arg_228082 =
        defunc_0_get_bit_arg_228082;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_cond_f_res_228083 =
        cond_f_res_228083;
    futhark_mc_scan_stage_1_parloop_struct_229535.free_cond_f_res_228084 =
        cond_f_res_228084;
    
    struct scheduler_parloop futhark_mc_scan_stage_1_parloop_229536_task;
    
    futhark_mc_scan_stage_1_parloop_229536_task.name =
        "futhark_mc_scan_stage_1_parloop_229536";
    futhark_mc_scan_stage_1_parloop_229536_task.fn =
        futhark_mc_scan_stage_1_parloop_229536;
    futhark_mc_scan_stage_1_parloop_229536_task.args =
        &futhark_mc_scan_stage_1_parloop_struct_229535;
    futhark_mc_scan_stage_1_parloop_229536_task.iterations = iterations;
    futhark_mc_scan_stage_1_parloop_229536_task.info = info;
    
    uint64_t futhark_mc_scan_stage_1_parloop_229536_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_scan_stage_1_parloop_229536_total_start = get_wall_time();
    
    int futhark_mc_scan_stage_1_parloop_229536_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_scan_stage_1_parloop_229536_task);
    
    if (futhark_mc_scan_stage_1_parloop_229536_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_scan_stage_1_parloop_229536_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_scan_stage_1_parloop_229536_total_end -
                 futhark_mc_scan_stage_1_parloop_229536_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_229536_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_229536_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_scan_stage_1_parloop_229536_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    if (slt32(1, num_tasks_228171)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "nonsegmentedScan stage 2");
        
        int64_t x_228173;
        int64_t x_228174;
        int64_t x_228175;
        int64_t x_228176;
        int64_t x_228177;
        int64_t x_228178;
        int64_t x_228179;
        int64_t x_228180;
        int64_t offset_228185 = (int64_t) 0;
        int64_t offset_index_228186 = (int64_t) 0;
        
        if (scan_stage_2_accum_mem_228187_cached_sizze_229531 <
            (size_t) (int64_t) 8) {
            scan_stage_2_accum_mem_228187 =
                realloc(scan_stage_2_accum_mem_228187, (int64_t) 8);
            scan_stage_2_accum_mem_228187_cached_sizze_229531 = (int64_t) 8;
        }
        if (scan_stage_2_accum_mem_228189_cached_sizze_229532 <
            (size_t) (int64_t) 8) {
            scan_stage_2_accum_mem_228189 =
                realloc(scan_stage_2_accum_mem_228189, (int64_t) 8);
            scan_stage_2_accum_mem_228189_cached_sizze_229532 = (int64_t) 8;
        }
        if (scan_stage_2_accum_mem_228191_cached_sizze_229533 <
            (size_t) (int64_t) 8) {
            scan_stage_2_accum_mem_228191 =
                realloc(scan_stage_2_accum_mem_228191, (int64_t) 8);
            scan_stage_2_accum_mem_228191_cached_sizze_229533 = (int64_t) 8;
        }
        if (scan_stage_2_accum_mem_228193_cached_sizze_229534 <
            (size_t) (int64_t) 8) {
            scan_stage_2_accum_mem_228193 =
                realloc(scan_stage_2_accum_mem_228193, (int64_t) 8);
            scan_stage_2_accum_mem_228193_cached_sizze_229534 = (int64_t) 8;
        }
        ((int64_t *) scan_stage_2_accum_mem_228187)[(int64_t) 0] = (int64_t) 0;
        ((int64_t *) scan_stage_2_accum_mem_228189)[(int64_t) 0] = (int64_t) 0;
        ((int64_t *) scan_stage_2_accum_mem_228191)[(int64_t) 0] = (int64_t) 0;
        ((int64_t *) scan_stage_2_accum_mem_228193)[(int64_t) 0] = (int64_t) 0;
        for (int32_t i_228195 = 0; i_228195 < num_tasks_228171 - 1;
             i_228195++) {
            offset_228185 = squot64(n_196692, sext_i32_i64(num_tasks_228171));
            if (slt64(sext_i32_i64(i_228195), srem64(n_196692,
                                                     sext_i32_i64(num_tasks_228171)))) {
                offset_228185 += (int64_t) 1;
            }
            offset_index_228186 += offset_228185;
            
            int64_t gtid_228091 = offset_index_228186;
            float x_228104;
            
            x_228104 = ((float *) mem_param_228078.mem)[gtid_228091];
            
            int32_t i32_arg_228105;
            
            i32_arg_228105 = futrts_to_bits32(x_228104);
            
            int32_t unsign_arg_228106 = ashr32(i32_arg_228105,
                                               defunc_0_get_bit_arg_228082);
            int32_t unsign_arg_228107 = 1 & unsign_arg_228106;
            int32_t unsign_arg_228108 = ashr32(i32_arg_228105, 31);
            int32_t unsign_arg_228109 = 1 & unsign_arg_228108;
            bool cond_228110 = unsign_arg_228109 == 1;
            bool x_228111 = !cond_228110;
            bool y_228112 = cond_f_res_228083 && x_228111;
            bool cond_228113 = cond_228110 || y_228112;
            int32_t defunc_1_get_bit_res_228114;
            
            if (cond_228113) {
                int32_t defunc_1_get_bit_res_t_res_228115 = 1 ^
                        unsign_arg_228107;
                
                defunc_1_get_bit_res_228114 = defunc_1_get_bit_res_t_res_228115;
            } else {
                defunc_1_get_bit_res_228114 = unsign_arg_228107;
            }
            
            int32_t x_228116 = mul32(2, defunc_1_get_bit_res_228114);
            int32_t unsign_arg_228117 = ashr32(i32_arg_228105,
                                               defunc_2_radix_sort_step_arg_228081);
            int32_t unsign_arg_228118 = 1 & unsign_arg_228117;
            bool y_228119 = cond_f_res_228084 && x_228111;
            bool cond_228120 = cond_228110 || y_228119;
            int32_t defunc_1_get_bit_res_228121;
            
            if (cond_228120) {
                int32_t defunc_1_get_bit_res_t_res_228122 = 1 ^
                        unsign_arg_228118;
                
                defunc_1_get_bit_res_228121 = defunc_1_get_bit_res_t_res_228122;
            } else {
                defunc_1_get_bit_res_228121 = unsign_arg_228118;
            }
            
            int32_t defunc_0_f_res_228123 = add32(x_228116,
                                                  defunc_1_get_bit_res_228121);
            bool cond_228124 = defunc_0_f_res_228123 == 0;
            int64_t defunc_0_f_res_228125 = btoi_bool_i64(cond_228124);
            int64_t defunc_0_f_res_228126;
            int64_t defunc_0_f_res_228127;
            int64_t defunc_0_f_res_228128;
            
            if (cond_228124) {
                defunc_0_f_res_228126 = (int64_t) 0;
                defunc_0_f_res_228127 = (int64_t) 0;
                defunc_0_f_res_228128 = (int64_t) 0;
            } else {
                bool cond_228129 = defunc_0_f_res_228123 == 1;
                int64_t defunc_0_f_res_f_res_228130 =
                        btoi_bool_i64(cond_228129);
                int64_t defunc_0_f_res_f_res_228131;
                int64_t defunc_0_f_res_f_res_228132;
                
                if (cond_228129) {
                    defunc_0_f_res_f_res_228131 = (int64_t) 0;
                    defunc_0_f_res_f_res_228132 = (int64_t) 0;
                } else {
                    bool cond_228133 = defunc_0_f_res_228123 == 2;
                    int64_t defunc_0_f_res_f_res_f_res_228134 =
                            btoi_bool_i64(cond_228133);
                    bool cond_neg_228135 = !cond_228133;
                    int64_t defunc_0_f_res_f_res_f_res_228136 =
                            btoi_bool_i64(cond_neg_228135);
                    
                    defunc_0_f_res_f_res_228131 =
                        defunc_0_f_res_f_res_f_res_228134;
                    defunc_0_f_res_f_res_228132 =
                        defunc_0_f_res_f_res_f_res_228136;
                }
                defunc_0_f_res_228126 = defunc_0_f_res_f_res_228130;
                defunc_0_f_res_228127 = defunc_0_f_res_f_res_228131;
                defunc_0_f_res_228128 = defunc_0_f_res_f_res_228132;
            }
            // Read carry in
            {
                x_228173 =
                    ((int64_t *) scan_stage_2_accum_mem_228187)[(int64_t) 0];
                x_228174 =
                    ((int64_t *) scan_stage_2_accum_mem_228189)[(int64_t) 0];
                x_228175 =
                    ((int64_t *) scan_stage_2_accum_mem_228191)[(int64_t) 0];
                x_228176 =
                    ((int64_t *) scan_stage_2_accum_mem_228193)[(int64_t) 0];
            }
            // Read next values
            {
                x_228177 = ((int64_t *) mem_213757.mem)[offset_index_228186 -
                                                        (int64_t) 1];
                x_228178 = ((int64_t *) mem_213760.mem)[offset_index_228186 -
                                                        (int64_t) 1];
                x_228179 = ((int64_t *) mem_213763.mem)[offset_index_228186 -
                                                        (int64_t) 1];
                x_228180 = ((int64_t *) mem_213766.mem)[offset_index_228186 -
                                                        (int64_t) 1];
            }
            
            int64_t defunc_1_op_res_228181 = add64(x_228173, x_228177);
            int64_t defunc_1_op_res_228182 = add64(x_228174, x_228178);
            int64_t defunc_1_op_res_228183 = add64(x_228175, x_228179);
            int64_t defunc_1_op_res_228184 = add64(x_228176, x_228180);
            
            ((int64_t *) mem_213757.mem)[offset_index_228186 - (int64_t) 1] =
                defunc_1_op_res_228181;
            ((int64_t *) scan_stage_2_accum_mem_228187)[(int64_t) 0] =
                defunc_1_op_res_228181;
            ((int64_t *) mem_213760.mem)[offset_index_228186 - (int64_t) 1] =
                defunc_1_op_res_228182;
            ((int64_t *) scan_stage_2_accum_mem_228189)[(int64_t) 0] =
                defunc_1_op_res_228182;
            ((int64_t *) mem_213763.mem)[offset_index_228186 - (int64_t) 1] =
                defunc_1_op_res_228183;
            ((int64_t *) scan_stage_2_accum_mem_228191)[(int64_t) 0] =
                defunc_1_op_res_228183;
            ((int64_t *) mem_213766.mem)[offset_index_228186 - (int64_t) 1] =
                defunc_1_op_res_228184;
            ((int64_t *) scan_stage_2_accum_mem_228193)[(int64_t) 0] =
                defunc_1_op_res_228184;
        }
        
        int64_t iter_228208 = (int64_t) 0;
        struct futhark_mc_scan_stage_3_parloop_struct_229537
        futhark_mc_scan_stage_3_parloop_struct_229537;
        
        futhark_mc_scan_stage_3_parloop_struct_229537.ctx = ctx;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_mem_213757 =
            mem_213757.mem;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_mem_213760 =
            mem_213760.mem;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_mem_213763 =
            mem_213763.mem;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_mem_213766 =
            mem_213766.mem;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_mem_param_228078 =
            mem_param_228078.mem;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_defunc_2_radix_sort_step_arg_228081 =
            defunc_2_radix_sort_step_arg_228081;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_defunc_0_get_bit_arg_228082 =
            defunc_0_get_bit_arg_228082;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_cond_f_res_228083 =
            cond_f_res_228083;
        futhark_mc_scan_stage_3_parloop_struct_229537.free_cond_f_res_228084 =
            cond_f_res_228084;
        
        struct scheduler_parloop futhark_mc_scan_stage_3_parloop_229538_task;
        
        futhark_mc_scan_stage_3_parloop_229538_task.name =
            "futhark_mc_scan_stage_3_parloop_229538";
        futhark_mc_scan_stage_3_parloop_229538_task.fn =
            futhark_mc_scan_stage_3_parloop_229538;
        futhark_mc_scan_stage_3_parloop_229538_task.args =
            &futhark_mc_scan_stage_3_parloop_struct_229537;
        futhark_mc_scan_stage_3_parloop_229538_task.iterations = iterations;
        futhark_mc_scan_stage_3_parloop_229538_task.info = info;
        
        uint64_t futhark_mc_scan_stage_3_parloop_229538_total_start = 0;
        
        if (ctx->profiling && !ctx->profiling_paused)
            futhark_mc_scan_stage_3_parloop_229538_total_start =
                get_wall_time();
        
        int futhark_mc_scan_stage_3_parloop_229538_err =
            scheduler_execute_task(&ctx->scheduler,
                                   &futhark_mc_scan_stage_3_parloop_229538_task);
        
        if (futhark_mc_scan_stage_3_parloop_229538_err != 0) {
            err = 1;
            goto cleanup;
        }
        if (ctx->profiling && !ctx->profiling_paused) {
            uint64_t futhark_mc_scan_stage_3_parloop_229538_total_end =
                     get_wall_time();
            uint64_t elapsed =
                     futhark_mc_scan_stage_3_parloop_229538_total_end -
                     futhark_mc_scan_stage_3_parloop_229538_total_start;
            
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_229538_total_runs,
                               1, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_229538_total_total_runtime,
                               elapsed, __ATOMIC_RELAXED);
            __atomic_fetch_add(&ctx->futhark_mc_scan_stage_3_parloop_229538_total_iter,
                               iterations, __ATOMIC_RELAXED);
        }
    }
    
  cleanup:
    {
        free(scan_stage_2_accum_mem_228187);
        free(scan_stage_2_accum_mem_228189);
        free(scan_stage_2_accum_mem_228191);
        free(scan_stage_2_accum_mem_228193);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segscan_task_229530_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segscan_task_229530_end -
                 futhark_mc_segscan_task_229530_start;
        
        ctx->futhark_mc_segscan_task_229530_runs[tid]++;
        ctx->futhark_mc_segscan_task_229530_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segscan_task_229530_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229539 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    unsigned char *free_mem_213757;
    unsigned char *free_mem_213760;
    unsigned char *free_mem_213763;
    unsigned char *free_mem_213766;
    unsigned char *free_mem_213769;
    unsigned char *free_mem_param_228078;
    unsigned char *free_mem_param_out_228079;
    int64_t free_last_res_228137;
    int64_t free_last_res_228138;
    int64_t free_last_res_228139;
};
struct futhark_mc_segmap_parloop_struct_229541 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    unsigned char *free_mem_213757;
    unsigned char *free_mem_213760;
    unsigned char *free_mem_213763;
    unsigned char *free_mem_213766;
    unsigned char *free_mem_213769;
    unsigned char *free_mem_param_228078;
    unsigned char *free_mem_param_out_228079;
    int64_t free_last_res_228137;
    int64_t free_last_res_228138;
    int64_t free_last_res_228139;
};
static int futhark_mc_segmap_parloop_229542(void *args, int64_t start,
                                            int64_t end, int flat_tid_228142,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229541
    *futhark_mc_segmap_parloop_struct_229541 =
    (struct futhark_mc_segmap_parloop_struct_229541 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229541->ctx;
    uint64_t futhark_mc_segmap_parloop_229542_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229542_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229541->free_n_196692;
    struct memblock mem_213757 = {.desc ="mem_213757", .mem =
                                  futhark_mc_segmap_parloop_struct_229541->free_mem_213757,
                                  .size =0, .references =NULL};
    struct memblock mem_213760 = {.desc ="mem_213760", .mem =
                                  futhark_mc_segmap_parloop_struct_229541->free_mem_213760,
                                  .size =0, .references =NULL};
    struct memblock mem_213763 = {.desc ="mem_213763", .mem =
                                  futhark_mc_segmap_parloop_struct_229541->free_mem_213763,
                                  .size =0, .references =NULL};
    struct memblock mem_213766 = {.desc ="mem_213766", .mem =
                                  futhark_mc_segmap_parloop_struct_229541->free_mem_213766,
                                  .size =0, .references =NULL};
    struct memblock mem_213769 = {.desc ="mem_213769", .mem =
                                  futhark_mc_segmap_parloop_struct_229541->free_mem_213769,
                                  .size =0, .references =NULL};
    struct memblock mem_param_228078 = {.desc ="mem_param_228078", .mem =
                                        futhark_mc_segmap_parloop_struct_229541->free_mem_param_228078,
                                        .size =0, .references =NULL};
    struct memblock mem_param_out_228079 = {.desc ="mem_param_out_228079",
                                            .mem =
                                            futhark_mc_segmap_parloop_struct_229541->free_mem_param_out_228079,
                                            .size =0, .references =NULL};
    int64_t last_res_228137 =
            futhark_mc_segmap_parloop_struct_229541->free_last_res_228137;
    int64_t last_res_228138 =
            futhark_mc_segmap_parloop_struct_229541->free_last_res_228138;
    int64_t last_res_228139 =
            futhark_mc_segmap_parloop_struct_229541->free_last_res_228139;
    int64_t iterations = end - start;
    int64_t iter_228210 = start;
    
    for (; iter_228210 < end; iter_228210++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228229 = n_196692;
        int64_t gtid_228143 = iter_228210;
        int64_t remnant_228230 = iter_228210 - gtid_228143;
        int32_t x_228144;
        
        x_228144 = ((int32_t *) mem_213769.mem)[gtid_228143];
        
        float write_value_228145;
        
        write_value_228145 = ((float *) mem_param_228078.mem)[gtid_228143];
        
        bool match_lit_228146 = 0 == x_228144;
        int64_t defunc_1_f_res_228147;
        
        if (match_lit_228146) {
            int64_t x_228211;
            
            x_228211 = ((int64_t *) mem_213757.mem)[gtid_228143];
            
            int64_t case_res_228212 = sub64(x_228211, (int64_t) 1);
            
            defunc_1_f_res_228147 = case_res_228212;
        } else {
            bool match_lit_228213 = 1 == x_228144;
            int64_t x_228214;
            
            if (match_lit_228213) {
                int64_t x_228215;
                
                x_228215 = ((int64_t *) mem_213760.mem)[gtid_228143];
                
                int64_t x_228216 = add64(last_res_228137, x_228215);
                int64_t case_res_228217 = sub64(x_228216, (int64_t) 1);
                
                x_228214 = case_res_228217;
            } else {
                bool match_lit_228218 = 2 == x_228144;
                int64_t x_228219;
                
                if (match_lit_228218) {
                    int64_t x_228220;
                    
                    x_228220 = ((int64_t *) mem_213763.mem)[gtid_228143];
                    
                    int64_t x_228221 = add64(last_res_228137, last_res_228138);
                    int64_t x_228222 = add64(x_228220, x_228221);
                    int64_t case_res_228223 = sub64(x_228222, (int64_t) 1);
                    
                    x_228219 = case_res_228223;
                } else {
                    int64_t x_228224;
                    
                    x_228224 = ((int64_t *) mem_213766.mem)[gtid_228143];
                    
                    int64_t x_228225 = add64(last_res_228137, last_res_228138);
                    int64_t x_228226 = add64(last_res_228139, x_228225);
                    int64_t x_228227 = add64(x_228224, x_228226);
                    int64_t defunc_1_f_res_res_228228 = sub64(x_228227,
                                                              (int64_t) 1);
                    
                    x_228219 = defunc_1_f_res_res_228228;
                }
                x_228214 = x_228219;
            }
            defunc_1_f_res_228147 = x_228214;
        }
        if (sle64((int64_t) 0, defunc_1_f_res_228147) &&
            slt64(defunc_1_f_res_228147, n_196692)) {
            ((float *) mem_param_out_228079.mem)[defunc_1_f_res_228147] =
                write_value_228145;
        }
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229542_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229542_end -
                 futhark_mc_segmap_parloop_229542_start;
        
        ctx->futhark_mc_segmap_parloop_229542_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229542_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229542_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229540(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_228142 = tid;
    int num_tasks_228209 = info.nsubtasks;
    struct futhark_mc_task_229539 *futhark_mc_task_229539 =
                                  (struct futhark_mc_task_229539 *) args;
    struct futhark_context *ctx = futhark_mc_task_229539->ctx;
    uint64_t futhark_mc_segmap_task_229540_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229540_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229539->free_n_196692;
    struct memblock mem_213757 = {.desc ="mem_213757", .mem =
                                  futhark_mc_task_229539->free_mem_213757,
                                  .size =0, .references =NULL};
    struct memblock mem_213760 = {.desc ="mem_213760", .mem =
                                  futhark_mc_task_229539->free_mem_213760,
                                  .size =0, .references =NULL};
    struct memblock mem_213763 = {.desc ="mem_213763", .mem =
                                  futhark_mc_task_229539->free_mem_213763,
                                  .size =0, .references =NULL};
    struct memblock mem_213766 = {.desc ="mem_213766", .mem =
                                  futhark_mc_task_229539->free_mem_213766,
                                  .size =0, .references =NULL};
    struct memblock mem_213769 = {.desc ="mem_213769", .mem =
                                  futhark_mc_task_229539->free_mem_213769,
                                  .size =0, .references =NULL};
    struct memblock mem_param_228078 = {.desc ="mem_param_228078", .mem =
                                        futhark_mc_task_229539->free_mem_param_228078,
                                        .size =0, .references =NULL};
    struct memblock mem_param_out_228079 = {.desc ="mem_param_out_228079",
                                            .mem =
                                            futhark_mc_task_229539->free_mem_param_out_228079,
                                            .size =0, .references =NULL};
    int64_t last_res_228137 = futhark_mc_task_229539->free_last_res_228137;
    int64_t last_res_228138 = futhark_mc_task_229539->free_last_res_228138;
    int64_t last_res_228139 = futhark_mc_task_229539->free_last_res_228139;
    int64_t iter_228210;
    struct futhark_mc_segmap_parloop_struct_229541
    futhark_mc_segmap_parloop_struct_229541;
    
    futhark_mc_segmap_parloop_struct_229541.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229541.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229541.free_mem_213757 = mem_213757.mem;
    futhark_mc_segmap_parloop_struct_229541.free_mem_213760 = mem_213760.mem;
    futhark_mc_segmap_parloop_struct_229541.free_mem_213763 = mem_213763.mem;
    futhark_mc_segmap_parloop_struct_229541.free_mem_213766 = mem_213766.mem;
    futhark_mc_segmap_parloop_struct_229541.free_mem_213769 = mem_213769.mem;
    futhark_mc_segmap_parloop_struct_229541.free_mem_param_228078 =
        mem_param_228078.mem;
    futhark_mc_segmap_parloop_struct_229541.free_mem_param_out_228079 =
        mem_param_out_228079.mem;
    futhark_mc_segmap_parloop_struct_229541.free_last_res_228137 =
        last_res_228137;
    futhark_mc_segmap_parloop_struct_229541.free_last_res_228138 =
        last_res_228138;
    futhark_mc_segmap_parloop_struct_229541.free_last_res_228139 =
        last_res_228139;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229542_task;
    
    futhark_mc_segmap_parloop_229542_task.name =
        "futhark_mc_segmap_parloop_229542";
    futhark_mc_segmap_parloop_229542_task.fn = futhark_mc_segmap_parloop_229542;
    futhark_mc_segmap_parloop_229542_task.args =
        &futhark_mc_segmap_parloop_struct_229541;
    futhark_mc_segmap_parloop_229542_task.iterations = iterations;
    futhark_mc_segmap_parloop_229542_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229542_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229542_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229542_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229542_task);
    
    if (futhark_mc_segmap_parloop_229542_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229542_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229542_total_end -
                 futhark_mc_segmap_parloop_229542_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229542_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229542_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229542_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229540_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229540_end -
                 futhark_mc_segmap_task_229540_start;
        
        ctx->futhark_mc_segmap_task_229540_runs[tid]++;
        ctx->futhark_mc_segmap_task_229540_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229540_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229523(void *args, int64_t start,
                                            int64_t end, int flat_tid_208751,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229522
    *futhark_mc_segmap_parloop_struct_229522 =
    (struct futhark_mc_segmap_parloop_struct_229522 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229522->ctx;
    uint64_t futhark_mc_segmap_parloop_229523_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229523_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229522->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229522->free_n_196692;
    int64_t i_196779 = futhark_mc_segmap_parloop_struct_229522->free_i_196779;
    int32_t iters_199778 =
            futhark_mc_segmap_parloop_struct_229522->free_iters_199778;
    int64_t bytes_210356 =
            futhark_mc_segmap_parloop_struct_229522->free_bytes_210356;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229522->free_bytes_210949;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_segmap_parloop_struct_229522->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_segmap_parloop_struct_229522->free_mem_213889,
                                  .size =0, .references =NULL};
    int64_t num_bytes_214091 =
            futhark_mc_segmap_parloop_struct_229522->free_num_bytes_214091;
    size_t mem_213757_cached_sizze_229524 = 0;
    unsigned char *mem_213757 = NULL;
    size_t mem_213760_cached_sizze_229525 = 0;
    unsigned char *mem_213760 = NULL;
    size_t mem_213763_cached_sizze_229526 = 0;
    unsigned char *mem_213763 = NULL;
    size_t mem_213766_cached_sizze_229527 = 0;
    unsigned char *mem_213766 = NULL;
    size_t mem_213769_cached_sizze_229528 = 0;
    unsigned char *mem_213769 = NULL;
    int64_t iterations = end - start;
    int64_t iter_228076 = start;
    
    if (mem_213757_cached_sizze_229524 < (size_t) bytes_210356) {
        mem_213757 = realloc(mem_213757, bytes_210356);
        mem_213757_cached_sizze_229524 = bytes_210356;
    }
    if (mem_213760_cached_sizze_229525 < (size_t) bytes_210356) {
        mem_213760 = realloc(mem_213760, bytes_210356);
        mem_213760_cached_sizze_229525 = bytes_210356;
    }
    if (mem_213763_cached_sizze_229526 < (size_t) bytes_210356) {
        mem_213763 = realloc(mem_213763, bytes_210356);
        mem_213763_cached_sizze_229526 = bytes_210356;
    }
    if (mem_213766_cached_sizze_229527 < (size_t) bytes_210356) {
        mem_213766 = realloc(mem_213766, bytes_210356);
        mem_213766_cached_sizze_229527 = bytes_210356;
    }
    if (mem_213769_cached_sizze_229528 < (size_t) bytes_210949) {
        mem_213769 = realloc(mem_213769, bytes_210949);
        mem_213769_cached_sizze_229528 = bytes_210949;
    }
    
    struct memblock mem_in_214092;
    
    mem_in_214092.references = NULL;
    if (memblock_alloc(ctx, &mem_in_214092, num_bytes_214091,
                       "mem_in_214092")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock mem_213772;
    
    mem_213772.references = NULL;
    if (memblock_alloc(ctx, &mem_213772, bytes_210949, "mem_213772")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock ext_mem_213775;
    
    ext_mem_213775.references = NULL;
    
    struct memblock ext_mem_unused_214093;
    
    ext_mem_unused_214093.references = NULL;
    
    struct memblock mem_param_228078;
    
    mem_param_228078.references = NULL;
    
    struct memblock mem_param_out_228079;
    
    mem_param_out_228079.references = NULL;
    for (; iter_228076 < end; iter_228076++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228166 = m_196691;
        int64_t gtid_208752 = iter_228076;
        int64_t remnant_228167 = iter_228076 - gtid_208752;
        
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_in_214092.mem + (int64_t) 0, mem_213739.mem +
                    gtid_208752 * n_196692 * (int64_t) 4, n_196692 *
                    (int64_t) 4);
        if (memblock_set(ctx, &mem_param_228078, &mem_in_214092,
                         "mem_in_214092") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_out_228079, &mem_213772,
                         "mem_213772") != 0)
            return 1;
        for (int32_t i_228077 = 0; i_228077 < iters_199778; i_228077++) {
            int32_t defunc_2_radix_sort_step_arg_228081 = mul32(2, i_228077);
            int32_t defunc_0_get_bit_arg_228082 = add32(1,
                                                        defunc_2_radix_sort_step_arg_228081);
            bool cond_f_res_228083 = defunc_0_get_bit_arg_228082 == 31;
            bool cond_f_res_228084 = defunc_2_radix_sort_step_arg_228081 == 31;
            int64_t flat_tid_228090 = (int64_t) 0;
            int32_t num_tasks_228171;
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "nonsegmented segScan");
            
            struct futhark_mc_task_229529 futhark_mc_task_229529;
            
            futhark_mc_task_229529.ctx = ctx;
            futhark_mc_task_229529.free_n_196692 = n_196692;
            futhark_mc_task_229529.free_mem_213757 = mem_213757;
            futhark_mc_task_229529.free_mem_213760 = mem_213760;
            futhark_mc_task_229529.free_mem_213763 = mem_213763;
            futhark_mc_task_229529.free_mem_213766 = mem_213766;
            futhark_mc_task_229529.free_mem_213769 = mem_213769;
            futhark_mc_task_229529.free_mem_param_228078 = mem_param_228078.mem;
            futhark_mc_task_229529.free_defunc_2_radix_sort_step_arg_228081 =
                defunc_2_radix_sort_step_arg_228081;
            futhark_mc_task_229529.free_defunc_0_get_bit_arg_228082 =
                defunc_0_get_bit_arg_228082;
            futhark_mc_task_229529.free_cond_f_res_228083 = cond_f_res_228083;
            futhark_mc_task_229529.free_cond_f_res_228084 = cond_f_res_228084;
            
            struct scheduler_segop futhark_mc_task_229529_task;
            
            futhark_mc_task_229529_task.args = &futhark_mc_task_229529;
            futhark_mc_task_229529_task.top_level_fn =
                futhark_mc_segscan_task_229530;
            futhark_mc_task_229529_task.name = "futhark_mc_segscan_task_229530";
            futhark_mc_task_229529_task.iterations = n_196692;
            futhark_mc_task_229529_task.task_time =
                &ctx->futhark_mc_segscan_task_229530_total_time;
            futhark_mc_task_229529_task.task_iter =
                &ctx->futhark_mc_segscan_task_229530_total_iter;
            futhark_mc_task_229529_task.sched = STATIC;
            futhark_mc_task_229529_task.nested_fn = NULL;
            
            int futhark_mc_segscan_task_229530_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229529_task);
            
            if (futhark_mc_segscan_task_229530_err != 0) {
                if (memblock_unref(ctx, &mem_param_out_228079,
                                   "mem_param_out_228079") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_228078,
                                   "mem_param_228078") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_unused_214093,
                                   "ext_mem_unused_214093") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213775, "ext_mem_213775") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_213772, "mem_213772") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_in_214092, "mem_in_214092") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t last_res_228137;
            
            last_res_228137 = ((int64_t *) mem_213757)[i_196779];
            
            int64_t last_res_228138;
            
            last_res_228138 = ((int64_t *) mem_213760)[i_196779];
            
            int64_t last_res_228139;
            
            last_res_228139 = ((int64_t *) mem_213763)[i_196779];
            if (n_196692 * (int64_t) 4 > 0)
                memmove(mem_param_out_228079.mem + (int64_t) 0,
                        mem_param_228078.mem + (int64_t) 0, n_196692 *
                        (int64_t) 4);
            
            int64_t flat_tid_228142 = (int64_t) 0;
            int32_t num_tasks_228209;
            struct futhark_mc_task_229539 futhark_mc_task_229539;
            
            futhark_mc_task_229539.ctx = ctx;
            futhark_mc_task_229539.free_n_196692 = n_196692;
            futhark_mc_task_229539.free_mem_213757 = mem_213757;
            futhark_mc_task_229539.free_mem_213760 = mem_213760;
            futhark_mc_task_229539.free_mem_213763 = mem_213763;
            futhark_mc_task_229539.free_mem_213766 = mem_213766;
            futhark_mc_task_229539.free_mem_213769 = mem_213769;
            futhark_mc_task_229539.free_mem_param_228078 = mem_param_228078.mem;
            futhark_mc_task_229539.free_mem_param_out_228079 =
                mem_param_out_228079.mem;
            futhark_mc_task_229539.free_last_res_228137 = last_res_228137;
            futhark_mc_task_229539.free_last_res_228138 = last_res_228138;
            futhark_mc_task_229539.free_last_res_228139 = last_res_228139;
            
            struct scheduler_segop futhark_mc_task_229539_task;
            
            futhark_mc_task_229539_task.args = &futhark_mc_task_229539;
            futhark_mc_task_229539_task.top_level_fn =
                futhark_mc_segmap_task_229540;
            futhark_mc_task_229539_task.name = "futhark_mc_segmap_task_229540";
            futhark_mc_task_229539_task.iterations = n_196692;
            futhark_mc_task_229539_task.task_time =
                &ctx->futhark_mc_segmap_task_229540_total_time;
            futhark_mc_task_229539_task.task_iter =
                &ctx->futhark_mc_segmap_task_229540_total_iter;
            futhark_mc_task_229539_task.sched = STATIC;
            futhark_mc_task_229539_task.nested_fn = NULL;
            
            int futhark_mc_segmap_task_229540_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229539_task);
            
            if (futhark_mc_segmap_task_229540_err != 0) {
                if (memblock_unref(ctx, &mem_param_out_228079,
                                   "mem_param_out_228079") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_228078,
                                   "mem_param_228078") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_unused_214093,
                                   "ext_mem_unused_214093") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213775, "ext_mem_213775") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_213772, "mem_213772") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_in_214092, "mem_in_214092") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            struct memblock mem_param_tmp_228168;
            
            mem_param_tmp_228168.references = NULL;
            if (memblock_set(ctx, &mem_param_tmp_228168, &mem_param_out_228079,
                             "mem_param_out_228079") != 0)
                return 1;
            
            struct memblock mem_param_out_tmp_228169;
            
            mem_param_out_tmp_228169.references = NULL;
            if (memblock_set(ctx, &mem_param_out_tmp_228169, &mem_param_228078,
                             "mem_param_228078") != 0)
                return 1;
            if (memblock_set(ctx, &mem_param_228078, &mem_param_tmp_228168,
                             "mem_param_tmp_228168") != 0)
                return 1;
            if (memblock_set(ctx, &mem_param_out_228079,
                             &mem_param_out_tmp_228169,
                             "mem_param_out_tmp_228169") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_out_tmp_228169,
                               "mem_param_out_tmp_228169") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_tmp_228168,
                               "mem_param_tmp_228168") != 0)
                return 1;
        }
        if (memblock_set(ctx, &ext_mem_213775, &mem_param_228078,
                         "mem_param_228078") != 0)
            return 1;
        if (memblock_set(ctx, &ext_mem_unused_214093, &mem_param_out_228079,
                         "mem_param_out_228079") != 0)
            return 1;
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213889.mem + gtid_208752 * n_196692 * (int64_t) 4,
                    ext_mem_213775.mem + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213757);
    free(mem_213760);
    free(mem_213763);
    free(mem_213766);
    free(mem_213769);
    if (memblock_unref(ctx, &mem_param_out_228079, "mem_param_out_228079") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_228078, "mem_param_228078") != 0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_unused_214093, "ext_mem_unused_214093") !=
        0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_213775, "ext_mem_213775") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_213772, "mem_213772") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_in_214092, "mem_in_214092") != 0)
        return 1;
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229523_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229523_end -
                 futhark_mc_segmap_parloop_229523_start;
        
        ctx->futhark_mc_segmap_parloop_229523_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229523_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229523_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229521(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208751 = tid;
    int num_tasks_227955 = info.nsubtasks;
    struct futhark_mc_task_229512 *futhark_mc_task_229512 =
                                  (struct futhark_mc_task_229512 *) args;
    struct futhark_context *ctx = futhark_mc_task_229512->ctx;
    uint64_t futhark_mc_segmap_nested_task_229521_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229521_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229512->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229512->free_n_196692;
    int64_t i_196779 = futhark_mc_task_229512->free_i_196779;
    int32_t iters_199778 = futhark_mc_task_229512->free_iters_199778;
    int64_t bytes_210356 = futhark_mc_task_229512->free_bytes_210356;
    int64_t bytes_210949 = futhark_mc_task_229512->free_bytes_210949;
    struct memblock mem_213739 = {.desc ="mem_213739", .mem =
                                  futhark_mc_task_229512->free_mem_213739,
                                  .size =0, .references =NULL};
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_task_229512->free_mem_213889,
                                  .size =0, .references =NULL};
    int64_t num_bytes_214091 = futhark_mc_task_229512->free_num_bytes_214091;
    int64_t num_bytes_214096 = futhark_mc_task_229512->free_num_bytes_214096;
    int64_t iter_228076;
    struct futhark_mc_segmap_parloop_struct_229522
    futhark_mc_segmap_parloop_struct_229522;
    
    futhark_mc_segmap_parloop_struct_229522.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229522.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229522.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229522.free_i_196779 = i_196779;
    futhark_mc_segmap_parloop_struct_229522.free_iters_199778 = iters_199778;
    futhark_mc_segmap_parloop_struct_229522.free_bytes_210356 = bytes_210356;
    futhark_mc_segmap_parloop_struct_229522.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229522.free_mem_213739 = mem_213739.mem;
    futhark_mc_segmap_parloop_struct_229522.free_mem_213889 = mem_213889.mem;
    futhark_mc_segmap_parloop_struct_229522.free_num_bytes_214091 =
        num_bytes_214091;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229523_task;
    
    futhark_mc_segmap_parloop_229523_task.name =
        "futhark_mc_segmap_parloop_229523";
    futhark_mc_segmap_parloop_229523_task.fn = futhark_mc_segmap_parloop_229523;
    futhark_mc_segmap_parloop_229523_task.args =
        &futhark_mc_segmap_parloop_struct_229522;
    futhark_mc_segmap_parloop_229523_task.iterations = iterations;
    futhark_mc_segmap_parloop_229523_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229523_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229523_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229523_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229523_task);
    
    if (futhark_mc_segmap_parloop_229523_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229523_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229523_total_end -
                 futhark_mc_segmap_parloop_229523_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229523_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229523_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229523_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229521_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229521_end -
                 futhark_mc_segmap_nested_task_229521_start;
        
        ctx->futhark_mc_segmap_nested_task_229521_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229521_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229521_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229543 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_stl_res_196773;
    int64_t free_j_m_i_197246;
    unsigned char *free_mem_213889;
    unsigned char *free_mem_213892;
    unsigned char *free_mem_213895;
    unsigned char *free_mem_213898;
};
struct futhark_mc_segmap_parloop_struct_229545 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_stl_res_196773;
    int64_t free_j_m_i_197246;
    unsigned char *free_mem_213889;
    unsigned char *free_mem_213892;
    unsigned char *free_mem_213895;
    unsigned char *free_mem_213898;
};
static int futhark_mc_segmap_parloop_229546(void *args, int64_t start,
                                            int64_t end, int flat_tid_208842,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229545
    *futhark_mc_segmap_parloop_struct_229545 =
    (struct futhark_mc_segmap_parloop_struct_229545 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229545->ctx;
    uint64_t futhark_mc_segmap_parloop_229546_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229546_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229545->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229545->free_n_196692;
    int64_t stl_res_196773 =
            futhark_mc_segmap_parloop_struct_229545->free_stl_res_196773;
    int64_t j_m_i_197246 =
            futhark_mc_segmap_parloop_struct_229545->free_j_m_i_197246;
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_segmap_parloop_struct_229545->free_mem_213889,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_segmap_parloop_struct_229545->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_segmap_parloop_struct_229545->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_segmap_parloop_struct_229545->free_mem_213898,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_228232 = start;
    
    for (; iter_228232 < end; iter_228232++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228238 = m_196691;
        int64_t gtid_208843 = iter_228232;
        int64_t remnant_228239 = iter_228232 - gtid_208843;
        float defunc_2_reduce_res_199914;
        float redout_228234 = 0.0F;
        
        for (int64_t i_228233 = 0; i_228233 < j_m_i_197246; i_228233++) {
            int64_t slice_228235 = stl_res_196773 + i_228233;
            float x_228236;
            
            x_228236 = ((float *) mem_213889.mem)[gtid_208843 * n_196692 +
                                                  slice_228235];
            
            float defunc_1_op_res_228237 = x_228236 + redout_228234;
            float redout_tmp_228240 = defunc_1_op_res_228237;
            
            redout_228234 = redout_tmp_228240;
        }
        defunc_2_reduce_res_199914 = redout_228234;
        
        float h_199919 = 3.0F * defunc_2_reduce_res_199914;
        float h9_199920 = 0.999F * h_199919;
        float h1_199921 = 1.0e-3F * h_199919;
        
        ((float *) mem_213892.mem)[gtid_208843] = h_199919;
        ((float *) mem_213895.mem)[gtid_208843] = h9_199920;
        ((float *) mem_213898.mem)[gtid_208843] = h1_199921;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229546_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229546_end -
                 futhark_mc_segmap_parloop_229546_start;
        
        ctx->futhark_mc_segmap_parloop_229546_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229546_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229546_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229544(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208842 = tid;
    int num_tasks_228231 = info.nsubtasks;
    struct futhark_mc_task_229543 *futhark_mc_task_229543 =
                                  (struct futhark_mc_task_229543 *) args;
    struct futhark_context *ctx = futhark_mc_task_229543->ctx;
    uint64_t futhark_mc_segmap_task_229544_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229544_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229543->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229543->free_n_196692;
    int64_t stl_res_196773 = futhark_mc_task_229543->free_stl_res_196773;
    int64_t j_m_i_197246 = futhark_mc_task_229543->free_j_m_i_197246;
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_task_229543->free_mem_213889,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_task_229543->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_task_229543->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_task_229543->free_mem_213898,
                                  .size =0, .references =NULL};
    int64_t iter_228232;
    struct futhark_mc_segmap_parloop_struct_229545
    futhark_mc_segmap_parloop_struct_229545;
    
    futhark_mc_segmap_parloop_struct_229545.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229545.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229545.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229545.free_stl_res_196773 =
        stl_res_196773;
    futhark_mc_segmap_parloop_struct_229545.free_j_m_i_197246 = j_m_i_197246;
    futhark_mc_segmap_parloop_struct_229545.free_mem_213889 = mem_213889.mem;
    futhark_mc_segmap_parloop_struct_229545.free_mem_213892 = mem_213892.mem;
    futhark_mc_segmap_parloop_struct_229545.free_mem_213895 = mem_213895.mem;
    futhark_mc_segmap_parloop_struct_229545.free_mem_213898 = mem_213898.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229546_task;
    
    futhark_mc_segmap_parloop_229546_task.name =
        "futhark_mc_segmap_parloop_229546";
    futhark_mc_segmap_parloop_229546_task.fn = futhark_mc_segmap_parloop_229546;
    futhark_mc_segmap_parloop_229546_task.args =
        &futhark_mc_segmap_parloop_struct_229545;
    futhark_mc_segmap_parloop_229546_task.iterations = iterations;
    futhark_mc_segmap_parloop_229546_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229546_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229546_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229546_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229546_task);
    
    if (futhark_mc_segmap_parloop_229546_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229546_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229546_total_end -
                 futhark_mc_segmap_parloop_229546_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229546_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229546_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229546_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229544_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229544_end -
                 futhark_mc_segmap_task_229544_start;
        
        ctx->futhark_mc_segmap_task_229544_runs[tid]++;
        ctx->futhark_mc_segmap_task_229544_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229544_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229548 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_stl_res_196773;
    int64_t free_j_m_i_197246;
    unsigned char *free_mem_213889;
    unsigned char *free_mem_213892;
    unsigned char *free_mem_213895;
    unsigned char *free_mem_213898;
};
struct futhark_mc_task_229550 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_stl_res_196773;
    int64_t free_gtid_208849;
    unsigned char *free_mem_213889;
    float *retval_defunc_2_reduce_res_208851;
};
struct futhark_mc_segred_stage_1_parloop_struct_229553 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_stl_res_196773;
    int64_t free_gtid_208849;
    unsigned char *free_mem_213889;
    unsigned char *free_reduce_stage_1_tid_res_arr_mem_228252;
};
static int futhark_mc_segred_stage_1_parloop_229554(void *args, int64_t start,
                                                    int64_t end,
                                                    int flat_tid_228242,
                                                    int tid)
{
    int err = 0;
    struct futhark_mc_segred_stage_1_parloop_struct_229553
    *futhark_mc_segred_stage_1_parloop_struct_229553 =
    (struct futhark_mc_segred_stage_1_parloop_struct_229553 *) args;
    struct futhark_context *ctx =
                           futhark_mc_segred_stage_1_parloop_struct_229553->ctx;
    uint64_t futhark_mc_segred_stage_1_parloop_229554_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229554_start = get_wall_time();
    
    int64_t n_196692 =
            futhark_mc_segred_stage_1_parloop_struct_229553->free_n_196692;
    int64_t stl_res_196773 =
            futhark_mc_segred_stage_1_parloop_struct_229553->free_stl_res_196773;
    int64_t gtid_208849 =
            futhark_mc_segred_stage_1_parloop_struct_229553->free_gtid_208849;
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_segred_stage_1_parloop_struct_229553->free_mem_213889,
                                  .size =0, .references =NULL};
    struct memblock reduce_stage_1_tid_res_arr_mem_228252 = {.desc =
                                                             "reduce_stage_1_tid_res_arr_mem_228252",
                                                             .mem =
                                                             futhark_mc_segred_stage_1_parloop_struct_229553->free_reduce_stage_1_tid_res_arr_mem_228252,
                                                             .size =0,
                                                             .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_228254 = start;
    float x_228244;
    float x_228245;
    float local_acc_228255 = 0.0F;
    
    for (; iter_228254 < end; iter_228254++) {
        int64_t gtid_228243 = iter_228254;
        int64_t slice_228247 = stl_res_196773 + gtid_228243;
        float x_228248;
        
        x_228248 = ((float *) mem_213889.mem)[gtid_208849 * n_196692 +
                                              slice_228247];
        // save map-out results
        { }
        // Load accum params
        {
            x_228244 = local_acc_228255;
        }
        // Load next params
        {
            x_228245 = x_228248;
        }
        // Red body
        {
            float defunc_1_op_res_228246 = x_228244 + x_228245;
            
            local_acc_228255 = defunc_1_op_res_228246;
        }
    }
    ((float *) reduce_stage_1_tid_res_arr_mem_228252.mem)[flat_tid_228242] =
        local_acc_228255;
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229554_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229554_end -
                 futhark_mc_segred_stage_1_parloop_229554_start;
        
        ctx->futhark_mc_segred_stage_1_parloop_229554_runs[tid]++;
        ctx->futhark_mc_segred_stage_1_parloop_229554_total_runtime[tid] +=
            elapsed;
        ctx->futhark_mc_segred_stage_1_parloop_229554_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segred_task_229551(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_228242 = tid;
    int num_tasks_228251 = info.nsubtasks;
    struct futhark_mc_task_229550 *futhark_mc_task_229550 =
                                  (struct futhark_mc_task_229550 *) args;
    struct futhark_context *ctx = futhark_mc_task_229550->ctx;
    uint64_t futhark_mc_segred_task_229551_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_task_229551_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229550->free_n_196692;
    int64_t stl_res_196773 = futhark_mc_task_229550->free_stl_res_196773;
    int64_t gtid_208849 = futhark_mc_task_229550->free_gtid_208849;
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_task_229550->free_mem_213889,
                                  .size =0, .references =NULL};
    float defunc_2_reduce_res_208851 =
          *futhark_mc_task_229550->retval_defunc_2_reduce_res_208851;
    size_t reduce_stage_1_tid_res_arr_mem_228252_cached_sizze_229552 = 0;
    unsigned char *reduce_stage_1_tid_res_arr_mem_228252 = NULL;
    
    if (reduce_stage_1_tid_res_arr_mem_228252_cached_sizze_229552 <
        (size_t) ((int64_t) 4 * num_tasks_228251)) {
        reduce_stage_1_tid_res_arr_mem_228252 =
            realloc(reduce_stage_1_tid_res_arr_mem_228252, (int64_t) 4 *
                    num_tasks_228251);
        reduce_stage_1_tid_res_arr_mem_228252_cached_sizze_229552 =
            (int64_t) 4 * num_tasks_228251;
    }
    
    int64_t iter_228254;
    struct futhark_mc_segred_stage_1_parloop_struct_229553
    futhark_mc_segred_stage_1_parloop_struct_229553;
    
    futhark_mc_segred_stage_1_parloop_struct_229553.ctx = ctx;
    futhark_mc_segred_stage_1_parloop_struct_229553.free_n_196692 = n_196692;
    futhark_mc_segred_stage_1_parloop_struct_229553.free_stl_res_196773 =
        stl_res_196773;
    futhark_mc_segred_stage_1_parloop_struct_229553.free_gtid_208849 =
        gtid_208849;
    futhark_mc_segred_stage_1_parloop_struct_229553.free_mem_213889 =
        mem_213889.mem;
    futhark_mc_segred_stage_1_parloop_struct_229553.free_reduce_stage_1_tid_res_arr_mem_228252 =
        reduce_stage_1_tid_res_arr_mem_228252;
    
    struct scheduler_parloop futhark_mc_segred_stage_1_parloop_229554_task;
    
    futhark_mc_segred_stage_1_parloop_229554_task.name =
        "futhark_mc_segred_stage_1_parloop_229554";
    futhark_mc_segred_stage_1_parloop_229554_task.fn =
        futhark_mc_segred_stage_1_parloop_229554;
    futhark_mc_segred_stage_1_parloop_229554_task.args =
        &futhark_mc_segred_stage_1_parloop_struct_229553;
    futhark_mc_segred_stage_1_parloop_229554_task.iterations = iterations;
    futhark_mc_segred_stage_1_parloop_229554_task.info = info;
    
    uint64_t futhark_mc_segred_stage_1_parloop_229554_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segred_stage_1_parloop_229554_total_start = get_wall_time();
    
    int futhark_mc_segred_stage_1_parloop_229554_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segred_stage_1_parloop_229554_task);
    
    if (futhark_mc_segred_stage_1_parloop_229554_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_stage_1_parloop_229554_total_end =
                 get_wall_time();
        uint64_t elapsed = futhark_mc_segred_stage_1_parloop_229554_total_end -
                 futhark_mc_segred_stage_1_parloop_229554_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229554_total_runs,
                           1, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229554_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segred_stage_1_parloop_229554_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    // neutral-initialise the output
    {
        defunc_2_reduce_res_208851 = 0.0F;
    }
    
    float x_228256;
    float x_228257;
    
    for (int32_t i_228259 = 0; i_228259 < num_tasks_228251; i_228259++) {
        flat_tid_228242 = i_228259;
        // Apply main thread reduction
        {
            // load acc params
            {
                x_228256 = defunc_2_reduce_res_208851;
            }
            // load next params
            {
                x_228257 =
                    ((float *) reduce_stage_1_tid_res_arr_mem_228252)[flat_tid_228242];
            }
            // red body
            {
                float defunc_1_op_res_228258 = x_228256 + x_228257;
                
                defunc_2_reduce_res_208851 = defunc_1_op_res_228258;
            }
        }
    }
    
  cleanup:
    {
        free(reduce_stage_1_tid_res_arr_mem_228252);
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segred_task_229551_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segred_task_229551_end -
                 futhark_mc_segred_task_229551_start;
        
        ctx->futhark_mc_segred_task_229551_runs[tid]++;
        ctx->futhark_mc_segred_task_229551_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segred_task_229551_iter[tid] += iterations;
    }
    if (err == 0) {
        *futhark_mc_task_229550->retval_defunc_2_reduce_res_208851 =
            defunc_2_reduce_res_208851;
    }
    return err;
}
static int futhark_mc_segmap_parloop_229549(void *args, int64_t start,
                                            int64_t end, int flat_tid_208848,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229548
    *futhark_mc_segmap_parloop_struct_229548 =
    (struct futhark_mc_segmap_parloop_struct_229548 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229548->ctx;
    uint64_t futhark_mc_segmap_parloop_229549_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229549_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229548->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229548->free_n_196692;
    int64_t stl_res_196773 =
            futhark_mc_segmap_parloop_struct_229548->free_stl_res_196773;
    int64_t j_m_i_197246 =
            futhark_mc_segmap_parloop_struct_229548->free_j_m_i_197246;
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_segmap_parloop_struct_229548->free_mem_213889,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_segmap_parloop_struct_229548->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_segmap_parloop_struct_229548->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_segmap_parloop_struct_229548->free_mem_213898,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_228241 = start;
    
    for (; iter_228241 < end; iter_228241++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228249 = m_196691;
        int64_t gtid_208849 = iter_228241;
        int64_t remnant_228250 = iter_228241 - gtid_208849;
        float defunc_2_reduce_res_208851;
        int64_t flat_tid_228242 = (int64_t) 0;
        int32_t num_tasks_228251;
        
        defunc_2_reduce_res_208851 = 0.0F;
        
        struct futhark_mc_task_229550 futhark_mc_task_229550;
        
        futhark_mc_task_229550.ctx = ctx;
        futhark_mc_task_229550.free_n_196692 = n_196692;
        futhark_mc_task_229550.free_stl_res_196773 = stl_res_196773;
        futhark_mc_task_229550.free_gtid_208849 = gtid_208849;
        futhark_mc_task_229550.free_mem_213889 = mem_213889.mem;
        futhark_mc_task_229550.retval_defunc_2_reduce_res_208851 =
            &defunc_2_reduce_res_208851;
        
        struct scheduler_segop futhark_mc_task_229550_task;
        
        futhark_mc_task_229550_task.args = &futhark_mc_task_229550;
        futhark_mc_task_229550_task.top_level_fn =
            futhark_mc_segred_task_229551;
        futhark_mc_task_229550_task.name = "futhark_mc_segred_task_229551";
        futhark_mc_task_229550_task.iterations = j_m_i_197246;
        futhark_mc_task_229550_task.task_time =
            &ctx->futhark_mc_segred_task_229551_total_time;
        futhark_mc_task_229550_task.task_iter =
            &ctx->futhark_mc_segred_task_229551_total_iter;
        futhark_mc_task_229550_task.sched = STATIC;
        futhark_mc_task_229550_task.nested_fn = NULL;
        
        int futhark_mc_segred_task_229551_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229550_task);
        
        if (futhark_mc_segred_task_229551_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        
        float h_208858 = 3.0F * defunc_2_reduce_res_208851;
        float h9_208859 = 0.999F * h_208858;
        float h1_208860 = 1.0e-3F * h_208858;
        
        ((float *) mem_213892.mem)[gtid_208849] = h_208858;
        ((float *) mem_213895.mem)[gtid_208849] = h9_208859;
        ((float *) mem_213898.mem)[gtid_208849] = h1_208860;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229549_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229549_end -
                 futhark_mc_segmap_parloop_229549_start;
        
        ctx->futhark_mc_segmap_parloop_229549_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229549_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229549_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229547(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208848 = tid;
    int num_tasks_228231 = info.nsubtasks;
    struct futhark_mc_task_229543 *futhark_mc_task_229543 =
                                  (struct futhark_mc_task_229543 *) args;
    struct futhark_context *ctx = futhark_mc_task_229543->ctx;
    uint64_t futhark_mc_segmap_nested_task_229547_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229547_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229543->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229543->free_n_196692;
    int64_t stl_res_196773 = futhark_mc_task_229543->free_stl_res_196773;
    int64_t j_m_i_197246 = futhark_mc_task_229543->free_j_m_i_197246;
    struct memblock mem_213889 = {.desc ="mem_213889", .mem =
                                  futhark_mc_task_229543->free_mem_213889,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_task_229543->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_task_229543->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_task_229543->free_mem_213898,
                                  .size =0, .references =NULL};
    int64_t iter_228241;
    struct futhark_mc_segmap_parloop_struct_229548
    futhark_mc_segmap_parloop_struct_229548;
    
    futhark_mc_segmap_parloop_struct_229548.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229548.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229548.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229548.free_stl_res_196773 =
        stl_res_196773;
    futhark_mc_segmap_parloop_struct_229548.free_j_m_i_197246 = j_m_i_197246;
    futhark_mc_segmap_parloop_struct_229548.free_mem_213889 = mem_213889.mem;
    futhark_mc_segmap_parloop_struct_229548.free_mem_213892 = mem_213892.mem;
    futhark_mc_segmap_parloop_struct_229548.free_mem_213895 = mem_213895.mem;
    futhark_mc_segmap_parloop_struct_229548.free_mem_213898 = mem_213898.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229549_task;
    
    futhark_mc_segmap_parloop_229549_task.name =
        "futhark_mc_segmap_parloop_229549";
    futhark_mc_segmap_parloop_229549_task.fn = futhark_mc_segmap_parloop_229549;
    futhark_mc_segmap_parloop_229549_task.args =
        &futhark_mc_segmap_parloop_struct_229548;
    futhark_mc_segmap_parloop_229549_task.iterations = iterations;
    futhark_mc_segmap_parloop_229549_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229549_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229549_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229549_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229549_task);
    
    if (futhark_mc_segmap_parloop_229549_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229549_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229549_total_end -
                 futhark_mc_segmap_parloop_229549_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229549_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229549_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229549_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229547_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229547_end -
                 futhark_mc_segmap_nested_task_229547_start;
        
        ctx->futhark_mc_segmap_nested_task_229547_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229547_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229547_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229555 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_bytes_210949;
    unsigned char *free_mem_213743;
    unsigned char *free_mem_213892;
    unsigned char *free_mem_213895;
    unsigned char *free_mem_213898;
    unsigned char *free_mem_213920;
};
struct futhark_mc_segmap_parloop_struct_229557 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_bytes_210949;
    unsigned char *free_mem_213743;
    unsigned char *free_mem_213892;
    unsigned char *free_mem_213895;
    unsigned char *free_mem_213898;
    unsigned char *free_mem_213920;
};
static int futhark_mc_segmap_parloop_229558(void *args, int64_t start,
                                            int64_t end, int flat_tid_208861,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229557
    *futhark_mc_segmap_parloop_struct_229557 =
    (struct futhark_mc_segmap_parloop_struct_229557 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229557->ctx;
    uint64_t futhark_mc_segmap_parloop_229558_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229558_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229557->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229557->free_n_196692;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229557->free_bytes_210949;
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_segmap_parloop_struct_229557->free_mem_213743,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_segmap_parloop_struct_229557->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_segmap_parloop_struct_229557->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_segmap_parloop_struct_229557->free_mem_213898,
                                  .size =0, .references =NULL};
    struct memblock mem_213920 = {.desc ="mem_213920", .mem =
                                  futhark_mc_segmap_parloop_struct_229557->free_mem_213920,
                                  .size =0, .references =NULL};
    size_t mem_213904_cached_sizze_229559 = 0;
    unsigned char *mem_213904 = NULL;
    int64_t iterations = end - start;
    int64_t iter_228261 = start;
    
    if (mem_213904_cached_sizze_229559 < (size_t) bytes_210949) {
        mem_213904 = realloc(mem_213904, bytes_210949);
        mem_213904_cached_sizze_229559 = bytes_210949;
    }
    for (; iter_228261 < end; iter_228261++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228282 = m_196691;
        int64_t gtid_208862 = iter_228261;
        int64_t remnant_228283 = iter_228261 - gtid_208862;
        float x_199927;
        
        x_199927 = ((float *) mem_213892.mem)[gtid_208862];
        
        float x_199928;
        
        x_199928 = ((float *) mem_213895.mem)[gtid_208862];
        
        float x_199929;
        
        x_199929 = ((float *) mem_213898.mem)[gtid_208862];
        for (int64_t i_228262 = 0; i_228262 < n_196692; i_228262++) {
            float x_228264;
            
            x_228264 = ((float *) mem_213743.mem)[gtid_208862 * n_196692 +
                                                  i_228262];
            
            float x_228265 = x_228264 / x_199927;
            float y_228266 = fpow32(x_228265, 2.0F);
            float x_228267 = 1.0F - y_228266;
            float bicube_228268 = fpow32(x_228267, 2.0F);
            bool isnan_res_228269;
            
            isnan_res_228269 = futrts_isnan32(x_228264);
            
            bool cond_f_res_228270 = x_228264 <= x_199929;
            bool x_228271 = !isnan_res_228269;
            bool y_228272 = cond_f_res_228270 && x_228271;
            bool cond_228273 = isnan_res_228269 || y_228272;
            float defunc_0_f_res_228274;
            
            if (cond_228273) {
                defunc_0_f_res_228274 = 1.0F;
            } else {
                bool cond_228275 = x_199928 <= x_228264;
                bool cond_f_res_228276 = x_228264 <= 1.0e-6F;
                bool x_228277 = !cond_228275;
                bool y_228278 = cond_f_res_228276 && x_228277;
                bool cond_228279 = cond_228275 || y_228278;
                float defunc_0_f_res_f_res_228280;
                
                if (cond_228279) {
                    defunc_0_f_res_f_res_228280 = 1.0e-6F;
                } else {
                    defunc_0_f_res_f_res_228280 = bicube_228268;
                }
                defunc_0_f_res_228274 = defunc_0_f_res_f_res_228280;
            }
            ((float *) mem_213904)[i_228262] = defunc_0_f_res_228274;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213920.mem + gtid_208862 * n_196692 * (int64_t) 4,
                    mem_213904 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213904);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229558_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229558_end -
                 futhark_mc_segmap_parloop_229558_start;
        
        ctx->futhark_mc_segmap_parloop_229558_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229558_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229558_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229556(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208861 = tid;
    int num_tasks_228260 = info.nsubtasks;
    struct futhark_mc_task_229555 *futhark_mc_task_229555 =
                                  (struct futhark_mc_task_229555 *) args;
    struct futhark_context *ctx = futhark_mc_task_229555->ctx;
    uint64_t futhark_mc_segmap_task_229556_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229556_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229555->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229555->free_n_196692;
    int64_t bytes_210949 = futhark_mc_task_229555->free_bytes_210949;
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_task_229555->free_mem_213743,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_task_229555->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_task_229555->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_task_229555->free_mem_213898,
                                  .size =0, .references =NULL};
    struct memblock mem_213920 = {.desc ="mem_213920", .mem =
                                  futhark_mc_task_229555->free_mem_213920,
                                  .size =0, .references =NULL};
    int64_t iter_228261;
    struct futhark_mc_segmap_parloop_struct_229557
    futhark_mc_segmap_parloop_struct_229557;
    
    futhark_mc_segmap_parloop_struct_229557.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229557.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229557.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229557.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229557.free_mem_213743 = mem_213743.mem;
    futhark_mc_segmap_parloop_struct_229557.free_mem_213892 = mem_213892.mem;
    futhark_mc_segmap_parloop_struct_229557.free_mem_213895 = mem_213895.mem;
    futhark_mc_segmap_parloop_struct_229557.free_mem_213898 = mem_213898.mem;
    futhark_mc_segmap_parloop_struct_229557.free_mem_213920 = mem_213920.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229558_task;
    
    futhark_mc_segmap_parloop_229558_task.name =
        "futhark_mc_segmap_parloop_229558";
    futhark_mc_segmap_parloop_229558_task.fn = futhark_mc_segmap_parloop_229558;
    futhark_mc_segmap_parloop_229558_task.args =
        &futhark_mc_segmap_parloop_struct_229557;
    futhark_mc_segmap_parloop_229558_task.iterations = iterations;
    futhark_mc_segmap_parloop_229558_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229558_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229558_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229558_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229558_task);
    
    if (futhark_mc_segmap_parloop_229558_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229558_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229558_total_end -
                 futhark_mc_segmap_parloop_229558_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229558_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229558_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229558_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229556_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229556_end -
                 futhark_mc_segmap_task_229556_start;
        
        ctx->futhark_mc_segmap_task_229556_runs[tid]++;
        ctx->futhark_mc_segmap_task_229556_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229556_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229561 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    int64_t free_bytes_210949;
    unsigned char *free_mem_213743;
    unsigned char *free_mem_213892;
    unsigned char *free_mem_213895;
    unsigned char *free_mem_213898;
    unsigned char *free_mem_213920;
};
struct futhark_mc_task_229564 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208868;
    float free_x_208870;
    float free_x_208871;
    float free_x_208872;
    unsigned char *free_mem_213743;
    unsigned char *free_mem_213901;
};
struct futhark_mc_segmap_parloop_struct_229566 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208868;
    float free_x_208870;
    float free_x_208871;
    float free_x_208872;
    unsigned char *free_mem_213743;
    unsigned char *free_mem_213901;
};
static int futhark_mc_segmap_parloop_229567(void *args, int64_t start,
                                            int64_t end, int flat_tid_228286,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229566
    *futhark_mc_segmap_parloop_struct_229566 =
    (struct futhark_mc_segmap_parloop_struct_229566 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229566->ctx;
    uint64_t futhark_mc_segmap_parloop_229567_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229567_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229566->free_n_196692;
    int64_t gtid_208868 =
            futhark_mc_segmap_parloop_struct_229566->free_gtid_208868;
    float x_208870 = futhark_mc_segmap_parloop_struct_229566->free_x_208870;
    float x_208871 = futhark_mc_segmap_parloop_struct_229566->free_x_208871;
    float x_208872 = futhark_mc_segmap_parloop_struct_229566->free_x_208872;
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_segmap_parloop_struct_229566->free_mem_213743,
                                  .size =0, .references =NULL};
    struct memblock mem_213901 = {.desc ="mem_213901", .mem =
                                  futhark_mc_segmap_parloop_struct_229566->free_mem_213901,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_228308 = start;
    
    for (; iter_228308 < end; iter_228308++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228315 = n_196692;
        int64_t gtid_228287 = iter_228308;
        int64_t remnant_228316 = iter_228308 - gtid_228287;
        float x_228288;
        
        x_228288 = ((float *) mem_213743.mem)[gtid_208868 * n_196692 +
                                              gtid_228287];
        
        float x_228289 = x_228288 / x_208870;
        float y_228290 = fpow32(x_228289, 2.0F);
        float x_228291 = 1.0F - y_228290;
        float bicube_228292 = fpow32(x_228291, 2.0F);
        bool isnan_res_228293;
        
        isnan_res_228293 = futrts_isnan32(x_228288);
        
        bool cond_f_res_228294 = x_228288 <= x_208872;
        bool x_228295 = !isnan_res_228293;
        bool y_228296 = cond_f_res_228294 && x_228295;
        bool cond_228297 = isnan_res_228293 || y_228296;
        float defunc_0_f_res_228298;
        
        if (cond_228297) {
            defunc_0_f_res_228298 = 1.0F;
        } else {
            bool cond_228309 = x_208871 <= x_228288;
            bool cond_f_res_228310 = x_228288 <= 1.0e-6F;
            bool x_228311 = !cond_228309;
            bool y_228312 = cond_f_res_228310 && x_228311;
            bool cond_228313 = cond_228309 || y_228312;
            float defunc_0_f_res_f_res_228314;
            
            if (cond_228313) {
                defunc_0_f_res_f_res_228314 = 1.0e-6F;
            } else {
                defunc_0_f_res_f_res_228314 = bicube_228292;
            }
            defunc_0_f_res_228298 = defunc_0_f_res_f_res_228314;
        }
        ((float *) mem_213901.mem)[gtid_228287] = defunc_0_f_res_228298;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229567_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229567_end -
                 futhark_mc_segmap_parloop_229567_start;
        
        ctx->futhark_mc_segmap_parloop_229567_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229567_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229567_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229565(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_228286 = tid;
    int num_tasks_228307 = info.nsubtasks;
    struct futhark_mc_task_229564 *futhark_mc_task_229564 =
                                  (struct futhark_mc_task_229564 *) args;
    struct futhark_context *ctx = futhark_mc_task_229564->ctx;
    uint64_t futhark_mc_segmap_task_229565_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229565_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229564->free_n_196692;
    int64_t gtid_208868 = futhark_mc_task_229564->free_gtid_208868;
    float x_208870 = futhark_mc_task_229564->free_x_208870;
    float x_208871 = futhark_mc_task_229564->free_x_208871;
    float x_208872 = futhark_mc_task_229564->free_x_208872;
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_task_229564->free_mem_213743,
                                  .size =0, .references =NULL};
    struct memblock mem_213901 = {.desc ="mem_213901", .mem =
                                  futhark_mc_task_229564->free_mem_213901,
                                  .size =0, .references =NULL};
    int64_t iter_228308;
    struct futhark_mc_segmap_parloop_struct_229566
    futhark_mc_segmap_parloop_struct_229566;
    
    futhark_mc_segmap_parloop_struct_229566.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229566.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229566.free_gtid_208868 = gtid_208868;
    futhark_mc_segmap_parloop_struct_229566.free_x_208870 = x_208870;
    futhark_mc_segmap_parloop_struct_229566.free_x_208871 = x_208871;
    futhark_mc_segmap_parloop_struct_229566.free_x_208872 = x_208872;
    futhark_mc_segmap_parloop_struct_229566.free_mem_213743 = mem_213743.mem;
    futhark_mc_segmap_parloop_struct_229566.free_mem_213901 = mem_213901.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229567_task;
    
    futhark_mc_segmap_parloop_229567_task.name =
        "futhark_mc_segmap_parloop_229567";
    futhark_mc_segmap_parloop_229567_task.fn = futhark_mc_segmap_parloop_229567;
    futhark_mc_segmap_parloop_229567_task.args =
        &futhark_mc_segmap_parloop_struct_229566;
    futhark_mc_segmap_parloop_229567_task.iterations = iterations;
    futhark_mc_segmap_parloop_229567_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229567_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229567_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229567_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229567_task);
    
    if (futhark_mc_segmap_parloop_229567_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229567_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229567_total_end -
                 futhark_mc_segmap_parloop_229567_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229567_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229567_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229567_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229565_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229565_end -
                 futhark_mc_segmap_task_229565_start;
        
        ctx->futhark_mc_segmap_task_229565_runs[tid]++;
        ctx->futhark_mc_segmap_task_229565_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229565_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229562(void *args, int64_t start,
                                            int64_t end, int flat_tid_208867,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229561
    *futhark_mc_segmap_parloop_struct_229561 =
    (struct futhark_mc_segmap_parloop_struct_229561 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229561->ctx;
    uint64_t futhark_mc_segmap_parloop_229562_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229562_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229561->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229561->free_n_196692;
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229561->free_bytes_210949;
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_segmap_parloop_struct_229561->free_mem_213743,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_segmap_parloop_struct_229561->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_segmap_parloop_struct_229561->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_segmap_parloop_struct_229561->free_mem_213898,
                                  .size =0, .references =NULL};
    struct memblock mem_213920 = {.desc ="mem_213920", .mem =
                                  futhark_mc_segmap_parloop_struct_229561->free_mem_213920,
                                  .size =0, .references =NULL};
    size_t mem_213901_cached_sizze_229563 = 0;
    unsigned char *mem_213901 = NULL;
    int64_t iterations = end - start;
    int64_t iter_228285 = start;
    
    if (mem_213901_cached_sizze_229563 < (size_t) bytes_210949) {
        mem_213901 = realloc(mem_213901, bytes_210949);
        mem_213901_cached_sizze_229563 = bytes_210949;
    }
    for (; iter_228285 < end; iter_228285++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228305 = m_196691;
        int64_t gtid_208868 = iter_228285;
        int64_t remnant_228306 = iter_228285 - gtid_208868;
        float x_208870;
        
        x_208870 = ((float *) mem_213892.mem)[gtid_208868];
        
        float x_208871;
        
        x_208871 = ((float *) mem_213895.mem)[gtid_208868];
        
        float x_208872;
        
        x_208872 = ((float *) mem_213898.mem)[gtid_208868];
        
        int64_t flat_tid_228286 = (int64_t) 0;
        int32_t num_tasks_228307;
        struct futhark_mc_task_229564 futhark_mc_task_229564;
        
        futhark_mc_task_229564.ctx = ctx;
        futhark_mc_task_229564.free_n_196692 = n_196692;
        futhark_mc_task_229564.free_gtid_208868 = gtid_208868;
        futhark_mc_task_229564.free_x_208870 = x_208870;
        futhark_mc_task_229564.free_x_208871 = x_208871;
        futhark_mc_task_229564.free_x_208872 = x_208872;
        futhark_mc_task_229564.free_mem_213743 = mem_213743.mem;
        futhark_mc_task_229564.free_mem_213901 = mem_213901;
        
        struct scheduler_segop futhark_mc_task_229564_task;
        
        futhark_mc_task_229564_task.args = &futhark_mc_task_229564;
        futhark_mc_task_229564_task.top_level_fn =
            futhark_mc_segmap_task_229565;
        futhark_mc_task_229564_task.name = "futhark_mc_segmap_task_229565";
        futhark_mc_task_229564_task.iterations = n_196692;
        futhark_mc_task_229564_task.task_time =
            &ctx->futhark_mc_segmap_task_229565_total_time;
        futhark_mc_task_229564_task.task_iter =
            &ctx->futhark_mc_segmap_task_229565_total_iter;
        futhark_mc_task_229564_task.sched = STATIC;
        futhark_mc_task_229564_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229565_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229564_task);
        
        if (futhark_mc_segmap_task_229565_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213920.mem + gtid_208868 * n_196692 * (int64_t) 4,
                    mem_213901 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213901);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229562_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229562_end -
                 futhark_mc_segmap_parloop_229562_start;
        
        ctx->futhark_mc_segmap_parloop_229562_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229562_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229562_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229560(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208867 = tid;
    int num_tasks_228260 = info.nsubtasks;
    struct futhark_mc_task_229555 *futhark_mc_task_229555 =
                                  (struct futhark_mc_task_229555 *) args;
    struct futhark_context *ctx = futhark_mc_task_229555->ctx;
    uint64_t futhark_mc_segmap_nested_task_229560_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229560_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229555->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229555->free_n_196692;
    int64_t bytes_210949 = futhark_mc_task_229555->free_bytes_210949;
    struct memblock mem_213743 = {.desc ="mem_213743", .mem =
                                  futhark_mc_task_229555->free_mem_213743,
                                  .size =0, .references =NULL};
    struct memblock mem_213892 = {.desc ="mem_213892", .mem =
                                  futhark_mc_task_229555->free_mem_213892,
                                  .size =0, .references =NULL};
    struct memblock mem_213895 = {.desc ="mem_213895", .mem =
                                  futhark_mc_task_229555->free_mem_213895,
                                  .size =0, .references =NULL};
    struct memblock mem_213898 = {.desc ="mem_213898", .mem =
                                  futhark_mc_task_229555->free_mem_213898,
                                  .size =0, .references =NULL};
    struct memblock mem_213920 = {.desc ="mem_213920", .mem =
                                  futhark_mc_task_229555->free_mem_213920,
                                  .size =0, .references =NULL};
    int64_t iter_228285;
    struct futhark_mc_segmap_parloop_struct_229561
    futhark_mc_segmap_parloop_struct_229561;
    
    futhark_mc_segmap_parloop_struct_229561.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229561.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229561.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229561.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229561.free_mem_213743 = mem_213743.mem;
    futhark_mc_segmap_parloop_struct_229561.free_mem_213892 = mem_213892.mem;
    futhark_mc_segmap_parloop_struct_229561.free_mem_213895 = mem_213895.mem;
    futhark_mc_segmap_parloop_struct_229561.free_mem_213898 = mem_213898.mem;
    futhark_mc_segmap_parloop_struct_229561.free_mem_213920 = mem_213920.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229562_task;
    
    futhark_mc_segmap_parloop_229562_task.name =
        "futhark_mc_segmap_parloop_229562";
    futhark_mc_segmap_parloop_229562_task.fn = futhark_mc_segmap_parloop_229562;
    futhark_mc_segmap_parloop_229562_task.args =
        &futhark_mc_segmap_parloop_struct_229561;
    futhark_mc_segmap_parloop_229562_task.iterations = iterations;
    futhark_mc_segmap_parloop_229562_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229562_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229562_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229562_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229562_task);
    
    if (futhark_mc_segmap_parloop_229562_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229562_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229562_total_end -
                 futhark_mc_segmap_parloop_229562_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229562_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229562_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229562_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229560_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229560_end -
                 futhark_mc_segmap_nested_task_229560_start;
        
        ctx->futhark_mc_segmap_nested_task_229560_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229560_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229560_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_task_229568 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213930;
    unsigned char *free_ext_mem_213931;
    int64_t free_ext_213942;
    unsigned char *free_mem_213974;
};
struct futhark_mc_segmap_parloop_struct_229570 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213930;
    unsigned char *free_ext_mem_213931;
    int64_t free_ext_213942;
    unsigned char *free_mem_213974;
};
static int futhark_mc_segmap_parloop_229571(void *args, int64_t start,
                                            int64_t end, int flat_tid_208893,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229570
    *futhark_mc_segmap_parloop_struct_229570 =
    (struct futhark_mc_segmap_parloop_struct_229570 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229570->ctx;
    uint64_t futhark_mc_segmap_parloop_229571_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229571_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229570->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229570->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229570->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229570->free_bytes_210949;
    struct memblock ext_mem_213930 = {.desc ="ext_mem_213930", .mem =
                                      futhark_mc_segmap_parloop_struct_229570->free_ext_mem_213930,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213931 = {.desc ="ext_mem_213931", .mem =
                                      futhark_mc_segmap_parloop_struct_229570->free_ext_mem_213931,
                                      .size =0, .references =NULL};
    int64_t ext_213942 =
            futhark_mc_segmap_parloop_struct_229570->free_ext_213942;
    struct memblock mem_213974 = {.desc ="mem_213974", .mem =
                                  futhark_mc_segmap_parloop_struct_229570->free_mem_213974,
                                  .size =0, .references =NULL};
    size_t mem_213958_cached_sizze_229572 = 0;
    unsigned char *mem_213958 = NULL;
    int64_t iterations = end - start;
    int64_t iter_228318 = start;
    
    if (mem_213958_cached_sizze_229572 < (size_t) bytes_210949) {
        mem_213958 = realloc(mem_213958, bytes_210949);
        mem_213958_cached_sizze_229572 = bytes_210949;
    }
    for (; iter_228318 < end; iter_228318++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228327 = m_196691;
        int64_t gtid_208894 = iter_228318;
        int64_t remnant_228328 = iter_228318 - gtid_208894;
        
        for (int64_t i_228319 = 0; i_228319 < n_196692; i_228319++) {
            float x_228321;
            
            x_228321 = ((float *) Y_mem_210354.mem)[gtid_208894 * n_196692 +
                                                    i_228319];
            
            float x_228322;
            
            x_228322 = ((float *) ext_mem_213931.mem)[gtid_208894 * n_196692 +
                                                      i_228319];
            
            float x_228323;
            
            x_228323 = ((float *) ext_mem_213930.mem)[gtid_208894 * ext_213942 +
                                                      i_228319];
            
            float x_228324 = x_228321 - x_228322;
            float defunc_2_f_res_228325 = x_228324 - x_228323;
            
            ((float *) mem_213958)[i_228319] = defunc_2_f_res_228325;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213974.mem + gtid_208894 * n_196692 * (int64_t) 4,
                    mem_213958 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213958);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229571_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229571_end -
                 futhark_mc_segmap_parloop_229571_start;
        
        ctx->futhark_mc_segmap_parloop_229571_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229571_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229571_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229569(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208893 = tid;
    int num_tasks_228317 = info.nsubtasks;
    struct futhark_mc_task_229568 *futhark_mc_task_229568 =
                                  (struct futhark_mc_task_229568 *) args;
    struct futhark_context *ctx = futhark_mc_task_229568->ctx;
    uint64_t futhark_mc_segmap_task_229569_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229569_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229568->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229568->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229568->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229568->free_bytes_210949;
    struct memblock ext_mem_213930 = {.desc ="ext_mem_213930", .mem =
                                      futhark_mc_task_229568->free_ext_mem_213930,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213931 = {.desc ="ext_mem_213931", .mem =
                                      futhark_mc_task_229568->free_ext_mem_213931,
                                      .size =0, .references =NULL};
    int64_t ext_213942 = futhark_mc_task_229568->free_ext_213942;
    struct memblock mem_213974 = {.desc ="mem_213974", .mem =
                                  futhark_mc_task_229568->free_mem_213974,
                                  .size =0, .references =NULL};
    int64_t iter_228318;
    struct futhark_mc_segmap_parloop_struct_229570
    futhark_mc_segmap_parloop_struct_229570;
    
    futhark_mc_segmap_parloop_struct_229570.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229570.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229570.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229570.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229570.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229570.free_ext_mem_213930 =
        ext_mem_213930.mem;
    futhark_mc_segmap_parloop_struct_229570.free_ext_mem_213931 =
        ext_mem_213931.mem;
    futhark_mc_segmap_parloop_struct_229570.free_ext_213942 = ext_213942;
    futhark_mc_segmap_parloop_struct_229570.free_mem_213974 = mem_213974.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229571_task;
    
    futhark_mc_segmap_parloop_229571_task.name =
        "futhark_mc_segmap_parloop_229571";
    futhark_mc_segmap_parloop_229571_task.fn = futhark_mc_segmap_parloop_229571;
    futhark_mc_segmap_parloop_229571_task.args =
        &futhark_mc_segmap_parloop_struct_229570;
    futhark_mc_segmap_parloop_229571_task.iterations = iterations;
    futhark_mc_segmap_parloop_229571_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229571_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229571_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229571_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229571_task);
    
    if (futhark_mc_segmap_parloop_229571_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229571_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229571_total_end -
                 futhark_mc_segmap_parloop_229571_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229571_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229571_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229571_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229569_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229569_end -
                 futhark_mc_segmap_task_229569_start;
        
        ctx->futhark_mc_segmap_task_229569_runs[tid]++;
        ctx->futhark_mc_segmap_task_229569_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229569_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
struct futhark_mc_segmap_parloop_struct_229574 {
    struct futhark_context *ctx;
    int64_t free_m_196691;
    int64_t free_n_196692;
    unsigned char *free_Y_mem_210354;
    int64_t free_bytes_210949;
    unsigned char *free_ext_mem_213930;
    unsigned char *free_ext_mem_213931;
    int64_t free_ext_213942;
    unsigned char *free_mem_213974;
};
struct futhark_mc_task_229577 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208900;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_ext_mem_213930;
    unsigned char *free_ext_mem_213931;
    int64_t free_ext_213942;
    unsigned char *free_mem_213955;
};
struct futhark_mc_segmap_parloop_struct_229579 {
    struct futhark_context *ctx;
    int64_t free_n_196692;
    int64_t free_gtid_208900;
    unsigned char *free_Y_mem_210354;
    unsigned char *free_ext_mem_213930;
    unsigned char *free_ext_mem_213931;
    int64_t free_ext_213942;
    unsigned char *free_mem_213955;
};
static int futhark_mc_segmap_parloop_229580(void *args, int64_t start,
                                            int64_t end, int flat_tid_228331,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229579
    *futhark_mc_segmap_parloop_struct_229579 =
    (struct futhark_mc_segmap_parloop_struct_229579 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229579->ctx;
    uint64_t futhark_mc_segmap_parloop_229580_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229580_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229579->free_n_196692;
    int64_t gtid_208900 =
            futhark_mc_segmap_parloop_struct_229579->free_gtid_208900;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229579->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock ext_mem_213930 = {.desc ="ext_mem_213930", .mem =
                                      futhark_mc_segmap_parloop_struct_229579->free_ext_mem_213930,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213931 = {.desc ="ext_mem_213931", .mem =
                                      futhark_mc_segmap_parloop_struct_229579->free_ext_mem_213931,
                                      .size =0, .references =NULL};
    int64_t ext_213942 =
            futhark_mc_segmap_parloop_struct_229579->free_ext_213942;
    struct memblock mem_213955 = {.desc ="mem_213955", .mem =
                                  futhark_mc_segmap_parloop_struct_229579->free_mem_213955,
                                  .size =0, .references =NULL};
    int64_t iterations = end - start;
    int64_t iter_228341 = start;
    
    for (; iter_228341 < end; iter_228341++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228342 = n_196692;
        int64_t gtid_228332 = iter_228341;
        int64_t remnant_228343 = iter_228341 - gtid_228332;
        float x_228333;
        
        x_228333 = ((float *) Y_mem_210354.mem)[gtid_208900 * n_196692 +
                                                gtid_228332];
        
        float x_228334;
        
        x_228334 = ((float *) ext_mem_213931.mem)[gtid_208900 * n_196692 +
                                                  gtid_228332];
        
        float x_228335;
        
        x_228335 = ((float *) ext_mem_213930.mem)[gtid_208900 * ext_213942 +
                                                  gtid_228332];
        
        float x_228336 = x_228333 - x_228334;
        float defunc_2_f_res_228337 = x_228336 - x_228335;
        
        ((float *) mem_213955.mem)[gtid_228332] = defunc_2_f_res_228337;
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229580_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229580_end -
                 futhark_mc_segmap_parloop_229580_start;
        
        ctx->futhark_mc_segmap_parloop_229580_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229580_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229580_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_task_229578(void *args, int64_t iterations, int tid,
                                  struct scheduler_info info)
{
    int err = 0;
    int flat_tid_228331 = tid;
    int num_tasks_228340 = info.nsubtasks;
    struct futhark_mc_task_229577 *futhark_mc_task_229577 =
                                  (struct futhark_mc_task_229577 *) args;
    struct futhark_context *ctx = futhark_mc_task_229577->ctx;
    uint64_t futhark_mc_segmap_task_229578_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_task_229578_start = get_wall_time();
    
    int64_t n_196692 = futhark_mc_task_229577->free_n_196692;
    int64_t gtid_208900 = futhark_mc_task_229577->free_gtid_208900;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229577->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    struct memblock ext_mem_213930 = {.desc ="ext_mem_213930", .mem =
                                      futhark_mc_task_229577->free_ext_mem_213930,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213931 = {.desc ="ext_mem_213931", .mem =
                                      futhark_mc_task_229577->free_ext_mem_213931,
                                      .size =0, .references =NULL};
    int64_t ext_213942 = futhark_mc_task_229577->free_ext_213942;
    struct memblock mem_213955 = {.desc ="mem_213955", .mem =
                                  futhark_mc_task_229577->free_mem_213955,
                                  .size =0, .references =NULL};
    int64_t iter_228341;
    struct futhark_mc_segmap_parloop_struct_229579
    futhark_mc_segmap_parloop_struct_229579;
    
    futhark_mc_segmap_parloop_struct_229579.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229579.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229579.free_gtid_208900 = gtid_208900;
    futhark_mc_segmap_parloop_struct_229579.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229579.free_ext_mem_213930 =
        ext_mem_213930.mem;
    futhark_mc_segmap_parloop_struct_229579.free_ext_mem_213931 =
        ext_mem_213931.mem;
    futhark_mc_segmap_parloop_struct_229579.free_ext_213942 = ext_213942;
    futhark_mc_segmap_parloop_struct_229579.free_mem_213955 = mem_213955.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229580_task;
    
    futhark_mc_segmap_parloop_229580_task.name =
        "futhark_mc_segmap_parloop_229580";
    futhark_mc_segmap_parloop_229580_task.fn = futhark_mc_segmap_parloop_229580;
    futhark_mc_segmap_parloop_229580_task.args =
        &futhark_mc_segmap_parloop_struct_229579;
    futhark_mc_segmap_parloop_229580_task.iterations = iterations;
    futhark_mc_segmap_parloop_229580_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229580_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229580_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229580_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229580_task);
    
    if (futhark_mc_segmap_parloop_229580_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229580_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229580_total_end -
                 futhark_mc_segmap_parloop_229580_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229580_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229580_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229580_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_task_229578_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_task_229578_end -
                 futhark_mc_segmap_task_229578_start;
        
        ctx->futhark_mc_segmap_task_229578_runs[tid]++;
        ctx->futhark_mc_segmap_task_229578_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_task_229578_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
static int futhark_mc_segmap_parloop_229575(void *args, int64_t start,
                                            int64_t end, int flat_tid_208899,
                                            int tid)
{
    int err = 0;
    struct futhark_mc_segmap_parloop_struct_229574
    *futhark_mc_segmap_parloop_struct_229574 =
    (struct futhark_mc_segmap_parloop_struct_229574 *) args;
    struct futhark_context *ctx = futhark_mc_segmap_parloop_struct_229574->ctx;
    uint64_t futhark_mc_segmap_parloop_229575_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229575_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_segmap_parloop_struct_229574->free_m_196691;
    int64_t n_196692 = futhark_mc_segmap_parloop_struct_229574->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_segmap_parloop_struct_229574->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210949 =
            futhark_mc_segmap_parloop_struct_229574->free_bytes_210949;
    struct memblock ext_mem_213930 = {.desc ="ext_mem_213930", .mem =
                                      futhark_mc_segmap_parloop_struct_229574->free_ext_mem_213930,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213931 = {.desc ="ext_mem_213931", .mem =
                                      futhark_mc_segmap_parloop_struct_229574->free_ext_mem_213931,
                                      .size =0, .references =NULL};
    int64_t ext_213942 =
            futhark_mc_segmap_parloop_struct_229574->free_ext_213942;
    struct memblock mem_213974 = {.desc ="mem_213974", .mem =
                                  futhark_mc_segmap_parloop_struct_229574->free_mem_213974,
                                  .size =0, .references =NULL};
    size_t mem_213955_cached_sizze_229576 = 0;
    unsigned char *mem_213955 = NULL;
    int64_t iterations = end - start;
    int64_t iter_228330 = start;
    
    if (mem_213955_cached_sizze_229576 < (size_t) bytes_210949) {
        mem_213955 = realloc(mem_213955, bytes_210949);
        mem_213955_cached_sizze_229576 = bytes_210949;
    }
    for (; iter_228330 < end; iter_228330++) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "SegMap fbody");
        
        int64_t slice_228338 = m_196691;
        int64_t gtid_208900 = iter_228330;
        int64_t remnant_228339 = iter_228330 - gtid_208900;
        int64_t flat_tid_228331 = (int64_t) 0;
        int32_t num_tasks_228340;
        struct futhark_mc_task_229577 futhark_mc_task_229577;
        
        futhark_mc_task_229577.ctx = ctx;
        futhark_mc_task_229577.free_n_196692 = n_196692;
        futhark_mc_task_229577.free_gtid_208900 = gtid_208900;
        futhark_mc_task_229577.free_Y_mem_210354 = Y_mem_210354.mem;
        futhark_mc_task_229577.free_ext_mem_213930 = ext_mem_213930.mem;
        futhark_mc_task_229577.free_ext_mem_213931 = ext_mem_213931.mem;
        futhark_mc_task_229577.free_ext_213942 = ext_213942;
        futhark_mc_task_229577.free_mem_213955 = mem_213955;
        
        struct scheduler_segop futhark_mc_task_229577_task;
        
        futhark_mc_task_229577_task.args = &futhark_mc_task_229577;
        futhark_mc_task_229577_task.top_level_fn =
            futhark_mc_segmap_task_229578;
        futhark_mc_task_229577_task.name = "futhark_mc_segmap_task_229578";
        futhark_mc_task_229577_task.iterations = n_196692;
        futhark_mc_task_229577_task.task_time =
            &ctx->futhark_mc_segmap_task_229578_total_time;
        futhark_mc_task_229577_task.task_iter =
            &ctx->futhark_mc_segmap_task_229578_total_iter;
        futhark_mc_task_229577_task.sched = STATIC;
        futhark_mc_task_229577_task.nested_fn = NULL;
        
        int futhark_mc_segmap_task_229578_err =
            scheduler_prepare_task(&ctx->scheduler,
                                   &futhark_mc_task_229577_task);
        
        if (futhark_mc_segmap_task_229578_err != 0) {
            ;
            err = 1;
            goto cleanup;
        }
        if (n_196692 * (int64_t) 4 > 0)
            memmove(mem_213974.mem + gtid_208900 * n_196692 * (int64_t) 4,
                    mem_213955 + (int64_t) 0, n_196692 * (int64_t) 4);
    }
    
  cleanup:
    { }
    free(mem_213955);
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229575_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229575_end -
                 futhark_mc_segmap_parloop_229575_start;
        
        ctx->futhark_mc_segmap_parloop_229575_runs[tid]++;
        ctx->futhark_mc_segmap_parloop_229575_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_parloop_229575_iter[tid] += iterations;
    }
    return err;
}
int futhark_mc_segmap_nested_task_229573(void *args, int64_t iterations,
                                         int tid, struct scheduler_info info)
{
    int err = 0;
    int flat_tid_208899 = tid;
    int num_tasks_228317 = info.nsubtasks;
    struct futhark_mc_task_229568 *futhark_mc_task_229568 =
                                  (struct futhark_mc_task_229568 *) args;
    struct futhark_context *ctx = futhark_mc_task_229568->ctx;
    uint64_t futhark_mc_segmap_nested_task_229573_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_nested_task_229573_start = get_wall_time();
    
    int64_t m_196691 = futhark_mc_task_229568->free_m_196691;
    int64_t n_196692 = futhark_mc_task_229568->free_n_196692;
    struct memblock Y_mem_210354 = {.desc ="Y_mem_210354", .mem =
                                    futhark_mc_task_229568->free_Y_mem_210354,
                                    .size =0, .references =NULL};
    int64_t bytes_210949 = futhark_mc_task_229568->free_bytes_210949;
    struct memblock ext_mem_213930 = {.desc ="ext_mem_213930", .mem =
                                      futhark_mc_task_229568->free_ext_mem_213930,
                                      .size =0, .references =NULL};
    struct memblock ext_mem_213931 = {.desc ="ext_mem_213931", .mem =
                                      futhark_mc_task_229568->free_ext_mem_213931,
                                      .size =0, .references =NULL};
    int64_t ext_213942 = futhark_mc_task_229568->free_ext_213942;
    struct memblock mem_213974 = {.desc ="mem_213974", .mem =
                                  futhark_mc_task_229568->free_mem_213974,
                                  .size =0, .references =NULL};
    int64_t iter_228330;
    struct futhark_mc_segmap_parloop_struct_229574
    futhark_mc_segmap_parloop_struct_229574;
    
    futhark_mc_segmap_parloop_struct_229574.ctx = ctx;
    futhark_mc_segmap_parloop_struct_229574.free_m_196691 = m_196691;
    futhark_mc_segmap_parloop_struct_229574.free_n_196692 = n_196692;
    futhark_mc_segmap_parloop_struct_229574.free_Y_mem_210354 =
        Y_mem_210354.mem;
    futhark_mc_segmap_parloop_struct_229574.free_bytes_210949 = bytes_210949;
    futhark_mc_segmap_parloop_struct_229574.free_ext_mem_213930 =
        ext_mem_213930.mem;
    futhark_mc_segmap_parloop_struct_229574.free_ext_mem_213931 =
        ext_mem_213931.mem;
    futhark_mc_segmap_parloop_struct_229574.free_ext_213942 = ext_213942;
    futhark_mc_segmap_parloop_struct_229574.free_mem_213974 = mem_213974.mem;
    
    struct scheduler_parloop futhark_mc_segmap_parloop_229575_task;
    
    futhark_mc_segmap_parloop_229575_task.name =
        "futhark_mc_segmap_parloop_229575";
    futhark_mc_segmap_parloop_229575_task.fn = futhark_mc_segmap_parloop_229575;
    futhark_mc_segmap_parloop_229575_task.args =
        &futhark_mc_segmap_parloop_struct_229574;
    futhark_mc_segmap_parloop_229575_task.iterations = iterations;
    futhark_mc_segmap_parloop_229575_task.info = info;
    
    uint64_t futhark_mc_segmap_parloop_229575_total_start = 0;
    
    if (ctx->profiling && !ctx->profiling_paused)
        futhark_mc_segmap_parloop_229575_total_start = get_wall_time();
    
    int futhark_mc_segmap_parloop_229575_err =
        scheduler_execute_task(&ctx->scheduler,
                               &futhark_mc_segmap_parloop_229575_task);
    
    if (futhark_mc_segmap_parloop_229575_err != 0) {
        err = 1;
        goto cleanup;
    }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_parloop_229575_total_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_parloop_229575_total_end -
                 futhark_mc_segmap_parloop_229575_total_start;
        
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229575_total_runs, 1,
                           __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229575_total_total_runtime,
                           elapsed, __ATOMIC_RELAXED);
        __atomic_fetch_add(&ctx->futhark_mc_segmap_parloop_229575_total_iter,
                           iterations, __ATOMIC_RELAXED);
    }
    
  cleanup:
    { }
    if (ctx->profiling && !ctx->profiling_paused) {
        uint64_t futhark_mc_segmap_nested_task_229573_end = get_wall_time();
        uint64_t elapsed = futhark_mc_segmap_nested_task_229573_end -
                 futhark_mc_segmap_nested_task_229573_start;
        
        ctx->futhark_mc_segmap_nested_task_229573_runs[tid]++;
        ctx->futhark_mc_segmap_nested_task_229573_total_runtime[tid] += elapsed;
        ctx->futhark_mc_segmap_nested_task_229573_iter[tid] += iterations;
    }
    if (err == 0) { }
    return err;
}
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);
    worker_local = &ctx->scheduler.workers[0];
    arr->mem.references = NULL;
    if (memblock_alloc(ctx, &arr->mem, dim0 * dim1 * 4, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    if ((size_t) (dim0 * dim1) * 4 > 0)
        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
                                              unsigned char *data,
                                              int64_t offset, int64_t dim0,
                                              int64_t dim1)
{
    struct futhark_f32_2d *bad = NULL;
    struct futhark_f32_2d *arr =
                          (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    worker_local = &ctx->scheduler.workers[0];
    arr->mem.references = NULL;
    if (memblock_alloc(ctx, &arr->mem, dim0 * dim1 * 4, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    if ((size_t) (dim0 * dim1) * 4 > 0)
        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);
    worker_local = &ctx->scheduler.workers[0];
    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);
    worker_local = &ctx->scheduler.workers[0];
    if ((size_t) (arr->shape[0] * arr->shape[1]) * 4 > 0)
        memmove(data + 0, arr->mem.mem + 0, (size_t) (arr->shape[0] *
                                                      arr->shape[1]) * 4);
    lock_unlock(&ctx->lock);
    return 0;
}
unsigned 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 *mem_out_p_228344,
                             struct memblock *mem_out_p_228345,
                             struct memblock *mem_out_p_228346,
                             struct memblock Y_mem_210354, int64_t m_196691,
                             int64_t n_196692, int64_t n_p_196694,
                             int64_t q_s_196695, int64_t q_t_196696,
                             int64_t q_l_196697, int64_t d_s_196698,
                             int64_t d_t_196699, int64_t d_l_196700,
                             int64_t jump_s_196701, int64_t jump_t_196702,
                             int64_t jump_l_196703, int64_t n_inner_196704,
                             int64_t n_outer_196705,
                             int64_t jump_threshold_196706,
                             int64_t q_threshold_196707)
{
    (void) ctx;
    
    int err = 0;
    size_t mem_210394_cached_sizze_228347 = 0;
    unsigned char *mem_210394 = NULL;
    size_t mem_210397_cached_sizze_228348 = 0;
    unsigned char *mem_210397 = NULL;
    size_t mem_210468_cached_sizze_228349 = 0;
    unsigned char *mem_210468 = NULL;
    size_t mem_210590_cached_sizze_228350 = 0;
    unsigned char *mem_210590 = NULL;
    size_t mem_210594_cached_sizze_228351 = 0;
    unsigned char *mem_210594 = NULL;
    size_t mem_210764_cached_sizze_228352 = 0;
    unsigned char *mem_210764 = NULL;
    size_t mem_210769_cached_sizze_228353 = 0;
    unsigned char *mem_210769 = NULL;
    size_t mem_210827_cached_sizze_228354 = 0;
    unsigned char *mem_210827 = NULL;
    size_t mem_210831_cached_sizze_228355 = 0;
    unsigned char *mem_210831 = NULL;
    size_t mem_210889_cached_sizze_228356 = 0;
    unsigned char *mem_210889 = NULL;
    size_t mem_210893_cached_sizze_228357 = 0;
    unsigned char *mem_210893 = NULL;
    size_t mem_210969_cached_sizze_228358 = 0;
    unsigned char *mem_210969 = NULL;
    size_t mem_211106_cached_sizze_228359 = 0;
    unsigned char *mem_211106 = NULL;
    size_t mem_211111_cached_sizze_228360 = 0;
    unsigned char *mem_211111 = NULL;
    size_t mem_212272_cached_sizze_228361 = 0;
    unsigned char *mem_212272 = NULL;
    size_t mem_212275_cached_sizze_228362 = 0;
    unsigned char *mem_212275 = NULL;
    size_t mem_212297_cached_sizze_228363 = 0;
    unsigned char *mem_212297 = NULL;
    size_t mem_212300_cached_sizze_228364 = 0;
    unsigned char *mem_212300 = NULL;
    size_t mem_212322_cached_sizze_228365 = 0;
    unsigned char *mem_212322 = NULL;
    size_t mem_212325_cached_sizze_228366 = 0;
    unsigned char *mem_212325 = NULL;
    size_t mem_212347_cached_sizze_228367 = 0;
    unsigned char *mem_212347 = NULL;
    size_t mem_213739_cached_sizze_228368 = 0;
    unsigned char *mem_213739 = NULL;
    size_t mem_213743_cached_sizze_228369 = 0;
    unsigned char *mem_213743 = NULL;
    size_t mem_213889_cached_sizze_228370 = 0;
    unsigned char *mem_213889 = NULL;
    size_t mem_213892_cached_sizze_228371 = 0;
    unsigned char *mem_213892 = NULL;
    size_t mem_213895_cached_sizze_228372 = 0;
    unsigned char *mem_213895 = NULL;
    size_t mem_213898_cached_sizze_228373 = 0;
    unsigned char *mem_213898 = NULL;
    struct memblock mem_out_214101;
    
    mem_out_214101.references = NULL;
    
    struct memblock mem_out_214102;
    
    mem_out_214102.references = NULL;
    
    struct memblock mem_out_214103;
    
    mem_out_214103.references = NULL;
    
    bool assert_cond_196708 = sle64((int64_t) 4, n_p_196694);
    bool assert_c_196709;
    
    if (!assert_cond_196708) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (n_p >= 4)",
                               "-> #0  stl.fut:69:13-33\n   #1  stl.fut:401:3-415:29\n   #2  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_196710 = smod64(q_t_196696, (int64_t) 2);
    bool assert_cond_196711 = x_196710 == (int64_t) 1;
    bool assert_c_196712;
    
    if (!assert_cond_196711) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:71:13-25\n   #3  stl.fut:401:3-415:29\n   #4  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_196713 = slt64((int64_t) 0, q_t_196696);
    bool assert_c_196714;
    
    if (!assert_cond_196713) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:71:13-25\n   #3  stl.fut:401:3-415:29\n   #4  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_196715 = smod64(q_l_196697, (int64_t) 2);
    bool assert_cond_196716 = x_196715 == (int64_t) 1;
    bool assert_c_196717;
    
    if (!assert_cond_196716) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:72:13-25\n   #3  stl.fut:401:3-415:29\n   #4  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_196718 = slt64((int64_t) 0, q_l_196697);
    bool assert_c_196719;
    
    if (!assert_cond_196718) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:72:13-25\n   #3  stl.fut:401:3-415:29\n   #4  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_196720 = sle64((int64_t) 0, d_t_196699);
    bool assert_cond_t_res_196721 = sle64(d_t_196699, (int64_t) 2);
    bool x_196722 = cond_196720 && assert_cond_t_res_196721;
    bool assert_c_196723;
    
    if (!x_196722) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:74:13-25\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_196724 = sle64((int64_t) 0, d_l_196700);
    bool assert_cond_t_res_196725 = sle64(d_l_196700, (int64_t) 2);
    bool x_196726 = cond_196724 && assert_cond_t_res_196725;
    bool assert_c_196727;
    
    if (!x_196726) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:75:13-25\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_196728 = slt64((int64_t) 0, jump_t_196702);
    bool assert_c_196729;
    
    if (!assert_cond_196728) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:77:16-31\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_196730 = slt64((int64_t) 0, jump_l_196703);
    bool assert_c_196731;
    
    if (!assert_cond_196730) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:78:16-31\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_196732 = slt64((int64_t) 0, n_inner_196704);
    bool assert_c_196733;
    
    if (!assert_cond_196732) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:80:17-33\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_196734 = slt64((int64_t) 0, n_outer_196705);
    bool assert_c_196735;
    
    if (!assert_cond_196734) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:81:17-33\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    float i64_res_196736 = sitofp_i64_f32(n_196692);
    float i64_res_196737 = sitofp_i64_f32(n_p_196694);
    float ceil_arg_196738 = i64_res_196736 / i64_res_196737;
    float ceil_res_196739;
    
    ceil_res_196739 = futrts_ceil32(ceil_arg_196738);
    
    int64_t defunc_0_f_res_196740 = fptosi_f32_i64(ceil_res_196739);
    int64_t pad_css_len_196741 = add64((int64_t) 2, defunc_0_f_res_196740);
    int64_t y_196742 = mul64((int64_t) 2, n_p_196694);
    int64_t C_len_196743 = add64(n_196692, y_196742);
    bool cond_196744 = jump_s_196701 == (int64_t) 1;
    int64_t s_n_m_196745;
    
    if (cond_196744) {
        s_n_m_196745 = pad_css_len_196741;
    } else {
        bool zzero_196746 = jump_s_196701 == (int64_t) 0;
        bool nonzzero_196747 = !zzero_196746;
        bool nonzzero_cert_196748;
        
        if (!nonzzero_196747) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:88:52-71\n   #1  stl.fut:401:3-415:29\n   #2  stl.fut:385:1-415:29\n");
            if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_196749 = sdiv64(defunc_0_f_res_196740, jump_s_196701);
        int64_t s_n_m_f_res_196750 = add64((int64_t) 3, x_196749);
        
        s_n_m_196745 = s_n_m_f_res_196750;
    }
    
    bool cond_196751 = jump_l_196703 == (int64_t) 1;
    int64_t l_n_m_196752;
    
    if (cond_196751) {
        l_n_m_196752 = n_196692;
    } else {
        bool zzero_196753 = jump_l_196703 == (int64_t) 0;
        bool nonzzero_196754 = !zzero_196753;
        bool nonzzero_cert_196755;
        
        if (!nonzzero_196754) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:94:42-51\n   #1  stl.fut:401:3-415:29\n   #2  stl.fut:385:1-415:29\n");
            if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_196756 = sdiv64(n_196692, jump_l_196703);
        int64_t l_n_m_f_res_196757 = add64((int64_t) 1, x_196756);
        
        l_n_m_196752 = l_n_m_f_res_196757;
    }
    
    bool cond_196758 = jump_t_196702 == (int64_t) 1;
    int64_t t_n_m_196759;
    
    if (cond_196758) {
        t_n_m_196759 = n_196692;
    } else {
        bool zzero_196760 = jump_t_196702 == (int64_t) 0;
        bool nonzzero_196761 = !zzero_196760;
        bool nonzzero_cert_196762;
        
        if (!nonzzero_196761) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:98:42-51\n   #1  stl.fut:401:3-415:29\n   #2  stl.fut:385:1-415:29\n");
            if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_196763 = sdiv64(n_196692, jump_t_196702);
        int64_t t_n_m_f_res_196764 = add64((int64_t) 1, x_196763);
        
        t_n_m_196759 = t_n_m_f_res_196764;
    }
    
    float x_196765 = i64_res_196736 / 2.0F;
    float floor_arg_196766 = 1.0F + x_196765;
    float floor_res_196767;
    
    floor_res_196767 = futrts_floor32(floor_arg_196766);
    
    int64_t defunc_0_f_res_196768 = fptosi_f32_i64(floor_res_196767);
    int64_t x_196769 = sub64(n_196692, defunc_0_f_res_196768);
    int64_t mid2_196770 = add64((int64_t) 1, x_196769);
    bool cond_196771 = defunc_0_f_res_196768 == mid2_196770;
    int64_t stl_res_t_res_196772 = sub64(defunc_0_f_res_196768, (int64_t) 1);
    int64_t stl_res_196773;
    int64_t stl_res_196774;
    
    if (cond_196771) {
        stl_res_196773 = stl_res_t_res_196772;
        stl_res_196774 = defunc_0_f_res_196768;
    } else {
        int64_t min_res_196775 = smin64(defunc_0_f_res_196768, mid2_196770);
        int64_t stl_res_f_res_196776 = sub64(min_res_196775, (int64_t) 1);
        int64_t max_res_196777 = smax64(defunc_0_f_res_196768, mid2_196770);
        
        stl_res_196773 = stl_res_f_res_196776;
        stl_res_196774 = max_res_196777;
    }
    
    int64_t i_196779 = sub64(n_196692, (int64_t) 1);
    bool x_196780 = sle64((int64_t) 0, i_196779);
    bool y_196781 = slt64(i_196779, n_196692);
    bool bounds_check_196782 = x_196780 && y_196781;
    bool index_certs_196783;
    
    if (!bounds_check_196782) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_196779,
                               "] out of bounds for array of shape [",
                               (long long) n_196692, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:112:31-49\n   #3  stl.fut:401:3-415:29\n   #4  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_x_210391 = m_196691 * n_196692;
    int64_t binop_y_210392 = (int64_t) 8 * binop_x_210391;
    int64_t bytes_210393 = smax64((int64_t) 0, binop_y_210392);
    
    if (mem_210394_cached_sizze_228347 < (size_t) bytes_210393) {
        mem_210394 = realloc(mem_210394, bytes_210393);
        mem_210394_cached_sizze_228347 = bytes_210393;
    }
    
    int64_t binop_y_210395 = (int64_t) 8 * m_196691;
    int64_t bytes_210396 = smax64((int64_t) 0, binop_y_210395);
    
    if (mem_210397_cached_sizze_228348 < (size_t) bytes_210396) {
        mem_210397 = realloc(mem_210397, bytes_210396);
        mem_210397_cached_sizze_228348 = bytes_210396;
    }
    
    int64_t binop_y_210355 = (int64_t) 8 * n_196692;
    int64_t bytes_210356 = smax64((int64_t) 0, binop_y_210355);
    int64_t flat_tid_199959 = (int64_t) 0;
    int32_t num_tasks_214104;
    int64_t flat_tid_199967 = (int64_t) 0;
    struct futhark_mc_task_228374 futhark_mc_task_228374;
    
    futhark_mc_task_228374.ctx = ctx;
    futhark_mc_task_228374.free_m_196691 = m_196691;
    futhark_mc_task_228374.free_n_196692 = n_196692;
    futhark_mc_task_228374.free_i_196779 = i_196779;
    futhark_mc_task_228374.free_Y_mem_210354 = Y_mem_210354.mem;
    futhark_mc_task_228374.free_bytes_210356 = bytes_210356;
    futhark_mc_task_228374.free_mem_210394 = mem_210394;
    futhark_mc_task_228374.free_mem_210397 = mem_210397;
    
    struct scheduler_segop futhark_mc_task_228374_task;
    
    futhark_mc_task_228374_task.args = &futhark_mc_task_228374;
    futhark_mc_task_228374_task.top_level_fn = futhark_mc_segmap_task_228375;
    futhark_mc_task_228374_task.name = "futhark_mc_segmap_task_228375";
    futhark_mc_task_228374_task.iterations = m_196691;
    futhark_mc_task_228374_task.task_time =
        &ctx->futhark_mc_segmap_task_228375_total_time;
    futhark_mc_task_228374_task.task_iter =
        &ctx->futhark_mc_segmap_task_228375_total_iter;
    futhark_mc_task_228374_task.sched = STATIC;
    futhark_mc_task_228374_task.nested_fn =
        futhark_mc_segmap_nested_task_228380;
    
    int futhark_mc_segmap_task_228375_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_228374_task);
    
    if (futhark_mc_segmap_task_228375_err != 0) {
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_196807 = slt64(n_p_196694, (int64_t) 0);
    bool valid_196808 = !bounds_invalid_upwards_196807;
    bool range_valid_c_196809;
    
    if (!valid_196808) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) n_p_196694, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:117:12-126:20\n   #4  stl.fut:116:5-127:11\n   #5  stl.fut:401:3-415:29\n   #6  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_196811 = slt64(defunc_0_f_res_196740,
                                               (int64_t) 0);
    bool valid_196812 = !bounds_invalid_upwards_196811;
    bool range_valid_c_196813;
    
    if (!valid_196812) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_196740,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:119:20-125:36\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:117:12-126:20\n   #8  stl.fut:116:5-127:11\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_x_210464 = m_196691 * n_p_196694;
    int64_t binop_x_210465 = defunc_0_f_res_196740 * binop_x_210464;
    int64_t binop_y_210466 = (int64_t) 4 * binop_x_210465;
    int64_t bytes_210467 = smax64((int64_t) 0, binop_y_210466);
    
    if (mem_210468_cached_sizze_228349 < (size_t) bytes_210467) {
        mem_210468 = realloc(mem_210468, bytes_210467);
        mem_210468_cached_sizze_228349 = bytes_210467;
    }
    
    int64_t binop_x_210416 = n_p_196694 * defunc_0_f_res_196740;
    int64_t binop_y_210417 = (int64_t) 4 * binop_x_210416;
    int64_t bytes_210418 = smax64((int64_t) 0, binop_y_210417);
    int64_t binop_y_210398 = (int64_t) 4 * defunc_0_f_res_196740;
    int64_t bytes_210399 = smax64((int64_t) 0, binop_y_210398);
    int64_t flat_tid_199992 = (int64_t) 0;
    int32_t num_tasks_214171;
    int64_t flat_tid_200018 = (int64_t) 0;
    struct futhark_mc_task_228396 futhark_mc_task_228396;
    
    futhark_mc_task_228396.ctx = ctx;
    futhark_mc_task_228396.free_m_196691 = m_196691;
    futhark_mc_task_228396.free_n_196692 = n_196692;
    futhark_mc_task_228396.free_n_p_196694 = n_p_196694;
    futhark_mc_task_228396.free_defunc_0_f_res_196740 = defunc_0_f_res_196740;
    futhark_mc_task_228396.free_i_196779 = i_196779;
    futhark_mc_task_228396.free_Y_mem_210354 = Y_mem_210354.mem;
    futhark_mc_task_228396.free_bytes_210399 = bytes_210399;
    futhark_mc_task_228396.free_bytes_210418 = bytes_210418;
    futhark_mc_task_228396.free_mem_210468 = mem_210468;
    
    struct scheduler_segop futhark_mc_task_228396_task;
    
    futhark_mc_task_228396_task.args = &futhark_mc_task_228396;
    futhark_mc_task_228396_task.top_level_fn = futhark_mc_segmap_task_228397;
    futhark_mc_task_228396_task.name = "futhark_mc_segmap_task_228397";
    futhark_mc_task_228396_task.iterations = m_196691;
    futhark_mc_task_228396_task.task_time =
        &ctx->futhark_mc_segmap_task_228397_total_time;
    futhark_mc_task_228396_task.task_iter =
        &ctx->futhark_mc_segmap_task_228397_total_iter;
    futhark_mc_task_228396_task.sched = STATIC;
    futhark_mc_task_228396_task.nested_fn =
        futhark_mc_segmap_nested_task_228401;
    
    int futhark_mc_segmap_task_228397_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_228396_task);
    
    if (futhark_mc_segmap_task_228397_err != 0) {
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    int64_t i_196831 = sub64(defunc_0_f_res_196740, (int64_t) 1);
    bool x_196832 = sle64((int64_t) 0, i_196831);
    bool y_196833 = slt64(i_196831, defunc_0_f_res_196740);
    bool bounds_check_196834 = x_196832 && y_196833;
    bool index_certs_196835;
    
    if (!bounds_check_196834) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_196831,
                               "] out of bounds for array of shape [",
                               (long long) defunc_0_f_res_196740, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:133:51-67\n   #3  stl.fut:132:12-135:21\n   #4  stl.fut:131:5-136:16\n   #5  stl.fut:401:3-415:29\n   #6  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_210588 = (int64_t) 8 * binop_x_210465;
    int64_t bytes_210589 = smax64((int64_t) 0, binop_y_210588);
    
    if (mem_210590_cached_sizze_228350 < (size_t) bytes_210589) {
        mem_210590 = realloc(mem_210590, bytes_210589);
        mem_210590_cached_sizze_228350 = bytes_210589;
    }
    
    int64_t binop_y_210592 = (int64_t) 8 * binop_x_210464;
    int64_t bytes_210593 = smax64((int64_t) 0, binop_y_210592);
    
    if (mem_210594_cached_sizze_228351 < (size_t) bytes_210593) {
        mem_210594 = realloc(mem_210594, bytes_210593);
        mem_210594_cached_sizze_228351 = bytes_210593;
    }
    
    int64_t binop_y_210506 = (int64_t) 8 * binop_x_210416;
    int64_t bytes_210507 = smax64((int64_t) 0, binop_y_210506);
    int64_t binop_y_210509 = (int64_t) 8 * n_p_196694;
    int64_t bytes_210510 = smax64((int64_t) 0, binop_y_210509);
    int64_t binop_y_210469 = (int64_t) 8 * defunc_0_f_res_196740;
    int64_t bytes_210470 = smax64((int64_t) 0, binop_y_210469);
    int64_t flat_tid_200052 = (int64_t) 0;
    int32_t num_tasks_214267;
    int64_t flat_tid_200089 = (int64_t) 0;
    struct futhark_mc_task_228418 futhark_mc_task_228418;
    
    futhark_mc_task_228418.ctx = ctx;
    futhark_mc_task_228418.free_m_196691 = m_196691;
    futhark_mc_task_228418.free_n_p_196694 = n_p_196694;
    futhark_mc_task_228418.free_defunc_0_f_res_196740 = defunc_0_f_res_196740;
    futhark_mc_task_228418.free_i_196831 = i_196831;
    futhark_mc_task_228418.free_mem_210468 = mem_210468;
    futhark_mc_task_228418.free_bytes_210470 = bytes_210470;
    futhark_mc_task_228418.free_bytes_210507 = bytes_210507;
    futhark_mc_task_228418.free_bytes_210510 = bytes_210510;
    futhark_mc_task_228418.free_mem_210590 = mem_210590;
    futhark_mc_task_228418.free_mem_210594 = mem_210594;
    
    struct scheduler_segop futhark_mc_task_228418_task;
    
    futhark_mc_task_228418_task.args = &futhark_mc_task_228418;
    futhark_mc_task_228418_task.top_level_fn = futhark_mc_segmap_task_228419;
    futhark_mc_task_228418_task.name = "futhark_mc_segmap_task_228419";
    futhark_mc_task_228418_task.iterations = m_196691;
    futhark_mc_task_228418_task.task_time =
        &ctx->futhark_mc_segmap_task_228419_total_time;
    futhark_mc_task_228418_task.task_iter =
        &ctx->futhark_mc_segmap_task_228419_total_iter;
    futhark_mc_task_228418_task.sched = STATIC;
    futhark_mc_task_228418_task.nested_fn =
        futhark_mc_segmap_nested_task_228426;
    
    int futhark_mc_segmap_task_228419_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_228418_task);
    
    if (futhark_mc_segmap_task_228419_err != 0) {
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    int64_t min_res_196862 = smin64(q_s_196695, defunc_0_f_res_196740);
    bool bounds_invalid_upwards_196863 = slt64(s_n_m_196745, (int64_t) 0);
    bool valid_196864 = !bounds_invalid_upwards_196863;
    bool range_valid_c_196865;
    
    if (!valid_196864) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) s_n_m_196745, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:442:3-469:10\n   #4  loess.fut:516:15-50\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:401:3-415:29\n   #13 stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_196867 = slt64((int64_t) 1, min_res_196862);
    float i64_res_196868 = sitofp_i64_f32(q_s_196695);
    int64_t binop_x_210761 = s_n_m_196745 * binop_x_210464;
    int64_t binop_y_210762 = (int64_t) 8 * binop_x_210761;
    int64_t bytes_210763 = smax64((int64_t) 0, binop_y_210762);
    
    if (mem_210764_cached_sizze_228352 < (size_t) bytes_210763) {
        mem_210764 = realloc(mem_210764, bytes_210763);
        mem_210764_cached_sizze_228352 = bytes_210763;
    }
    
    int64_t binop_y_210767 = (int64_t) 4 * binop_x_210761;
    int64_t bytes_210768 = smax64((int64_t) 0, binop_y_210767);
    
    if (mem_210769_cached_sizze_228353 < (size_t) bytes_210768) {
        mem_210769 = realloc(mem_210769, bytes_210768);
        mem_210769_cached_sizze_228353 = bytes_210768;
    }
    
    int64_t binop_x_210649 = n_p_196694 * s_n_m_196745;
    int64_t binop_y_210650 = (int64_t) 8 * binop_x_210649;
    int64_t bytes_210651 = smax64((int64_t) 0, binop_y_210650);
    int64_t binop_y_210654 = (int64_t) 4 * binop_x_210649;
    int64_t bytes_210655 = smax64((int64_t) 0, binop_y_210654);
    int64_t binop_y_210598 = (int64_t) 4 * s_n_m_196745;
    int64_t bytes_210599 = smax64((int64_t) 0, binop_y_210598);
    int64_t binop_y_210601 = (int64_t) 8 * s_n_m_196745;
    int64_t bytes_210602 = smax64((int64_t) 0, binop_y_210601);
    int64_t flat_tid_200140 = (int64_t) 0;
    int32_t num_tasks_214428;
    int64_t flat_tid_200275 = (int64_t) 0;
    struct futhark_mc_task_228453 futhark_mc_task_228453;
    
    futhark_mc_task_228453.ctx = ctx;
    futhark_mc_task_228453.free_m_196691 = m_196691;
    futhark_mc_task_228453.free_n_p_196694 = n_p_196694;
    futhark_mc_task_228453.free_q_s_196695 = q_s_196695;
    futhark_mc_task_228453.free_jump_s_196701 = jump_s_196701;
    futhark_mc_task_228453.free_defunc_0_f_res_196740 = defunc_0_f_res_196740;
    futhark_mc_task_228453.free_pad_css_len_196741 = pad_css_len_196741;
    futhark_mc_task_228453.free_s_n_m_196745 = s_n_m_196745;
    futhark_mc_task_228453.free_i_196831 = i_196831;
    futhark_mc_task_228453.free_x_196832 = x_196832;
    futhark_mc_task_228453.free_min_res_196862 = min_res_196862;
    futhark_mc_task_228453.free_loop_cond_196867 = loop_cond_196867;
    futhark_mc_task_228453.free_i64_res_196868 = i64_res_196868;
    futhark_mc_task_228453.free_bytes_210470 = bytes_210470;
    futhark_mc_task_228453.free_mem_210590 = mem_210590;
    futhark_mc_task_228453.free_mem_210594 = mem_210594;
    futhark_mc_task_228453.free_bytes_210599 = bytes_210599;
    futhark_mc_task_228453.free_bytes_210602 = bytes_210602;
    futhark_mc_task_228453.free_bytes_210651 = bytes_210651;
    futhark_mc_task_228453.free_bytes_210655 = bytes_210655;
    futhark_mc_task_228453.free_mem_210764 = mem_210764;
    futhark_mc_task_228453.free_mem_210769 = mem_210769;
    
    struct scheduler_segop futhark_mc_task_228453_task;
    
    futhark_mc_task_228453_task.args = &futhark_mc_task_228453;
    futhark_mc_task_228453_task.top_level_fn = futhark_mc_segmap_task_228454;
    futhark_mc_task_228453_task.name = "futhark_mc_segmap_task_228454";
    futhark_mc_task_228453_task.iterations = m_196691;
    futhark_mc_task_228453_task.task_time =
        &ctx->futhark_mc_segmap_task_228454_total_time;
    futhark_mc_task_228453_task.task_iter =
        &ctx->futhark_mc_segmap_task_228454_total_iter;
    futhark_mc_task_228453_task.sched = DYNAMIC;
    futhark_mc_task_228453_task.nested_fn =
        futhark_mc_segmap_nested_task_228460;
    
    int futhark_mc_segmap_task_228454_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_228453_task);
    
    if (futhark_mc_segmap_task_228454_err != 0) {
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    int64_t min_res_196994 = smin64(n_196692, q_l_196697);
    bool bounds_invalid_upwards_196995 = slt64(l_n_m_196752, (int64_t) 0);
    bool valid_196996 = !bounds_invalid_upwards_196995;
    bool range_valid_c_196997;
    
    if (!valid_196996) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) l_n_m_196752, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:442:3-469:10\n   #4  loess.fut:502:15-61\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_196999 = slt64((int64_t) 1, min_res_196994);
    float i64_res_197000 = sitofp_i64_f32(q_l_196697);
    int64_t binop_x_210824 = m_196691 * l_n_m_196752;
    int64_t binop_y_210825 = (int64_t) 8 * binop_x_210824;
    int64_t bytes_210826 = smax64((int64_t) 0, binop_y_210825);
    
    if (mem_210827_cached_sizze_228354 < (size_t) bytes_210826) {
        mem_210827 = realloc(mem_210827, bytes_210826);
        mem_210827_cached_sizze_228354 = bytes_210826;
    }
    
    int64_t binop_y_210829 = (int64_t) 4 * binop_x_210824;
    int64_t bytes_210830 = smax64((int64_t) 0, binop_y_210829);
    
    if (mem_210831_cached_sizze_228355 < (size_t) bytes_210830) {
        mem_210831 = realloc(mem_210831, bytes_210830);
        mem_210831_cached_sizze_228355 = bytes_210830;
    }
    
    int64_t binop_y_210773 = (int64_t) 4 * l_n_m_196752;
    int64_t bytes_210774 = smax64((int64_t) 0, binop_y_210773);
    int64_t binop_y_210776 = (int64_t) 8 * l_n_m_196752;
    int64_t bytes_210777 = smax64((int64_t) 0, binop_y_210776);
    int64_t flat_tid_200523 = (int64_t) 0;
    int32_t num_tasks_215152;
    int64_t flat_tid_200531 = (int64_t) 0;
    struct futhark_mc_task_228486 futhark_mc_task_228486;
    
    futhark_mc_task_228486.ctx = ctx;
    futhark_mc_task_228486.free_m_196691 = m_196691;
    futhark_mc_task_228486.free_n_196692 = n_196692;
    futhark_mc_task_228486.free_q_l_196697 = q_l_196697;
    futhark_mc_task_228486.free_jump_l_196703 = jump_l_196703;
    futhark_mc_task_228486.free_l_n_m_196752 = l_n_m_196752;
    futhark_mc_task_228486.free_i_196779 = i_196779;
    futhark_mc_task_228486.free_x_196780 = x_196780;
    futhark_mc_task_228486.free_min_res_196994 = min_res_196994;
    futhark_mc_task_228486.free_loop_cond_196999 = loop_cond_196999;
    futhark_mc_task_228486.free_i64_res_197000 = i64_res_197000;
    futhark_mc_task_228486.free_bytes_210356 = bytes_210356;
    futhark_mc_task_228486.free_mem_210394 = mem_210394;
    futhark_mc_task_228486.free_mem_210397 = mem_210397;
    futhark_mc_task_228486.free_bytes_210774 = bytes_210774;
    futhark_mc_task_228486.free_bytes_210777 = bytes_210777;
    futhark_mc_task_228486.free_mem_210827 = mem_210827;
    futhark_mc_task_228486.free_mem_210831 = mem_210831;
    
    struct scheduler_segop futhark_mc_task_228486_task;
    
    futhark_mc_task_228486_task.args = &futhark_mc_task_228486;
    futhark_mc_task_228486_task.top_level_fn = futhark_mc_segmap_task_228487;
    futhark_mc_task_228486_task.name = "futhark_mc_segmap_task_228487";
    futhark_mc_task_228486_task.iterations = m_196691;
    futhark_mc_task_228486_task.task_time =
        &ctx->futhark_mc_segmap_task_228487_total_time;
    futhark_mc_task_228486_task.task_iter =
        &ctx->futhark_mc_segmap_task_228487_total_iter;
    futhark_mc_task_228486_task.sched = DYNAMIC;
    futhark_mc_task_228486_task.nested_fn =
        futhark_mc_segmap_nested_task_228493;
    
    int futhark_mc_segmap_task_228487_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_228486_task);
    
    if (futhark_mc_segmap_task_228487_err != 0) {
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    int64_t min_res_197106 = smin64(n_196692, q_t_196696);
    bool bounds_invalid_upwards_197107 = slt64(t_n_m_196759, (int64_t) 0);
    bool valid_197108 = !bounds_invalid_upwards_197107;
    bool range_valid_c_197109;
    
    if (!valid_197108) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) t_n_m_196759, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:442:3-469:10\n   #4  loess.fut:502:15-61\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_197111 = slt64((int64_t) 1, min_res_197106);
    float i64_res_197112 = sitofp_i64_f32(q_t_196696);
    int64_t binop_x_210886 = m_196691 * t_n_m_196759;
    int64_t binop_y_210887 = (int64_t) 8 * binop_x_210886;
    int64_t bytes_210888 = smax64((int64_t) 0, binop_y_210887);
    
    if (mem_210889_cached_sizze_228356 < (size_t) bytes_210888) {
        mem_210889 = realloc(mem_210889, bytes_210888);
        mem_210889_cached_sizze_228356 = bytes_210888;
    }
    
    int64_t binop_y_210891 = (int64_t) 4 * binop_x_210886;
    int64_t bytes_210892 = smax64((int64_t) 0, binop_y_210891);
    
    if (mem_210893_cached_sizze_228357 < (size_t) bytes_210892) {
        mem_210893 = realloc(mem_210893, bytes_210892);
        mem_210893_cached_sizze_228357 = bytes_210892;
    }
    
    int64_t binop_y_210835 = (int64_t) 4 * t_n_m_196759;
    int64_t bytes_210836 = smax64((int64_t) 0, binop_y_210835);
    int64_t binop_y_210838 = (int64_t) 8 * t_n_m_196759;
    int64_t bytes_210839 = smax64((int64_t) 0, binop_y_210838);
    int64_t flat_tid_200638 = (int64_t) 0;
    int32_t num_tasks_215427;
    int64_t flat_tid_200646 = (int64_t) 0;
    struct futhark_mc_task_228507 futhark_mc_task_228507;
    
    futhark_mc_task_228507.ctx = ctx;
    futhark_mc_task_228507.free_m_196691 = m_196691;
    futhark_mc_task_228507.free_n_196692 = n_196692;
    futhark_mc_task_228507.free_q_t_196696 = q_t_196696;
    futhark_mc_task_228507.free_jump_t_196702 = jump_t_196702;
    futhark_mc_task_228507.free_t_n_m_196759 = t_n_m_196759;
    futhark_mc_task_228507.free_i_196779 = i_196779;
    futhark_mc_task_228507.free_x_196780 = x_196780;
    futhark_mc_task_228507.free_min_res_197106 = min_res_197106;
    futhark_mc_task_228507.free_loop_cond_197111 = loop_cond_197111;
    futhark_mc_task_228507.free_i64_res_197112 = i64_res_197112;
    futhark_mc_task_228507.free_bytes_210356 = bytes_210356;
    futhark_mc_task_228507.free_mem_210394 = mem_210394;
    futhark_mc_task_228507.free_mem_210397 = mem_210397;
    futhark_mc_task_228507.free_bytes_210836 = bytes_210836;
    futhark_mc_task_228507.free_bytes_210839 = bytes_210839;
    futhark_mc_task_228507.free_mem_210889 = mem_210889;
    futhark_mc_task_228507.free_mem_210893 = mem_210893;
    
    struct scheduler_segop futhark_mc_task_228507_task;
    
    futhark_mc_task_228507_task.args = &futhark_mc_task_228507;
    futhark_mc_task_228507_task.top_level_fn = futhark_mc_segmap_task_228508;
    futhark_mc_task_228507_task.name = "futhark_mc_segmap_task_228508";
    futhark_mc_task_228507_task.iterations = m_196691;
    futhark_mc_task_228507_task.task_time =
        &ctx->futhark_mc_segmap_task_228508_total_time;
    futhark_mc_task_228507_task.task_iter =
        &ctx->futhark_mc_segmap_task_228508_total_iter;
    futhark_mc_task_228507_task.sched = DYNAMIC;
    futhark_mc_task_228507_task.nested_fn =
        futhark_mc_segmap_nested_task_228514;
    
    int futhark_mc_segmap_task_228508_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_228507_task);
    
    if (futhark_mc_segmap_task_228508_err != 0) {
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_210895 = (int64_t) 4 * binop_x_210391;
    int64_t bytes_210896 = smax64((int64_t) 0, binop_y_210895);
    struct memblock mem_210897;
    
    mem_210897.references = NULL;
    if (memblock_alloc(ctx, &mem_210897, bytes_210896, "mem_210897")) {
        err = 1;
        goto cleanup;
    }
    for (int64_t i_215702 = 0; i_215702 < m_196691; i_215702++) {
        for (int64_t i_215703 = 0; i_215703 < n_196692; i_215703++) {
            ((float *) mem_210897.mem)[i_215702 * n_196692 + i_215703] = 0.0F;
        }
    }
    
    struct memblock mem_210901;
    
    mem_210901.references = NULL;
    if (memblock_alloc(ctx, &mem_210901, bytes_210896, "mem_210901")) {
        err = 1;
        goto cleanup;
    }
    for (int64_t i_215704 = 0; i_215704 < m_196691; i_215704++) {
        for (int64_t i_215705 = 0; i_215705 < n_196692; i_215705++) {
            ((float *) mem_210901.mem)[i_215704 * n_196692 + i_215705] = 1.0F;
        }
    }
    
    bool cond_197220 = slt64((int64_t) 1, jump_l_196703);
    bool cond_197221 = slt64((int64_t) 1, jump_t_196702);
    int64_t y_197222 = sub64(n_outer_196705, (int64_t) 1);
    int64_t css_results_l_197223;
    
    if (cond_196744) {
        css_results_l_197223 = s_n_m_196745;
    } else {
        css_results_l_197223 = pad_css_len_196741;
    }
    
    bool zzero_197224 = n_p_196694 == (int64_t) 0;
    bool nonzzero_197225 = !zzero_197224;
    bool loop_not_taken_197226 = !assert_cond_196732;
    bool protect_assert_disj_197227 = nonzzero_197225 || loop_not_taken_197226;
    bool loop_not_taken_197228 = !assert_cond_196734;
    bool protect_assert_disj_197229 = protect_assert_disj_197227 ||
         loop_not_taken_197228;
    bool nonzzero_cert_197230;
    
    if (!protect_assert_disj_197229) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "division by zero",
                               "-> #0  stl.fut:226:51-57\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:401:3-415:29\n   #7  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_197231 = add64(n_196692, n_p_196694);
    bool empty_slice_197232 = n_196692 == (int64_t) 0;
    int64_t i_p_m_t_s_197233 = add64(n_p_196694, i_196779);
    bool zzero_leq_i_p_m_t_s_197234 = sle64((int64_t) 0, i_p_m_t_s_197233);
    bool i_p_m_t_s_leq_w_197235 = slt64(i_p_m_t_s_197233, C_len_196743);
    bool zzero_lte_i_197236 = sle64((int64_t) 0, n_p_196694);
    bool i_lte_j_197237 = sle64(n_p_196694, j_197231);
    bool y_197238 = i_p_m_t_s_leq_w_197235 && zzero_lte_i_197236;
    bool y_197239 = zzero_leq_i_p_m_t_s_197234 && y_197238;
    bool y_197240 = i_lte_j_197237 && y_197239;
    bool forwards_ok_197241 = zzero_lte_i_197236 && y_197240;
    bool ok_or_empty_197242 = empty_slice_197232 || forwards_ok_197241;
    bool protect_assert_disj_197243 = loop_not_taken_197226 ||
         ok_or_empty_197242;
    bool protect_assert_disj_197244 = loop_not_taken_197228 ||
         protect_assert_disj_197243;
    bool index_certs_197245;
    
    if (!protect_assert_disj_197244) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) n_p_196694, ":",
                               (long long) j_197231,
                               "] out of bounds for array of shape [",
                               (long long) C_len_196743, "].",
                               "-> #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:401:3-415:29\n   #5  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_m_i_197246 = sub64(stl_res_196774, stl_res_196773);
    int64_t lifted_single_ma_l_arg_197247 = add64((int64_t) 1, j_197231);
    int64_t m_197248 = sub64(n_p_196694, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_197249 = sle64((int64_t) 0, m_197248);
    bool i_p_m_t_s_leq_w_197250 = slt64(m_197248, C_len_196743);
    bool y_197251 = zzero_leq_i_p_m_t_s_197249 && i_p_m_t_s_leq_w_197250;
    bool y_197252 = zzero_lte_i_197236 && y_197251;
    bool ok_or_empty_197253 = zzero_197224 || y_197252;
    bool protect_assert_disj_197254 = loop_not_taken_197226 ||
         ok_or_empty_197253;
    bool protect_assert_disj_197255 = loop_not_taken_197228 ||
         protect_assert_disj_197254;
    bool index_certs_197256;
    
    if (!protect_assert_disj_197255) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_196694,
                               "] out of bounds for array of shape [",
                               (long long) C_len_196743, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  stl.fut:38:3-36\n   #3  stl.fut:231:23-47\n   #4  stl.fut:401:3-415:29\n   #5  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t dyn_lifted_single_ma_l_arg_197257 = add64((int64_t) 2, n_196692);
    bool i_p_m_t_s_leq_w_197258 = slt64(m_197248,
                                        lifted_single_ma_l_arg_197247);
    bool y_197259 = zzero_leq_i_p_m_t_s_197249 && i_p_m_t_s_leq_w_197258;
    bool y_197260 = zzero_lte_i_197236 && y_197259;
    bool ok_or_empty_197261 = zzero_197224 || y_197260;
    bool protect_assert_disj_197262 = loop_not_taken_197226 ||
         ok_or_empty_197261;
    bool protect_assert_disj_197263 = loop_not_taken_197228 ||
         protect_assert_disj_197262;
    bool index_certs_197264;
    
    if (!protect_assert_disj_197263) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_196694,
                               "] out of bounds for array of shape [",
                               (long long) lifted_single_ma_l_arg_197247, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-64\n   #4  stl.fut:231:23-47\n   #5  stl.fut:401:3-415:29\n   #6  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool i_p_m_t_s_leq_w_197265 = slt64((int64_t) 2,
                                        dyn_lifted_single_ma_l_arg_197257);
    bool protect_assert_disj_197266 = loop_not_taken_197226 ||
         i_p_m_t_s_leq_w_197265;
    bool protect_assert_disj_197267 = loop_not_taken_197228 ||
         protect_assert_disj_197266;
    bool index_certs_197268;
    
    if (!protect_assert_disj_197267) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) (int64_t) 3,
                               "] out of bounds for array of shape [",
                               (long long) dyn_lifted_single_ma_l_arg_197257,
                               "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-84\n   #4  stl.fut:231:23-47\n   #5  stl.fut:401:3-415:29\n   #6  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_197269 = slt64(jump_l_196703, jump_threshold_196706);
    bool cond_f_res_197270 = slt64(q_threshold_196707, q_l_196697);
    bool x_197271 = !cond_197269;
    bool y_197272 = cond_f_res_197270 && x_197271;
    bool cond_197273 = cond_197269 || y_197272;
    bool cond_197274 = slt64(jump_t_196702, jump_threshold_196706);
    bool cond_f_res_197275 = slt64(q_threshold_196707, q_t_196696);
    bool x_197276 = !cond_197274;
    bool y_197277 = cond_f_res_197275 && x_197276;
    bool cond_197278 = cond_197274 || y_197277;
    bool cond_197279 = slt64(jump_s_196701, jump_threshold_196706);
    bool cond_f_res_197280 = slt64(q_threshold_196707, q_s_196695);
    bool x_197281 = !cond_197279;
    bool y_197282 = cond_f_res_197280 && x_197281;
    bool cond_197283 = cond_197279 || y_197282;
    bool bounds_invalid_upwards_197284 = slt64(C_len_196743, (int64_t) 0);
    bool valid_197285 = !bounds_invalid_upwards_197284;
    bool protect_assert_disj_197286 = loop_not_taken_197226 || valid_197285;
    bool protect_assert_disj_197287 = loop_not_taken_197228 ||
         protect_assert_disj_197286;
    bool range_valid_c_197288;
    
    if (!protect_assert_disj_197287) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) C_len_196743, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:226:28-74\n   #4  stl.fut:225:21-227:39\n   #5  stl.fut:401:3-415:29\n   #6  stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_197290 = slt64(lifted_single_ma_l_arg_197247,
                                               (int64_t) 0);
    bool valid_197291 = !bounds_invalid_upwards_197290;
    bool protect_assert_disj_197292 = loop_not_taken_197226 || valid_197291;
    bool protect_assert_disj_197293 = loop_not_taken_197228 ||
         protect_assert_disj_197292;
    bool range_valid_c_197294;
    
    if (!protect_assert_disj_197293) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) lifted_single_ma_l_arg_197247,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  stl.fut:38:3-36\n   #8  stl.fut:231:23-47\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_197296 =
         slt64(dyn_lifted_single_ma_l_arg_197257, (int64_t) 0);
    bool valid_197297 = !bounds_invalid_upwards_197296;
    bool protect_assert_disj_197298 = loop_not_taken_197226 || valid_197297;
    bool protect_assert_disj_197299 = loop_not_taken_197228 ||
         protect_assert_disj_197298;
    bool range_valid_c_197300;
    
    if (!protect_assert_disj_197299) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) dyn_lifted_single_ma_l_arg_197257,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  /prelude/functional.fut:9:42-44\n   #8  stl.fut:38:3-64\n   #9  stl.fut:231:23-47\n   #10 stl.fut:401:3-415:29\n   #11 stl.fut:385:1-415:29\n");
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (mem_210969_cached_sizze_228358 < (size_t) bytes_210896) {
        mem_210969 = realloc(mem_210969, bytes_210896);
        mem_210969_cached_sizze_228358 = bytes_210896;
    }
    
    int64_t binop_y_210948 = (int64_t) 4 * n_196692;
    int64_t bytes_210949 = smax64((int64_t) 0, binop_y_210948);
    
    if (mem_211106_cached_sizze_228359 < (size_t) bytes_210467) {
        mem_211106 = realloc(mem_211106, bytes_210467);
        mem_211106_cached_sizze_228359 = bytes_210467;
    }
    if (mem_211111_cached_sizze_228360 < (size_t) bytes_210467) {
        mem_211111 = realloc(mem_211111, bytes_210467);
        mem_211111_cached_sizze_228360 = bytes_210467;
    }
    
    int64_t binop_x_212245 = pad_css_len_196741 * binop_x_210464;
    int64_t binop_y_212246 = (int64_t) 4 * binop_x_212245;
    int64_t bytes_212247 = smax64((int64_t) 0, binop_y_212246);
    int64_t binop_x_212269 = m_196691 * C_len_196743;
    int64_t binop_y_212270 = (int64_t) 4 * binop_x_212269;
    int64_t bytes_212271 = smax64((int64_t) 0, binop_y_212270);
    
    if (mem_212272_cached_sizze_228361 < (size_t) bytes_212271) {
        mem_212272 = realloc(mem_212272, bytes_212271);
        mem_212272_cached_sizze_228361 = bytes_212271;
    }
    
    int64_t binop_y_212251 = (int64_t) 4 * C_len_196743;
    int64_t bytes_212252 = smax64((int64_t) 0, binop_y_212251);
    int64_t binop_y_212273 = (int64_t) 4 * m_196691;
    int64_t bytes_212274 = smax64((int64_t) 0, binop_y_212273);
    
    if (mem_212275_cached_sizze_228362 < (size_t) bytes_212274) {
        mem_212275 = realloc(mem_212275, bytes_212274);
        mem_212275_cached_sizze_228362 = bytes_212274;
    }
    
    int64_t binop_x_212294 = m_196691 * lifted_single_ma_l_arg_197247;
    int64_t binop_y_212295 = (int64_t) 4 * binop_x_212294;
    int64_t bytes_212296 = smax64((int64_t) 0, binop_y_212295);
    
    if (mem_212297_cached_sizze_228363 < (size_t) bytes_212296) {
        mem_212297 = realloc(mem_212297, bytes_212296);
        mem_212297_cached_sizze_228363 = bytes_212296;
    }
    
    int64_t binop_y_212276 = (int64_t) 4 * lifted_single_ma_l_arg_197247;
    int64_t bytes_212277 = smax64((int64_t) 0, binop_y_212276);
    
    if (mem_212300_cached_sizze_228364 < (size_t) bytes_212274) {
        mem_212300 = realloc(mem_212300, bytes_212274);
        mem_212300_cached_sizze_228364 = bytes_212274;
    }
    
    int64_t binop_x_212319 = m_196691 * dyn_lifted_single_ma_l_arg_197257;
    int64_t binop_y_212320 = (int64_t) 4 * binop_x_212319;
    int64_t bytes_212321 = smax64((int64_t) 0, binop_y_212320);
    
    if (mem_212322_cached_sizze_228365 < (size_t) bytes_212321) {
        mem_212322 = realloc(mem_212322, bytes_212321);
        mem_212322_cached_sizze_228365 = bytes_212321;
    }
    
    int64_t binop_y_212301 = (int64_t) 4 * dyn_lifted_single_ma_l_arg_197257;
    int64_t bytes_212302 = smax64((int64_t) 0, binop_y_212301);
    
    if (mem_212325_cached_sizze_228366 < (size_t) bytes_212274) {
        mem_212325 = realloc(mem_212325, bytes_212274);
        mem_212325_cached_sizze_228366 = bytes_212274;
    }
    if (mem_212347_cached_sizze_228367 < (size_t) bytes_210896) {
        mem_212347 = realloc(mem_212347, bytes_210896);
        mem_212347_cached_sizze_228367 = bytes_210896;
    }
    
    int64_t ext_212840;
    
    if (cond_197220) {
        ext_212840 = n_196692;
    } else {
        ext_212840 = l_n_m_196752;
    }
    
    int64_t ext_213679;
    
    if (cond_197221) {
        ext_213679 = n_196692;
    } else {
        ext_213679 = t_n_m_196759;
    }
    
    int64_t ext_213944;
    int64_t ext_213942;
    int64_t ext_213938;
    int64_t ext_213937;
    int64_t ext_213936;
    int64_t ext_213935;
    int64_t ext_213934;
    int64_t ext_213933;
    int64_t ext_213932;
    struct memblock ext_mem_213931;
    
    ext_mem_213931.references = NULL;
    
    struct memblock ext_mem_213930;
    
    ext_mem_213930.references = NULL;
    
    struct memblock ext_mem_213929;
    
    ext_mem_213929.references = NULL;
    
    struct memblock mem_param_210909;
    
    mem_param_210909.references = NULL;
    
    int64_t ctx_param_ext_210911;
    int64_t ctx_param_ext_210913;
    struct memblock mem_param_210917;
    
    mem_param_210917.references = NULL;
    
    int64_t ctx_param_ext_210918;
    int64_t ctx_param_ext_210919;
    int64_t ctx_param_ext_210920;
    int64_t ctx_param_ext_210921;
    int64_t ctx_param_ext_210922;
    int64_t ctx_param_ext_210923;
    int64_t ctx_param_ext_210924;
    struct memblock mem_param_210925;
    
    mem_param_210925.references = NULL;
    ctx_param_ext_210911 = n_196692;
    ctx_param_ext_210913 = n_196692;
    ctx_param_ext_210918 = m_196691;
    ctx_param_ext_210919 = n_196692;
    ctx_param_ext_210920 = (int64_t) 0;
    ctx_param_ext_210921 = n_196692;
    ctx_param_ext_210922 = m_196691;
    ctx_param_ext_210923 = (int64_t) 1;
    ctx_param_ext_210924 = n_196692;
    if (memblock_set(ctx, &mem_param_210909, &mem_210897, "mem_210897") != 0)
        return 1;
    if (memblock_set(ctx, &mem_param_210917, &mem_210897, "mem_210897") != 0)
        return 1;
    if (memblock_set(ctx, &mem_param_210925, &mem_210901, "mem_210901") != 0)
        return 1;
    for (int64_t i_outer_197305 = 0; i_outer_197305 < n_outer_196705;
         i_outer_197305++) {
        int64_t ext_213691;
        int64_t ext_213689;
        struct memblock ext_mem_213685;
        
        ext_mem_213685.references = NULL;
        
        struct memblock ext_mem_213684;
        
        ext_mem_213684.references = NULL;
        
        struct memblock mem_param_210939;
        
        mem_param_210939.references = NULL;
        
        int64_t ctx_param_ext_210941;
        int64_t ctx_param_ext_210943;
        struct memblock mem_param_210947;
        
        mem_param_210947.references = NULL;
        ctx_param_ext_210941 = ctx_param_ext_210911;
        ctx_param_ext_210943 = ctx_param_ext_210913;
        if (memblock_set(ctx, &mem_param_210939, &mem_param_210909,
                         "mem_param_210909") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_210947, &mem_param_210917,
                         "mem_param_210917") != 0)
            return 1;
        for (int64_t _i_inner_197311 = 0; _i_inner_197311 < n_inner_196704;
             _i_inner_197311++) {
            int64_t flat_tid_200753 = (int64_t) 0;
            int32_t num_tasks_215727;
            int64_t flat_tid_200759 = (int64_t) 0;
            struct futhark_mc_task_228528 futhark_mc_task_228528;
            
            futhark_mc_task_228528.ctx = ctx;
            futhark_mc_task_228528.free_m_196691 = m_196691;
            futhark_mc_task_228528.free_n_196692 = n_196692;
            futhark_mc_task_228528.free_Y_mem_210354 = Y_mem_210354.mem;
            futhark_mc_task_228528.free_ctx_param_ext_210943 =
                ctx_param_ext_210943;
            futhark_mc_task_228528.free_mem_param_210947 = mem_param_210947.mem;
            futhark_mc_task_228528.free_bytes_210949 = bytes_210949;
            futhark_mc_task_228528.free_mem_210969 = mem_210969;
            
            struct scheduler_segop futhark_mc_task_228528_task;
            
            futhark_mc_task_228528_task.args = &futhark_mc_task_228528;
            futhark_mc_task_228528_task.top_level_fn =
                futhark_mc_segmap_task_228529;
            futhark_mc_task_228528_task.name = "futhark_mc_segmap_task_228529";
            futhark_mc_task_228528_task.iterations = m_196691;
            futhark_mc_task_228528_task.task_time =
                &ctx->futhark_mc_segmap_task_228529_total_time;
            futhark_mc_task_228528_task.task_iter =
                &ctx->futhark_mc_segmap_task_228529_total_iter;
            futhark_mc_task_228528_task.sched = STATIC;
            futhark_mc_task_228528_task.nested_fn =
                futhark_mc_segmap_nested_task_228533;
            
            int futhark_mc_segmap_task_228529_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228528_task);
            
            if (futhark_mc_segmap_task_228529_err != 0) {
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_200769 = (int64_t) 0;
            int32_t num_tasks_215750;
            int64_t flat_tid_200803 = (int64_t) 0;
            struct futhark_mc_task_228541 futhark_mc_task_228541;
            
            futhark_mc_task_228541.ctx = ctx;
            futhark_mc_task_228541.free_m_196691 = m_196691;
            futhark_mc_task_228541.free_n_196692 = n_196692;
            futhark_mc_task_228541.free_n_p_196694 = n_p_196694;
            futhark_mc_task_228541.free_defunc_0_f_res_196740 =
                defunc_0_f_res_196740;
            futhark_mc_task_228541.free_i_196779 = i_196779;
            futhark_mc_task_228541.free_bytes_210399 = bytes_210399;
            futhark_mc_task_228541.free_bytes_210418 = bytes_210418;
            futhark_mc_task_228541.free_mem_210590 = mem_210590;
            futhark_mc_task_228541.free_ctx_param_ext_210920 =
                ctx_param_ext_210920;
            futhark_mc_task_228541.free_ctx_param_ext_210921 =
                ctx_param_ext_210921;
            futhark_mc_task_228541.free_ctx_param_ext_210923 =
                ctx_param_ext_210923;
            futhark_mc_task_228541.free_mem_param_210925 = mem_param_210925.mem;
            futhark_mc_task_228541.free_mem_210969 = mem_210969;
            futhark_mc_task_228541.free_mem_211106 = mem_211106;
            futhark_mc_task_228541.free_mem_211111 = mem_211111;
            
            struct scheduler_segop futhark_mc_task_228541_task;
            
            futhark_mc_task_228541_task.args = &futhark_mc_task_228541;
            futhark_mc_task_228541_task.top_level_fn =
                futhark_mc_segmap_task_228542;
            futhark_mc_task_228541_task.name = "futhark_mc_segmap_task_228542";
            futhark_mc_task_228541_task.iterations = m_196691;
            futhark_mc_task_228541_task.task_time =
                &ctx->futhark_mc_segmap_task_228542_total_time;
            futhark_mc_task_228541_task.task_iter =
                &ctx->futhark_mc_segmap_task_228542_total_iter;
            futhark_mc_task_228541_task.sched = STATIC;
            futhark_mc_task_228541_task.nested_fn =
                futhark_mc_segmap_nested_task_228547;
            
            int futhark_mc_segmap_task_228542_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228541_task);
            
            if (futhark_mc_segmap_task_228542_err != 0) {
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            struct memblock ext_mem_212177;
            
            ext_mem_212177.references = NULL;
            
            struct memblock ext_mem_212176;
            
            ext_mem_212176.references = NULL;
            if (cond_197283) {
                bool match_lit_197353 = (int64_t) 0 == d_s_196698;
                struct memblock ext_mem_211475;
                
                ext_mem_211475.references = NULL;
                
                struct memblock ext_mem_211474;
                
                ext_mem_211474.references = NULL;
                if (match_lit_197353) {
                    struct memblock mem_211116;
                    
                    mem_211116.references = NULL;
                    if (memblock_alloc(ctx, &mem_211116, bytes_210768,
                                       "mem_211116")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_215898 = 0; i_215898 < m_196691;
                         i_215898++) {
                        for (int64_t i_215899 = 0; i_215899 < n_p_196694;
                             i_215899++) {
                            for (int64_t i_215900 = 0; i_215900 < s_n_m_196745;
                                 i_215900++) {
                                ((float *) mem_211116.mem)[i_215898 *
                                                           (s_n_m_196745 *
                                                            n_p_196694) +
                                                           i_215899 *
                                                           s_n_m_196745 +
                                                           i_215900] = 0.0F;
                            }
                        }
                    }
                    
                    struct memblock mem_211187;
                    
                    mem_211187.references = NULL;
                    if (memblock_alloc(ctx, &mem_211187, bytes_210768,
                                       "mem_211187")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t flat_tid_200856 = (int64_t) 0;
                    int32_t num_tasks_215901;
                    int64_t flat_tid_201117 = (int64_t) 0;
                    struct futhark_mc_task_228567 futhark_mc_task_228567;
                    
                    futhark_mc_task_228567.ctx = ctx;
                    futhark_mc_task_228567.free_m_196691 = m_196691;
                    futhark_mc_task_228567.free_n_p_196694 = n_p_196694;
                    futhark_mc_task_228567.free_q_s_196695 = q_s_196695;
                    futhark_mc_task_228567.free_jump_s_196701 = jump_s_196701;
                    futhark_mc_task_228567.free_defunc_0_f_res_196740 =
                        defunc_0_f_res_196740;
                    futhark_mc_task_228567.free_pad_css_len_196741 =
                        pad_css_len_196741;
                    futhark_mc_task_228567.free_s_n_m_196745 = s_n_m_196745;
                    futhark_mc_task_228567.free_mem_210590 = mem_210590;
                    futhark_mc_task_228567.free_mem_210594 = mem_210594;
                    futhark_mc_task_228567.free_bytes_210599 = bytes_210599;
                    futhark_mc_task_228567.free_bytes_210655 = bytes_210655;
                    futhark_mc_task_228567.free_mem_210764 = mem_210764;
                    futhark_mc_task_228567.free_mem_210769 = mem_210769;
                    futhark_mc_task_228567.free_mem_211106 = mem_211106;
                    futhark_mc_task_228567.free_mem_211111 = mem_211111;
                    futhark_mc_task_228567.free_mem_211187 = mem_211187.mem;
                    
                    struct scheduler_segop futhark_mc_task_228567_task;
                    
                    futhark_mc_task_228567_task.args = &futhark_mc_task_228567;
                    futhark_mc_task_228567_task.top_level_fn =
                        futhark_mc_segmap_task_228568;
                    futhark_mc_task_228567_task.name =
                        "futhark_mc_segmap_task_228568";
                    futhark_mc_task_228567_task.iterations = m_196691;
                    futhark_mc_task_228567_task.task_time =
                        &ctx->futhark_mc_segmap_task_228568_total_time;
                    futhark_mc_task_228567_task.task_iter =
                        &ctx->futhark_mc_segmap_task_228568_total_iter;
                    futhark_mc_task_228567_task.sched = STATIC;
                    futhark_mc_task_228567_task.nested_fn =
                        futhark_mc_segmap_nested_task_228572;
                    
                    int futhark_mc_segmap_task_228568_err =
                        scheduler_prepare_task(&ctx->scheduler,
                                               &futhark_mc_task_228567_task);
                    
                    if (futhark_mc_segmap_task_228568_err != 0) {
                        if (memblock_unref(ctx, &mem_211187, "mem_211187") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211116, "mem_211116") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_211474,
                                           "ext_mem_211474") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_211475,
                                           "ext_mem_211475") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212176,
                                           "ext_mem_212176") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212177,
                                           "ext_mem_212177") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210947,
                                           "mem_param_210947") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210939,
                                           "mem_param_210939") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213684,
                                           "ext_mem_213684") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213685,
                                           "ext_mem_213685") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210925,
                                           "mem_param_210925") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210917,
                                           "mem_param_210917") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210909,
                                           "mem_param_210909") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213929,
                                           "ext_mem_213929") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213930,
                                           "ext_mem_213930") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213931,
                                           "ext_mem_213931") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214103,
                                           "mem_out_214103") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214102,
                                           "mem_out_214102") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214101,
                                           "mem_out_214101") != 0)
                            return 1;
                        ;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_set(ctx, &ext_mem_211475, &mem_211187,
                                     "mem_211187") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_211474, &mem_211116,
                                     "mem_211116") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_211187, "mem_211187") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_211116, "mem_211116") != 0)
                        return 1;
                } else {
                    bool match_lit_197449 = (int64_t) 1 == d_s_196698;
                    struct memblock ext_mem_211473;
                    
                    ext_mem_211473.references = NULL;
                    
                    struct memblock ext_mem_211472;
                    
                    ext_mem_211472.references = NULL;
                    if (match_lit_197449) {
                        struct memblock mem_211324;
                        
                        mem_211324.references = NULL;
                        if (memblock_alloc(ctx, &mem_211324, bytes_210768,
                                           "mem_211324")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_211329;
                        
                        mem_211329.references = NULL;
                        if (memblock_alloc(ctx, &mem_211329, bytes_210768,
                                           "mem_211329")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t flat_tid_201374 = (int64_t) 0;
                        int32_t num_tasks_216616;
                        int64_t flat_tid_201720 = (int64_t) 0;
                        struct futhark_mc_task_228602 futhark_mc_task_228602;
                        
                        futhark_mc_task_228602.ctx = ctx;
                        futhark_mc_task_228602.free_m_196691 = m_196691;
                        futhark_mc_task_228602.free_n_p_196694 = n_p_196694;
                        futhark_mc_task_228602.free_q_s_196695 = q_s_196695;
                        futhark_mc_task_228602.free_jump_s_196701 =
                            jump_s_196701;
                        futhark_mc_task_228602.free_defunc_0_f_res_196740 =
                            defunc_0_f_res_196740;
                        futhark_mc_task_228602.free_pad_css_len_196741 =
                            pad_css_len_196741;
                        futhark_mc_task_228602.free_s_n_m_196745 = s_n_m_196745;
                        futhark_mc_task_228602.free_mem_210590 = mem_210590;
                        futhark_mc_task_228602.free_mem_210594 = mem_210594;
                        futhark_mc_task_228602.free_bytes_210599 = bytes_210599;
                        futhark_mc_task_228602.free_bytes_210655 = bytes_210655;
                        futhark_mc_task_228602.free_mem_210764 = mem_210764;
                        futhark_mc_task_228602.free_mem_210769 = mem_210769;
                        futhark_mc_task_228602.free_mem_211106 = mem_211106;
                        futhark_mc_task_228602.free_mem_211111 = mem_211111;
                        futhark_mc_task_228602.free_mem_211324 = mem_211324.mem;
                        futhark_mc_task_228602.free_mem_211329 = mem_211329.mem;
                        
                        struct scheduler_segop futhark_mc_task_228602_task;
                        
                        futhark_mc_task_228602_task.args =
                            &futhark_mc_task_228602;
                        futhark_mc_task_228602_task.top_level_fn =
                            futhark_mc_segmap_task_228603;
                        futhark_mc_task_228602_task.name =
                            "futhark_mc_segmap_task_228603";
                        futhark_mc_task_228602_task.iterations = m_196691;
                        futhark_mc_task_228602_task.task_time =
                            &ctx->futhark_mc_segmap_task_228603_total_time;
                        futhark_mc_task_228602_task.task_iter =
                            &ctx->futhark_mc_segmap_task_228603_total_iter;
                        futhark_mc_task_228602_task.sched = STATIC;
                        futhark_mc_task_228602_task.nested_fn =
                            futhark_mc_segmap_nested_task_228608;
                        
                        int futhark_mc_segmap_task_228603_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_228602_task);
                        
                        if (futhark_mc_segmap_task_228603_err != 0) {
                            if (memblock_unref(ctx, &mem_211329,
                                               "mem_211329") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_211324,
                                               "mem_211324") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211472,
                                               "ext_mem_211472") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211473,
                                               "ext_mem_211473") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211474,
                                               "ext_mem_211474") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211475,
                                               "ext_mem_211475") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_211473, &mem_211324,
                                         "mem_211324") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_211472, &mem_211329,
                                         "mem_211329") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211329, "mem_211329") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211324, "mem_211324") != 0)
                            return 1;
                    } else {
                        struct memblock mem_211466;
                        
                        mem_211466.references = NULL;
                        if (memblock_alloc(ctx, &mem_211466, bytes_210768,
                                           "mem_211466")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_211471;
                        
                        mem_211471.references = NULL;
                        if (memblock_alloc(ctx, &mem_211471, bytes_210768,
                                           "mem_211471")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t flat_tid_202064 = (int64_t) 0;
                        int32_t num_tasks_217588;
                        int64_t flat_tid_202506 = (int64_t) 0;
                        struct futhark_mc_task_228644 futhark_mc_task_228644;
                        
                        futhark_mc_task_228644.ctx = ctx;
                        futhark_mc_task_228644.free_m_196691 = m_196691;
                        futhark_mc_task_228644.free_n_p_196694 = n_p_196694;
                        futhark_mc_task_228644.free_q_s_196695 = q_s_196695;
                        futhark_mc_task_228644.free_jump_s_196701 =
                            jump_s_196701;
                        futhark_mc_task_228644.free_defunc_0_f_res_196740 =
                            defunc_0_f_res_196740;
                        futhark_mc_task_228644.free_pad_css_len_196741 =
                            pad_css_len_196741;
                        futhark_mc_task_228644.free_s_n_m_196745 = s_n_m_196745;
                        futhark_mc_task_228644.free_mem_210590 = mem_210590;
                        futhark_mc_task_228644.free_mem_210594 = mem_210594;
                        futhark_mc_task_228644.free_bytes_210599 = bytes_210599;
                        futhark_mc_task_228644.free_bytes_210655 = bytes_210655;
                        futhark_mc_task_228644.free_mem_210764 = mem_210764;
                        futhark_mc_task_228644.free_mem_210769 = mem_210769;
                        futhark_mc_task_228644.free_mem_211106 = mem_211106;
                        futhark_mc_task_228644.free_mem_211111 = mem_211111;
                        futhark_mc_task_228644.free_mem_211466 = mem_211466.mem;
                        futhark_mc_task_228644.free_mem_211471 = mem_211471.mem;
                        
                        struct scheduler_segop futhark_mc_task_228644_task;
                        
                        futhark_mc_task_228644_task.args =
                            &futhark_mc_task_228644;
                        futhark_mc_task_228644_task.top_level_fn =
                            futhark_mc_segmap_task_228645;
                        futhark_mc_task_228644_task.name =
                            "futhark_mc_segmap_task_228645";
                        futhark_mc_task_228644_task.iterations = m_196691;
                        futhark_mc_task_228644_task.task_time =
                            &ctx->futhark_mc_segmap_task_228645_total_time;
                        futhark_mc_task_228644_task.task_iter =
                            &ctx->futhark_mc_segmap_task_228645_total_iter;
                        futhark_mc_task_228644_task.sched = STATIC;
                        futhark_mc_task_228644_task.nested_fn =
                            futhark_mc_segmap_nested_task_228650;
                        
                        int futhark_mc_segmap_task_228645_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_228644_task);
                        
                        if (futhark_mc_segmap_task_228645_err != 0) {
                            if (memblock_unref(ctx, &mem_211471,
                                               "mem_211471") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_211466,
                                               "mem_211466") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211472,
                                               "ext_mem_211472") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211473,
                                               "ext_mem_211473") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211474,
                                               "ext_mem_211474") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_211475,
                                               "ext_mem_211475") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_211473, &mem_211466,
                                         "mem_211466") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_211472, &mem_211471,
                                         "mem_211471") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211471, "mem_211471") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211466, "mem_211466") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx, &ext_mem_211475, &ext_mem_211473,
                                     "ext_mem_211473") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_211474, &ext_mem_211472,
                                     "ext_mem_211472") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_211472,
                                       "ext_mem_211472") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_211473,
                                       "ext_mem_211473") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &ext_mem_212177, &ext_mem_211475,
                                 "ext_mem_211475") != 0)
                    return 1;
                if (memblock_set(ctx, &ext_mem_212176, &ext_mem_211474,
                                 "ext_mem_211474") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_211474, "ext_mem_211474") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_211475, "ext_mem_211475") != 0)
                    return 1;
            } else {
                bool match_lit_197730 = (int64_t) 0 == d_s_196698;
                struct memblock ext_mem_212175;
                
                ext_mem_212175.references = NULL;
                
                struct memblock ext_mem_212174;
                
                ext_mem_212174.references = NULL;
                if (match_lit_197730) {
                    struct memblock mem_211480;
                    
                    mem_211480.references = NULL;
                    if (memblock_alloc(ctx, &mem_211480, bytes_210768,
                                       "mem_211480")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_218816 = 0; i_218816 < m_196691;
                         i_218816++) {
                        for (int64_t i_218817 = 0; i_218817 < n_p_196694;
                             i_218817++) {
                            for (int64_t i_218818 = 0; i_218818 < s_n_m_196745;
                                 i_218818++) {
                                ((float *) mem_211480.mem)[i_218816 *
                                                           (s_n_m_196745 *
                                                            n_p_196694) +
                                                           i_218817 *
                                                           s_n_m_196745 +
                                                           i_218818] = 0.0F;
                            }
                        }
                    }
                    
                    struct memblock mem_211599;
                    
                    mem_211599.references = NULL;
                    if (memblock_alloc(ctx, &mem_211599, bytes_210768,
                                       "mem_211599")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t binop_y_211481 = (int64_t) 4 * q_s_196695;
                    int64_t bytes_211482 = smax64((int64_t) 0, binop_y_211481);
                    int64_t flat_tid_202946 = (int64_t) 0;
                    int32_t num_tasks_218819;
                    int64_t flat_tid_203135 = (int64_t) 0;
                    struct futhark_mc_task_228688 futhark_mc_task_228688;
                    
                    futhark_mc_task_228688.ctx = ctx;
                    futhark_mc_task_228688.free_m_196691 = m_196691;
                    futhark_mc_task_228688.free_n_p_196694 = n_p_196694;
                    futhark_mc_task_228688.free_q_s_196695 = q_s_196695;
                    futhark_mc_task_228688.free_jump_s_196701 = jump_s_196701;
                    futhark_mc_task_228688.free_defunc_0_f_res_196740 =
                        defunc_0_f_res_196740;
                    futhark_mc_task_228688.free_pad_css_len_196741 =
                        pad_css_len_196741;
                    futhark_mc_task_228688.free_s_n_m_196745 = s_n_m_196745;
                    futhark_mc_task_228688.free_mem_210590 = mem_210590;
                    futhark_mc_task_228688.free_mem_210594 = mem_210594;
                    futhark_mc_task_228688.free_bytes_210599 = bytes_210599;
                    futhark_mc_task_228688.free_bytes_210655 = bytes_210655;
                    futhark_mc_task_228688.free_mem_210764 = mem_210764;
                    futhark_mc_task_228688.free_mem_210769 = mem_210769;
                    futhark_mc_task_228688.free_mem_211106 = mem_211106;
                    futhark_mc_task_228688.free_mem_211111 = mem_211111;
                    futhark_mc_task_228688.free_bytes_211482 = bytes_211482;
                    futhark_mc_task_228688.free_mem_211599 = mem_211599.mem;
                    
                    struct scheduler_segop futhark_mc_task_228688_task;
                    
                    futhark_mc_task_228688_task.args = &futhark_mc_task_228688;
                    futhark_mc_task_228688_task.top_level_fn =
                        futhark_mc_segmap_task_228689;
                    futhark_mc_task_228688_task.name =
                        "futhark_mc_segmap_task_228689";
                    futhark_mc_task_228688_task.iterations = m_196691;
                    futhark_mc_task_228688_task.task_time =
                        &ctx->futhark_mc_segmap_task_228689_total_time;
                    futhark_mc_task_228688_task.task_iter =
                        &ctx->futhark_mc_segmap_task_228689_total_iter;
                    futhark_mc_task_228688_task.sched = STATIC;
                    futhark_mc_task_228688_task.nested_fn =
                        futhark_mc_segmap_nested_task_228694;
                    
                    int futhark_mc_segmap_task_228689_err =
                        scheduler_prepare_task(&ctx->scheduler,
                                               &futhark_mc_task_228688_task);
                    
                    if (futhark_mc_segmap_task_228689_err != 0) {
                        if (memblock_unref(ctx, &mem_211599, "mem_211599") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211480, "mem_211480") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212174,
                                           "ext_mem_212174") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212175,
                                           "ext_mem_212175") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212176,
                                           "ext_mem_212176") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212177,
                                           "ext_mem_212177") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210947,
                                           "mem_param_210947") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210939,
                                           "mem_param_210939") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213684,
                                           "ext_mem_213684") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213685,
                                           "ext_mem_213685") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210925,
                                           "mem_param_210925") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210917,
                                           "mem_param_210917") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210909,
                                           "mem_param_210909") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213929,
                                           "ext_mem_213929") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213930,
                                           "ext_mem_213930") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213931,
                                           "ext_mem_213931") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214103,
                                           "mem_out_214103") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214102,
                                           "mem_out_214102") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214101,
                                           "mem_out_214101") != 0)
                            return 1;
                        ;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_set(ctx, &ext_mem_212175, &mem_211599,
                                     "mem_211599") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_212174, &mem_211480,
                                     "mem_211480") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_211599, "mem_211599") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_211480, "mem_211480") != 0)
                        return 1;
                } else {
                    bool match_lit_197802 = (int64_t) 1 == d_s_196698;
                    struct memblock ext_mem_212173;
                    
                    ext_mem_212173.references = NULL;
                    
                    struct memblock ext_mem_212172;
                    
                    ext_mem_212172.references = NULL;
                    if (match_lit_197802) {
                        struct memblock mem_211832;
                        
                        mem_211832.references = NULL;
                        if (memblock_alloc(ctx, &mem_211832, bytes_210768,
                                           "mem_211832")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_211837;
                        
                        mem_211837.references = NULL;
                        if (memblock_alloc(ctx, &mem_211837, bytes_210768,
                                           "mem_211837")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t binop_y_211600 = (int64_t) 4 * q_s_196695;
                        int64_t bytes_211601 = smax64((int64_t) 0,
                                                      binop_y_211600);
                        int64_t flat_tid_203320 = (int64_t) 0;
                        int32_t num_tasks_219343;
                        int64_t flat_tid_203597 = (int64_t) 0;
                        struct futhark_mc_task_228727 futhark_mc_task_228727;
                        
                        futhark_mc_task_228727.ctx = ctx;
                        futhark_mc_task_228727.free_m_196691 = m_196691;
                        futhark_mc_task_228727.free_n_p_196694 = n_p_196694;
                        futhark_mc_task_228727.free_q_s_196695 = q_s_196695;
                        futhark_mc_task_228727.free_jump_s_196701 =
                            jump_s_196701;
                        futhark_mc_task_228727.free_defunc_0_f_res_196740 =
                            defunc_0_f_res_196740;
                        futhark_mc_task_228727.free_pad_css_len_196741 =
                            pad_css_len_196741;
                        futhark_mc_task_228727.free_s_n_m_196745 = s_n_m_196745;
                        futhark_mc_task_228727.free_mem_210590 = mem_210590;
                        futhark_mc_task_228727.free_mem_210594 = mem_210594;
                        futhark_mc_task_228727.free_bytes_210599 = bytes_210599;
                        futhark_mc_task_228727.free_bytes_210655 = bytes_210655;
                        futhark_mc_task_228727.free_mem_210764 = mem_210764;
                        futhark_mc_task_228727.free_mem_210769 = mem_210769;
                        futhark_mc_task_228727.free_mem_211106 = mem_211106;
                        futhark_mc_task_228727.free_mem_211111 = mem_211111;
                        futhark_mc_task_228727.free_bytes_211601 = bytes_211601;
                        futhark_mc_task_228727.free_mem_211832 = mem_211832.mem;
                        futhark_mc_task_228727.free_mem_211837 = mem_211837.mem;
                        
                        struct scheduler_segop futhark_mc_task_228727_task;
                        
                        futhark_mc_task_228727_task.args =
                            &futhark_mc_task_228727;
                        futhark_mc_task_228727_task.top_level_fn =
                            futhark_mc_segmap_task_228728;
                        futhark_mc_task_228727_task.name =
                            "futhark_mc_segmap_task_228728";
                        futhark_mc_task_228727_task.iterations = m_196691;
                        futhark_mc_task_228727_task.task_time =
                            &ctx->futhark_mc_segmap_task_228728_total_time;
                        futhark_mc_task_228727_task.task_iter =
                            &ctx->futhark_mc_segmap_task_228728_total_iter;
                        futhark_mc_task_228727_task.sched = STATIC;
                        futhark_mc_task_228727_task.nested_fn =
                            futhark_mc_segmap_nested_task_228735;
                        
                        int futhark_mc_segmap_task_228728_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_228727_task);
                        
                        if (futhark_mc_segmap_task_228728_err != 0) {
                            if (memblock_unref(ctx, &mem_211837,
                                               "mem_211837") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_211832,
                                               "mem_211832") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212172,
                                               "ext_mem_212172") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212173,
                                               "ext_mem_212173") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212174,
                                               "ext_mem_212174") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212175,
                                               "ext_mem_212175") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_212173, &mem_211832,
                                         "mem_211832") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_212172, &mem_211837,
                                         "mem_211837") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211837, "mem_211837") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_211832, "mem_211832") != 0)
                            return 1;
                    } else {
                        struct memblock mem_212166;
                        
                        mem_212166.references = NULL;
                        if (memblock_alloc(ctx, &mem_212166, bytes_210768,
                                           "mem_212166")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_212171;
                        
                        mem_212171.references = NULL;
                        if (memblock_alloc(ctx, &mem_212171, bytes_210768,
                                           "mem_212171")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t binop_y_211838 = (int64_t) 4 * q_s_196695;
                        int64_t bytes_211839 = smax64((int64_t) 0,
                                                      binop_y_211838);
                        int64_t flat_tid_203872 = (int64_t) 0;
                        int32_t num_tasks_220156;
                        int64_t flat_tid_204263 = (int64_t) 0;
                        struct futhark_mc_task_228777 futhark_mc_task_228777;
                        
                        futhark_mc_task_228777.ctx = ctx;
                        futhark_mc_task_228777.free_m_196691 = m_196691;
                        futhark_mc_task_228777.free_n_p_196694 = n_p_196694;
                        futhark_mc_task_228777.free_q_s_196695 = q_s_196695;
                        futhark_mc_task_228777.free_jump_s_196701 =
                            jump_s_196701;
                        futhark_mc_task_228777.free_defunc_0_f_res_196740 =
                            defunc_0_f_res_196740;
                        futhark_mc_task_228777.free_pad_css_len_196741 =
                            pad_css_len_196741;
                        futhark_mc_task_228777.free_s_n_m_196745 = s_n_m_196745;
                        futhark_mc_task_228777.free_mem_210590 = mem_210590;
                        futhark_mc_task_228777.free_mem_210594 = mem_210594;
                        futhark_mc_task_228777.free_bytes_210599 = bytes_210599;
                        futhark_mc_task_228777.free_bytes_210655 = bytes_210655;
                        futhark_mc_task_228777.free_mem_210764 = mem_210764;
                        futhark_mc_task_228777.free_mem_210769 = mem_210769;
                        futhark_mc_task_228777.free_mem_211106 = mem_211106;
                        futhark_mc_task_228777.free_mem_211111 = mem_211111;
                        futhark_mc_task_228777.free_bytes_211839 = bytes_211839;
                        futhark_mc_task_228777.free_mem_212166 = mem_212166.mem;
                        futhark_mc_task_228777.free_mem_212171 = mem_212171.mem;
                        
                        struct scheduler_segop futhark_mc_task_228777_task;
                        
                        futhark_mc_task_228777_task.args =
                            &futhark_mc_task_228777;
                        futhark_mc_task_228777_task.top_level_fn =
                            futhark_mc_segmap_task_228778;
                        futhark_mc_task_228777_task.name =
                            "futhark_mc_segmap_task_228778";
                        futhark_mc_task_228777_task.iterations = m_196691;
                        futhark_mc_task_228777_task.task_time =
                            &ctx->futhark_mc_segmap_task_228778_total_time;
                        futhark_mc_task_228777_task.task_iter =
                            &ctx->futhark_mc_segmap_task_228778_total_iter;
                        futhark_mc_task_228777_task.sched = STATIC;
                        futhark_mc_task_228777_task.nested_fn =
                            futhark_mc_segmap_nested_task_228787;
                        
                        int futhark_mc_segmap_task_228778_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_228777_task);
                        
                        if (futhark_mc_segmap_task_228778_err != 0) {
                            if (memblock_unref(ctx, &mem_212171,
                                               "mem_212171") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212166,
                                               "mem_212166") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212172,
                                               "ext_mem_212172") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212173,
                                               "ext_mem_212173") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212174,
                                               "ext_mem_212174") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212175,
                                               "ext_mem_212175") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_212173, &mem_212166,
                                         "mem_212166") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_212172, &mem_212171,
                                         "mem_212171") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212171, "mem_212171") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212166, "mem_212166") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx, &ext_mem_212175, &ext_mem_212173,
                                     "ext_mem_212173") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_212174, &ext_mem_212172,
                                     "ext_mem_212172") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212172,
                                       "ext_mem_212172") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212173,
                                       "ext_mem_212173") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &ext_mem_212177, &ext_mem_212175,
                                 "ext_mem_212175") != 0)
                    return 1;
                if (memblock_set(ctx, &ext_mem_212176, &ext_mem_212174,
                                 "ext_mem_212174") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212174, "ext_mem_212174") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212175, "ext_mem_212175") != 0)
                    return 1;
            }
            
            struct memblock ext_mem_212249;
            
            ext_mem_212249.references = NULL;
            if (cond_196744) {
                if (memblock_set(ctx, &ext_mem_212249, &ext_mem_212177,
                                 "ext_mem_212177") != 0)
                    return 1;
            } else {
                bool bounds_invalid_upwards_198084 = slt64(pad_css_len_196741,
                                                           (int64_t) 0);
                bool valid_198085 = !bounds_invalid_upwards_198084;
                bool range_valid_c_198086;
                
                if (!valid_198085) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Range ", (long long) (int64_t) 0, "..",
                                  (long long) (int64_t) 1, "..<",
                                  (long long) pad_css_len_196741,
                                  " is invalid.",
                                  "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:556:3-565:9\n   #4  stl.fut:220:31-96\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:219:23-221:48\n   #8  /prelude/soacs.fut:67:19-23\n   #9  /prelude/soacs.fut:67:3-37\n   #10 stl.fut:218:15-222:44\n   #11 stl.fut:401:3-415:29\n   #12 stl.fut:385:1-415:29\n");
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock mem_212248;
                
                mem_212248.references = NULL;
                if (memblock_alloc(ctx, &mem_212248, bytes_212247,
                                   "mem_212248")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t binop_x_212196 = n_p_196694 * pad_css_len_196741;
                int64_t binop_y_212197 = (int64_t) 4 * binop_x_212196;
                int64_t bytes_212198 = smax64((int64_t) 0, binop_y_212197);
                int64_t binop_y_212178 = (int64_t) 4 * pad_css_len_196741;
                int64_t bytes_212179 = smax64((int64_t) 0, binop_y_212178);
                int64_t flat_tid_204648 = (int64_t) 0;
                int32_t num_tasks_221328;
                int64_t flat_tid_204745 = (int64_t) 0;
                struct futhark_mc_task_228841 futhark_mc_task_228841;
                
                futhark_mc_task_228841.ctx = ctx;
                futhark_mc_task_228841.free_m_196691 = m_196691;
                futhark_mc_task_228841.free_n_p_196694 = n_p_196694;
                futhark_mc_task_228841.free_jump_s_196701 = jump_s_196701;
                futhark_mc_task_228841.free_defunc_0_f_res_196740 =
                    defunc_0_f_res_196740;
                futhark_mc_task_228841.free_pad_css_len_196741 =
                    pad_css_len_196741;
                futhark_mc_task_228841.free_s_n_m_196745 = s_n_m_196745;
                futhark_mc_task_228841.free_ext_mem_212176 = ext_mem_212176.mem;
                futhark_mc_task_228841.free_ext_mem_212177 = ext_mem_212177.mem;
                futhark_mc_task_228841.free_bytes_212179 = bytes_212179;
                futhark_mc_task_228841.free_bytes_212198 = bytes_212198;
                futhark_mc_task_228841.free_mem_212248 = mem_212248.mem;
                
                struct scheduler_segop futhark_mc_task_228841_task;
                
                futhark_mc_task_228841_task.args = &futhark_mc_task_228841;
                futhark_mc_task_228841_task.top_level_fn =
                    futhark_mc_segmap_task_228842;
                futhark_mc_task_228841_task.name =
                    "futhark_mc_segmap_task_228842";
                futhark_mc_task_228841_task.iterations = m_196691;
                futhark_mc_task_228841_task.task_time =
                    &ctx->futhark_mc_segmap_task_228842_total_time;
                futhark_mc_task_228841_task.task_iter =
                    &ctx->futhark_mc_segmap_task_228842_total_iter;
                futhark_mc_task_228841_task.sched = STATIC;
                futhark_mc_task_228841_task.nested_fn =
                    futhark_mc_segmap_nested_task_228846;
                
                int futhark_mc_segmap_task_228842_err =
                    scheduler_prepare_task(&ctx->scheduler,
                                           &futhark_mc_task_228841_task);
                
                if (futhark_mc_segmap_task_228842_err != 0) {
                    if (memblock_unref(ctx, &mem_212248, "mem_212248") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    ;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set(ctx, &ext_mem_212249, &mem_212248,
                                 "mem_212248") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_212248, "mem_212248") != 0)
                    return 1;
            }
            if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                return 1;
            
            int64_t flat_tid_204922 = (int64_t) 0;
            int32_t num_tasks_221846;
            int64_t flat_tid_204928 = (int64_t) 0;
            struct futhark_mc_task_228863 futhark_mc_task_228863;
            
            futhark_mc_task_228863.ctx = ctx;
            futhark_mc_task_228863.free_m_196691 = m_196691;
            futhark_mc_task_228863.free_n_p_196694 = n_p_196694;
            futhark_mc_task_228863.free_C_len_196743 = C_len_196743;
            futhark_mc_task_228863.free_css_results_l_197223 =
                css_results_l_197223;
            futhark_mc_task_228863.free_ext_mem_212249 = ext_mem_212249.mem;
            futhark_mc_task_228863.free_bytes_212252 = bytes_212252;
            futhark_mc_task_228863.free_mem_212272 = mem_212272;
            
            struct scheduler_segop futhark_mc_task_228863_task;
            
            futhark_mc_task_228863_task.args = &futhark_mc_task_228863;
            futhark_mc_task_228863_task.top_level_fn =
                futhark_mc_segmap_task_228864;
            futhark_mc_task_228863_task.name = "futhark_mc_segmap_task_228864";
            futhark_mc_task_228863_task.iterations = m_196691;
            futhark_mc_task_228863_task.task_time =
                &ctx->futhark_mc_segmap_task_228864_total_time;
            futhark_mc_task_228863_task.task_iter =
                &ctx->futhark_mc_segmap_task_228864_total_iter;
            futhark_mc_task_228863_task.sched = STATIC;
            futhark_mc_task_228863_task.nested_fn =
                futhark_mc_segmap_nested_task_228868;
            
            int futhark_mc_segmap_task_228864_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228863_task);
            
            if (futhark_mc_segmap_task_228864_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                return 1;
            
            int64_t flat_tid_204946 = (int64_t) 0;
            int32_t num_tasks_221885;
            int64_t flat_tid_204952 = (int64_t) 0;
            struct futhark_mc_task_228876 futhark_mc_task_228876;
            
            futhark_mc_task_228876.ctx = ctx;
            futhark_mc_task_228876.free_m_196691 = m_196691;
            futhark_mc_task_228876.free_n_p_196694 = n_p_196694;
            futhark_mc_task_228876.free_C_len_196743 = C_len_196743;
            futhark_mc_task_228876.free_mem_212272 = mem_212272;
            futhark_mc_task_228876.free_mem_212275 = mem_212275;
            
            struct scheduler_segop futhark_mc_task_228876_task;
            
            futhark_mc_task_228876_task.args = &futhark_mc_task_228876;
            futhark_mc_task_228876_task.top_level_fn =
                futhark_mc_segmap_task_228877;
            futhark_mc_task_228876_task.name = "futhark_mc_segmap_task_228877";
            futhark_mc_task_228876_task.iterations = m_196691;
            futhark_mc_task_228876_task.task_time =
                &ctx->futhark_mc_segmap_task_228877_total_time;
            futhark_mc_task_228876_task.task_iter =
                &ctx->futhark_mc_segmap_task_228877_total_iter;
            futhark_mc_task_228876_task.sched = STATIC;
            futhark_mc_task_228876_task.nested_fn =
                futhark_mc_segmap_nested_task_228880;
            
            int futhark_mc_segmap_task_228877_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228876_task);
            
            if (futhark_mc_segmap_task_228877_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_204962 = (int64_t) 0;
            int32_t num_tasks_221912;
            int64_t flat_tid_204968 = (int64_t) 0;
            struct futhark_mc_task_228888 futhark_mc_task_228888;
            
            futhark_mc_task_228888.ctx = ctx;
            futhark_mc_task_228888.free_m_196691 = m_196691;
            futhark_mc_task_228888.free_n_p_196694 = n_p_196694;
            futhark_mc_task_228888.free_i64_res_196737 = i64_res_196737;
            futhark_mc_task_228888.free_C_len_196743 = C_len_196743;
            futhark_mc_task_228888.free_lifted_single_ma_l_arg_197247 =
                lifted_single_ma_l_arg_197247;
            futhark_mc_task_228888.free_mem_212272 = mem_212272;
            futhark_mc_task_228888.free_mem_212275 = mem_212275;
            futhark_mc_task_228888.free_bytes_212277 = bytes_212277;
            futhark_mc_task_228888.free_mem_212297 = mem_212297;
            
            struct scheduler_segop futhark_mc_task_228888_task;
            
            futhark_mc_task_228888_task.args = &futhark_mc_task_228888;
            futhark_mc_task_228888_task.top_level_fn =
                futhark_mc_segmap_task_228889;
            futhark_mc_task_228888_task.name = "futhark_mc_segmap_task_228889";
            futhark_mc_task_228888_task.iterations = m_196691;
            futhark_mc_task_228888_task.task_time =
                &ctx->futhark_mc_segmap_task_228889_total_time;
            futhark_mc_task_228888_task.task_iter =
                &ctx->futhark_mc_segmap_task_228889_total_iter;
            futhark_mc_task_228888_task.sched = STATIC;
            futhark_mc_task_228888_task.nested_fn =
                futhark_mc_segmap_nested_task_228893;
            
            int futhark_mc_segmap_task_228889_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228888_task);
            
            if (futhark_mc_segmap_task_228889_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_204997 = (int64_t) 0;
            int32_t num_tasks_221981;
            int64_t flat_tid_205003 = (int64_t) 0;
            struct futhark_mc_task_228904 futhark_mc_task_228904;
            
            futhark_mc_task_228904.ctx = ctx;
            futhark_mc_task_228904.free_m_196691 = m_196691;
            futhark_mc_task_228904.free_n_p_196694 = n_p_196694;
            futhark_mc_task_228904.free_lifted_single_ma_l_arg_197247 =
                lifted_single_ma_l_arg_197247;
            futhark_mc_task_228904.free_mem_212297 = mem_212297;
            futhark_mc_task_228904.free_mem_212300 = mem_212300;
            
            struct scheduler_segop futhark_mc_task_228904_task;
            
            futhark_mc_task_228904_task.args = &futhark_mc_task_228904;
            futhark_mc_task_228904_task.top_level_fn =
                futhark_mc_segmap_task_228905;
            futhark_mc_task_228904_task.name = "futhark_mc_segmap_task_228905";
            futhark_mc_task_228904_task.iterations = m_196691;
            futhark_mc_task_228904_task.task_time =
                &ctx->futhark_mc_segmap_task_228905_total_time;
            futhark_mc_task_228904_task.task_iter =
                &ctx->futhark_mc_segmap_task_228905_total_iter;
            futhark_mc_task_228904_task.sched = STATIC;
            futhark_mc_task_228904_task.nested_fn =
                futhark_mc_segmap_nested_task_228908;
            
            int futhark_mc_segmap_task_228905_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228904_task);
            
            if (futhark_mc_segmap_task_228905_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_205013 = (int64_t) 0;
            int32_t num_tasks_222008;
            int64_t flat_tid_205019 = (int64_t) 0;
            struct futhark_mc_task_228916 futhark_mc_task_228916;
            
            futhark_mc_task_228916.ctx = ctx;
            futhark_mc_task_228916.free_m_196691 = m_196691;
            futhark_mc_task_228916.free_n_p_196694 = n_p_196694;
            futhark_mc_task_228916.free_i64_res_196737 = i64_res_196737;
            futhark_mc_task_228916.free_lifted_single_ma_l_arg_197247 =
                lifted_single_ma_l_arg_197247;
            futhark_mc_task_228916.free_dyn_lifted_single_ma_l_arg_197257 =
                dyn_lifted_single_ma_l_arg_197257;
            futhark_mc_task_228916.free_mem_212297 = mem_212297;
            futhark_mc_task_228916.free_mem_212300 = mem_212300;
            futhark_mc_task_228916.free_bytes_212302 = bytes_212302;
            futhark_mc_task_228916.free_mem_212322 = mem_212322;
            
            struct scheduler_segop futhark_mc_task_228916_task;
            
            futhark_mc_task_228916_task.args = &futhark_mc_task_228916;
            futhark_mc_task_228916_task.top_level_fn =
                futhark_mc_segmap_task_228917;
            futhark_mc_task_228916_task.name = "futhark_mc_segmap_task_228917";
            futhark_mc_task_228916_task.iterations = m_196691;
            futhark_mc_task_228916_task.task_time =
                &ctx->futhark_mc_segmap_task_228917_total_time;
            futhark_mc_task_228916_task.task_iter =
                &ctx->futhark_mc_segmap_task_228917_total_iter;
            futhark_mc_task_228916_task.sched = STATIC;
            futhark_mc_task_228916_task.nested_fn =
                futhark_mc_segmap_nested_task_228921;
            
            int futhark_mc_segmap_task_228917_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228916_task);
            
            if (futhark_mc_segmap_task_228917_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_205048 = (int64_t) 0;
            int32_t num_tasks_222077;
            int64_t flat_tid_205054 = (int64_t) 0;
            struct futhark_mc_task_228932 futhark_mc_task_228932;
            
            futhark_mc_task_228932.ctx = ctx;
            futhark_mc_task_228932.free_m_196691 = m_196691;
            futhark_mc_task_228932.free_dyn_lifted_single_ma_l_arg_197257 =
                dyn_lifted_single_ma_l_arg_197257;
            futhark_mc_task_228932.free_mem_212322 = mem_212322;
            futhark_mc_task_228932.free_mem_212325 = mem_212325;
            
            struct scheduler_segop futhark_mc_task_228932_task;
            
            futhark_mc_task_228932_task.args = &futhark_mc_task_228932;
            futhark_mc_task_228932_task.top_level_fn =
                futhark_mc_segmap_task_228933;
            futhark_mc_task_228932_task.name = "futhark_mc_segmap_task_228933";
            futhark_mc_task_228932_task.iterations = m_196691;
            futhark_mc_task_228932_task.task_time =
                &ctx->futhark_mc_segmap_task_228933_total_time;
            futhark_mc_task_228932_task.task_iter =
                &ctx->futhark_mc_segmap_task_228933_total_iter;
            futhark_mc_task_228932_task.sched = STATIC;
            futhark_mc_task_228932_task.nested_fn =
                futhark_mc_segmap_nested_task_228936;
            
            int futhark_mc_segmap_task_228933_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228932_task);
            
            if (futhark_mc_segmap_task_228933_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_205064 = (int64_t) 0;
            int32_t num_tasks_222105;
            int64_t flat_tid_205070 = (int64_t) 0;
            struct futhark_mc_task_228944 futhark_mc_task_228944;
            
            futhark_mc_task_228944.ctx = ctx;
            futhark_mc_task_228944.free_m_196691 = m_196691;
            futhark_mc_task_228944.free_n_196692 = n_196692;
            futhark_mc_task_228944.free_dyn_lifted_single_ma_l_arg_197257 =
                dyn_lifted_single_ma_l_arg_197257;
            futhark_mc_task_228944.free_bytes_210949 = bytes_210949;
            futhark_mc_task_228944.free_mem_212322 = mem_212322;
            futhark_mc_task_228944.free_mem_212325 = mem_212325;
            futhark_mc_task_228944.free_mem_212347 = mem_212347;
            
            struct scheduler_segop futhark_mc_task_228944_task;
            
            futhark_mc_task_228944_task.args = &futhark_mc_task_228944;
            futhark_mc_task_228944_task.top_level_fn =
                futhark_mc_segmap_task_228945;
            futhark_mc_task_228944_task.name = "futhark_mc_segmap_task_228945";
            futhark_mc_task_228944_task.iterations = m_196691;
            futhark_mc_task_228944_task.task_time =
                &ctx->futhark_mc_segmap_task_228945_total_time;
            futhark_mc_task_228944_task.task_iter =
                &ctx->futhark_mc_segmap_task_228945_total_iter;
            futhark_mc_task_228944_task.sched = STATIC;
            futhark_mc_task_228944_task.nested_fn =
                futhark_mc_segmap_nested_task_228949;
            
            int futhark_mc_segmap_task_228945_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_228944_task);
            
            if (futhark_mc_segmap_task_228945_err != 0) {
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            struct memblock ext_mem_212816;
            
            ext_mem_212816.references = NULL;
            
            struct memblock ext_mem_212815;
            
            ext_mem_212815.references = NULL;
            if (cond_197273) {
                bool match_lit_198303 = (int64_t) 0 == d_l_196700;
                struct memblock ext_mem_212465;
                
                ext_mem_212465.references = NULL;
                
                struct memblock ext_mem_212464;
                
                ext_mem_212464.references = NULL;
                if (match_lit_198303) {
                    struct memblock mem_212351;
                    
                    mem_212351.references = NULL;
                    if (memblock_alloc(ctx, &mem_212351, bytes_210830,
                                       "mem_212351")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_222174 = 0; i_222174 < m_196691;
                         i_222174++) {
                        for (int64_t i_222175 = 0; i_222175 < l_n_m_196752;
                             i_222175++) {
                            ((float *) mem_212351.mem)[i_222174 * l_n_m_196752 +
                                                       i_222175] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_212373;
                    
                    mem_212373.references = NULL;
                    if (memblock_alloc(ctx, &mem_212373, bytes_210830,
                                       "mem_212373")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t flat_tid_205099 = (int64_t) 0;
                    int32_t num_tasks_222176;
                    int64_t flat_tid_205173 = (int64_t) 0;
                    struct futhark_mc_task_228960 futhark_mc_task_228960;
                    
                    futhark_mc_task_228960.ctx = ctx;
                    futhark_mc_task_228960.free_m_196691 = m_196691;
                    futhark_mc_task_228960.free_n_196692 = n_196692;
                    futhark_mc_task_228960.free_q_l_196697 = q_l_196697;
                    futhark_mc_task_228960.free_jump_t_196702 = jump_t_196702;
                    futhark_mc_task_228960.free_l_n_m_196752 = l_n_m_196752;
                    futhark_mc_task_228960.free_i_196779 = i_196779;
                    futhark_mc_task_228960.free_bytes_210774 = bytes_210774;
                    futhark_mc_task_228960.free_mem_210827 = mem_210827;
                    futhark_mc_task_228960.free_mem_210831 = mem_210831;
                    futhark_mc_task_228960.free_ctx_param_ext_210920 =
                        ctx_param_ext_210920;
                    futhark_mc_task_228960.free_ctx_param_ext_210921 =
                        ctx_param_ext_210921;
                    futhark_mc_task_228960.free_ctx_param_ext_210923 =
                        ctx_param_ext_210923;
                    futhark_mc_task_228960.free_mem_param_210925 =
                        mem_param_210925.mem;
                    futhark_mc_task_228960.free_mem_212347 = mem_212347;
                    futhark_mc_task_228960.free_mem_212373 = mem_212373.mem;
                    
                    struct scheduler_segop futhark_mc_task_228960_task;
                    
                    futhark_mc_task_228960_task.args = &futhark_mc_task_228960;
                    futhark_mc_task_228960_task.top_level_fn =
                        futhark_mc_segmap_task_228961;
                    futhark_mc_task_228960_task.name =
                        "futhark_mc_segmap_task_228961";
                    futhark_mc_task_228960_task.iterations = m_196691;
                    futhark_mc_task_228960_task.task_time =
                        &ctx->futhark_mc_segmap_task_228961_total_time;
                    futhark_mc_task_228960_task.task_iter =
                        &ctx->futhark_mc_segmap_task_228961_total_iter;
                    futhark_mc_task_228960_task.sched = STATIC;
                    futhark_mc_task_228960_task.nested_fn =
                        futhark_mc_segmap_nested_task_228965;
                    
                    int futhark_mc_segmap_task_228961_err =
                        scheduler_prepare_task(&ctx->scheduler,
                                               &futhark_mc_task_228960_task);
                    
                    if (futhark_mc_segmap_task_228961_err != 0) {
                        if (memblock_unref(ctx, &mem_212373, "mem_212373") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212351, "mem_212351") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212464,
                                           "ext_mem_212464") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212465,
                                           "ext_mem_212465") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212815,
                                           "ext_mem_212815") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212816,
                                           "ext_mem_212816") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212249,
                                           "ext_mem_212249") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212176,
                                           "ext_mem_212176") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212177,
                                           "ext_mem_212177") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210947,
                                           "mem_param_210947") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210939,
                                           "mem_param_210939") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213684,
                                           "ext_mem_213684") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213685,
                                           "ext_mem_213685") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210925,
                                           "mem_param_210925") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210917,
                                           "mem_param_210917") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210909,
                                           "mem_param_210909") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213929,
                                           "ext_mem_213929") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213930,
                                           "ext_mem_213930") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213931,
                                           "ext_mem_213931") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214103,
                                           "mem_out_214103") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214102,
                                           "mem_out_214102") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214101,
                                           "mem_out_214101") != 0)
                            return 1;
                        ;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_set(ctx, &ext_mem_212465, &mem_212373,
                                     "mem_212373") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_212464, &mem_212351,
                                     "mem_212351") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212373, "mem_212373") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212351, "mem_212351") != 0)
                        return 1;
                } else {
                    bool match_lit_198372 = (int64_t) 1 == d_l_196700;
                    struct memblock ext_mem_212463;
                    
                    ext_mem_212463.references = NULL;
                    
                    struct memblock ext_mem_212462;
                    
                    ext_mem_212462.references = NULL;
                    if (match_lit_198372) {
                        struct memblock mem_212413;
                        
                        mem_212413.references = NULL;
                        if (memblock_alloc(ctx, &mem_212413, bytes_210830,
                                           "mem_212413")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_212417;
                        
                        mem_212417.references = NULL;
                        if (memblock_alloc(ctx, &mem_212417, bytes_210830,
                                           "mem_212417")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t flat_tid_205300 = (int64_t) 0;
                        int32_t num_tasks_222477;
                        int64_t flat_tid_205402 = (int64_t) 0;
                        struct futhark_mc_task_228986 futhark_mc_task_228986;
                        
                        futhark_mc_task_228986.ctx = ctx;
                        futhark_mc_task_228986.free_m_196691 = m_196691;
                        futhark_mc_task_228986.free_n_196692 = n_196692;
                        futhark_mc_task_228986.free_q_l_196697 = q_l_196697;
                        futhark_mc_task_228986.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_228986.free_l_n_m_196752 = l_n_m_196752;
                        futhark_mc_task_228986.free_i_196779 = i_196779;
                        futhark_mc_task_228986.free_bytes_210774 = bytes_210774;
                        futhark_mc_task_228986.free_mem_210827 = mem_210827;
                        futhark_mc_task_228986.free_mem_210831 = mem_210831;
                        futhark_mc_task_228986.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_228986.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_228986.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_228986.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_228986.free_mem_212347 = mem_212347;
                        futhark_mc_task_228986.free_mem_212413 = mem_212413.mem;
                        futhark_mc_task_228986.free_mem_212417 = mem_212417.mem;
                        
                        struct scheduler_segop futhark_mc_task_228986_task;
                        
                        futhark_mc_task_228986_task.args =
                            &futhark_mc_task_228986;
                        futhark_mc_task_228986_task.top_level_fn =
                            futhark_mc_segmap_task_228987;
                        futhark_mc_task_228986_task.name =
                            "futhark_mc_segmap_task_228987";
                        futhark_mc_task_228986_task.iterations = m_196691;
                        futhark_mc_task_228986_task.task_time =
                            &ctx->futhark_mc_segmap_task_228987_total_time;
                        futhark_mc_task_228986_task.task_iter =
                            &ctx->futhark_mc_segmap_task_228987_total_iter;
                        futhark_mc_task_228986_task.sched = STATIC;
                        futhark_mc_task_228986_task.nested_fn =
                            futhark_mc_segmap_nested_task_228992;
                        
                        int futhark_mc_segmap_task_228987_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_228986_task);
                        
                        if (futhark_mc_segmap_task_228987_err != 0) {
                            if (memblock_unref(ctx, &mem_212417,
                                               "mem_212417") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212413,
                                               "mem_212413") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212462,
                                               "ext_mem_212462") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212463,
                                               "ext_mem_212463") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212464,
                                               "ext_mem_212464") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212465,
                                               "ext_mem_212465") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_212463, &mem_212413,
                                         "mem_212413") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_212462, &mem_212417,
                                         "mem_212417") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212417, "mem_212417") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212413, "mem_212413") != 0)
                            return 1;
                    } else {
                        struct memblock mem_212457;
                        
                        mem_212457.references = NULL;
                        if (memblock_alloc(ctx, &mem_212457, bytes_210830,
                                           "mem_212457")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_212461;
                        
                        mem_212461.references = NULL;
                        if (memblock_alloc(ctx, &mem_212461, bytes_210830,
                                           "mem_212461")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t flat_tid_205586 = (int64_t) 0;
                        int32_t num_tasks_222916;
                        int64_t flat_tid_205720 = (int64_t) 0;
                        struct futhark_mc_task_229017 futhark_mc_task_229017;
                        
                        futhark_mc_task_229017.ctx = ctx;
                        futhark_mc_task_229017.free_m_196691 = m_196691;
                        futhark_mc_task_229017.free_n_196692 = n_196692;
                        futhark_mc_task_229017.free_q_l_196697 = q_l_196697;
                        futhark_mc_task_229017.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229017.free_l_n_m_196752 = l_n_m_196752;
                        futhark_mc_task_229017.free_i_196779 = i_196779;
                        futhark_mc_task_229017.free_bytes_210774 = bytes_210774;
                        futhark_mc_task_229017.free_mem_210827 = mem_210827;
                        futhark_mc_task_229017.free_mem_210831 = mem_210831;
                        futhark_mc_task_229017.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229017.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229017.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229017.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229017.free_mem_212347 = mem_212347;
                        futhark_mc_task_229017.free_mem_212457 = mem_212457.mem;
                        futhark_mc_task_229017.free_mem_212461 = mem_212461.mem;
                        
                        struct scheduler_segop futhark_mc_task_229017_task;
                        
                        futhark_mc_task_229017_task.args =
                            &futhark_mc_task_229017;
                        futhark_mc_task_229017_task.top_level_fn =
                            futhark_mc_segmap_task_229018;
                        futhark_mc_task_229017_task.name =
                            "futhark_mc_segmap_task_229018";
                        futhark_mc_task_229017_task.iterations = m_196691;
                        futhark_mc_task_229017_task.task_time =
                            &ctx->futhark_mc_segmap_task_229018_total_time;
                        futhark_mc_task_229017_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229018_total_iter;
                        futhark_mc_task_229017_task.sched = STATIC;
                        futhark_mc_task_229017_task.nested_fn =
                            futhark_mc_segmap_nested_task_229023;
                        
                        int futhark_mc_segmap_task_229018_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229017_task);
                        
                        if (futhark_mc_segmap_task_229018_err != 0) {
                            if (memblock_unref(ctx, &mem_212461,
                                               "mem_212461") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212457,
                                               "mem_212457") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212462,
                                               "ext_mem_212462") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212463,
                                               "ext_mem_212463") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212464,
                                               "ext_mem_212464") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212465,
                                               "ext_mem_212465") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_212463, &mem_212457,
                                         "mem_212457") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_212462, &mem_212461,
                                         "mem_212461") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212461, "mem_212461") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212457, "mem_212457") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx, &ext_mem_212465, &ext_mem_212463,
                                     "ext_mem_212463") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_212464, &ext_mem_212462,
                                     "ext_mem_212462") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212462,
                                       "ext_mem_212462") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212463,
                                       "ext_mem_212463") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &ext_mem_212816, &ext_mem_212465,
                                 "ext_mem_212465") != 0)
                    return 1;
                if (memblock_set(ctx, &ext_mem_212815, &ext_mem_212464,
                                 "ext_mem_212464") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212464, "ext_mem_212464") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212465, "ext_mem_212465") != 0)
                    return 1;
            } else {
                bool match_lit_198597 = (int64_t) 0 == d_l_196700;
                struct memblock ext_mem_212814;
                
                ext_mem_212814.references = NULL;
                
                struct memblock ext_mem_212813;
                
                ext_mem_212813.references = NULL;
                if (match_lit_198597) {
                    struct memblock mem_212469;
                    
                    mem_212469.references = NULL;
                    if (memblock_alloc(ctx, &mem_212469, bytes_210830,
                                       "mem_212469")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_223487 = 0; i_223487 < m_196691;
                         i_223487++) {
                        for (int64_t i_223488 = 0; i_223488 < l_n_m_196752;
                             i_223488++) {
                            ((float *) mem_212469.mem)[i_223487 * l_n_m_196752 +
                                                       i_223488] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_212524;
                    
                    mem_212524.references = NULL;
                    if (memblock_alloc(ctx, &mem_212524, bytes_210830,
                                       "mem_212524")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t binop_y_212470 = (int64_t) 4 * q_l_196697;
                    int64_t bytes_212471 = smax64((int64_t) 0, binop_y_212470);
                    int64_t flat_tid_205968 = (int64_t) 0;
                    int32_t num_tasks_223489;
                    int64_t flat_tid_206028 = (int64_t) 0;
                    struct futhark_mc_task_229050 futhark_mc_task_229050;
                    
                    futhark_mc_task_229050.ctx = ctx;
                    futhark_mc_task_229050.free_m_196691 = m_196691;
                    futhark_mc_task_229050.free_n_196692 = n_196692;
                    futhark_mc_task_229050.free_q_l_196697 = q_l_196697;
                    futhark_mc_task_229050.free_jump_t_196702 = jump_t_196702;
                    futhark_mc_task_229050.free_l_n_m_196752 = l_n_m_196752;
                    futhark_mc_task_229050.free_i_196779 = i_196779;
                    futhark_mc_task_229050.free_bytes_210774 = bytes_210774;
                    futhark_mc_task_229050.free_mem_210827 = mem_210827;
                    futhark_mc_task_229050.free_mem_210831 = mem_210831;
                    futhark_mc_task_229050.free_ctx_param_ext_210920 =
                        ctx_param_ext_210920;
                    futhark_mc_task_229050.free_ctx_param_ext_210921 =
                        ctx_param_ext_210921;
                    futhark_mc_task_229050.free_ctx_param_ext_210923 =
                        ctx_param_ext_210923;
                    futhark_mc_task_229050.free_mem_param_210925 =
                        mem_param_210925.mem;
                    futhark_mc_task_229050.free_mem_212347 = mem_212347;
                    futhark_mc_task_229050.free_bytes_212471 = bytes_212471;
                    futhark_mc_task_229050.free_mem_212524 = mem_212524.mem;
                    
                    struct scheduler_segop futhark_mc_task_229050_task;
                    
                    futhark_mc_task_229050_task.args = &futhark_mc_task_229050;
                    futhark_mc_task_229050_task.top_level_fn =
                        futhark_mc_segmap_task_229051;
                    futhark_mc_task_229050_task.name =
                        "futhark_mc_segmap_task_229051";
                    futhark_mc_task_229050_task.iterations = m_196691;
                    futhark_mc_task_229050_task.task_time =
                        &ctx->futhark_mc_segmap_task_229051_total_time;
                    futhark_mc_task_229050_task.task_iter =
                        &ctx->futhark_mc_segmap_task_229051_total_iter;
                    futhark_mc_task_229050_task.sched = STATIC;
                    futhark_mc_task_229050_task.nested_fn =
                        futhark_mc_segmap_nested_task_229056;
                    
                    int futhark_mc_segmap_task_229051_err =
                        scheduler_prepare_task(&ctx->scheduler,
                                               &futhark_mc_task_229050_task);
                    
                    if (futhark_mc_segmap_task_229051_err != 0) {
                        if (memblock_unref(ctx, &mem_212524, "mem_212524") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212469, "mem_212469") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212813,
                                           "ext_mem_212813") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212814,
                                           "ext_mem_212814") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212815,
                                           "ext_mem_212815") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212816,
                                           "ext_mem_212816") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212249,
                                           "ext_mem_212249") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212176,
                                           "ext_mem_212176") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212177,
                                           "ext_mem_212177") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210947,
                                           "mem_param_210947") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210939,
                                           "mem_param_210939") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213684,
                                           "ext_mem_213684") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213685,
                                           "ext_mem_213685") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210925,
                                           "mem_param_210925") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210917,
                                           "mem_param_210917") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210909,
                                           "mem_param_210909") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213929,
                                           "ext_mem_213929") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213930,
                                           "ext_mem_213930") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213931,
                                           "ext_mem_213931") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214103,
                                           "mem_out_214103") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214102,
                                           "mem_out_214102") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214101,
                                           "mem_out_214101") != 0)
                            return 1;
                        ;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_set(ctx, &ext_mem_212814, &mem_212524,
                                     "mem_212524") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_212813, &mem_212469,
                                     "mem_212469") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212524, "mem_212524") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212469, "mem_212469") != 0)
                        return 1;
                } else {
                    bool match_lit_198652 = (int64_t) 1 == d_l_196700;
                    struct memblock ext_mem_212812;
                    
                    ext_mem_212812.references = NULL;
                    
                    struct memblock ext_mem_212811;
                    
                    ext_mem_212811.references = NULL;
                    if (match_lit_198652) {
                        struct memblock mem_212630;
                        
                        mem_212630.references = NULL;
                        if (memblock_alloc(ctx, &mem_212630, bytes_210830,
                                           "mem_212630")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_212634;
                        
                        mem_212634.references = NULL;
                        if (memblock_alloc(ctx, &mem_212634, bytes_210830,
                                           "mem_212634")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t binop_y_212525 = (int64_t) 4 * q_l_196697;
                        int64_t bytes_212526 = smax64((int64_t) 0,
                                                      binop_y_212525);
                        int64_t flat_tid_206127 = (int64_t) 0;
                        int32_t num_tasks_223730;
                        int64_t flat_tid_206216 = (int64_t) 0;
                        struct futhark_mc_task_229079 futhark_mc_task_229079;
                        
                        futhark_mc_task_229079.ctx = ctx;
                        futhark_mc_task_229079.free_m_196691 = m_196691;
                        futhark_mc_task_229079.free_n_196692 = n_196692;
                        futhark_mc_task_229079.free_q_l_196697 = q_l_196697;
                        futhark_mc_task_229079.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229079.free_l_n_m_196752 = l_n_m_196752;
                        futhark_mc_task_229079.free_i_196779 = i_196779;
                        futhark_mc_task_229079.free_bytes_210774 = bytes_210774;
                        futhark_mc_task_229079.free_mem_210827 = mem_210827;
                        futhark_mc_task_229079.free_mem_210831 = mem_210831;
                        futhark_mc_task_229079.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229079.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229079.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229079.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229079.free_mem_212347 = mem_212347;
                        futhark_mc_task_229079.free_bytes_212526 = bytes_212526;
                        futhark_mc_task_229079.free_mem_212630 = mem_212630.mem;
                        futhark_mc_task_229079.free_mem_212634 = mem_212634.mem;
                        
                        struct scheduler_segop futhark_mc_task_229079_task;
                        
                        futhark_mc_task_229079_task.args =
                            &futhark_mc_task_229079;
                        futhark_mc_task_229079_task.top_level_fn =
                            futhark_mc_segmap_task_229080;
                        futhark_mc_task_229079_task.name =
                            "futhark_mc_segmap_task_229080";
                        futhark_mc_task_229079_task.iterations = m_196691;
                        futhark_mc_task_229079_task.task_time =
                            &ctx->futhark_mc_segmap_task_229080_total_time;
                        futhark_mc_task_229079_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229080_total_iter;
                        futhark_mc_task_229079_task.sched = STATIC;
                        futhark_mc_task_229079_task.nested_fn =
                            futhark_mc_segmap_nested_task_229087;
                        
                        int futhark_mc_segmap_task_229080_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229079_task);
                        
                        if (futhark_mc_segmap_task_229080_err != 0) {
                            if (memblock_unref(ctx, &mem_212634,
                                               "mem_212634") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212630,
                                               "mem_212630") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212811,
                                               "ext_mem_212811") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212812,
                                               "ext_mem_212812") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212813,
                                               "ext_mem_212813") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212814,
                                               "ext_mem_212814") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_212812, &mem_212630,
                                         "mem_212630") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_212811, &mem_212634,
                                         "mem_212634") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212634, "mem_212634") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212630, "mem_212630") != 0)
                            return 1;
                    } else {
                        struct memblock mem_212806;
                        
                        mem_212806.references = NULL;
                        if (memblock_alloc(ctx, &mem_212806, bytes_210830,
                                           "mem_212806")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_212810;
                        
                        mem_212810.references = NULL;
                        if (memblock_alloc(ctx, &mem_212810, bytes_210830,
                                           "mem_212810")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t binop_y_212635 = (int64_t) 4 * q_l_196697;
                        int64_t bytes_212636 = smax64((int64_t) 0,
                                                      binop_y_212635);
                        int64_t flat_tid_206374 = (int64_t) 0;
                        int32_t num_tasks_224124;
                        int64_t flat_tid_206503 = (int64_t) 0;
                        struct futhark_mc_task_229116 futhark_mc_task_229116;
                        
                        futhark_mc_task_229116.ctx = ctx;
                        futhark_mc_task_229116.free_m_196691 = m_196691;
                        futhark_mc_task_229116.free_n_196692 = n_196692;
                        futhark_mc_task_229116.free_q_l_196697 = q_l_196697;
                        futhark_mc_task_229116.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229116.free_l_n_m_196752 = l_n_m_196752;
                        futhark_mc_task_229116.free_i_196779 = i_196779;
                        futhark_mc_task_229116.free_bytes_210774 = bytes_210774;
                        futhark_mc_task_229116.free_mem_210827 = mem_210827;
                        futhark_mc_task_229116.free_mem_210831 = mem_210831;
                        futhark_mc_task_229116.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229116.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229116.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229116.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229116.free_mem_212347 = mem_212347;
                        futhark_mc_task_229116.free_bytes_212636 = bytes_212636;
                        futhark_mc_task_229116.free_mem_212806 = mem_212806.mem;
                        futhark_mc_task_229116.free_mem_212810 = mem_212810.mem;
                        
                        struct scheduler_segop futhark_mc_task_229116_task;
                        
                        futhark_mc_task_229116_task.args =
                            &futhark_mc_task_229116;
                        futhark_mc_task_229116_task.top_level_fn =
                            futhark_mc_segmap_task_229117;
                        futhark_mc_task_229116_task.name =
                            "futhark_mc_segmap_task_229117";
                        futhark_mc_task_229116_task.iterations = m_196691;
                        futhark_mc_task_229116_task.task_time =
                            &ctx->futhark_mc_segmap_task_229117_total_time;
                        futhark_mc_task_229116_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229117_total_iter;
                        futhark_mc_task_229116_task.sched = STATIC;
                        futhark_mc_task_229116_task.nested_fn =
                            futhark_mc_segmap_nested_task_229126;
                        
                        int futhark_mc_segmap_task_229117_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229116_task);
                        
                        if (futhark_mc_segmap_task_229117_err != 0) {
                            if (memblock_unref(ctx, &mem_212810,
                                               "mem_212810") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212806,
                                               "mem_212806") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212811,
                                               "ext_mem_212811") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212812,
                                               "ext_mem_212812") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212813,
                                               "ext_mem_212813") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212814,
                                               "ext_mem_212814") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_212812, &mem_212806,
                                         "mem_212806") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_212811, &mem_212810,
                                         "mem_212810") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212810, "mem_212810") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212806, "mem_212806") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx, &ext_mem_212814, &ext_mem_212812,
                                     "ext_mem_212812") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_212813, &ext_mem_212811,
                                     "ext_mem_212811") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212811,
                                       "ext_mem_212811") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212812,
                                       "ext_mem_212812") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &ext_mem_212816, &ext_mem_212814,
                                 "ext_mem_212814") != 0)
                    return 1;
                if (memblock_set(ctx, &ext_mem_212815, &ext_mem_212813,
                                 "ext_mem_212813") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212813, "ext_mem_212813") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212814, "ext_mem_212814") != 0)
                    return 1;
            }
            
            struct memblock ext_mem_212839;
            
            ext_mem_212839.references = NULL;
            if (cond_197220) {
                bool zzero_198896 = jump_l_196703 == (int64_t) 0;
                bool nonzzero_198897 = !zzero_198896;
                bool nonzzero_cert_198898;
                
                if (!nonzzero_198897) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:546:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:545:3-549:9\n   #5  stl.fut:252:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:250:15-253:43\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
                    if (memblock_unref(ctx, &ext_mem_212839,
                                       "ext_mem_212839") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212815,
                                       "ext_mem_212815") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212816,
                                       "ext_mem_212816") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_198899 = sub64(l_n_m_196752, (int64_t) 1);
                struct memblock mem_212838;
                
                mem_212838.references = NULL;
                if (memblock_alloc(ctx, &mem_212838, bytes_210896,
                                   "mem_212838")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t flat_tid_206735 = (int64_t) 0;
                int32_t num_tasks_224705;
                int64_t flat_tid_206741 = (int64_t) 0;
                struct futhark_mc_task_229165 futhark_mc_task_229165;
                
                futhark_mc_task_229165.ctx = ctx;
                futhark_mc_task_229165.free_m_196691 = m_196691;
                futhark_mc_task_229165.free_n_196692 = n_196692;
                futhark_mc_task_229165.free_jump_l_196703 = jump_l_196703;
                futhark_mc_task_229165.free_l_n_m_196752 = l_n_m_196752;
                futhark_mc_task_229165.free_i_196779 = i_196779;
                futhark_mc_task_229165.free_y_198899 = y_198899;
                futhark_mc_task_229165.free_bytes_210949 = bytes_210949;
                futhark_mc_task_229165.free_ext_mem_212815 = ext_mem_212815.mem;
                futhark_mc_task_229165.free_ext_mem_212816 = ext_mem_212816.mem;
                futhark_mc_task_229165.free_mem_212838 = mem_212838.mem;
                
                struct scheduler_segop futhark_mc_task_229165_task;
                
                futhark_mc_task_229165_task.args = &futhark_mc_task_229165;
                futhark_mc_task_229165_task.top_level_fn =
                    futhark_mc_segmap_task_229166;
                futhark_mc_task_229165_task.name =
                    "futhark_mc_segmap_task_229166";
                futhark_mc_task_229165_task.iterations = m_196691;
                futhark_mc_task_229165_task.task_time =
                    &ctx->futhark_mc_segmap_task_229166_total_time;
                futhark_mc_task_229165_task.task_iter =
                    &ctx->futhark_mc_segmap_task_229166_total_iter;
                futhark_mc_task_229165_task.sched = STATIC;
                futhark_mc_task_229165_task.nested_fn =
                    futhark_mc_segmap_nested_task_229170;
                
                int futhark_mc_segmap_task_229166_err =
                    scheduler_prepare_task(&ctx->scheduler,
                                           &futhark_mc_task_229165_task);
                
                if (futhark_mc_segmap_task_229166_err != 0) {
                    if (memblock_unref(ctx, &mem_212838, "mem_212838") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212839,
                                       "ext_mem_212839") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212815,
                                       "ext_mem_212815") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212816,
                                       "ext_mem_212816") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    ;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set(ctx, &ext_mem_212839, &mem_212838,
                                 "mem_212838") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_212838, "mem_212838") != 0)
                    return 1;
            } else {
                bool dim_match_198951 = n_196692 == l_n_m_196752;
                bool empty_or_match_cert_198952;
                
                if (!dim_match_198951) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) m_196691, ", ",
                                  (long long) l_n_m_196752,
                                  ") cannot match shape of type `[",
                                  (long long) m_196691, "][",
                                  (long long) n_196692, "]t`.",
                                  "-> #0  stl.fut:255:15-36\n   #1  stl.fut:401:3-415:29\n   #2  stl.fut:385:1-415:29\n");
                    if (memblock_unref(ctx, &ext_mem_212839,
                                       "ext_mem_212839") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212815,
                                       "ext_mem_212815") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212816,
                                       "ext_mem_212816") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set(ctx, &ext_mem_212839, &ext_mem_212816,
                                 "ext_mem_212816") != 0)
                    return 1;
            }
            if (memblock_unref(ctx, &ext_mem_212815, "ext_mem_212815") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212816, "ext_mem_212816") != 0)
                return 1;
            
            struct memblock mem_212862;
            
            mem_212862.references = NULL;
            if (memblock_alloc(ctx, &mem_212862, bytes_210896, "mem_212862")) {
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_206795 = (int64_t) 0;
            int32_t num_tasks_224815;
            int64_t flat_tid_206801 = (int64_t) 0;
            struct futhark_mc_task_229178 futhark_mc_task_229178;
            
            futhark_mc_task_229178.ctx = ctx;
            futhark_mc_task_229178.free_m_196691 = m_196691;
            futhark_mc_task_229178.free_n_196692 = n_196692;
            futhark_mc_task_229178.free_n_p_196694 = n_p_196694;
            futhark_mc_task_229178.free_C_len_196743 = C_len_196743;
            futhark_mc_task_229178.free_bytes_210949 = bytes_210949;
            futhark_mc_task_229178.free_mem_212272 = mem_212272;
            futhark_mc_task_229178.free_ext_mem_212839 = ext_mem_212839.mem;
            futhark_mc_task_229178.free_ext_212840 = ext_212840;
            futhark_mc_task_229178.free_mem_212862 = mem_212862.mem;
            
            struct scheduler_segop futhark_mc_task_229178_task;
            
            futhark_mc_task_229178_task.args = &futhark_mc_task_229178;
            futhark_mc_task_229178_task.top_level_fn =
                futhark_mc_segmap_task_229179;
            futhark_mc_task_229178_task.name = "futhark_mc_segmap_task_229179";
            futhark_mc_task_229178_task.iterations = m_196691;
            futhark_mc_task_229178_task.task_time =
                &ctx->futhark_mc_segmap_task_229179_total_time;
            futhark_mc_task_229178_task.task_iter =
                &ctx->futhark_mc_segmap_task_229179_total_iter;
            futhark_mc_task_229178_task.sched = STATIC;
            futhark_mc_task_229178_task.nested_fn =
                futhark_mc_segmap_nested_task_229183;
            
            int futhark_mc_segmap_task_229179_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229178_task);
            
            if (futhark_mc_segmap_task_229179_err != 0) {
                if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212839, "ext_mem_212839") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212815, "ext_mem_212815") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212816, "ext_mem_212816") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            if (memblock_unref(ctx, &ext_mem_212839, "ext_mem_212839") != 0)
                return 1;
            
            struct memblock ext_mem_213655;
            
            ext_mem_213655.references = NULL;
            
            struct memblock ext_mem_213654;
            
            ext_mem_213654.references = NULL;
            if (cond_197278) {
                bool match_lit_198964 = (int64_t) 0 == d_t_196699;
                struct memblock ext_mem_213142;
                
                ext_mem_213142.references = NULL;
                
                struct memblock ext_mem_213141;
                
                ext_mem_213141.references = NULL;
                if (match_lit_198964) {
                    struct memblock mem_212866;
                    
                    mem_212866.references = NULL;
                    if (memblock_alloc(ctx, &mem_212866, bytes_210892,
                                       "mem_212866")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_224840 = 0; i_224840 < m_196691;
                         i_224840++) {
                        for (int64_t i_224841 = 0; i_224841 < t_n_m_196759;
                             i_224841++) {
                            ((float *) mem_212866.mem)[i_224840 * t_n_m_196759 +
                                                       i_224841] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_212942;
                    
                    mem_212942.references = NULL;
                    if (memblock_alloc(ctx, &mem_212942, bytes_210892,
                                       "mem_212942")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t flat_tid_206811 = (int64_t) 0;
                    int32_t num_tasks_224842;
                    int64_t flat_tid_206891 = (int64_t) 0;
                    struct futhark_mc_task_229191 futhark_mc_task_229191;
                    
                    futhark_mc_task_229191.ctx = ctx;
                    futhark_mc_task_229191.free_m_196691 = m_196691;
                    futhark_mc_task_229191.free_n_196692 = n_196692;
                    futhark_mc_task_229191.free_q_t_196696 = q_t_196696;
                    futhark_mc_task_229191.free_jump_t_196702 = jump_t_196702;
                    futhark_mc_task_229191.free_t_n_m_196759 = t_n_m_196759;
                    futhark_mc_task_229191.free_i_196779 = i_196779;
                    futhark_mc_task_229191.free_Y_mem_210354 = Y_mem_210354.mem;
                    futhark_mc_task_229191.free_mem_210394 = mem_210394;
                    futhark_mc_task_229191.free_mem_210397 = mem_210397;
                    futhark_mc_task_229191.free_bytes_210836 = bytes_210836;
                    futhark_mc_task_229191.free_mem_210889 = mem_210889;
                    futhark_mc_task_229191.free_mem_210893 = mem_210893;
                    futhark_mc_task_229191.free_ctx_param_ext_210920 =
                        ctx_param_ext_210920;
                    futhark_mc_task_229191.free_ctx_param_ext_210921 =
                        ctx_param_ext_210921;
                    futhark_mc_task_229191.free_ctx_param_ext_210923 =
                        ctx_param_ext_210923;
                    futhark_mc_task_229191.free_mem_param_210925 =
                        mem_param_210925.mem;
                    futhark_mc_task_229191.free_bytes_210949 = bytes_210949;
                    futhark_mc_task_229191.free_mem_212862 = mem_212862.mem;
                    futhark_mc_task_229191.free_mem_212942 = mem_212942.mem;
                    
                    struct scheduler_segop futhark_mc_task_229191_task;
                    
                    futhark_mc_task_229191_task.args = &futhark_mc_task_229191;
                    futhark_mc_task_229191_task.top_level_fn =
                        futhark_mc_segmap_task_229192;
                    futhark_mc_task_229191_task.name =
                        "futhark_mc_segmap_task_229192";
                    futhark_mc_task_229191_task.iterations = m_196691;
                    futhark_mc_task_229191_task.task_time =
                        &ctx->futhark_mc_segmap_task_229192_total_time;
                    futhark_mc_task_229191_task.task_iter =
                        &ctx->futhark_mc_segmap_task_229192_total_iter;
                    futhark_mc_task_229191_task.sched = STATIC;
                    futhark_mc_task_229191_task.nested_fn =
                        futhark_mc_segmap_nested_task_229199;
                    
                    int futhark_mc_segmap_task_229192_err =
                        scheduler_prepare_task(&ctx->scheduler,
                                               &futhark_mc_task_229191_task);
                    
                    if (futhark_mc_segmap_task_229192_err != 0) {
                        if (memblock_unref(ctx, &mem_212942, "mem_212942") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212866, "mem_212866") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213141,
                                           "ext_mem_213141") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213142,
                                           "ext_mem_213142") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213654,
                                           "ext_mem_213654") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213655,
                                           "ext_mem_213655") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212839,
                                           "ext_mem_212839") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212815,
                                           "ext_mem_212815") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212816,
                                           "ext_mem_212816") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212249,
                                           "ext_mem_212249") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212176,
                                           "ext_mem_212176") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212177,
                                           "ext_mem_212177") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210947,
                                           "mem_param_210947") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210939,
                                           "mem_param_210939") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213684,
                                           "ext_mem_213684") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213685,
                                           "ext_mem_213685") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210925,
                                           "mem_param_210925") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210917,
                                           "mem_param_210917") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210909,
                                           "mem_param_210909") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213929,
                                           "ext_mem_213929") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213930,
                                           "ext_mem_213930") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213931,
                                           "ext_mem_213931") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214103,
                                           "mem_out_214103") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214102,
                                           "mem_out_214102") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214101,
                                           "mem_out_214101") != 0)
                            return 1;
                        ;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_set(ctx, &ext_mem_213142, &mem_212942,
                                     "mem_212942") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_213141, &mem_212866,
                                     "mem_212866") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212942, "mem_212942") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212866, "mem_212866") != 0)
                        return 1;
                } else {
                    bool match_lit_199056 = (int64_t) 1 == d_t_196699;
                    struct memblock ext_mem_213140;
                    
                    ext_mem_213140.references = NULL;
                    
                    struct memblock ext_mem_213139;
                    
                    ext_mem_213139.references = NULL;
                    if (match_lit_199056) {
                        struct memblock mem_213036;
                        
                        mem_213036.references = NULL;
                        if (memblock_alloc(ctx, &mem_213036, bytes_210892,
                                           "mem_213036")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_213040;
                        
                        mem_213040.references = NULL;
                        if (memblock_alloc(ctx, &mem_213040, bytes_210892,
                                           "mem_213040")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t flat_tid_207047 = (int64_t) 0;
                        int32_t num_tasks_225214;
                        int64_t flat_tid_207155 = (int64_t) 0;
                        struct futhark_mc_task_229231 futhark_mc_task_229231;
                        
                        futhark_mc_task_229231.ctx = ctx;
                        futhark_mc_task_229231.free_m_196691 = m_196691;
                        futhark_mc_task_229231.free_n_196692 = n_196692;
                        futhark_mc_task_229231.free_q_t_196696 = q_t_196696;
                        futhark_mc_task_229231.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229231.free_t_n_m_196759 = t_n_m_196759;
                        futhark_mc_task_229231.free_i_196779 = i_196779;
                        futhark_mc_task_229231.free_Y_mem_210354 =
                            Y_mem_210354.mem;
                        futhark_mc_task_229231.free_mem_210394 = mem_210394;
                        futhark_mc_task_229231.free_mem_210397 = mem_210397;
                        futhark_mc_task_229231.free_bytes_210836 = bytes_210836;
                        futhark_mc_task_229231.free_mem_210889 = mem_210889;
                        futhark_mc_task_229231.free_mem_210893 = mem_210893;
                        futhark_mc_task_229231.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229231.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229231.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229231.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229231.free_bytes_210949 = bytes_210949;
                        futhark_mc_task_229231.free_mem_212862 = mem_212862.mem;
                        futhark_mc_task_229231.free_mem_213036 = mem_213036.mem;
                        futhark_mc_task_229231.free_mem_213040 = mem_213040.mem;
                        
                        struct scheduler_segop futhark_mc_task_229231_task;
                        
                        futhark_mc_task_229231_task.args =
                            &futhark_mc_task_229231;
                        futhark_mc_task_229231_task.top_level_fn =
                            futhark_mc_segmap_task_229232;
                        futhark_mc_task_229231_task.name =
                            "futhark_mc_segmap_task_229232";
                        futhark_mc_task_229231_task.iterations = m_196691;
                        futhark_mc_task_229231_task.task_time =
                            &ctx->futhark_mc_segmap_task_229232_total_time;
                        futhark_mc_task_229231_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229232_total_iter;
                        futhark_mc_task_229231_task.sched = STATIC;
                        futhark_mc_task_229231_task.nested_fn =
                            futhark_mc_segmap_nested_task_229240;
                        
                        int futhark_mc_segmap_task_229232_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229231_task);
                        
                        if (futhark_mc_segmap_task_229232_err != 0) {
                            if (memblock_unref(ctx, &mem_213040,
                                               "mem_213040") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_213036,
                                               "mem_213036") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213139,
                                               "ext_mem_213139") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213140,
                                               "ext_mem_213140") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213141,
                                               "ext_mem_213141") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213142,
                                               "ext_mem_213142") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213654,
                                               "ext_mem_213654") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213655,
                                               "ext_mem_213655") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212862,
                                               "mem_212862") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212839,
                                               "ext_mem_212839") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_213140, &mem_213036,
                                         "mem_213036") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_213139, &mem_213040,
                                         "mem_213040") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213040, "mem_213040") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213036, "mem_213036") != 0)
                            return 1;
                    } else {
                        struct memblock mem_213134;
                        
                        mem_213134.references = NULL;
                        if (memblock_alloc(ctx, &mem_213134, bytes_210892,
                                           "mem_213134")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_213138;
                        
                        mem_213138.references = NULL;
                        if (memblock_alloc(ctx, &mem_213138, bytes_210892,
                                           "mem_213138")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t flat_tid_207368 = (int64_t) 0;
                        int32_t num_tasks_225724;
                        int64_t flat_tid_207508 = (int64_t) 0;
                        struct futhark_mc_task_229276 futhark_mc_task_229276;
                        
                        futhark_mc_task_229276.ctx = ctx;
                        futhark_mc_task_229276.free_m_196691 = m_196691;
                        futhark_mc_task_229276.free_n_196692 = n_196692;
                        futhark_mc_task_229276.free_q_t_196696 = q_t_196696;
                        futhark_mc_task_229276.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229276.free_t_n_m_196759 = t_n_m_196759;
                        futhark_mc_task_229276.free_i_196779 = i_196779;
                        futhark_mc_task_229276.free_Y_mem_210354 =
                            Y_mem_210354.mem;
                        futhark_mc_task_229276.free_mem_210394 = mem_210394;
                        futhark_mc_task_229276.free_mem_210397 = mem_210397;
                        futhark_mc_task_229276.free_bytes_210836 = bytes_210836;
                        futhark_mc_task_229276.free_mem_210889 = mem_210889;
                        futhark_mc_task_229276.free_mem_210893 = mem_210893;
                        futhark_mc_task_229276.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229276.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229276.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229276.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229276.free_bytes_210949 = bytes_210949;
                        futhark_mc_task_229276.free_mem_212862 = mem_212862.mem;
                        futhark_mc_task_229276.free_mem_213134 = mem_213134.mem;
                        futhark_mc_task_229276.free_mem_213138 = mem_213138.mem;
                        
                        struct scheduler_segop futhark_mc_task_229276_task;
                        
                        futhark_mc_task_229276_task.args =
                            &futhark_mc_task_229276;
                        futhark_mc_task_229276_task.top_level_fn =
                            futhark_mc_segmap_task_229277;
                        futhark_mc_task_229276_task.name =
                            "futhark_mc_segmap_task_229277";
                        futhark_mc_task_229276_task.iterations = m_196691;
                        futhark_mc_task_229276_task.task_time =
                            &ctx->futhark_mc_segmap_task_229277_total_time;
                        futhark_mc_task_229276_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229277_total_iter;
                        futhark_mc_task_229276_task.sched = STATIC;
                        futhark_mc_task_229276_task.nested_fn =
                            futhark_mc_segmap_nested_task_229285;
                        
                        int futhark_mc_segmap_task_229277_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229276_task);
                        
                        if (futhark_mc_segmap_task_229277_err != 0) {
                            if (memblock_unref(ctx, &mem_213138,
                                               "mem_213138") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_213134,
                                               "mem_213134") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213139,
                                               "ext_mem_213139") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213140,
                                               "ext_mem_213140") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213141,
                                               "ext_mem_213141") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213142,
                                               "ext_mem_213142") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213654,
                                               "ext_mem_213654") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213655,
                                               "ext_mem_213655") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212862,
                                               "mem_212862") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212839,
                                               "ext_mem_212839") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_213140, &mem_213134,
                                         "mem_213134") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_213139, &mem_213138,
                                         "mem_213138") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213138, "mem_213138") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213134, "mem_213134") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx, &ext_mem_213142, &ext_mem_213140,
                                     "ext_mem_213140") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_213141, &ext_mem_213139,
                                     "ext_mem_213139") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213139,
                                       "ext_mem_213139") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213140,
                                       "ext_mem_213140") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &ext_mem_213655, &ext_mem_213142,
                                 "ext_mem_213142") != 0)
                    return 1;
                if (memblock_set(ctx, &ext_mem_213654, &ext_mem_213141,
                                 "ext_mem_213141") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213141, "ext_mem_213141") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213142, "ext_mem_213142") != 0)
                    return 1;
            } else {
                bool match_lit_199327 = (int64_t) 0 == d_t_196699;
                struct memblock ext_mem_213653;
                
                ext_mem_213653.references = NULL;
                
                struct memblock ext_mem_213652;
                
                ext_mem_213652.references = NULL;
                if (match_lit_199327) {
                    struct memblock mem_213146;
                    
                    mem_213146.references = NULL;
                    if (memblock_alloc(ctx, &mem_213146, bytes_210892,
                                       "mem_213146")) {
                        err = 1;
                        goto cleanup;
                    }
                    for (int64_t i_226366 = 0; i_226366 < m_196691;
                         i_226366++) {
                        for (int64_t i_226367 = 0; i_226367 < t_n_m_196759;
                             i_226367++) {
                            ((float *) mem_213146.mem)[i_226366 * t_n_m_196759 +
                                                       i_226367] = 0.0F;
                        }
                    }
                    
                    struct memblock mem_213255;
                    
                    mem_213255.references = NULL;
                    if (memblock_alloc(ctx, &mem_213255, bytes_210892,
                                       "mem_213255")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t binop_y_213156 = (int64_t) 4 * q_t_196696;
                    int64_t bytes_213157 = smax64((int64_t) 0, binop_y_213156);
                    int64_t flat_tid_207785 = (int64_t) 0;
                    int32_t num_tasks_226368;
                    int64_t flat_tid_207850 = (int64_t) 0;
                    struct futhark_mc_task_229323 futhark_mc_task_229323;
                    
                    futhark_mc_task_229323.ctx = ctx;
                    futhark_mc_task_229323.free_m_196691 = m_196691;
                    futhark_mc_task_229323.free_n_196692 = n_196692;
                    futhark_mc_task_229323.free_q_t_196696 = q_t_196696;
                    futhark_mc_task_229323.free_jump_t_196702 = jump_t_196702;
                    futhark_mc_task_229323.free_t_n_m_196759 = t_n_m_196759;
                    futhark_mc_task_229323.free_i_196779 = i_196779;
                    futhark_mc_task_229323.free_Y_mem_210354 = Y_mem_210354.mem;
                    futhark_mc_task_229323.free_mem_210394 = mem_210394;
                    futhark_mc_task_229323.free_mem_210397 = mem_210397;
                    futhark_mc_task_229323.free_bytes_210836 = bytes_210836;
                    futhark_mc_task_229323.free_mem_210889 = mem_210889;
                    futhark_mc_task_229323.free_mem_210893 = mem_210893;
                    futhark_mc_task_229323.free_ctx_param_ext_210920 =
                        ctx_param_ext_210920;
                    futhark_mc_task_229323.free_ctx_param_ext_210921 =
                        ctx_param_ext_210921;
                    futhark_mc_task_229323.free_ctx_param_ext_210923 =
                        ctx_param_ext_210923;
                    futhark_mc_task_229323.free_mem_param_210925 =
                        mem_param_210925.mem;
                    futhark_mc_task_229323.free_bytes_210949 = bytes_210949;
                    futhark_mc_task_229323.free_mem_212862 = mem_212862.mem;
                    futhark_mc_task_229323.free_bytes_213157 = bytes_213157;
                    futhark_mc_task_229323.free_mem_213255 = mem_213255.mem;
                    
                    struct scheduler_segop futhark_mc_task_229323_task;
                    
                    futhark_mc_task_229323_task.args = &futhark_mc_task_229323;
                    futhark_mc_task_229323_task.top_level_fn =
                        futhark_mc_segmap_task_229324;
                    futhark_mc_task_229323_task.name =
                        "futhark_mc_segmap_task_229324";
                    futhark_mc_task_229323_task.iterations = m_196691;
                    futhark_mc_task_229323_task.task_time =
                        &ctx->futhark_mc_segmap_task_229324_total_time;
                    futhark_mc_task_229323_task.task_iter =
                        &ctx->futhark_mc_segmap_task_229324_total_iter;
                    futhark_mc_task_229323_task.sched = STATIC;
                    futhark_mc_task_229323_task.nested_fn =
                        futhark_mc_segmap_nested_task_229332;
                    
                    int futhark_mc_segmap_task_229324_err =
                        scheduler_prepare_task(&ctx->scheduler,
                                               &futhark_mc_task_229323_task);
                    
                    if (futhark_mc_segmap_task_229324_err != 0) {
                        if (memblock_unref(ctx, &mem_213255, "mem_213255") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213146, "mem_213146") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213652,
                                           "ext_mem_213652") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213653,
                                           "ext_mem_213653") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213654,
                                           "ext_mem_213654") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213655,
                                           "ext_mem_213655") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212839,
                                           "ext_mem_212839") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212815,
                                           "ext_mem_212815") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212816,
                                           "ext_mem_212816") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212249,
                                           "ext_mem_212249") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212176,
                                           "ext_mem_212176") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_212177,
                                           "ext_mem_212177") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210947,
                                           "mem_param_210947") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210939,
                                           "mem_param_210939") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213684,
                                           "ext_mem_213684") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213685,
                                           "ext_mem_213685") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210925,
                                           "mem_param_210925") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210917,
                                           "mem_param_210917") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_param_210909,
                                           "mem_param_210909") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213929,
                                           "ext_mem_213929") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213930,
                                           "ext_mem_213930") != 0)
                            return 1;
                        if (memblock_unref(ctx, &ext_mem_213931,
                                           "ext_mem_213931") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214103,
                                           "mem_out_214103") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214102,
                                           "mem_out_214102") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_out_214101,
                                           "mem_out_214101") != 0)
                            return 1;
                        ;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_set(ctx, &ext_mem_213653, &mem_213255,
                                     "mem_213255") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_213652, &mem_213146,
                                     "mem_213146") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_213255, "mem_213255") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_213146, "mem_213146") != 0)
                        return 1;
                } else {
                    bool match_lit_199404 = (int64_t) 1 == d_t_196699;
                    struct memblock ext_mem_213651;
                    
                    ext_mem_213651.references = NULL;
                    
                    struct memblock ext_mem_213650;
                    
                    ext_mem_213650.references = NULL;
                    if (match_lit_199404) {
                        struct memblock mem_213415;
                        
                        mem_213415.references = NULL;
                        if (memblock_alloc(ctx, &mem_213415, bytes_210892,
                                           "mem_213415")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_213419;
                        
                        mem_213419.references = NULL;
                        if (memblock_alloc(ctx, &mem_213419, bytes_210892,
                                           "mem_213419")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t binop_y_213265 = (int64_t) 4 * q_t_196696;
                        int64_t bytes_213266 = smax64((int64_t) 0,
                                                      binop_y_213265);
                        int64_t flat_tid_207976 = (int64_t) 0;
                        int32_t num_tasks_226675;
                        int64_t flat_tid_208070 = (int64_t) 0;
                        struct futhark_mc_task_229366 futhark_mc_task_229366;
                        
                        futhark_mc_task_229366.ctx = ctx;
                        futhark_mc_task_229366.free_m_196691 = m_196691;
                        futhark_mc_task_229366.free_n_196692 = n_196692;
                        futhark_mc_task_229366.free_q_t_196696 = q_t_196696;
                        futhark_mc_task_229366.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229366.free_t_n_m_196759 = t_n_m_196759;
                        futhark_mc_task_229366.free_i_196779 = i_196779;
                        futhark_mc_task_229366.free_Y_mem_210354 =
                            Y_mem_210354.mem;
                        futhark_mc_task_229366.free_mem_210394 = mem_210394;
                        futhark_mc_task_229366.free_mem_210397 = mem_210397;
                        futhark_mc_task_229366.free_bytes_210836 = bytes_210836;
                        futhark_mc_task_229366.free_mem_210889 = mem_210889;
                        futhark_mc_task_229366.free_mem_210893 = mem_210893;
                        futhark_mc_task_229366.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229366.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229366.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229366.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229366.free_bytes_210949 = bytes_210949;
                        futhark_mc_task_229366.free_mem_212862 = mem_212862.mem;
                        futhark_mc_task_229366.free_bytes_213266 = bytes_213266;
                        futhark_mc_task_229366.free_mem_213415 = mem_213415.mem;
                        futhark_mc_task_229366.free_mem_213419 = mem_213419.mem;
                        
                        struct scheduler_segop futhark_mc_task_229366_task;
                        
                        futhark_mc_task_229366_task.args =
                            &futhark_mc_task_229366;
                        futhark_mc_task_229366_task.top_level_fn =
                            futhark_mc_segmap_task_229367;
                        futhark_mc_task_229366_task.name =
                            "futhark_mc_segmap_task_229367";
                        futhark_mc_task_229366_task.iterations = m_196691;
                        futhark_mc_task_229366_task.task_time =
                            &ctx->futhark_mc_segmap_task_229367_total_time;
                        futhark_mc_task_229366_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229367_total_iter;
                        futhark_mc_task_229366_task.sched = STATIC;
                        futhark_mc_task_229366_task.nested_fn =
                            futhark_mc_segmap_nested_task_229377;
                        
                        int futhark_mc_segmap_task_229367_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229366_task);
                        
                        if (futhark_mc_segmap_task_229367_err != 0) {
                            if (memblock_unref(ctx, &mem_213419,
                                               "mem_213419") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_213415,
                                               "mem_213415") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213650,
                                               "ext_mem_213650") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213651,
                                               "ext_mem_213651") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213652,
                                               "ext_mem_213652") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213653,
                                               "ext_mem_213653") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213654,
                                               "ext_mem_213654") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213655,
                                               "ext_mem_213655") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212862,
                                               "mem_212862") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212839,
                                               "ext_mem_212839") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_213651, &mem_213415,
                                         "mem_213415") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_213650, &mem_213419,
                                         "mem_213419") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213419, "mem_213419") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213415, "mem_213415") != 0)
                            return 1;
                    } else {
                        struct memblock mem_213645;
                        
                        mem_213645.references = NULL;
                        if (memblock_alloc(ctx, &mem_213645, bytes_210892,
                                           "mem_213645")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock mem_213649;
                        
                        mem_213649.references = NULL;
                        if (memblock_alloc(ctx, &mem_213649, bytes_210892,
                                           "mem_213649")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t binop_y_213429 = (int64_t) 4 * q_t_196696;
                        int64_t bytes_213430 = smax64((int64_t) 0,
                                                      binop_y_213429);
                        int64_t flat_tid_208255 = (int64_t) 0;
                        int32_t num_tasks_227135;
                        int64_t flat_tid_208389 = (int64_t) 0;
                        struct futhark_mc_task_229417 futhark_mc_task_229417;
                        
                        futhark_mc_task_229417.ctx = ctx;
                        futhark_mc_task_229417.free_m_196691 = m_196691;
                        futhark_mc_task_229417.free_n_196692 = n_196692;
                        futhark_mc_task_229417.free_q_t_196696 = q_t_196696;
                        futhark_mc_task_229417.free_jump_t_196702 =
                            jump_t_196702;
                        futhark_mc_task_229417.free_t_n_m_196759 = t_n_m_196759;
                        futhark_mc_task_229417.free_i_196779 = i_196779;
                        futhark_mc_task_229417.free_Y_mem_210354 =
                            Y_mem_210354.mem;
                        futhark_mc_task_229417.free_mem_210394 = mem_210394;
                        futhark_mc_task_229417.free_mem_210397 = mem_210397;
                        futhark_mc_task_229417.free_bytes_210836 = bytes_210836;
                        futhark_mc_task_229417.free_mem_210889 = mem_210889;
                        futhark_mc_task_229417.free_mem_210893 = mem_210893;
                        futhark_mc_task_229417.free_ctx_param_ext_210920 =
                            ctx_param_ext_210920;
                        futhark_mc_task_229417.free_ctx_param_ext_210921 =
                            ctx_param_ext_210921;
                        futhark_mc_task_229417.free_ctx_param_ext_210923 =
                            ctx_param_ext_210923;
                        futhark_mc_task_229417.free_mem_param_210925 =
                            mem_param_210925.mem;
                        futhark_mc_task_229417.free_bytes_210949 = bytes_210949;
                        futhark_mc_task_229417.free_mem_212862 = mem_212862.mem;
                        futhark_mc_task_229417.free_bytes_213430 = bytes_213430;
                        futhark_mc_task_229417.free_mem_213645 = mem_213645.mem;
                        futhark_mc_task_229417.free_mem_213649 = mem_213649.mem;
                        
                        struct scheduler_segop futhark_mc_task_229417_task;
                        
                        futhark_mc_task_229417_task.args =
                            &futhark_mc_task_229417;
                        futhark_mc_task_229417_task.top_level_fn =
                            futhark_mc_segmap_task_229418;
                        futhark_mc_task_229417_task.name =
                            "futhark_mc_segmap_task_229418";
                        futhark_mc_task_229417_task.iterations = m_196691;
                        futhark_mc_task_229417_task.task_time =
                            &ctx->futhark_mc_segmap_task_229418_total_time;
                        futhark_mc_task_229417_task.task_iter =
                            &ctx->futhark_mc_segmap_task_229418_total_iter;
                        futhark_mc_task_229417_task.sched = STATIC;
                        futhark_mc_task_229417_task.nested_fn =
                            futhark_mc_segmap_nested_task_229430;
                        
                        int futhark_mc_segmap_task_229418_err =
                            scheduler_prepare_task(&ctx->scheduler,
                                                   &futhark_mc_task_229417_task);
                        
                        if (futhark_mc_segmap_task_229418_err != 0) {
                            if (memblock_unref(ctx, &mem_213649,
                                               "mem_213649") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_213645,
                                               "mem_213645") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213650,
                                               "ext_mem_213650") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213651,
                                               "ext_mem_213651") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213652,
                                               "ext_mem_213652") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213653,
                                               "ext_mem_213653") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213654,
                                               "ext_mem_213654") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213655,
                                               "ext_mem_213655") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_212862,
                                               "mem_212862") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212839,
                                               "ext_mem_212839") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212815,
                                               "ext_mem_212815") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212816,
                                               "ext_mem_212816") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212249,
                                               "ext_mem_212249") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212176,
                                               "ext_mem_212176") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_212177,
                                               "ext_mem_212177") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210947,
                                               "mem_param_210947") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210939,
                                               "mem_param_210939") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213684,
                                               "ext_mem_213684") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213685,
                                               "ext_mem_213685") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210925,
                                               "mem_param_210925") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210917,
                                               "mem_param_210917") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_param_210909,
                                               "mem_param_210909") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213929,
                                               "ext_mem_213929") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213930,
                                               "ext_mem_213930") != 0)
                                return 1;
                            if (memblock_unref(ctx, &ext_mem_213931,
                                               "ext_mem_213931") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210901,
                                               "mem_210901") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_210897,
                                               "mem_210897") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214103,
                                               "mem_out_214103") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214102,
                                               "mem_out_214102") != 0)
                                return 1;
                            if (memblock_unref(ctx, &mem_out_214101,
                                               "mem_out_214101") != 0)
                                return 1;
                            ;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_set(ctx, &ext_mem_213651, &mem_213645,
                                         "mem_213645") != 0)
                            return 1;
                        if (memblock_set(ctx, &ext_mem_213650, &mem_213649,
                                         "mem_213649") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213649, "mem_213649") != 0)
                            return 1;
                        if (memblock_unref(ctx, &mem_213645, "mem_213645") != 0)
                            return 1;
                    }
                    if (memblock_set(ctx, &ext_mem_213653, &ext_mem_213651,
                                     "ext_mem_213651") != 0)
                        return 1;
                    if (memblock_set(ctx, &ext_mem_213652, &ext_mem_213650,
                                     "ext_mem_213650") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213650,
                                       "ext_mem_213650") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213651,
                                       "ext_mem_213651") != 0)
                        return 1;
                }
                if (memblock_set(ctx, &ext_mem_213655, &ext_mem_213653,
                                 "ext_mem_213653") != 0)
                    return 1;
                if (memblock_set(ctx, &ext_mem_213654, &ext_mem_213652,
                                 "ext_mem_213652") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213652, "ext_mem_213652") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213653, "ext_mem_213653") != 0)
                    return 1;
            }
            
            struct memblock ext_mem_213678;
            
            ext_mem_213678.references = NULL;
            if (cond_197221) {
                bool zzero_199693 = jump_t_196702 == (int64_t) 0;
                bool nonzzero_199694 = !zzero_199693;
                bool nonzzero_cert_199695;
                
                if (!nonzzero_199694) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:546:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:545:3-549:9\n   #5  stl.fut:304:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:303:15-305:43\n   #9  stl.fut:401:3-415:29\n   #10 stl.fut:385:1-415:29\n");
                    if (memblock_unref(ctx, &ext_mem_213678,
                                       "ext_mem_213678") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213654,
                                       "ext_mem_213654") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213655,
                                       "ext_mem_213655") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212839,
                                       "ext_mem_212839") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212815,
                                       "ext_mem_212815") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212816,
                                       "ext_mem_212816") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_199696 = sub64(t_n_m_196759, (int64_t) 1);
                struct memblock mem_213677;
                
                mem_213677.references = NULL;
                if (memblock_alloc(ctx, &mem_213677, bytes_210896,
                                   "mem_213677")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t flat_tid_208648 = (int64_t) 0;
                int32_t num_tasks_227783;
                int64_t flat_tid_208654 = (int64_t) 0;
                struct futhark_mc_task_229480 futhark_mc_task_229480;
                
                futhark_mc_task_229480.ctx = ctx;
                futhark_mc_task_229480.free_m_196691 = m_196691;
                futhark_mc_task_229480.free_n_196692 = n_196692;
                futhark_mc_task_229480.free_jump_t_196702 = jump_t_196702;
                futhark_mc_task_229480.free_t_n_m_196759 = t_n_m_196759;
                futhark_mc_task_229480.free_i_196779 = i_196779;
                futhark_mc_task_229480.free_y_199696 = y_199696;
                futhark_mc_task_229480.free_bytes_210949 = bytes_210949;
                futhark_mc_task_229480.free_ext_mem_213654 = ext_mem_213654.mem;
                futhark_mc_task_229480.free_ext_mem_213655 = ext_mem_213655.mem;
                futhark_mc_task_229480.free_mem_213677 = mem_213677.mem;
                
                struct scheduler_segop futhark_mc_task_229480_task;
                
                futhark_mc_task_229480_task.args = &futhark_mc_task_229480;
                futhark_mc_task_229480_task.top_level_fn =
                    futhark_mc_segmap_task_229481;
                futhark_mc_task_229480_task.name =
                    "futhark_mc_segmap_task_229481";
                futhark_mc_task_229480_task.iterations = m_196691;
                futhark_mc_task_229480_task.task_time =
                    &ctx->futhark_mc_segmap_task_229481_total_time;
                futhark_mc_task_229480_task.task_iter =
                    &ctx->futhark_mc_segmap_task_229481_total_iter;
                futhark_mc_task_229480_task.sched = STATIC;
                futhark_mc_task_229480_task.nested_fn =
                    futhark_mc_segmap_nested_task_229485;
                
                int futhark_mc_segmap_task_229481_err =
                    scheduler_prepare_task(&ctx->scheduler,
                                           &futhark_mc_task_229480_task);
                
                if (futhark_mc_segmap_task_229481_err != 0) {
                    if (memblock_unref(ctx, &mem_213677, "mem_213677") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213678,
                                       "ext_mem_213678") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213654,
                                       "ext_mem_213654") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213655,
                                       "ext_mem_213655") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212839,
                                       "ext_mem_212839") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212815,
                                       "ext_mem_212815") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212816,
                                       "ext_mem_212816") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    ;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set(ctx, &ext_mem_213678, &mem_213677,
                                 "mem_213677") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_213677, "mem_213677") != 0)
                    return 1;
            } else {
                bool dim_match_199749 = n_196692 == t_n_m_196759;
                bool empty_or_match_cert_199750;
                
                if (!dim_match_199749) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) m_196691, ", ",
                                  (long long) t_n_m_196759,
                                  ") cannot match shape of type `[",
                                  (long long) m_196691, "][",
                                  (long long) n_196692, "]t`.",
                                  "-> #0  stl.fut:307:15-36\n   #1  stl.fut:401:3-415:29\n   #2  stl.fut:385:1-415:29\n");
                    if (memblock_unref(ctx, &ext_mem_213678,
                                       "ext_mem_213678") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213654,
                                       "ext_mem_213654") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213655,
                                       "ext_mem_213655") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212839,
                                       "ext_mem_212839") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212815,
                                       "ext_mem_212815") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212816,
                                       "ext_mem_212816") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212249,
                                       "ext_mem_212249") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212176,
                                       "ext_mem_212176") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_212177,
                                       "ext_mem_212177") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210947,
                                       "mem_param_210947") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210939,
                                       "mem_param_210939") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213684,
                                       "ext_mem_213684") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213685,
                                       "ext_mem_213685") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210925,
                                       "mem_param_210925") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210917,
                                       "mem_param_210917") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_param_210909,
                                       "mem_param_210909") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213929,
                                       "ext_mem_213929") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213930,
                                       "ext_mem_213930") != 0)
                        return 1;
                    if (memblock_unref(ctx, &ext_mem_213931,
                                       "ext_mem_213931") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214103,
                                       "mem_out_214103") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214102,
                                       "mem_out_214102") != 0)
                        return 1;
                    if (memblock_unref(ctx, &mem_out_214101,
                                       "mem_out_214101") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set(ctx, &ext_mem_213678, &ext_mem_213655,
                                 "ext_mem_213655") != 0)
                    return 1;
            }
            if (memblock_unref(ctx, &ext_mem_213654, "ext_mem_213654") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_213655, "ext_mem_213655") != 0)
                return 1;
            
            int64_t ctx_param_ext_tmp_215721 = ext_213679;
            int64_t ctx_param_ext_tmp_215722 = ext_213679;
            struct memblock mem_param_tmp_215723;
            
            mem_param_tmp_215723.references = NULL;
            if (memblock_set(ctx, &mem_param_tmp_215723, &mem_212862,
                             "mem_212862") != 0)
                return 1;
            
            struct memblock mem_param_tmp_215724;
            
            mem_param_tmp_215724.references = NULL;
            if (memblock_set(ctx, &mem_param_tmp_215724, &ext_mem_213678,
                             "ext_mem_213678") != 0)
                return 1;
            ctx_param_ext_210941 = ctx_param_ext_tmp_215721;
            ctx_param_ext_210943 = ctx_param_ext_tmp_215722;
            if (memblock_set(ctx, &mem_param_210939, &mem_param_tmp_215723,
                             "mem_param_tmp_215723") != 0)
                return 1;
            if (memblock_set(ctx, &mem_param_210947, &mem_param_tmp_215724,
                             "mem_param_tmp_215724") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_tmp_215724,
                               "mem_param_tmp_215724") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_param_tmp_215723,
                               "mem_param_tmp_215723") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_213678, "ext_mem_213678") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_213654, "ext_mem_213654") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_213655, "ext_mem_213655") != 0)
                return 1;
            if (memblock_unref(ctx, &mem_212862, "mem_212862") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212839, "ext_mem_212839") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212815, "ext_mem_212815") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212816, "ext_mem_212816") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212249, "ext_mem_212249") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212176, "ext_mem_212176") != 0)
                return 1;
            if (memblock_unref(ctx, &ext_mem_212177, "ext_mem_212177") != 0)
                return 1;
        }
        ext_213691 = ctx_param_ext_210941;
        ext_213689 = ctx_param_ext_210943;
        if (memblock_set(ctx, &ext_mem_213685, &mem_param_210939,
                         "mem_param_210939") != 0)
            return 1;
        if (memblock_set(ctx, &ext_mem_213684, &mem_param_210947,
                         "mem_param_210947") != 0)
            return 1;
        
        bool cond_199752 = slt64(i_outer_197305, y_197222);
        int64_t ext_213928;
        
        if (cond_199752) {
            ext_213928 = m_196691;
        } else {
            ext_213928 = ctx_param_ext_210922;
        }
        
        int64_t ext_213927;
        
        if (cond_199752) {
            ext_213927 = n_196692;
        } else {
            ext_213927 = ctx_param_ext_210924;
        }
        
        int64_t ext_213926;
        
        if (cond_199752) {
            ext_213926 = m_196691;
        } else {
            ext_213926 = ctx_param_ext_210918;
        }
        
        int64_t ext_213925;
        
        if (cond_199752) {
            ext_213925 = n_196692;
        } else {
            ext_213925 = ctx_param_ext_210919;
        }
        
        int64_t ext_213924;
        
        if (cond_199752) {
            ext_213924 = n_196692;
        } else {
            ext_213924 = ctx_param_ext_210921;
        }
        
        int64_t ext_213923;
        
        if (cond_199752) {
            ext_213923 = (int64_t) 1;
        } else {
            ext_213923 = ctx_param_ext_210923;
        }
        
        int64_t ext_213922;
        
        if (cond_199752) {
            ext_213922 = (int64_t) 0;
        } else {
            ext_213922 = ctx_param_ext_210920;
        }
        
        struct memblock ext_mem_213921;
        
        ext_mem_213921.references = NULL;
        if (cond_199752) {
            if (mem_213739_cached_sizze_228368 < (size_t) bytes_210896) {
                mem_213739 = realloc(mem_213739, bytes_210896);
                mem_213739_cached_sizze_228368 = bytes_210896;
            }
            if (mem_213743_cached_sizze_228369 < (size_t) bytes_210896) {
                mem_213743 = realloc(mem_213743, bytes_210896);
                mem_213743_cached_sizze_228369 = bytes_210896;
            }
            
            int64_t flat_tid_208708 = (int64_t) 0;
            int32_t num_tasks_227893;
            int64_t flat_tid_208716 = (int64_t) 0;
            struct futhark_mc_task_229493 futhark_mc_task_229493;
            
            futhark_mc_task_229493.ctx = ctx;
            futhark_mc_task_229493.free_m_196691 = m_196691;
            futhark_mc_task_229493.free_n_196692 = n_196692;
            futhark_mc_task_229493.free_Y_mem_210354 = Y_mem_210354.mem;
            futhark_mc_task_229493.free_mem_210394 = mem_210394;
            futhark_mc_task_229493.free_bytes_210949 = bytes_210949;
            futhark_mc_task_229493.free_ext_mem_213684 = ext_mem_213684.mem;
            futhark_mc_task_229493.free_ext_mem_213685 = ext_mem_213685.mem;
            futhark_mc_task_229493.free_ext_213689 = ext_213689;
            futhark_mc_task_229493.free_mem_213739 = mem_213739;
            futhark_mc_task_229493.free_mem_213743 = mem_213743;
            
            struct scheduler_segop futhark_mc_task_229493_task;
            
            futhark_mc_task_229493_task.args = &futhark_mc_task_229493;
            futhark_mc_task_229493_task.top_level_fn =
                futhark_mc_segmap_task_229494;
            futhark_mc_task_229493_task.name = "futhark_mc_segmap_task_229494";
            futhark_mc_task_229493_task.iterations = m_196691;
            futhark_mc_task_229493_task.task_time =
                &ctx->futhark_mc_segmap_task_229494_total_time;
            futhark_mc_task_229493_task.task_iter =
                &ctx->futhark_mc_segmap_task_229494_total_iter;
            futhark_mc_task_229493_task.sched = STATIC;
            futhark_mc_task_229493_task.nested_fn =
                futhark_mc_segmap_nested_task_229499;
            
            int futhark_mc_segmap_task_229494_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229493_task);
            
            if (futhark_mc_segmap_task_229494_err != 0) {
                if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            int32_t iters_199778;
            
            if (empty_slice_197232) {
                iters_199778 = 0;
            } else {
                iters_199778 = 16;
            }
            
            bool loop_nonempty_199779 = slt32(0, iters_199778);
            bool loop_not_taken_199780 = !loop_nonempty_199779;
            bool protect_assert_disj_199781 = bounds_check_196782 ||
                 loop_not_taken_199780;
            bool index_certs_199782;
            
            if (!protect_assert_disj_199781) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) i_196779,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  /prelude/array.fut:26:29-34\n   #1  lib/github.com/diku-dk/sorts/radix_sort.fut:25:24-35\n   #2  lib/github.com/diku-dk/sorts/radix_sort.fut:53:31-62\n   #3  lib/github.com/diku-dk/sorts/radix_sort.fut:104:6-36\n   #4  stl.fut:338:35-77\n   #5  stl.fut:337:28-339:40\n   #6  stl.fut:401:3-415:29\n   #7  stl.fut:385:1-415:29\n");
                if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            if (mem_213889_cached_sizze_228370 < (size_t) bytes_210896) {
                mem_213889 = realloc(mem_213889, bytes_210896);
                mem_213889_cached_sizze_228370 = bytes_210896;
            }
            
            int64_t num_bytes_214091 = (int64_t) 4 * n_196692;
            int64_t num_bytes_214096 = (int64_t) 4 * n_196692;
            int64_t flat_tid_208743 = (int64_t) 0;
            int32_t num_tasks_227955;
            int64_t flat_tid_208751 = (int64_t) 0;
            struct futhark_mc_task_229512 futhark_mc_task_229512;
            
            futhark_mc_task_229512.ctx = ctx;
            futhark_mc_task_229512.free_m_196691 = m_196691;
            futhark_mc_task_229512.free_n_196692 = n_196692;
            futhark_mc_task_229512.free_i_196779 = i_196779;
            futhark_mc_task_229512.free_iters_199778 = iters_199778;
            futhark_mc_task_229512.free_bytes_210356 = bytes_210356;
            futhark_mc_task_229512.free_bytes_210949 = bytes_210949;
            futhark_mc_task_229512.free_mem_213739 = mem_213739;
            futhark_mc_task_229512.free_mem_213889 = mem_213889;
            futhark_mc_task_229512.free_num_bytes_214091 = num_bytes_214091;
            futhark_mc_task_229512.free_num_bytes_214096 = num_bytes_214096;
            
            struct scheduler_segop futhark_mc_task_229512_task;
            
            futhark_mc_task_229512_task.args = &futhark_mc_task_229512;
            futhark_mc_task_229512_task.top_level_fn =
                futhark_mc_segmap_task_229513;
            futhark_mc_task_229512_task.name = "futhark_mc_segmap_task_229513";
            futhark_mc_task_229512_task.iterations = m_196691;
            futhark_mc_task_229512_task.task_time =
                &ctx->futhark_mc_segmap_task_229513_total_time;
            futhark_mc_task_229512_task.task_iter =
                &ctx->futhark_mc_segmap_task_229513_total_iter;
            futhark_mc_task_229512_task.sched = STATIC;
            futhark_mc_task_229512_task.nested_fn =
                futhark_mc_segmap_nested_task_229521;
            
            int futhark_mc_segmap_task_229513_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229512_task);
            
            if (futhark_mc_segmap_task_229513_err != 0) {
                if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            bool empty_slice_199896 = j_m_i_197246 == (int64_t) 0;
            int64_t m_199897 = sub64(j_m_i_197246, (int64_t) 1);
            int64_t i_p_m_t_s_199898 = add64(stl_res_196773, m_199897);
            bool zzero_leq_i_p_m_t_s_199899 = sle64((int64_t) 0,
                                                    i_p_m_t_s_199898);
            bool i_p_m_t_s_leq_w_199900 = slt64(i_p_m_t_s_199898, n_196692);
            bool zzero_lte_i_199901 = sle64((int64_t) 0, stl_res_196773);
            bool i_lte_j_199902 = sle64(stl_res_196773, stl_res_196774);
            bool y_199903 = i_p_m_t_s_leq_w_199900 && zzero_lte_i_199901;
            bool y_199904 = zzero_leq_i_p_m_t_s_199899 && y_199903;
            bool y_199905 = i_lte_j_199902 && y_199904;
            bool forwards_ok_199906 = zzero_lte_i_199901 && y_199905;
            bool ok_or_empty_199907 = empty_slice_199896 || forwards_ok_199906;
            bool index_certs_199908;
            
            if (!ok_or_empty_199907) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) stl_res_196773, ":",
                              (long long) stl_res_196774,
                              "] out of bounds for array of shape [",
                              (long long) n_196692, "].",
                              "-> #0  stl.fut:344:33-51\n   #1  stl.fut:342:13-349:28\n   #2  stl.fut:401:3-415:29\n   #3  stl.fut:385:1-415:29\n");
                if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            if (mem_213892_cached_sizze_228371 < (size_t) bytes_212274) {
                mem_213892 = realloc(mem_213892, bytes_212274);
                mem_213892_cached_sizze_228371 = bytes_212274;
            }
            if (mem_213895_cached_sizze_228372 < (size_t) bytes_212274) {
                mem_213895 = realloc(mem_213895, bytes_212274);
                mem_213895_cached_sizze_228372 = bytes_212274;
            }
            if (mem_213898_cached_sizze_228373 < (size_t) bytes_212274) {
                mem_213898 = realloc(mem_213898, bytes_212274);
                mem_213898_cached_sizze_228373 = bytes_212274;
            }
            
            int64_t flat_tid_208842 = (int64_t) 0;
            int32_t num_tasks_228231;
            int64_t flat_tid_208848 = (int64_t) 0;
            struct futhark_mc_task_229543 futhark_mc_task_229543;
            
            futhark_mc_task_229543.ctx = ctx;
            futhark_mc_task_229543.free_m_196691 = m_196691;
            futhark_mc_task_229543.free_n_196692 = n_196692;
            futhark_mc_task_229543.free_stl_res_196773 = stl_res_196773;
            futhark_mc_task_229543.free_j_m_i_197246 = j_m_i_197246;
            futhark_mc_task_229543.free_mem_213889 = mem_213889;
            futhark_mc_task_229543.free_mem_213892 = mem_213892;
            futhark_mc_task_229543.free_mem_213895 = mem_213895;
            futhark_mc_task_229543.free_mem_213898 = mem_213898;
            
            struct scheduler_segop futhark_mc_task_229543_task;
            
            futhark_mc_task_229543_task.args = &futhark_mc_task_229543;
            futhark_mc_task_229543_task.top_level_fn =
                futhark_mc_segmap_task_229544;
            futhark_mc_task_229543_task.name = "futhark_mc_segmap_task_229544";
            futhark_mc_task_229543_task.iterations = m_196691;
            futhark_mc_task_229543_task.task_time =
                &ctx->futhark_mc_segmap_task_229544_total_time;
            futhark_mc_task_229543_task.task_iter =
                &ctx->futhark_mc_segmap_task_229544_total_iter;
            futhark_mc_task_229543_task.sched = STATIC;
            futhark_mc_task_229543_task.nested_fn =
                futhark_mc_segmap_nested_task_229547;
            
            int futhark_mc_segmap_task_229544_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229543_task);
            
            if (futhark_mc_segmap_task_229544_err != 0) {
                if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            
            struct memblock mem_213920;
            
            mem_213920.references = NULL;
            if (memblock_alloc(ctx, &mem_213920, bytes_210896, "mem_213920")) {
                err = 1;
                goto cleanup;
            }
            
            int64_t flat_tid_208861 = (int64_t) 0;
            int32_t num_tasks_228260;
            int64_t flat_tid_208867 = (int64_t) 0;
            struct futhark_mc_task_229555 futhark_mc_task_229555;
            
            futhark_mc_task_229555.ctx = ctx;
            futhark_mc_task_229555.free_m_196691 = m_196691;
            futhark_mc_task_229555.free_n_196692 = n_196692;
            futhark_mc_task_229555.free_bytes_210949 = bytes_210949;
            futhark_mc_task_229555.free_mem_213743 = mem_213743;
            futhark_mc_task_229555.free_mem_213892 = mem_213892;
            futhark_mc_task_229555.free_mem_213895 = mem_213895;
            futhark_mc_task_229555.free_mem_213898 = mem_213898;
            futhark_mc_task_229555.free_mem_213920 = mem_213920.mem;
            
            struct scheduler_segop futhark_mc_task_229555_task;
            
            futhark_mc_task_229555_task.args = &futhark_mc_task_229555;
            futhark_mc_task_229555_task.top_level_fn =
                futhark_mc_segmap_task_229556;
            futhark_mc_task_229555_task.name = "futhark_mc_segmap_task_229556";
            futhark_mc_task_229555_task.iterations = m_196691;
            futhark_mc_task_229555_task.task_time =
                &ctx->futhark_mc_segmap_task_229556_total_time;
            futhark_mc_task_229555_task.task_iter =
                &ctx->futhark_mc_segmap_task_229556_total_iter;
            futhark_mc_task_229555_task.sched = STATIC;
            futhark_mc_task_229555_task.nested_fn =
                futhark_mc_segmap_nested_task_229560;
            
            int futhark_mc_segmap_task_229556_err =
                scheduler_prepare_task(&ctx->scheduler,
                                       &futhark_mc_task_229555_task);
            
            if (futhark_mc_segmap_task_229556_err != 0) {
                if (memblock_unref(ctx, &mem_213920, "mem_213920") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210947,
                                   "mem_param_210947") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210939,
                                   "mem_param_210939") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210925,
                                   "mem_param_210925") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210917,
                                   "mem_param_210917") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_param_210909,
                                   "mem_param_210909") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
                    return 1;
                if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
                    return 1;
                if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
                    return 1;
                ;
                err = 1;
                goto cleanup;
            }
            if (memblock_set(ctx, &ext_mem_213921, &mem_213920, "mem_213920") !=
                0)
                return 1;
            if (memblock_unref(ctx, &mem_213920, "mem_213920") != 0)
                return 1;
        } else {
            if (memblock_set(ctx, &ext_mem_213921, &mem_param_210925,
                             "mem_param_210925") != 0)
                return 1;
        }
        
        int64_t ctx_param_ext_tmp_215706 = ext_213691;
        int64_t ctx_param_ext_tmp_215707 = ext_213689;
        int64_t ctx_param_ext_tmp_215708 = ext_213926;
        int64_t ctx_param_ext_tmp_215709 = ext_213925;
        int64_t ctx_param_ext_tmp_215710 = ext_213922;
        int64_t ctx_param_ext_tmp_215711 = ext_213924;
        int64_t ctx_param_ext_tmp_215712 = ext_213928;
        int64_t ctx_param_ext_tmp_215713 = ext_213923;
        int64_t ctx_param_ext_tmp_215714 = ext_213927;
        struct memblock mem_param_tmp_215715;
        
        mem_param_tmp_215715.references = NULL;
        if (memblock_set(ctx, &mem_param_tmp_215715, &ext_mem_213685,
                         "ext_mem_213685") != 0)
            return 1;
        
        struct memblock mem_param_tmp_215716;
        
        mem_param_tmp_215716.references = NULL;
        if (memblock_set(ctx, &mem_param_tmp_215716, &ext_mem_213684,
                         "ext_mem_213684") != 0)
            return 1;
        
        struct memblock mem_param_tmp_215717;
        
        mem_param_tmp_215717.references = NULL;
        if (memblock_set(ctx, &mem_param_tmp_215717, &ext_mem_213921,
                         "ext_mem_213921") != 0)
            return 1;
        ctx_param_ext_210911 = ctx_param_ext_tmp_215706;
        ctx_param_ext_210913 = ctx_param_ext_tmp_215707;
        ctx_param_ext_210918 = ctx_param_ext_tmp_215708;
        ctx_param_ext_210919 = ctx_param_ext_tmp_215709;
        ctx_param_ext_210920 = ctx_param_ext_tmp_215710;
        ctx_param_ext_210921 = ctx_param_ext_tmp_215711;
        ctx_param_ext_210922 = ctx_param_ext_tmp_215712;
        ctx_param_ext_210923 = ctx_param_ext_tmp_215713;
        ctx_param_ext_210924 = ctx_param_ext_tmp_215714;
        if (memblock_set(ctx, &mem_param_210909, &mem_param_tmp_215715,
                         "mem_param_tmp_215715") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_210917, &mem_param_tmp_215716,
                         "mem_param_tmp_215716") != 0)
            return 1;
        if (memblock_set(ctx, &mem_param_210925, &mem_param_tmp_215717,
                         "mem_param_tmp_215717") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_tmp_215717,
                           "mem_param_tmp_215717") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_tmp_215716,
                           "mem_param_tmp_215716") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_tmp_215715,
                           "mem_param_tmp_215715") != 0)
            return 1;
        if (memblock_unref(ctx, &ext_mem_213921, "ext_mem_213921") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_210947, "mem_param_210947") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_210939, "mem_param_210939") != 0)
            return 1;
        if (memblock_unref(ctx, &ext_mem_213684, "ext_mem_213684") != 0)
            return 1;
        if (memblock_unref(ctx, &ext_mem_213685, "ext_mem_213685") != 0)
            return 1;
    }
    ext_213944 = ctx_param_ext_210911;
    ext_213942 = ctx_param_ext_210913;
    ext_213938 = ctx_param_ext_210918;
    ext_213937 = ctx_param_ext_210919;
    ext_213936 = ctx_param_ext_210920;
    ext_213935 = ctx_param_ext_210921;
    ext_213934 = ctx_param_ext_210922;
    ext_213933 = ctx_param_ext_210923;
    ext_213932 = ctx_param_ext_210924;
    if (memblock_set(ctx, &ext_mem_213931, &mem_param_210909,
                     "mem_param_210909") != 0)
        return 1;
    if (memblock_set(ctx, &ext_mem_213930, &mem_param_210917,
                     "mem_param_210917") != 0)
        return 1;
    if (memblock_set(ctx, &ext_mem_213929, &mem_param_210925,
                     "mem_param_210925") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
        return 1;
    
    struct memblock mem_213974;
    
    mem_213974.references = NULL;
    if (memblock_alloc(ctx, &mem_213974, bytes_210896, "mem_213974")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t flat_tid_208893 = (int64_t) 0;
    int32_t num_tasks_228317;
    int64_t flat_tid_208899 = (int64_t) 0;
    struct futhark_mc_task_229568 futhark_mc_task_229568;
    
    futhark_mc_task_229568.ctx = ctx;
    futhark_mc_task_229568.free_m_196691 = m_196691;
    futhark_mc_task_229568.free_n_196692 = n_196692;
    futhark_mc_task_229568.free_Y_mem_210354 = Y_mem_210354.mem;
    futhark_mc_task_229568.free_bytes_210949 = bytes_210949;
    futhark_mc_task_229568.free_ext_mem_213930 = ext_mem_213930.mem;
    futhark_mc_task_229568.free_ext_mem_213931 = ext_mem_213931.mem;
    futhark_mc_task_229568.free_ext_213942 = ext_213942;
    futhark_mc_task_229568.free_mem_213974 = mem_213974.mem;
    
    struct scheduler_segop futhark_mc_task_229568_task;
    
    futhark_mc_task_229568_task.args = &futhark_mc_task_229568;
    futhark_mc_task_229568_task.top_level_fn = futhark_mc_segmap_task_229569;
    futhark_mc_task_229568_task.name = "futhark_mc_segmap_task_229569";
    futhark_mc_task_229568_task.iterations = m_196691;
    futhark_mc_task_229568_task.task_time =
        &ctx->futhark_mc_segmap_task_229569_total_time;
    futhark_mc_task_229568_task.task_iter =
        &ctx->futhark_mc_segmap_task_229569_total_iter;
    futhark_mc_task_229568_task.sched = STATIC;
    futhark_mc_task_229568_task.nested_fn =
        futhark_mc_segmap_nested_task_229573;
    
    int futhark_mc_segmap_task_229569_err =
        scheduler_prepare_task(&ctx->scheduler, &futhark_mc_task_229568_task);
    
    if (futhark_mc_segmap_task_229569_err != 0) {
        if (memblock_unref(ctx, &mem_213974, "mem_213974") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_210925, "mem_param_210925") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_210917, "mem_param_210917") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_param_210909, "mem_param_210909") != 0)
            return 1;
        if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
            return 1;
        if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
            return 1;
        if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
            return 1;
        if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
            return 1;
        ;
        err = 1;
        goto cleanup;
    }
    
    struct memblock mem_213978;
    
    mem_213978.references = NULL;
    if (memblock_alloc(ctx, &mem_213978, bytes_210896, "mem_213978")) {
        err = 1;
        goto cleanup;
    }
    if (m_196691 * n_196692 * (int64_t) 4 > 0)
        memmove(mem_213978.mem + (int64_t) 0, ext_mem_213931.mem + (int64_t) 0,
                m_196691 * n_196692 * (int64_t) 4);
    if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
        return 1;
    
    struct memblock mem_213983;
    
    mem_213983.references = NULL;
    if (memblock_alloc(ctx, &mem_213983, bytes_210896, "mem_213983")) {
        err = 1;
        goto cleanup;
    }
    if (m_196691 * n_196692 * (int64_t) 4 > 0)
        memmove(mem_213983.mem + (int64_t) 0, ext_mem_213930.mem + (int64_t) 0,
                m_196691 * n_196692 * (int64_t) 4);
    if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
        return 1;
    if (memblock_set(ctx, &mem_out_214101, &mem_213978, "mem_213978") != 0)
        return 1;
    if (memblock_set(ctx, &mem_out_214102, &mem_213983, "mem_213983") != 0)
        return 1;
    if (memblock_set(ctx, &mem_out_214103, &mem_213974, "mem_213974") != 0)
        return 1;
    (*mem_out_p_228344).references = NULL;
    if (memblock_set(ctx, &*mem_out_p_228344, &mem_out_214101,
                     "mem_out_214101") != 0)
        return 1;
    (*mem_out_p_228345).references = NULL;
    if (memblock_set(ctx, &*mem_out_p_228345, &mem_out_214102,
                     "mem_out_214102") != 0)
        return 1;
    (*mem_out_p_228346).references = NULL;
    if (memblock_set(ctx, &*mem_out_p_228346, &mem_out_214103,
                     "mem_out_214103") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_213983, "mem_213983") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_213978, "mem_213978") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_213974, "mem_213974") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_210925, "mem_param_210925") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_210917, "mem_param_210917") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_param_210909, "mem_param_210909") != 0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_213929, "ext_mem_213929") != 0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_213930, "ext_mem_213930") != 0)
        return 1;
    if (memblock_unref(ctx, &ext_mem_213931, "ext_mem_213931") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_210901, "mem_210901") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_210897, "mem_210897") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_out_214103, "mem_out_214103") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_out_214102, "mem_out_214102") != 0)
        return 1;
    if (memblock_unref(ctx, &mem_out_214101, "mem_out_214101") != 0)
        return 1;
    
  cleanup:
    { }
    free(mem_210394);
    free(mem_210397);
    free(mem_210468);
    free(mem_210590);
    free(mem_210594);
    free(mem_210764);
    free(mem_210769);
    free(mem_210827);
    free(mem_210831);
    free(mem_210889);
    free(mem_210893);
    free(mem_210969);
    free(mem_211106);
    free(mem_211111);
    free(mem_212272);
    free(mem_212275);
    free(mem_212297);
    free(mem_212300);
    free(mem_212322);
    free(mem_212325);
    free(mem_212347);
    free(mem_213739);
    free(mem_213743);
    free(mem_213889);
    free(mem_213892);
    free(mem_213895);
    free(mem_213898);
    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, const int64_t in12, const int64_t in13,
                       const int64_t in14)
{
    struct memblock Y_mem_210354;
    
    Y_mem_210354.references = NULL;
    
    int64_t m_196691;
    int64_t n_196692;
    int64_t n_p_196694;
    int64_t q_s_196695;
    int64_t q_t_196696;
    int64_t q_l_196697;
    int64_t d_s_196698;
    int64_t d_t_196699;
    int64_t d_l_196700;
    int64_t jump_s_196701;
    int64_t jump_t_196702;
    int64_t jump_l_196703;
    int64_t n_inner_196704;
    int64_t n_outer_196705;
    int64_t jump_threshold_196706;
    int64_t q_threshold_196707;
    struct memblock mem_out_214101;
    
    mem_out_214101.references = NULL;
    
    struct memblock mem_out_214102;
    
    mem_out_214102.references = NULL;
    
    struct memblock mem_out_214103;
    
    mem_out_214103.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    worker_local = &ctx->scheduler.workers[0];
    Y_mem_210354 = in0->mem;
    m_196691 = in0->shape[0];
    n_196692 = in0->shape[1];
    n_p_196694 = in1;
    q_s_196695 = in2;
    q_t_196696 = in3;
    q_l_196697 = in4;
    d_s_196698 = in5;
    d_t_196699 = in6;
    d_l_196700 = in7;
    jump_s_196701 = in8;
    jump_t_196702 = in9;
    jump_l_196703 = in10;
    n_inner_196704 = in11;
    n_outer_196705 = in12;
    jump_threshold_196706 = in13;
    q_threshold_196707 = in14;
    if (!(m_196691 == in0->shape[0] && n_196692 == in0->shape[1])) {
        ret = 1;
        if (!ctx->error)
            ctx->error =
                msgprintf("Error: entry point arguments have invalid sizes.\n");
    }
    if (ret == 0) {
        ret = futrts_entry_main(ctx, &mem_out_214101, &mem_out_214102,
                                &mem_out_214103, Y_mem_210354, m_196691,
                                n_196692, n_p_196694, q_s_196695, q_t_196696,
                                q_l_196697, d_s_196698, d_t_196699, d_l_196700,
                                jump_s_196701, jump_t_196702, jump_l_196703,
                                n_inner_196704, n_outer_196705,
                                jump_threshold_196706, q_threshold_196707);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out0)->mem = mem_out_214101;
            (*out0)->shape[0] = m_196691;
            (*out0)->shape[1] = n_196692;
            assert((*out1 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out1)->mem = mem_out_214102;
            (*out1)->shape[0] = m_196691;
            (*out1)->shape[1] = n_196692;
            assert((*out2 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out2)->mem = mem_out_214103;
            (*out2)->shape[0] = m_196691;
            (*out2)->shape[1] = n_196692;
        }
    }
    lock_unlock(&ctx->lock);
    return ret;
}
  
