Problem 762
Amoebas - C(100000) last nine digits. Uses state DP with 35 states (4-tuples summing to <= 3), transition weights, and layer rotation.
View problem on Project Euler
Performance comparison
| Metric | Our solution | Best known |
| Time complexity | O(n^4) | ? |
| Space complexity | O(n^2) | ? |
| Approach | Flow solution | Not curated |
| Verdict | Unknown |
Flow source
# Project Euler 762
# Amoebas - C(100000) last nine digits.
# Uses state DP with 35 states (4-tuples summing to <= 3),
# transition weights, and layer rotation.
extern {
function calloc(n: i64, size: i64) -> ptr<void>
function free(p: ptr<void>) -> void
}
const MOD: i64 = 1000000000
const MAXSTATES: i32 = 70
const MAXTRANS: i32 = 16
function pop4(m: i32) -> i32 {
return (m & 1) + ((m >> 1) & 1) + ((m >> 2) & 1) + ((m >> 3) & 1)
}
function main() -> i32 {
let states: ptr<i32> = calloc((MAXSTATES as i64) * 4, 4)
let idx: ptr<i32> = calloc(256, 4)
let to_nt_v: ptr<i32> = calloc((MAXSTATES as i64) * (MAXTRANS as i64), 4)
let to_nt_w: ptr<i32> = calloc((MAXSTATES as i64) * (MAXTRANS as i64), 4)
let to_nt_n: ptr<i32> = calloc(MAXSTATES as i64, 4)
let to_t_w: ptr<i32> = calloc((MAXSTATES as i64) * (MAXTRANS as i64), 4)
let to_t_n: ptr<i32> = calloc(MAXSTATES as i64, 4)
let order: ptr<i32> = calloc(MAXSTATES as i64, 4)
if states == null || idx == null || to_nt_v == null || to_nt_w == null
|| to_nt_n == null || to_t_w == null || to_t_n == null || order == null {
return 1
}
# Initialize idx to -1
let mut ii: i32 = 0
while ii < 256 {
idx[ii] = -1
ii = ii + 1
}
# Enumerate states
let mut S: i32 = 0
let mut a0: i32 = 0
while a0 < 4 {
let mut a1: i32 = 0
while a1 < 4 - a0 {
let mut a2: i32 = 0
while a2 < 4 - a0 - a1 {
let mut a3: i32 = 0
while a3 < 4 - a0 - a1 - a2 {
states[S * 4 + 0] = a0
states[S * 4 + 1] = a1
states[S * 4 + 2] = a2
states[S * 4 + 3] = a3
idx[a0 * 64 + a1 * 16 + a2 * 4 + a3] = S
S = S + 1
a3 = a3 + 1
}
a2 = a2 + 1
}
a1 = a1 + 1
}
a0 = a0 + 1
}
let terminal: i32 = idx[0 * 64 + 0 * 16 + 0 * 4 + 0]
# Compute transitions
let mut u: i32 = 0
while u < S {
if u == terminal {
u = u + 1
continue
}
let s0: i32 = states[u * 4 + 0]
let s1: i32 = states[u * 4 + 1]
let s2: i32 = states[u * 4 + 2]
let s3: i32 = states[u * 4 + 3]
let t0: i32 = s0 + s3
let t1: i32 = s1 + s0
let t2: i32 = s2 + s1
let t3: i32 = s3 + s2
let mut mask: i32 = 0
while mask < 16 {
let b0: i32 = mask & 1
let b1: i32 = (mask >> 1) & 1
let b2: i32 = (mask >> 2) & 1
let b3: i32 = (mask >> 3) & 1
let n0: i32 = t0 - b0
let n1: i32 = t1 - b1
let n2: i32 = t2 - b2
let n3: i32 = t3 - b3
if n0 < 0 || n1 < 0 || n2 < 0 || n3 < 0 || n0 > 3 || n1 > 3 || n2 > 3 || n3 > 3 {
mask = mask + 1
continue
}
if n0 + n1 + n2 + n3 > 3 {
mask = mask + 1
continue
}
let v: i32 = idx[n0 * 64 + n1 * 16 + n2 * 4 + n3]
if v < 0 {
mask = mask + 1
continue
}
let w: i32 = pop4(mask)
if v == terminal {
to_t_w[u * MAXTRANS + to_t_n[u]] = w
to_t_n[u] = to_t_n[u] + 1
} else {
to_nt_v[u * MAXTRANS + to_nt_n[u]] = v
to_nt_w[u * MAXTRANS + to_nt_n[u]] = w
to_nt_n[u] = to_nt_n[u] + 1
}
mask = mask + 1
}
u = u + 1
}
# Sort states by sum (descending)
let mut i: i32 = 0
while i < S {
order[i] = i
i = i + 1
}
i = 0
while i < S {
let mut j: i32 = i + 1
while j < S {
let si: i32 = states[order[i] * 4 + 0] + states[order[i] * 4 + 1]
+ states[order[i] * 4 + 2] + states[order[i] * 4 + 3]
let sj: i32 = states[order[j] * 4 + 0] + states[order[j] * 4 + 1]
+ states[order[j] * 4 + 2] + states[order[j] * 4 + 3]
if sj < si {
let tmp: i32 = order[i]
order[i] = order[j]
order[j] = tmp
}
j = j + 1
}
i = i + 1
}
# DP over layers
let max_n: i32 = 100000
let mmax: i32 = max_n + 1
let end_arr: ptr<i64> = calloc((mmax + 1) as i64, 8)
if end_arr == null { return 1 }
let mut L0: ptr<i64> = calloc(S as i64, 8)
let mut L1: ptr<i64> = calloc(S as i64, 8)
let mut L2: ptr<i64> = calloc(S as i64, 8)
let mut L3: ptr<i64> = calloc(S as i64, 8)
let mut L4: ptr<i64> = calloc(S as i64, 8)
if L0 == null || L1 == null || L2 == null || L3 == null || L4 == null { return 1 }
let start: i32 = idx[1 * 64 + 0 * 16 + 0 * 4 + 0]
L0[start] = 1
let mut m: i32 = 0
while m <= mmax {
let cur: ptr<i64> = L0
let mut oi: i32 = 0
while oi < S {
let uu: i32 = order[oi]
let val: i64 = cur[uu]
if val == 0 {
oi = oi + 1
continue
}
# Terminal transitions
let mut ti: i32 = 0
while ti < to_t_n[uu] {
let nm: i32 = m + to_t_w[uu * MAXTRANS + ti]
if nm <= mmax {
end_arr[nm] = (end_arr[nm] + val) % MOD
}
ti = ti + 1
}
# Non-terminal transitions
let mut ni: i32 = 0
while ni < to_nt_n[uu] {
let v: i32 = to_nt_v[uu * MAXTRANS + ni]
let w: i32 = to_nt_w[uu * MAXTRANS + ni]
let nm: i32 = m + w
if nm > mmax {
ni = ni + 1
continue
}
if w == 0 {
cur[v] = (cur[v] + val) % MOD
} else {
if w == 1 { L1[v] = (L1[v] + val) % MOD }
if w == 2 { L2[v] = (L2[v] + val) % MOD }
if w == 3 { L3[v] = (L3[v] + val) % MOD }
if w == 4 { L4[v] = (L4[v] + val) % MOD }
}
ni = ni + 1
}
oi = oi + 1
}
free(L0)
L0 = L1
L1 = L2
L2 = L3
L3 = L4
L4 = calloc(S as i64, 8)
if L4 == null { return 1 }
m = m + 1
}
printf("%09lld\n", end_arr[max_n + 1] % MOD)
free(states); free(idx); free(to_nt_v); free(to_nt_w); free(to_nt_n)
free(to_t_w); free(to_t_n); free(order); free(end_arr)
free(L4)
return 0
}
Generated C
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Flow runtime helpers */
typedef struct flow_temp_node { struct flow_temp_node* next; } flow_temp_node;
static flow_temp_node* flow_temp_head = NULL;
static int flow_temp_atexit_set = 0;
__attribute__((unused)) static void flow_temp_free_all(void) {
while (flow_temp_head) {
flow_temp_node* n = flow_temp_head;
flow_temp_head = n->next;
free(n);
}
}
__attribute__((unused)) static void* flow_temp_alloc(size_t nbytes) {
flow_temp_node* node = (flow_temp_node*)malloc(sizeof(flow_temp_node) + nbytes);
if (!node) return NULL;
node->next = flow_temp_head;
flow_temp_head = node;
if (!flow_temp_atexit_set) {
flow_temp_atexit_set = 1;
atexit(flow_temp_free_all);
}
return (void*)(node + 1);
}
#ifndef FLOW_DIAG
#define FLOW_DIAG(msg) fprintf(stderr, "%s", (msg))
#endif
#ifndef FLOW_LOG
#define FLOW_LOG(fmt, ...) printf(fmt, __VA_ARGS__)
#endif
#ifndef FLOW_LOG_EMPTY
#define FLOW_LOG_EMPTY(fmt) printf(fmt)
#endif
static char* flow_strcat(const char* a, const char* b) {
size_t la = strlen(a ? a : ""), lb = strlen(b ? b : "");
char* r = (char*)flow_temp_alloc(la + lb + 1);
if (!r) return NULL;
if (la) memcpy(r, a, la);
if (lb) memcpy(r + la, b, lb);
r[la + lb] = '\0';
return r;
}
#define __flow_in_arr(arr, val) __extension__ ({ \
int _found = 0; \
size_t _n = sizeof(arr)/sizeof((arr)[0]); \
for (size_t _i = 0; _i < _n; _i++) { \
if ((arr)[_i] == (val)) { _found = 1; break; } \
} _found; })
/* Unified fault handler (MISRA #279) — override with -DFLOW_FAULT_HANDLER=fn */
#ifndef FLOW_FAULT_HANDLER
__attribute__((unused)) static inline void flow_fault_handler(const char* msg) {
fprintf(stderr, "flow: %s\n", msg ? msg : "fault");
abort();
#if defined(__GNUC__) || defined(__clang__)
__builtin_unreachable();
#endif
}
#else
#define flow_fault_handler FLOW_FAULT_HANDLER
#endif
#define flow_div_by_zero_handler() flow_fault_handler("division by zero")
#define flow_shift_ub_handler() flow_fault_handler("invalid shift (amount out of range or left-shift of negative)")
#ifndef FLOW_CHECKED_DIV
#define FLOW_CHECKED_DIV(L, R) (((R) != 0) ? ((L) / (R)) : (flow_div_by_zero_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_MOD
#define FLOW_CHECKED_MOD(L, R) (((R) != 0) ? ((L) % (R)) : (flow_div_by_zero_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_SHL
#define FLOW_CHECKED_SHL(L, R) ((((R) >= 0) && ((unsigned long long)(R) < (sizeof(L) * 8ull)) && ((L) >= 0)) ? ((L) << (R)) : (flow_shift_ub_handler(), (L) * 0))
#endif
#ifndef FLOW_CHECKED_SHR
#define FLOW_CHECKED_SHR(L, R) ((((R) >= 0) && ((unsigned long long)(R) < (sizeof(L) * 8ull))) ? ((L) >> (R)) : (flow_shift_ub_handler(), (L) * 0))
#endif
#include <math.h>
void* _ui_state = NULL;
static inline float i32_to_f32(int32_t v) { return (float)v; }
/* Host stub for @gpu kernels (device codegen replaces this). */
static inline int32_t gpu_thread_id(void) { return 0; }
int32_t pop4_i32(int32_t m);
int32_t main(void);
static const int64_t MOD = 1000000000;
static const int32_t MAXSTATES = 70;
static const int32_t MAXTRANS = 16;
int32_t pop4_i32(int32_t m) {
return ((((m & 1) + (FLOW_CHECKED_SHR((m), (1)) & 1)) + (FLOW_CHECKED_SHR((m), (2)) & 1)) + (FLOW_CHECKED_SHR((m), (3)) & 1));
}
int32_t main(void) {
int32_t* states = (int32_t*)(calloc((((int64_t)(MAXSTATES)) * 4), 4));
int32_t* idx = (int32_t*)(calloc(256, 4));
int32_t* to_nt_v = (int32_t*)(calloc((((int64_t)(MAXSTATES)) * ((int64_t)(MAXTRANS))), 4));
int32_t* to_nt_w = (int32_t*)(calloc((((int64_t)(MAXSTATES)) * ((int64_t)(MAXTRANS))), 4));
int32_t* to_nt_n = (int32_t*)(calloc(((int64_t)(MAXSTATES)), 4));
int32_t* to_t_w = (int32_t*)(calloc((((int64_t)(MAXSTATES)) * ((int64_t)(MAXTRANS))), 4));
int32_t* to_t_n = (int32_t*)(calloc(((int64_t)(MAXSTATES)), 4));
int32_t* order = (int32_t*)(calloc(((int64_t)(MAXSTATES)), 4));
if ((((((((states == NULL || idx == NULL) || to_nt_v == NULL) || to_nt_w == NULL) || to_nt_n == NULL) || to_t_w == NULL) || to_t_n == NULL) || order == NULL)) {
return 1;
}
int32_t ii = 0;
while (ii < 256) {
idx[ii] = (-1);
ii = (ii + 1);
}
int32_t S = 0;
int32_t a0 = 0;
while (a0 < 4) {
int32_t a1 = 0;
while (a1 < (4 - a0)) {
int32_t a2 = 0;
while (a2 < ((4 - a0) - a1)) {
int32_t a3 = 0;
while (a3 < (((4 - a0) - a1) - a2)) {
states[((S * 4) + 0)] = a0;
states[((S * 4) + 1)] = a1;
states[((S * 4) + 2)] = a2;
states[((S * 4) + 3)] = a3;
idx[((((a0 * 64) + (a1 * 16)) + (a2 * 4)) + a3)] = S;
S = (S + 1);
a3 = (a3 + 1);
}
a2 = (a2 + 1);
}
a1 = (a1 + 1);
}
a0 = (a0 + 1);
}
int32_t terminal = idx[((((0 * 64) + (0 * 16)) + (0 * 4)) + 0)];
int32_t u = 0;
while (u < S) {
if (u == terminal) {
u = (u + 1);
continue;
}
int32_t s0 = states[((u * 4) + 0)];
int32_t s1 = states[((u * 4) + 1)];
int32_t s2 = states[((u * 4) + 2)];
int32_t s3 = states[((u * 4) + 3)];
int32_t t0 = (s0 + s3);
int32_t t1 = (s1 + s0);
int32_t t2 = (s2 + s1);
int32_t t3 = (s3 + s2);
int32_t mask = 0;
while (mask < 16) {
int32_t b0 = (mask & 1);
int32_t b1 = (FLOW_CHECKED_SHR((mask), (1)) & 1);
int32_t b2 = (FLOW_CHECKED_SHR((mask), (2)) & 1);
int32_t b3 = (FLOW_CHECKED_SHR((mask), (3)) & 1);
int32_t n0 = (t0 - b0);
int32_t n1 = (t1 - b1);
int32_t n2 = (t2 - b2);
int32_t n3 = (t3 - b3);
if ((((((((n0 < 0 || n1 < 0) || n2 < 0) || n3 < 0) || n0 > 3) || n1 > 3) || n2 > 3) || n3 > 3)) {
mask = (mask + 1);
continue;
}
if ((((n0 + n1) + n2) + n3) > 3) {
mask = (mask + 1);
continue;
}
int32_t v = idx[((((n0 * 64) + (n1 * 16)) + (n2 * 4)) + n3)];
if (v < 0) {
mask = (mask + 1);
continue;
}
int32_t w = pop4_i32(mask);
if (v == terminal) {
to_t_w[((u * MAXTRANS) + to_t_n[u])] = w;
to_t_n[u] = (to_t_n[u] + 1);
} else {
to_nt_v[((u * MAXTRANS) + to_nt_n[u])] = v;
to_nt_w[((u * MAXTRANS) + to_nt_n[u])] = w;
to_nt_n[u] = (to_nt_n[u] + 1);
}
mask = (mask + 1);
}
u = (u + 1);
}
int32_t i = 0;
while (i < S) {
order[i] = i;
i = (i + 1);
}
i = 0;
while (i < S) {
int32_t j = (i + 1);
while (j < S) {
int32_t si = (((states[((order[i] * 4) + 0)] + states[((order[i] * 4) + 1)]) + states[((order[i] * 4) + 2)]) + states[((order[i] * 4) + 3)]);
int32_t sj = (((states[((order[j] * 4) + 0)] + states[((order[j] * 4) + 1)]) + states[((order[j] * 4) + 2)]) + states[((order[j] * 4) + 3)]);
if (sj < si) {
int32_t tmp = order[i];
order[i] = order[j];
order[j] = tmp;
}
j = (j + 1);
}
i = (i + 1);
}
int32_t max_n = 100000;
int32_t mmax = (max_n + 1);
int64_t* end_arr = (int64_t*)(calloc(((int64_t)((mmax + 1))), 8));
if (end_arr == NULL) {
return 1;
}
int64_t* L0 = (int64_t*)(calloc(((int64_t)(S)), 8));
int64_t* L1 = (int64_t*)(calloc(((int64_t)(S)), 8));
int64_t* L2 = (int64_t*)(calloc(((int64_t)(S)), 8));
int64_t* L3 = (int64_t*)(calloc(((int64_t)(S)), 8));
int64_t* L4 = (int64_t*)(calloc(((int64_t)(S)), 8));
if (((((L0 == NULL || L1 == NULL) || L2 == NULL) || L3 == NULL) || L4 == NULL)) {
return 1;
}
int32_t start = idx[((((1 * 64) + (0 * 16)) + (0 * 4)) + 0)];
L0[start] = 1;
int32_t m = 0;
while (m <= mmax) {
int64_t* cur = (int64_t*)(L0);
int32_t oi = 0;
while (oi < S) {
int32_t uu = order[oi];
int64_t val = cur[uu];
if (val == 0) {
oi = (oi + 1);
continue;
}
int32_t ti = 0;
while (ti < to_t_n[uu]) {
int32_t nm = (m + to_t_w[((uu * MAXTRANS) + ti)]);
if (nm <= mmax) {
end_arr[nm] = FLOW_CHECKED_MOD(((end_arr[nm] + val)), (MOD));
}
ti = (ti + 1);
}
int32_t ni = 0;
while (ni < to_nt_n[uu]) {
int32_t v = to_nt_v[((uu * MAXTRANS) + ni)];
int32_t w = to_nt_w[((uu * MAXTRANS) + ni)];
int32_t nm = (m + w);
if (nm > mmax) {
ni = (ni + 1);
continue;
}
if (w == 0) {
cur[v] = FLOW_CHECKED_MOD(((cur[v] + val)), (MOD));
} else {
if (w == 1) {
L1[v] = FLOW_CHECKED_MOD(((L1[v] + val)), (MOD));
}
if (w == 2) {
L2[v] = FLOW_CHECKED_MOD(((L2[v] + val)), (MOD));
}
if (w == 3) {
L3[v] = FLOW_CHECKED_MOD(((L3[v] + val)), (MOD));
}
if (w == 4) {
L4[v] = FLOW_CHECKED_MOD(((L4[v] + val)), (MOD));
}
}
ni = (ni + 1);
}
oi = (oi + 1);
}
free(L0);
L0 = L1;
L1 = L2;
L2 = L3;
L3 = L4;
L4 = calloc(((int64_t)(S)), 8);
if (L4 == NULL) {
return 1;
}
m = (m + 1);
}
printf("%09lld\n", FLOW_CHECKED_MOD((end_arr[(max_n + 1)]), (MOD)));
free(states);
free(idx);
free(to_nt_v);
free(to_nt_w);
free(to_nt_n);
free(to_t_w);
free(to_t_n);
free(order);
free(end_arr);
free(L4);
return 0;
}
Generated MLIR
module {
llvm.func @printf(!llvm.ptr, ...) -> i32
llvm.mlir.global internal constant @str_0("%09lld\n\00") {addr_space = 0 : i32} : !llvm.array<8 x i8>
func.func private @calloc(i64, i64) -> !llvm.ptr
func.func private @free(!llvm.ptr) -> ()
// Constant: MOD
llvm.mlir.global internal constant @MOD(1000000000 : i64) : i64
// Constant: MAXSTATES
llvm.mlir.global internal constant @MAXSTATES(70 : i32) : i32
// Constant: MAXTRANS
llvm.mlir.global internal constant @MAXTRANS(16 : i32) : i32
func.func @pop4(%arg0: i32) -> i32 {
%0 = arith.constant 1 : i32
%1 = arith.andi %arg0, %0 : i32
%2 = arith.constant 1 : i32
%3 = arith.shrsi %arg0, %2 : i32
%4 = arith.constant 1 : i32
%5 = arith.andi %3, %4 : i32
%6 = arith.addi %1, %5 : i32
%7 = arith.constant 2 : i32
%8 = arith.shrsi %arg0, %7 : i32
%9 = arith.constant 1 : i32
%10 = arith.andi %8, %9 : i32
%11 = arith.addi %6, %10 : i32
%12 = arith.constant 3 : i32
%13 = arith.shrsi %arg0, %12 : i32
%14 = arith.constant 1 : i32
%15 = arith.andi %13, %14 : i32
%16 = arith.addi %11, %15 : i32
func.return %16 : i32
}
func.func @main() -> i32 {
%18 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%19 = llvm.load %18 : !llvm.ptr -> i32
%20 = arith.extsi %19 : i32 to i64
%21 = arith.constant 4 : i32
%23 = arith.extsi %21 : i32 to i64
%22 = arith.muli %20, %23 : i64
%24 = arith.constant 4 : i32
%25 = arith.extsi %24 : i32 to i64
%17 = func.call @calloc(%22, %25) : (i64, i64) -> !llvm.ptr
%27 = arith.constant 256 : i32
%28 = arith.constant 4 : i32
%29 = arith.extsi %27 : i32 to i64
%30 = arith.extsi %28 : i32 to i64
%26 = func.call @calloc(%29, %30) : (i64, i64) -> !llvm.ptr
%32 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%33 = llvm.load %32 : !llvm.ptr -> i32
%34 = arith.extsi %33 : i32 to i64
%35 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%36 = llvm.load %35 : !llvm.ptr -> i32
%37 = arith.extsi %36 : i32 to i64
%38 = arith.muli %34, %37 : i64
%39 = arith.constant 4 : i32
%40 = arith.extsi %39 : i32 to i64
%31 = func.call @calloc(%38, %40) : (i64, i64) -> !llvm.ptr
%42 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%43 = llvm.load %42 : !llvm.ptr -> i32
%44 = arith.extsi %43 : i32 to i64
%45 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%46 = llvm.load %45 : !llvm.ptr -> i32
%47 = arith.extsi %46 : i32 to i64
%48 = arith.muli %44, %47 : i64
%49 = arith.constant 4 : i32
%50 = arith.extsi %49 : i32 to i64
%41 = func.call @calloc(%48, %50) : (i64, i64) -> !llvm.ptr
%52 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%53 = llvm.load %52 : !llvm.ptr -> i32
%54 = arith.extsi %53 : i32 to i64
%55 = arith.constant 4 : i32
%56 = arith.extsi %55 : i32 to i64
%51 = func.call @calloc(%54, %56) : (i64, i64) -> !llvm.ptr
%58 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%59 = llvm.load %58 : !llvm.ptr -> i32
%60 = arith.extsi %59 : i32 to i64
%61 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%62 = llvm.load %61 : !llvm.ptr -> i32
%63 = arith.extsi %62 : i32 to i64
%64 = arith.muli %60, %63 : i64
%65 = arith.constant 4 : i32
%66 = arith.extsi %65 : i32 to i64
%57 = func.call @calloc(%64, %66) : (i64, i64) -> !llvm.ptr
%68 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%69 = llvm.load %68 : !llvm.ptr -> i32
%70 = arith.extsi %69 : i32 to i64
%71 = arith.constant 4 : i32
%72 = arith.extsi %71 : i32 to i64
%67 = func.call @calloc(%70, %72) : (i64, i64) -> !llvm.ptr
%74 = llvm.mlir.addressof @MAXSTATES : !llvm.ptr
%75 = llvm.load %74 : !llvm.ptr -> i32
%76 = arith.extsi %75 : i32 to i64
%77 = arith.constant 4 : i32
%78 = arith.extsi %77 : i32 to i64
%73 = func.call @calloc(%76, %78) : (i64, i64) -> !llvm.ptr
%79 = llvm.mlir.zero : !llvm.ptr
%80 = llvm.icmp "eq" %17, %79 : !llvm.ptr
%81 = scf.if %80 -> (i1) {
%82 = arith.constant true
scf.yield %82 : i1
} else {
%83 = llvm.mlir.zero : !llvm.ptr
%84 = llvm.icmp "eq" %26, %83 : !llvm.ptr
scf.yield %84 : i1
}
%85 = scf.if %81 -> (i1) {
%86 = arith.constant true
scf.yield %86 : i1
} else {
%87 = llvm.mlir.zero : !llvm.ptr
%88 = llvm.icmp "eq" %31, %87 : !llvm.ptr
scf.yield %88 : i1
}
%89 = scf.if %85 -> (i1) {
%90 = arith.constant true
scf.yield %90 : i1
} else {
%91 = llvm.mlir.zero : !llvm.ptr
%92 = llvm.icmp "eq" %41, %91 : !llvm.ptr
scf.yield %92 : i1
}
%93 = scf.if %89 -> (i1) {
%94 = arith.constant true
scf.yield %94 : i1
} else {
%95 = llvm.mlir.zero : !llvm.ptr
%96 = llvm.icmp "eq" %51, %95 : !llvm.ptr
scf.yield %96 : i1
}
%97 = scf.if %93 -> (i1) {
%98 = arith.constant true
scf.yield %98 : i1
} else {
%99 = llvm.mlir.zero : !llvm.ptr
%100 = llvm.icmp "eq" %57, %99 : !llvm.ptr
scf.yield %100 : i1
}
%101 = scf.if %97 -> (i1) {
%102 = arith.constant true
scf.yield %102 : i1
} else {
%103 = llvm.mlir.zero : !llvm.ptr
%104 = llvm.icmp "eq" %67, %103 : !llvm.ptr
scf.yield %104 : i1
}
%105 = scf.if %101 -> (i1) {
%106 = arith.constant true
scf.yield %106 : i1
} else {
%107 = llvm.mlir.zero : !llvm.ptr
%108 = llvm.icmp "eq" %73, %107 : !llvm.ptr
scf.yield %108 : i1
}
cf.cond_br %105, ^bb0, ^bb1
^bb0:
%109 = arith.constant 1 : i32
func.return %109 : i32
^bb1:
cf.br ^bb2
^bb2:
%110 = arith.constant 0 : i32
%111 = llvm.mlir.constant(1 : i64) : i64
%112 = llvm.alloca %111 x i32 : (i64) -> !llvm.ptr
llvm.store %110, %112 : i32, !llvm.ptr
cf.br ^bb3
^bb3:
%113 = llvm.load %112 : !llvm.ptr -> i32
%114 = arith.constant 256 : i32
%115 = arith.cmpi slt, %113, %114 : i32
cf.cond_br %115, ^bb4, ^bb5
^bb4:
%116 = arith.constant 1 : i32
%118 = arith.constant 0 : i32
%117 = arith.subi %118, %116 : i32
%119 = llvm.load %112 : !llvm.ptr -> i32
%120 = arith.extsi %119 : i32 to i64
%121 = llvm.getelementptr %26[%120] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %117, %121 : i32, !llvm.ptr
%122 = llvm.load %112 : !llvm.ptr -> i32
%123 = arith.constant 1 : i32
%124 = arith.addi %122, %123 : i32
llvm.store %124, %112 : i32, !llvm.ptr
cf.br ^bb3
^bb5:
%125 = arith.constant 0 : i32
%126 = llvm.mlir.constant(1 : i64) : i64
%127 = llvm.alloca %126 x i32 : (i64) -> !llvm.ptr
llvm.store %125, %127 : i32, !llvm.ptr
%128 = arith.constant 0 : i32
%129 = llvm.mlir.constant(1 : i64) : i64
%130 = llvm.alloca %129 x i32 : (i64) -> !llvm.ptr
llvm.store %128, %130 : i32, !llvm.ptr
cf.br ^bb6
^bb6:
%131 = llvm.load %130 : !llvm.ptr -> i32
%132 = arith.constant 4 : i32
%133 = arith.cmpi slt, %131, %132 : i32
cf.cond_br %133, ^bb7, ^bb8
^bb7:
%134 = arith.constant 0 : i32
%135 = llvm.mlir.constant(1 : i64) : i64
%136 = llvm.alloca %135 x i32 : (i64) -> !llvm.ptr
llvm.store %134, %136 : i32, !llvm.ptr
cf.br ^bb9
^bb9:
%137 = llvm.load %136 : !llvm.ptr -> i32
%138 = arith.constant 4 : i32
%139 = llvm.load %130 : !llvm.ptr -> i32
%140 = arith.subi %138, %139 : i32
%141 = arith.cmpi slt, %137, %140 : i32
cf.cond_br %141, ^bb10, ^bb11
^bb10:
%142 = arith.constant 0 : i32
%143 = llvm.mlir.constant(1 : i64) : i64
%144 = llvm.alloca %143 x i32 : (i64) -> !llvm.ptr
llvm.store %142, %144 : i32, !llvm.ptr
cf.br ^bb12
^bb12:
%145 = llvm.load %144 : !llvm.ptr -> i32
%146 = arith.constant 4 : i32
%147 = llvm.load %130 : !llvm.ptr -> i32
%148 = arith.subi %146, %147 : i32
%149 = llvm.load %136 : !llvm.ptr -> i32
%150 = arith.subi %148, %149 : i32
%151 = arith.cmpi slt, %145, %150 : i32
cf.cond_br %151, ^bb13, ^bb14
^bb13:
%152 = arith.constant 0 : i32
%153 = llvm.mlir.constant(1 : i64) : i64
%154 = llvm.alloca %153 x i32 : (i64) -> !llvm.ptr
llvm.store %152, %154 : i32, !llvm.ptr
cf.br ^bb15
^bb15:
%155 = llvm.load %154 : !llvm.ptr -> i32
%156 = arith.constant 4 : i32
%157 = llvm.load %130 : !llvm.ptr -> i32
%158 = arith.subi %156, %157 : i32
%159 = llvm.load %136 : !llvm.ptr -> i32
%160 = arith.subi %158, %159 : i32
%161 = llvm.load %144 : !llvm.ptr -> i32
%162 = arith.subi %160, %161 : i32
%163 = arith.cmpi slt, %155, %162 : i32
cf.cond_br %163, ^bb16, ^bb17
^bb16:
%164 = llvm.load %130 : !llvm.ptr -> i32
%165 = llvm.load %127 : !llvm.ptr -> i32
%166 = arith.constant 4 : i32
%167 = arith.muli %165, %166 : i32
%168 = arith.constant 0 : i32
%169 = arith.addi %167, %168 : i32
%170 = arith.extsi %169 : i32 to i64
%171 = llvm.getelementptr %17[%170] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %164, %171 : i32, !llvm.ptr
%172 = llvm.load %136 : !llvm.ptr -> i32
%173 = llvm.load %127 : !llvm.ptr -> i32
%174 = arith.constant 4 : i32
%175 = arith.muli %173, %174 : i32
%176 = arith.constant 1 : i32
%177 = arith.addi %175, %176 : i32
%178 = arith.extsi %177 : i32 to i64
%179 = llvm.getelementptr %17[%178] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %172, %179 : i32, !llvm.ptr
%180 = llvm.load %144 : !llvm.ptr -> i32
%181 = llvm.load %127 : !llvm.ptr -> i32
%182 = arith.constant 4 : i32
%183 = arith.muli %181, %182 : i32
%184 = arith.constant 2 : i32
%185 = arith.addi %183, %184 : i32
%186 = arith.extsi %185 : i32 to i64
%187 = llvm.getelementptr %17[%186] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %180, %187 : i32, !llvm.ptr
%188 = llvm.load %154 : !llvm.ptr -> i32
%189 = llvm.load %127 : !llvm.ptr -> i32
%190 = arith.constant 4 : i32
%191 = arith.muli %189, %190 : i32
%192 = arith.constant 3 : i32
%193 = arith.addi %191, %192 : i32
%194 = arith.extsi %193 : i32 to i64
%195 = llvm.getelementptr %17[%194] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %188, %195 : i32, !llvm.ptr
%196 = llvm.load %127 : !llvm.ptr -> i32
%197 = llvm.load %130 : !llvm.ptr -> i32
%198 = arith.constant 64 : i32
%199 = arith.muli %197, %198 : i32
%200 = llvm.load %136 : !llvm.ptr -> i32
%201 = arith.constant 16 : i32
%202 = arith.muli %200, %201 : i32
%203 = arith.addi %199, %202 : i32
%204 = llvm.load %144 : !llvm.ptr -> i32
%205 = arith.constant 4 : i32
%206 = arith.muli %204, %205 : i32
%207 = arith.addi %203, %206 : i32
%208 = llvm.load %154 : !llvm.ptr -> i32
%209 = arith.addi %207, %208 : i32
%210 = arith.extsi %209 : i32 to i64
%211 = llvm.getelementptr %26[%210] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %196, %211 : i32, !llvm.ptr
%212 = llvm.load %127 : !llvm.ptr -> i32
%213 = arith.constant 1 : i32
%214 = arith.addi %212, %213 : i32
llvm.store %214, %127 : i32, !llvm.ptr
%215 = llvm.load %154 : !llvm.ptr -> i32
%216 = arith.constant 1 : i32
%217 = arith.addi %215, %216 : i32
llvm.store %217, %154 : i32, !llvm.ptr
cf.br ^bb15
^bb17:
%218 = llvm.load %144 : !llvm.ptr -> i32
%219 = arith.constant 1 : i32
%220 = arith.addi %218, %219 : i32
llvm.store %220, %144 : i32, !llvm.ptr
cf.br ^bb12
^bb14:
%221 = llvm.load %136 : !llvm.ptr -> i32
%222 = arith.constant 1 : i32
%223 = arith.addi %221, %222 : i32
llvm.store %223, %136 : i32, !llvm.ptr
cf.br ^bb9
^bb11:
%224 = llvm.load %130 : !llvm.ptr -> i32
%225 = arith.constant 1 : i32
%226 = arith.addi %224, %225 : i32
llvm.store %226, %130 : i32, !llvm.ptr
cf.br ^bb6
^bb8:
%228 = arith.constant 0 : i32
%229 = arith.constant 64 : i32
%230 = arith.muli %228, %229 : i32
%231 = arith.constant 0 : i32
%232 = arith.constant 16 : i32
%233 = arith.muli %231, %232 : i32
%234 = arith.addi %230, %233 : i32
%235 = arith.constant 0 : i32
%236 = arith.constant 4 : i32
%237 = arith.muli %235, %236 : i32
%238 = arith.addi %234, %237 : i32
%239 = arith.constant 0 : i32
%240 = arith.addi %238, %239 : i32
%241 = arith.extsi %240 : i32 to i64
%242 = llvm.getelementptr %26[%241] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%227 = llvm.load %242 : !llvm.ptr -> i32
%243 = arith.constant 0 : i32
%244 = llvm.mlir.constant(1 : i64) : i64
%245 = llvm.alloca %244 x i32 : (i64) -> !llvm.ptr
llvm.store %243, %245 : i32, !llvm.ptr
cf.br ^bb18
^bb18:
%246 = llvm.load %245 : !llvm.ptr -> i32
%247 = llvm.load %127 : !llvm.ptr -> i32
%248 = arith.cmpi slt, %246, %247 : i32
cf.cond_br %248, ^bb19, ^bb20
^bb19:
%249 = llvm.load %245 : !llvm.ptr -> i32
%250 = arith.cmpi eq, %249, %227 : i32
cf.cond_br %250, ^bb21, ^bb22
^bb21:
%251 = llvm.load %245 : !llvm.ptr -> i32
%252 = arith.constant 1 : i32
%253 = arith.addi %251, %252 : i32
llvm.store %253, %245 : i32, !llvm.ptr
cf.br ^bb18
^bb22:
cf.br ^bb23
^bb23:
%255 = llvm.load %245 : !llvm.ptr -> i32
%256 = arith.constant 4 : i32
%257 = arith.muli %255, %256 : i32
%258 = arith.constant 0 : i32
%259 = arith.addi %257, %258 : i32
%260 = arith.extsi %259 : i32 to i64
%261 = llvm.getelementptr %17[%260] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%254 = llvm.load %261 : !llvm.ptr -> i32
%263 = llvm.load %245 : !llvm.ptr -> i32
%264 = arith.constant 4 : i32
%265 = arith.muli %263, %264 : i32
%266 = arith.constant 1 : i32
%267 = arith.addi %265, %266 : i32
%268 = arith.extsi %267 : i32 to i64
%269 = llvm.getelementptr %17[%268] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%262 = llvm.load %269 : !llvm.ptr -> i32
%271 = llvm.load %245 : !llvm.ptr -> i32
%272 = arith.constant 4 : i32
%273 = arith.muli %271, %272 : i32
%274 = arith.constant 2 : i32
%275 = arith.addi %273, %274 : i32
%276 = arith.extsi %275 : i32 to i64
%277 = llvm.getelementptr %17[%276] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%270 = llvm.load %277 : !llvm.ptr -> i32
%279 = llvm.load %245 : !llvm.ptr -> i32
%280 = arith.constant 4 : i32
%281 = arith.muli %279, %280 : i32
%282 = arith.constant 3 : i32
%283 = arith.addi %281, %282 : i32
%284 = arith.extsi %283 : i32 to i64
%285 = llvm.getelementptr %17[%284] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%278 = llvm.load %285 : !llvm.ptr -> i32
%286 = arith.addi %254, %278 : i32
%287 = arith.addi %262, %254 : i32
%288 = arith.addi %270, %262 : i32
%289 = arith.addi %278, %270 : i32
%290 = arith.constant 0 : i32
%291 = llvm.mlir.constant(1 : i64) : i64
%292 = llvm.alloca %291 x i32 : (i64) -> !llvm.ptr
llvm.store %290, %292 : i32, !llvm.ptr
cf.br ^bb24
^bb24:
%293 = llvm.load %292 : !llvm.ptr -> i32
%294 = arith.constant 16 : i32
%295 = arith.cmpi slt, %293, %294 : i32
cf.cond_br %295, ^bb25, ^bb26
^bb25:
%296 = llvm.load %292 : !llvm.ptr -> i32
%297 = arith.constant 1 : i32
%298 = arith.andi %296, %297 : i32
%299 = llvm.load %292 : !llvm.ptr -> i32
%300 = arith.constant 1 : i32
%301 = arith.shrsi %299, %300 : i32
%302 = arith.constant 1 : i32
%303 = arith.andi %301, %302 : i32
%304 = llvm.load %292 : !llvm.ptr -> i32
%305 = arith.constant 2 : i32
%306 = arith.shrsi %304, %305 : i32
%307 = arith.constant 1 : i32
%308 = arith.andi %306, %307 : i32
%309 = llvm.load %292 : !llvm.ptr -> i32
%310 = arith.constant 3 : i32
%311 = arith.shrsi %309, %310 : i32
%312 = arith.constant 1 : i32
%313 = arith.andi %311, %312 : i32
%314 = arith.subi %286, %298 : i32
%315 = arith.subi %287, %303 : i32
%316 = arith.subi %288, %308 : i32
%317 = arith.subi %289, %313 : i32
%318 = arith.constant 0 : i32
%319 = arith.cmpi slt, %314, %318 : i32
%320 = scf.if %319 -> (i1) {
%321 = arith.constant true
scf.yield %321 : i1
} else {
%322 = arith.constant 0 : i32
%323 = arith.cmpi slt, %315, %322 : i32
scf.yield %323 : i1
}
%324 = scf.if %320 -> (i1) {
%325 = arith.constant true
scf.yield %325 : i1
} else {
%326 = arith.constant 0 : i32
%327 = arith.cmpi slt, %316, %326 : i32
scf.yield %327 : i1
}
%328 = scf.if %324 -> (i1) {
%329 = arith.constant true
scf.yield %329 : i1
} else {
%330 = arith.constant 0 : i32
%331 = arith.cmpi slt, %317, %330 : i32
scf.yield %331 : i1
}
%332 = scf.if %328 -> (i1) {
%333 = arith.constant true
scf.yield %333 : i1
} else {
%334 = arith.constant 3 : i32
%335 = arith.cmpi sgt, %314, %334 : i32
scf.yield %335 : i1
}
%336 = scf.if %332 -> (i1) {
%337 = arith.constant true
scf.yield %337 : i1
} else {
%338 = arith.constant 3 : i32
%339 = arith.cmpi sgt, %315, %338 : i32
scf.yield %339 : i1
}
%340 = scf.if %336 -> (i1) {
%341 = arith.constant true
scf.yield %341 : i1
} else {
%342 = arith.constant 3 : i32
%343 = arith.cmpi sgt, %316, %342 : i32
scf.yield %343 : i1
}
%344 = scf.if %340 -> (i1) {
%345 = arith.constant true
scf.yield %345 : i1
} else {
%346 = arith.constant 3 : i32
%347 = arith.cmpi sgt, %317, %346 : i32
scf.yield %347 : i1
}
cf.cond_br %344, ^bb27, ^bb28
^bb27:
%348 = llvm.load %292 : !llvm.ptr -> i32
%349 = arith.constant 1 : i32
%350 = arith.addi %348, %349 : i32
llvm.store %350, %292 : i32, !llvm.ptr
cf.br ^bb24
^bb28:
cf.br ^bb29
^bb29:
%351 = arith.addi %314, %315 : i32
%352 = arith.addi %351, %316 : i32
%353 = arith.addi %352, %317 : i32
%354 = arith.constant 3 : i32
%355 = arith.cmpi sgt, %353, %354 : i32
cf.cond_br %355, ^bb30, ^bb31
^bb30:
%356 = llvm.load %292 : !llvm.ptr -> i32
%357 = arith.constant 1 : i32
%358 = arith.addi %356, %357 : i32
llvm.store %358, %292 : i32, !llvm.ptr
cf.br ^bb24
^bb31:
cf.br ^bb32
^bb32:
%360 = arith.constant 64 : i32
%361 = arith.muli %314, %360 : i32
%362 = arith.constant 16 : i32
%363 = arith.muli %315, %362 : i32
%364 = arith.addi %361, %363 : i32
%365 = arith.constant 4 : i32
%366 = arith.muli %316, %365 : i32
%367 = arith.addi %364, %366 : i32
%368 = arith.addi %367, %317 : i32
%369 = arith.extsi %368 : i32 to i64
%370 = llvm.getelementptr %26[%369] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%359 = llvm.load %370 : !llvm.ptr -> i32
%371 = arith.constant 0 : i32
%372 = arith.cmpi slt, %359, %371 : i32
cf.cond_br %372, ^bb33, ^bb34
^bb33:
%373 = llvm.load %292 : !llvm.ptr -> i32
%374 = arith.constant 1 : i32
%375 = arith.addi %373, %374 : i32
llvm.store %375, %292 : i32, !llvm.ptr
cf.br ^bb24
^bb34:
cf.br ^bb35
^bb35:
%377 = llvm.load %292 : !llvm.ptr -> i32
%376 = func.call @pop4(%377) : (i32) -> i32
%378 = arith.cmpi eq, %359, %227 : i32
cf.cond_br %378, ^bb36, ^bb37
^bb36:
%379 = llvm.load %245 : !llvm.ptr -> i32
%380 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%381 = llvm.load %380 : !llvm.ptr -> i32
%382 = arith.muli %379, %381 : i32
%384 = llvm.load %245 : !llvm.ptr -> i32
%385 = arith.extsi %384 : i32 to i64
%386 = llvm.getelementptr %67[%385] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%383 = llvm.load %386 : !llvm.ptr -> i32
%387 = arith.addi %382, %383 : i32
%388 = arith.extsi %387 : i32 to i64
%389 = llvm.getelementptr %57[%388] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %376, %389 : i32, !llvm.ptr
%391 = llvm.load %245 : !llvm.ptr -> i32
%392 = arith.extsi %391 : i32 to i64
%393 = llvm.getelementptr %67[%392] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%390 = llvm.load %393 : !llvm.ptr -> i32
%394 = arith.constant 1 : i32
%395 = arith.addi %390, %394 : i32
%396 = llvm.load %245 : !llvm.ptr -> i32
%397 = arith.extsi %396 : i32 to i64
%398 = llvm.getelementptr %67[%397] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %395, %398 : i32, !llvm.ptr
cf.br ^bb38
^bb37:
%399 = llvm.load %245 : !llvm.ptr -> i32
%400 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%401 = llvm.load %400 : !llvm.ptr -> i32
%402 = arith.muli %399, %401 : i32
%404 = llvm.load %245 : !llvm.ptr -> i32
%405 = arith.extsi %404 : i32 to i64
%406 = llvm.getelementptr %51[%405] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%403 = llvm.load %406 : !llvm.ptr -> i32
%407 = arith.addi %402, %403 : i32
%408 = arith.extsi %407 : i32 to i64
%409 = llvm.getelementptr %31[%408] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %359, %409 : i32, !llvm.ptr
%410 = llvm.load %245 : !llvm.ptr -> i32
%411 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%412 = llvm.load %411 : !llvm.ptr -> i32
%413 = arith.muli %410, %412 : i32
%415 = llvm.load %245 : !llvm.ptr -> i32
%416 = arith.extsi %415 : i32 to i64
%417 = llvm.getelementptr %51[%416] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%414 = llvm.load %417 : !llvm.ptr -> i32
%418 = arith.addi %413, %414 : i32
%419 = arith.extsi %418 : i32 to i64
%420 = llvm.getelementptr %41[%419] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %376, %420 : i32, !llvm.ptr
%422 = llvm.load %245 : !llvm.ptr -> i32
%423 = arith.extsi %422 : i32 to i64
%424 = llvm.getelementptr %51[%423] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%421 = llvm.load %424 : !llvm.ptr -> i32
%425 = arith.constant 1 : i32
%426 = arith.addi %421, %425 : i32
%427 = llvm.load %245 : !llvm.ptr -> i32
%428 = arith.extsi %427 : i32 to i64
%429 = llvm.getelementptr %51[%428] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %426, %429 : i32, !llvm.ptr
cf.br ^bb38
^bb38:
%430 = llvm.load %292 : !llvm.ptr -> i32
%431 = arith.constant 1 : i32
%432 = arith.addi %430, %431 : i32
llvm.store %432, %292 : i32, !llvm.ptr
cf.br ^bb24
^bb26:
%433 = llvm.load %245 : !llvm.ptr -> i32
%434 = arith.constant 1 : i32
%435 = arith.addi %433, %434 : i32
llvm.store %435, %245 : i32, !llvm.ptr
cf.br ^bb18
^bb20:
%436 = arith.constant 0 : i32
%437 = llvm.mlir.constant(1 : i64) : i64
%438 = llvm.alloca %437 x i32 : (i64) -> !llvm.ptr
llvm.store %436, %438 : i32, !llvm.ptr
cf.br ^bb39
^bb39:
%439 = llvm.load %438 : !llvm.ptr -> i32
%440 = llvm.load %127 : !llvm.ptr -> i32
%441 = arith.cmpi slt, %439, %440 : i32
cf.cond_br %441, ^bb40, ^bb41
^bb40:
%442 = llvm.load %438 : !llvm.ptr -> i32
%443 = llvm.load %438 : !llvm.ptr -> i32
%444 = arith.extsi %443 : i32 to i64
%445 = llvm.getelementptr %73[%444] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %442, %445 : i32, !llvm.ptr
%446 = llvm.load %438 : !llvm.ptr -> i32
%447 = arith.constant 1 : i32
%448 = arith.addi %446, %447 : i32
llvm.store %448, %438 : i32, !llvm.ptr
cf.br ^bb39
^bb41:
%449 = arith.constant 0 : i32
llvm.store %449, %438 : i32, !llvm.ptr
cf.br ^bb42
^bb42:
%450 = llvm.load %438 : !llvm.ptr -> i32
%451 = llvm.load %127 : !llvm.ptr -> i32
%452 = arith.cmpi slt, %450, %451 : i32
cf.cond_br %452, ^bb43, ^bb44
^bb43:
%453 = llvm.load %438 : !llvm.ptr -> i32
%454 = arith.constant 1 : i32
%455 = arith.addi %453, %454 : i32
%456 = llvm.mlir.constant(1 : i64) : i64
%457 = llvm.alloca %456 x i32 : (i64) -> !llvm.ptr
llvm.store %455, %457 : i32, !llvm.ptr
cf.br ^bb45
^bb45:
%458 = llvm.load %457 : !llvm.ptr -> i32
%459 = llvm.load %127 : !llvm.ptr -> i32
%460 = arith.cmpi slt, %458, %459 : i32
cf.cond_br %460, ^bb46, ^bb47
^bb46:
%463 = llvm.load %438 : !llvm.ptr -> i32
%464 = arith.extsi %463 : i32 to i64
%465 = llvm.getelementptr %73[%464] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%462 = llvm.load %465 : !llvm.ptr -> i32
%466 = arith.constant 4 : i32
%467 = arith.muli %462, %466 : i32
%468 = arith.constant 0 : i32
%469 = arith.addi %467, %468 : i32
%470 = arith.extsi %469 : i32 to i64
%471 = llvm.getelementptr %17[%470] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%461 = llvm.load %471 : !llvm.ptr -> i32
%474 = llvm.load %438 : !llvm.ptr -> i32
%475 = arith.extsi %474 : i32 to i64
%476 = llvm.getelementptr %73[%475] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%473 = llvm.load %476 : !llvm.ptr -> i32
%477 = arith.constant 4 : i32
%478 = arith.muli %473, %477 : i32
%479 = arith.constant 1 : i32
%480 = arith.addi %478, %479 : i32
%481 = arith.extsi %480 : i32 to i64
%482 = llvm.getelementptr %17[%481] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%472 = llvm.load %482 : !llvm.ptr -> i32
%483 = arith.addi %461, %472 : i32
%486 = llvm.load %438 : !llvm.ptr -> i32
%487 = arith.extsi %486 : i32 to i64
%488 = llvm.getelementptr %73[%487] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%485 = llvm.load %488 : !llvm.ptr -> i32
%489 = arith.constant 4 : i32
%490 = arith.muli %485, %489 : i32
%491 = arith.constant 2 : i32
%492 = arith.addi %490, %491 : i32
%493 = arith.extsi %492 : i32 to i64
%494 = llvm.getelementptr %17[%493] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%484 = llvm.load %494 : !llvm.ptr -> i32
%495 = arith.addi %483, %484 : i32
%498 = llvm.load %438 : !llvm.ptr -> i32
%499 = arith.extsi %498 : i32 to i64
%500 = llvm.getelementptr %73[%499] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%497 = llvm.load %500 : !llvm.ptr -> i32
%501 = arith.constant 4 : i32
%502 = arith.muli %497, %501 : i32
%503 = arith.constant 3 : i32
%504 = arith.addi %502, %503 : i32
%505 = arith.extsi %504 : i32 to i64
%506 = llvm.getelementptr %17[%505] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%496 = llvm.load %506 : !llvm.ptr -> i32
%507 = arith.addi %495, %496 : i32
%510 = llvm.load %457 : !llvm.ptr -> i32
%511 = arith.extsi %510 : i32 to i64
%512 = llvm.getelementptr %73[%511] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%509 = llvm.load %512 : !llvm.ptr -> i32
%513 = arith.constant 4 : i32
%514 = arith.muli %509, %513 : i32
%515 = arith.constant 0 : i32
%516 = arith.addi %514, %515 : i32
%517 = arith.extsi %516 : i32 to i64
%518 = llvm.getelementptr %17[%517] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%508 = llvm.load %518 : !llvm.ptr -> i32
%521 = llvm.load %457 : !llvm.ptr -> i32
%522 = arith.extsi %521 : i32 to i64
%523 = llvm.getelementptr %73[%522] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%520 = llvm.load %523 : !llvm.ptr -> i32
%524 = arith.constant 4 : i32
%525 = arith.muli %520, %524 : i32
%526 = arith.constant 1 : i32
%527 = arith.addi %525, %526 : i32
%528 = arith.extsi %527 : i32 to i64
%529 = llvm.getelementptr %17[%528] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%519 = llvm.load %529 : !llvm.ptr -> i32
%530 = arith.addi %508, %519 : i32
%533 = llvm.load %457 : !llvm.ptr -> i32
%534 = arith.extsi %533 : i32 to i64
%535 = llvm.getelementptr %73[%534] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%532 = llvm.load %535 : !llvm.ptr -> i32
%536 = arith.constant 4 : i32
%537 = arith.muli %532, %536 : i32
%538 = arith.constant 2 : i32
%539 = arith.addi %537, %538 : i32
%540 = arith.extsi %539 : i32 to i64
%541 = llvm.getelementptr %17[%540] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%531 = llvm.load %541 : !llvm.ptr -> i32
%542 = arith.addi %530, %531 : i32
%545 = llvm.load %457 : !llvm.ptr -> i32
%546 = arith.extsi %545 : i32 to i64
%547 = llvm.getelementptr %73[%546] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%544 = llvm.load %547 : !llvm.ptr -> i32
%548 = arith.constant 4 : i32
%549 = arith.muli %544, %548 : i32
%550 = arith.constant 3 : i32
%551 = arith.addi %549, %550 : i32
%552 = arith.extsi %551 : i32 to i64
%553 = llvm.getelementptr %17[%552] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%543 = llvm.load %553 : !llvm.ptr -> i32
%554 = arith.addi %542, %543 : i32
%555 = arith.cmpi slt, %554, %507 : i32
cf.cond_br %555, ^bb48, ^bb49
^bb48:
%557 = llvm.load %438 : !llvm.ptr -> i32
%558 = arith.extsi %557 : i32 to i64
%559 = llvm.getelementptr %73[%558] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%556 = llvm.load %559 : !llvm.ptr -> i32
%561 = llvm.load %457 : !llvm.ptr -> i32
%562 = arith.extsi %561 : i32 to i64
%563 = llvm.getelementptr %73[%562] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%560 = llvm.load %563 : !llvm.ptr -> i32
%564 = llvm.load %438 : !llvm.ptr -> i32
%565 = arith.extsi %564 : i32 to i64
%566 = llvm.getelementptr %73[%565] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %560, %566 : i32, !llvm.ptr
%567 = llvm.load %457 : !llvm.ptr -> i32
%568 = arith.extsi %567 : i32 to i64
%569 = llvm.getelementptr %73[%568] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %556, %569 : i32, !llvm.ptr
cf.br ^bb50
^bb49:
cf.br ^bb50
^bb50:
%570 = llvm.load %457 : !llvm.ptr -> i32
%571 = arith.constant 1 : i32
%572 = arith.addi %570, %571 : i32
llvm.store %572, %457 : i32, !llvm.ptr
cf.br ^bb45
^bb47:
%573 = llvm.load %438 : !llvm.ptr -> i32
%574 = arith.constant 1 : i32
%575 = arith.addi %573, %574 : i32
llvm.store %575, %438 : i32, !llvm.ptr
cf.br ^bb42
^bb44:
%576 = arith.constant 100000 : i32
%577 = arith.constant 1 : i32
%578 = arith.addi %576, %577 : i32
%580 = arith.constant 1 : i32
%581 = arith.addi %578, %580 : i32
%582 = arith.extsi %581 : i32 to i64
%583 = arith.constant 8 : i32
%584 = arith.extsi %583 : i32 to i64
%579 = func.call @calloc(%582, %584) : (i64, i64) -> !llvm.ptr
%585 = llvm.mlir.zero : !llvm.ptr
%586 = llvm.icmp "eq" %579, %585 : !llvm.ptr
cf.cond_br %586, ^bb51, ^bb52
^bb51:
%587 = arith.constant 1 : i32
func.return %587 : i32
^bb52:
cf.br ^bb53
^bb53:
%589 = llvm.load %127 : !llvm.ptr -> i32
%590 = arith.extsi %589 : i32 to i64
%591 = arith.constant 8 : i32
%592 = arith.extsi %591 : i32 to i64
%588 = func.call @calloc(%590, %592) : (i64, i64) -> !llvm.ptr
%593 = llvm.mlir.constant(1 : i64) : i64
%594 = llvm.alloca %593 x !llvm.ptr : (i64) -> !llvm.ptr
llvm.store %588, %594 : !llvm.ptr, !llvm.ptr
%596 = llvm.load %127 : !llvm.ptr -> i32
%597 = arith.extsi %596 : i32 to i64
%598 = arith.constant 8 : i32
%599 = arith.extsi %598 : i32 to i64
%595 = func.call @calloc(%597, %599) : (i64, i64) -> !llvm.ptr
%600 = llvm.mlir.constant(1 : i64) : i64
%601 = llvm.alloca %600 x !llvm.ptr : (i64) -> !llvm.ptr
llvm.store %595, %601 : !llvm.ptr, !llvm.ptr
%603 = llvm.load %127 : !llvm.ptr -> i32
%604 = arith.extsi %603 : i32 to i64
%605 = arith.constant 8 : i32
%606 = arith.extsi %605 : i32 to i64
%602 = func.call @calloc(%604, %606) : (i64, i64) -> !llvm.ptr
%607 = llvm.mlir.constant(1 : i64) : i64
%608 = llvm.alloca %607 x !llvm.ptr : (i64) -> !llvm.ptr
llvm.store %602, %608 : !llvm.ptr, !llvm.ptr
%610 = llvm.load %127 : !llvm.ptr -> i32
%611 = arith.extsi %610 : i32 to i64
%612 = arith.constant 8 : i32
%613 = arith.extsi %612 : i32 to i64
%609 = func.call @calloc(%611, %613) : (i64, i64) -> !llvm.ptr
%614 = llvm.mlir.constant(1 : i64) : i64
%615 = llvm.alloca %614 x !llvm.ptr : (i64) -> !llvm.ptr
llvm.store %609, %615 : !llvm.ptr, !llvm.ptr
%617 = llvm.load %127 : !llvm.ptr -> i32
%618 = arith.extsi %617 : i32 to i64
%619 = arith.constant 8 : i32
%620 = arith.extsi %619 : i32 to i64
%616 = func.call @calloc(%618, %620) : (i64, i64) -> !llvm.ptr
%621 = llvm.mlir.constant(1 : i64) : i64
%622 = llvm.alloca %621 x !llvm.ptr : (i64) -> !llvm.ptr
llvm.store %616, %622 : !llvm.ptr, !llvm.ptr
%623 = llvm.load %594 : !llvm.ptr -> !llvm.ptr
%624 = llvm.mlir.zero : !llvm.ptr
%625 = llvm.icmp "eq" %623, %624 : !llvm.ptr
%626 = scf.if %625 -> (i1) {
%627 = arith.constant true
scf.yield %627 : i1
} else {
%628 = llvm.load %601 : !llvm.ptr -> !llvm.ptr
%629 = llvm.mlir.zero : !llvm.ptr
%630 = llvm.icmp "eq" %628, %629 : !llvm.ptr
scf.yield %630 : i1
}
%631 = scf.if %626 -> (i1) {
%632 = arith.constant true
scf.yield %632 : i1
} else {
%633 = llvm.load %608 : !llvm.ptr -> !llvm.ptr
%634 = llvm.mlir.zero : !llvm.ptr
%635 = llvm.icmp "eq" %633, %634 : !llvm.ptr
scf.yield %635 : i1
}
%636 = scf.if %631 -> (i1) {
%637 = arith.constant true
scf.yield %637 : i1
} else {
%638 = llvm.load %615 : !llvm.ptr -> !llvm.ptr
%639 = llvm.mlir.zero : !llvm.ptr
%640 = llvm.icmp "eq" %638, %639 : !llvm.ptr
scf.yield %640 : i1
}
%641 = scf.if %636 -> (i1) {
%642 = arith.constant true
scf.yield %642 : i1
} else {
%643 = llvm.load %622 : !llvm.ptr -> !llvm.ptr
%644 = llvm.mlir.zero : !llvm.ptr
%645 = llvm.icmp "eq" %643, %644 : !llvm.ptr
scf.yield %645 : i1
}
cf.cond_br %641, ^bb54, ^bb55
^bb54:
%646 = arith.constant 1 : i32
func.return %646 : i32
^bb55:
cf.br ^bb56
^bb56:
%648 = arith.constant 1 : i32
%649 = arith.constant 64 : i32
%650 = arith.muli %648, %649 : i32
%651 = arith.constant 0 : i32
%652 = arith.constant 16 : i32
%653 = arith.muli %651, %652 : i32
%654 = arith.addi %650, %653 : i32
%655 = arith.constant 0 : i32
%656 = arith.constant 4 : i32
%657 = arith.muli %655, %656 : i32
%658 = arith.addi %654, %657 : i32
%659 = arith.constant 0 : i32
%660 = arith.addi %658, %659 : i32
%661 = arith.extsi %660 : i32 to i64
%662 = llvm.getelementptr %26[%661] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%647 = llvm.load %662 : !llvm.ptr -> i32
%663 = arith.constant 1 : i32
%664 = llvm.load %594 : !llvm.ptr -> !llvm.ptr
%665 = arith.extsi %663 : i32 to i64
%666 = arith.extsi %647 : i32 to i64
%667 = llvm.getelementptr %664[%666] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %665, %667 : i64, !llvm.ptr
%668 = arith.constant 0 : i32
%669 = llvm.mlir.constant(1 : i64) : i64
%670 = llvm.alloca %669 x i32 : (i64) -> !llvm.ptr
llvm.store %668, %670 : i32, !llvm.ptr
cf.br ^bb57
^bb57:
%671 = llvm.load %670 : !llvm.ptr -> i32
%672 = arith.cmpi sle, %671, %578 : i32
cf.cond_br %672, ^bb58, ^bb59
^bb58:
%673 = llvm.load %594 : !llvm.ptr -> !llvm.ptr
%674 = arith.constant 0 : i32
%675 = llvm.mlir.constant(1 : i64) : i64
%676 = llvm.alloca %675 x i32 : (i64) -> !llvm.ptr
llvm.store %674, %676 : i32, !llvm.ptr
cf.br ^bb60
^bb60:
%677 = llvm.load %676 : !llvm.ptr -> i32
%678 = llvm.load %127 : !llvm.ptr -> i32
%679 = arith.cmpi slt, %677, %678 : i32
cf.cond_br %679, ^bb61, ^bb62
^bb61:
%681 = llvm.load %676 : !llvm.ptr -> i32
%682 = arith.extsi %681 : i32 to i64
%683 = llvm.getelementptr %73[%682] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%680 = llvm.load %683 : !llvm.ptr -> i32
%685 = arith.extsi %680 : i32 to i64
%686 = llvm.getelementptr %673[%685] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%684 = llvm.load %686 : !llvm.ptr -> i64
%687 = arith.constant 0 : i32
%689 = arith.extsi %687 : i32 to i64
%688 = arith.cmpi eq, %684, %689 : i64
cf.cond_br %688, ^bb63, ^bb64
^bb63:
%690 = llvm.load %676 : !llvm.ptr -> i32
%691 = arith.constant 1 : i32
%692 = arith.addi %690, %691 : i32
llvm.store %692, %676 : i32, !llvm.ptr
cf.br ^bb60
^bb64:
cf.br ^bb65
^bb65:
%693 = arith.constant 0 : i32
%694 = llvm.mlir.constant(1 : i64) : i64
%695 = llvm.alloca %694 x i32 : (i64) -> !llvm.ptr
llvm.store %693, %695 : i32, !llvm.ptr
cf.br ^bb66
^bb66:
%696 = llvm.load %695 : !llvm.ptr -> i32
%698 = arith.extsi %680 : i32 to i64
%699 = llvm.getelementptr %67[%698] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%697 = llvm.load %699 : !llvm.ptr -> i32
%700 = arith.cmpi slt, %696, %697 : i32
cf.cond_br %700, ^bb67, ^bb68
^bb67:
%701 = llvm.load %670 : !llvm.ptr -> i32
%703 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%704 = llvm.load %703 : !llvm.ptr -> i32
%705 = arith.muli %680, %704 : i32
%706 = llvm.load %695 : !llvm.ptr -> i32
%707 = arith.addi %705, %706 : i32
%708 = arith.extsi %707 : i32 to i64
%709 = llvm.getelementptr %57[%708] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%702 = llvm.load %709 : !llvm.ptr -> i32
%710 = arith.addi %701, %702 : i32
%711 = arith.cmpi sle, %710, %578 : i32
cf.cond_br %711, ^bb69, ^bb70
^bb69:
%713 = arith.extsi %710 : i32 to i64
%714 = llvm.getelementptr %579[%713] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%712 = llvm.load %714 : !llvm.ptr -> i64
%715 = arith.addi %712, %684 : i64
%716 = llvm.mlir.addressof @MOD : !llvm.ptr
%717 = llvm.load %716 : !llvm.ptr -> i64
%718 = arith.remsi %715, %717 : i64
%719 = arith.extsi %710 : i32 to i64
%720 = llvm.getelementptr %579[%719] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %718, %720 : i64, !llvm.ptr
cf.br ^bb71
^bb70:
cf.br ^bb71
^bb71:
%721 = llvm.load %695 : !llvm.ptr -> i32
%722 = arith.constant 1 : i32
%723 = arith.addi %721, %722 : i32
llvm.store %723, %695 : i32, !llvm.ptr
cf.br ^bb66
^bb68:
%724 = arith.constant 0 : i32
%725 = llvm.mlir.constant(1 : i64) : i64
%726 = llvm.alloca %725 x i32 : (i64) -> !llvm.ptr
llvm.store %724, %726 : i32, !llvm.ptr
cf.br ^bb72
^bb72:
%727 = llvm.load %726 : !llvm.ptr -> i32
%729 = arith.extsi %680 : i32 to i64
%730 = llvm.getelementptr %51[%729] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%728 = llvm.load %730 : !llvm.ptr -> i32
%731 = arith.cmpi slt, %727, %728 : i32
cf.cond_br %731, ^bb73, ^bb74
^bb73:
%733 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%734 = llvm.load %733 : !llvm.ptr -> i32
%735 = arith.muli %680, %734 : i32
%736 = llvm.load %726 : !llvm.ptr -> i32
%737 = arith.addi %735, %736 : i32
%738 = arith.extsi %737 : i32 to i64
%739 = llvm.getelementptr %31[%738] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%732 = llvm.load %739 : !llvm.ptr -> i32
%741 = llvm.mlir.addressof @MAXTRANS : !llvm.ptr
%742 = llvm.load %741 : !llvm.ptr -> i32
%743 = arith.muli %680, %742 : i32
%744 = llvm.load %726 : !llvm.ptr -> i32
%745 = arith.addi %743, %744 : i32
%746 = arith.extsi %745 : i32 to i64
%747 = llvm.getelementptr %41[%746] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%740 = llvm.load %747 : !llvm.ptr -> i32
%748 = llvm.load %670 : !llvm.ptr -> i32
%749 = arith.addi %748, %740 : i32
%750 = arith.cmpi sgt, %749, %578 : i32
cf.cond_br %750, ^bb75, ^bb76
^bb75:
%751 = llvm.load %726 : !llvm.ptr -> i32
%752 = arith.constant 1 : i32
%753 = arith.addi %751, %752 : i32
llvm.store %753, %726 : i32, !llvm.ptr
cf.br ^bb72
^bb76:
cf.br ^bb77
^bb77:
%754 = arith.constant 0 : i32
%755 = arith.cmpi eq, %740, %754 : i32
cf.cond_br %755, ^bb78, ^bb79
^bb78:
%757 = arith.extsi %732 : i32 to i64
%758 = llvm.getelementptr %673[%757] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%756 = llvm.load %758 : !llvm.ptr -> i64
%759 = arith.addi %756, %684 : i64
%760 = llvm.mlir.addressof @MOD : !llvm.ptr
%761 = llvm.load %760 : !llvm.ptr -> i64
%762 = arith.remsi %759, %761 : i64
%763 = arith.extsi %732 : i32 to i64
%764 = llvm.getelementptr %673[%763] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %762, %764 : i64, !llvm.ptr
cf.br ^bb80
^bb79:
%765 = arith.constant 1 : i32
%766 = arith.cmpi eq, %740, %765 : i32
cf.cond_br %766, ^bb81, ^bb82
^bb81:
%768 = llvm.load %601 : !llvm.ptr -> !llvm.ptr
%769 = arith.extsi %732 : i32 to i64
%770 = llvm.getelementptr %768[%769] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%767 = llvm.load %770 : !llvm.ptr -> i64
%771 = arith.addi %767, %684 : i64
%772 = llvm.mlir.addressof @MOD : !llvm.ptr
%773 = llvm.load %772 : !llvm.ptr -> i64
%774 = arith.remsi %771, %773 : i64
%775 = llvm.load %601 : !llvm.ptr -> !llvm.ptr
%776 = arith.extsi %732 : i32 to i64
%777 = llvm.getelementptr %775[%776] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %774, %777 : i64, !llvm.ptr
cf.br ^bb83
^bb82:
cf.br ^bb83
^bb83:
%778 = arith.constant 2 : i32
%779 = arith.cmpi eq, %740, %778 : i32
cf.cond_br %779, ^bb84, ^bb85
^bb84:
%781 = llvm.load %608 : !llvm.ptr -> !llvm.ptr
%782 = arith.extsi %732 : i32 to i64
%783 = llvm.getelementptr %781[%782] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%780 = llvm.load %783 : !llvm.ptr -> i64
%784 = arith.addi %780, %684 : i64
%785 = llvm.mlir.addressof @MOD : !llvm.ptr
%786 = llvm.load %785 : !llvm.ptr -> i64
%787 = arith.remsi %784, %786 : i64
%788 = llvm.load %608 : !llvm.ptr -> !llvm.ptr
%789 = arith.extsi %732 : i32 to i64
%790 = llvm.getelementptr %788[%789] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %787, %790 : i64, !llvm.ptr
cf.br ^bb86
^bb85:
cf.br ^bb86
^bb86:
%791 = arith.constant 3 : i32
%792 = arith.cmpi eq, %740, %791 : i32
cf.cond_br %792, ^bb87, ^bb88
^bb87:
%794 = llvm.load %615 : !llvm.ptr -> !llvm.ptr
%795 = arith.extsi %732 : i32 to i64
%796 = llvm.getelementptr %794[%795] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%793 = llvm.load %796 : !llvm.ptr -> i64
%797 = arith.addi %793, %684 : i64
%798 = llvm.mlir.addressof @MOD : !llvm.ptr
%799 = llvm.load %798 : !llvm.ptr -> i64
%800 = arith.remsi %797, %799 : i64
%801 = llvm.load %615 : !llvm.ptr -> !llvm.ptr
%802 = arith.extsi %732 : i32 to i64
%803 = llvm.getelementptr %801[%802] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %800, %803 : i64, !llvm.ptr
cf.br ^bb89
^bb88:
cf.br ^bb89
^bb89:
%804 = arith.constant 4 : i32
%805 = arith.cmpi eq, %740, %804 : i32
cf.cond_br %805, ^bb90, ^bb91
^bb90:
%807 = llvm.load %622 : !llvm.ptr -> !llvm.ptr
%808 = arith.extsi %732 : i32 to i64
%809 = llvm.getelementptr %807[%808] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%806 = llvm.load %809 : !llvm.ptr -> i64
%810 = arith.addi %806, %684 : i64
%811 = llvm.mlir.addressof @MOD : !llvm.ptr
%812 = llvm.load %811 : !llvm.ptr -> i64
%813 = arith.remsi %810, %812 : i64
%814 = llvm.load %622 : !llvm.ptr -> !llvm.ptr
%815 = arith.extsi %732 : i32 to i64
%816 = llvm.getelementptr %814[%815] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %813, %816 : i64, !llvm.ptr
cf.br ^bb92
^bb91:
cf.br ^bb92
^bb92:
cf.br ^bb80
^bb80:
%817 = llvm.load %726 : !llvm.ptr -> i32
%818 = arith.constant 1 : i32
%819 = arith.addi %817, %818 : i32
llvm.store %819, %726 : i32, !llvm.ptr
cf.br ^bb72
^bb74:
%820 = llvm.load %676 : !llvm.ptr -> i32
%821 = arith.constant 1 : i32
%822 = arith.addi %820, %821 : i32
llvm.store %822, %676 : i32, !llvm.ptr
cf.br ^bb60
^bb62:
%824 = llvm.load %594 : !llvm.ptr -> !llvm.ptr
func.call @free(%824) : (!llvm.ptr) -> ()
%825 = llvm.load %601 : !llvm.ptr -> !llvm.ptr
llvm.store %825, %594 : !llvm.ptr, !llvm.ptr
%826 = llvm.load %608 : !llvm.ptr -> !llvm.ptr
llvm.store %826, %601 : !llvm.ptr, !llvm.ptr
%827 = llvm.load %615 : !llvm.ptr -> !llvm.ptr
llvm.store %827, %608 : !llvm.ptr, !llvm.ptr
%828 = llvm.load %622 : !llvm.ptr -> !llvm.ptr
llvm.store %828, %615 : !llvm.ptr, !llvm.ptr
%830 = llvm.load %127 : !llvm.ptr -> i32
%831 = arith.extsi %830 : i32 to i64
%832 = arith.constant 8 : i32
%833 = arith.extsi %832 : i32 to i64
%829 = func.call @calloc(%831, %833) : (i64, i64) -> !llvm.ptr
llvm.store %829, %622 : !llvm.ptr, !llvm.ptr
%834 = llvm.load %622 : !llvm.ptr -> !llvm.ptr
%835 = llvm.mlir.zero : !llvm.ptr
%836 = llvm.icmp "eq" %834, %835 : !llvm.ptr
cf.cond_br %836, ^bb93, ^bb94
^bb93:
%837 = arith.constant 1 : i32
func.return %837 : i32
^bb94:
cf.br ^bb95
^bb95:
%838 = llvm.load %670 : !llvm.ptr -> i32
%839 = arith.constant 1 : i32
%840 = arith.addi %838, %839 : i32
llvm.store %840, %670 : i32, !llvm.ptr
cf.br ^bb57
^bb59:
%841 = llvm.mlir.addressof @str_0 : !llvm.ptr
%843 = arith.constant 1 : i32
%844 = arith.addi %576, %843 : i32
%845 = arith.extsi %844 : i32 to i64
%846 = llvm.getelementptr %579[%845] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%842 = llvm.load %846 : !llvm.ptr -> i64
%847 = llvm.mlir.addressof @MOD : !llvm.ptr
%848 = llvm.load %847 : !llvm.ptr -> i64
%849 = arith.remsi %842, %848 : i64
%850 = llvm.call @printf(%841, %849) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
func.call @free(%17) : (!llvm.ptr) -> ()
func.call @free(%26) : (!llvm.ptr) -> ()
func.call @free(%31) : (!llvm.ptr) -> ()
func.call @free(%41) : (!llvm.ptr) -> ()
func.call @free(%51) : (!llvm.ptr) -> ()
func.call @free(%57) : (!llvm.ptr) -> ()
func.call @free(%67) : (!llvm.ptr) -> ()
func.call @free(%73) : (!llvm.ptr) -> ()
func.call @free(%579) : (!llvm.ptr) -> ()
%861 = llvm.load %622 : !llvm.ptr -> !llvm.ptr
func.call @free(%861) : (!llvm.ptr) -> ()
%862 = arith.constant 0 : i32
func.return %862 : i32
}
}