← All problems
Problem 355
Maximal coprime subset sum Co(200000) via min-cost max-flow matching.
View problem on Project Euler
Performance comparison
Metric Our solution Best known
Time complexity O(n^3)O(n * sum)
Space complexity O(n^2)O(sum)
Approach Flow solution Subset sum DP
Verdict Unknown
Flow source
# Project Euler 355
# Maximal coprime subset sum Co(200000) via min-cost max-flow matching.
import euler.nt { isqrt }
extern {
function calloc(n: i64, size: i64) -> ptr<void>
function free(p: ptr<void>) -> void
}
function main() -> i32 {
let N: i64 = 200000
let sieve: ptr<i8> = calloc(N + 1, 1)
let primes: ptr<i32> = calloc(N / 5 + 10, 4)
let mut pc: i64 = 0
sieve[0] = 1
sieve[1] = 1
let mut i: i64 = 2
while i <= N {
if sieve[i] == 0 {
primes[pc] = i as i32
pc = pc + 1
let mut j: i64 = i * i
while j <= N {
sieve[j] = 1
j = j + i
}
}
i = i + 1
}
let vpow: ptr<i32> = calloc(N + 1, 4)
let mut baseline: i64 = 1
let mut pi: i64 = 0
while pi < pc {
let p: i64 = primes[pi] as i64
let mut x: i64 = p
while x * p <= N { x = x * p }
vpow[p] = x as i32
baseline = baseline + x
pi = pi + 1
}
let sq: i64 = isqrt(N)
let small: ptr<i32> = calloc(pc, 4)
let big: ptr<i32> = calloc(pc, 4)
let mut sc: i64 = 0
let mut bc: i64 = 0
pi = 0
while pi < pc {
let p: i64 = primes[pi] as i64
if p <= sq {
small[sc] = p as i32
sc = sc + 1
} elif p <= N / 2 {
big[bc] = p as i32
bc = bc + 1
}
pi = pi + 1
}
if sc == 0 || bc == 0 {
printf("%lld\n", baseline)
return 0
}
# Precompute power lists for small primes
let spow_start: ptr<i32> = calloc(sc + 1, 4)
let spow_vals: ptr<i32> = calloc(sc * 20, 4)
let mut spow_n: i64 = 0
let mut si: i64 = 0
while si < sc {
spow_start[si] = spow_n as i32
let p: i64 = small[si] as i64
let mut x: i64 = p
while true {
spow_vals[spow_n] = x as i32
spow_n = spow_n + 1
if x > N / p { break }
x = x * p
}
si = si + 1
}
spow_start[sc] = spow_n as i32
# Collect positive-gain edges
let e_i: ptr<i32> = calloc(sc * bc + 1, 4)
let e_j: ptr<i32> = calloc(sc * bc + 1, 4)
let e_g: ptr<i32> = calloc(sc * bc + 1, 4)
let mut ec: i64 = 0
let mut max_gain: i64 = 0
let mut j: i64 = 0
while j < bc {
let q: i64 = big[j] as i64
let limit: i64 = N / q
si = 0
while si < sc {
let p: i64 = small[si] as i64
if p > limit { break }
let a0: i64 = spow_start[si] as i64
let a1: i64 = spow_start[si + 1] as i64
let mut pa: i64 = spow_vals[a1 - 1] as i64
if pa > limit {
let mut t: i64 = a1 - 1
while t >= a0 {
let val: i64 = spow_vals[t] as i64
if val <= limit {
pa = val
break
}
t = t - 1
}
}
let m: i64 = pa * q
let gain: i64 = m - (vpow[p] as i64) - q
if gain > 0 {
e_i[ec] = si as i32
e_j[ec] = j as i32
e_g[ec] = gain as i32
ec = ec + 1
if gain > max_gain { max_gain = gain }
}
si = si + 1
}
j = j + 1
}
if max_gain == 0 {
printf("%lld\n", baseline)
return 0
}
let C: i64 = max_gain
# Nodes: 0=SRC, 1..sc=small, sc+1..sc+bc=big, sc+bc+1=SNK
let SRC: i64 = 0
let off_s: i64 = 1
let off_b: i64 = off_s + sc
let SNK: i64 = off_b + bc
let nn: i64 = SNK + 1
# Edges: each logical edge makes 2 directed. Estimate capacity.
let max_edges: i64 = (sc * 2 + bc + ec) * 2 + 10
let eto: ptr<i32> = calloc(max_edges, 4)
let ecap: ptr<i32> = calloc(max_edges, 4)
let ecost: ptr<i32> = calloc(max_edges, 4)
let erev: ptr<i32> = calloc(max_edges, 4)
let enext: ptr<i32> = calloc(max_edges, 4)
let head: ptr<i32> = calloc(nn, 4)
let mut ei: i64 = 0
let mut u: i64 = 0
while u < nn {
head[u] = -1
u = u + 1
}
# helper via inline add
# add_edge fr -> dst
# We'll add in a loop below.
si = 0
while si < sc {
# SRC -> small
let fr: i64 = SRC
let dst: i64 = off_s + si
eto[ei] = dst as i32; ecap[ei] = 1; ecost[ei] = 0; erev[ei] = (ei + 1) as i32; enext[ei] = head[fr]; head[fr] = ei as i32; ei = ei + 1
eto[ei] = fr as i32; ecap[ei] = 0; ecost[ei] = 0; erev[ei] = (ei - 1) as i32; enext[ei] = head[dst]; head[dst] = ei as i32; ei = ei + 1
# small -> SNK cost C
let fr2: i64 = dst
let dst2: i64 = SNK
eto[ei] = dst2 as i32; ecap[ei] = 1; ecost[ei] = C as i32; erev[ei] = (ei + 1) as i32; enext[ei] = head[fr2]; head[fr2] = ei as i32; ei = ei + 1
eto[ei] = fr2 as i32; ecap[ei] = 0; ecost[ei] = (0 - C) as i32; erev[ei] = (ei - 1) as i32; enext[ei] = head[dst2]; head[dst2] = ei as i32; ei = ei + 1
si = si + 1
}
j = 0
while j < bc {
let fr: i64 = off_b + j
let dst: i64 = SNK
eto[ei] = dst as i32; ecap[ei] = 1; ecost[ei] = 0; erev[ei] = (ei + 1) as i32; enext[ei] = head[fr]; head[fr] = ei as i32; ei = ei + 1
eto[ei] = fr as i32; ecap[ei] = 0; ecost[ei] = 0; erev[ei] = (ei - 1) as i32; enext[ei] = head[dst]; head[dst] = ei as i32; ei = ei + 1
j = j + 1
}
let mut e: i64 = 0
while e < ec {
let fr: i64 = off_s + (e_i[e] as i64)
let dst: i64 = off_b + (e_j[e] as i64)
let cost: i64 = C - (e_g[e] as i64)
eto[ei] = dst as i32; ecap[ei] = 1; ecost[ei] = cost as i32; erev[ei] = (ei + 1) as i32; enext[ei] = head[fr]; head[fr] = ei as i32; ei = ei + 1
eto[ei] = fr as i32; ecap[ei] = 0; ecost[ei] = (0 - cost) as i32; erev[ei] = (ei - 1) as i32; enext[ei] = head[dst]; head[dst] = ei as i32; ei = ei + 1
e = e + 1
}
let pot: ptr<i64> = calloc(nn, 8)
let dist: ptr<i64> = calloc(nn, 8)
let prev_v: ptr<i32> = calloc(nn, 4)
let prev_e: ptr<i32> = calloc(nn, 4)
let heap_d: ptr<i64> = calloc(nn * 4, 8)
let heap_v: ptr<i32> = calloc(nn * 4, 4)
let INF: i64 = 1000000000000000
let mut flow: i64 = 0
let mut cost_total: i64 = 0
let need: i64 = sc
while flow < need {
u = 0
while u < nn {
dist[u] = INF
u = u + 1
}
dist[SRC] = 0
heap_d[0] = 0
heap_v[0] = SRC as i32
let mut hs: i64 = 1
while hs > 0 {
let dcur: i64 = heap_d[0]
let v: i64 = heap_v[0] as i64
hs = hs - 1
if hs > 0 {
heap_d[0] = heap_d[hs]
heap_v[0] = heap_v[hs]
let mut idx: i64 = 0
while true {
let l: i64 = 2 * idx + 1
let r: i64 = l + 1
let mut smallest: i64 = idx
if l < hs && heap_d[l] < heap_d[smallest] { smallest = l }
if r < hs && heap_d[r] < heap_d[smallest] { smallest = r }
if smallest == idx { break }
let td: i64 = heap_d[idx]
let tv: i32 = heap_v[idx]
heap_d[idx] = heap_d[smallest]
heap_v[idx] = heap_v[smallest]
heap_d[smallest] = td
heap_v[smallest] = tv
idx = smallest
}
}
if dcur != dist[v] { continue }
let mut ed: i32 = head[v]
while ed != -1 {
if ecap[ed] > 0 {
let w: i64 = eto[ed] as i64
let nd: i64 = dcur + (ecost[ed] as i64) + pot[v] - pot[w]
if nd < dist[w] {
dist[w] = nd
prev_v[w] = v as i32
prev_e[w] = ed
# push
let mut idx: i64 = hs
heap_d[idx] = nd
heap_v[idx] = w as i32
hs = hs + 1
while idx > 0 {
let par: i64 = (idx - 1) / 2
if heap_d[par] <= heap_d[idx] { break }
let td: i64 = heap_d[par]
let tv: i32 = heap_v[par]
heap_d[par] = heap_d[idx]
heap_v[par] = heap_v[idx]
heap_d[idx] = td
heap_v[idx] = tv
idx = par
}
}
}
ed = enext[ed]
}
}
if dist[SNK] >= INF { break }
u = 0
while u < nn {
if dist[u] < INF { pot[u] = pot[u] + dist[u] }
u = u + 1
}
let mut add: i64 = need - flow
let mut v: i64 = SNK
while v != SRC {
let pv: i64 = prev_v[v] as i64
let pe: i64 = prev_e[v] as i64
if (ecap[pe] as i64) < add { add = ecap[pe] as i64 }
v = pv
}
v = SNK
while v != SRC {
let pv: i64 = prev_v[v] as i64
let pe: i64 = prev_e[v] as i64
ecap[pe] = (ecap[pe] as i64 - add) as i32
let rv: i64 = erev[pe] as i64
ecap[rv] = (ecap[rv] as i64 + add) as i32
cost_total = cost_total + add * (ecost[pe] as i64)
v = pv
}
flow = flow + add
}
let total_gain: i64 = C * sc - cost_total
printf("%lld\n", baseline + total_gain)
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; }
int64_t gcd_i64_i64(int64_t a0, int64_t b0);
int64_t lcm_i64_i64(int64_t a, int64_t b);
int64_t isqrt_i64(int64_t n);
int64_t mulmod_i64_i64_i64(int64_t a0, int64_t b0, int64_t mod);
int64_t mod_pow_i64_i64_i64(int64_t base, int64_t exp, int64_t mod);
bool is_prime_i64(int64_t n);
int32_t main(void);
int64_t gcd_i64_i64(int64_t a0, int64_t b0) {
int64_t a = a0;
int64_t b = b0;
while (b != 0) {
int64_t t = FLOW_CHECKED_MOD((a), (b));
a = b;
b = t;
}
return a;
}
int64_t lcm_i64_i64(int64_t a, int64_t b) {
if ((a == 0 || b == 0)) {
return 0;
}
return (FLOW_CHECKED_DIV((a), (gcd_i64_i64(a, b))) * b);
}
int64_t isqrt_i64(int64_t n) {
if (n < 2) {
return n;
}
int64_t x = n;
int64_t y = FLOW_CHECKED_DIV(((x + 1)), (2));
while (y < x) {
x = y;
y = FLOW_CHECKED_DIV(((x + FLOW_CHECKED_DIV((n), (x)))), (2));
}
return x;
}
int64_t mulmod_i64_i64_i64(int64_t a0, int64_t b0, int64_t mod) {
int64_t a = FLOW_CHECKED_MOD((a0), (mod));
int64_t b = FLOW_CHECKED_MOD((b0), (mod));
int64_t result = 0;
while (b > 0) {
if (FLOW_CHECKED_MOD((b), (2)) == 1) {
result = FLOW_CHECKED_MOD(((result + a)), (mod));
}
a = FLOW_CHECKED_MOD(((a * 2)), (mod));
b = FLOW_CHECKED_DIV((b), (2));
}
return result;
}
int64_t mod_pow_i64_i64_i64(int64_t base, int64_t exp, int64_t mod) {
if (mod == 1) {
return 0;
}
int64_t result = 1;
int64_t b = FLOW_CHECKED_MOD((base), (mod));
int64_t e = exp;
while (e > 0) {
if (FLOW_CHECKED_MOD((e), (2)) == 1) {
result = mulmod_i64_i64_i64(result, b, mod);
}
b = mulmod_i64_i64_i64(b, b, mod);
e = FLOW_CHECKED_DIV((e), (2));
}
return result;
}
bool is_prime_i64(int64_t n) {
if (n < 2) {
return 0;
}
if (n < 4) {
return 1;
}
if ((FLOW_CHECKED_MOD((n), (2)) == 0 || FLOW_CHECKED_MOD((n), (3)) == 0)) {
return 0;
}
int64_t i = 5;
while ((i * i) <= n) {
if ((FLOW_CHECKED_MOD((n), (i)) == 0 || FLOW_CHECKED_MOD((n), ((i + 2))) == 0)) {
return 0;
}
i = (i + 6);
}
return 1;
}
int32_t main(void) {
int64_t N = 200000;
int8_t* sieve = (int8_t*)(calloc((N + 1), 1));
int32_t* primes = (int32_t*)(calloc((FLOW_CHECKED_DIV((N), (5)) + 10), 4));
int64_t pc = 0;
sieve[0] = 1;
sieve[1] = 1;
int64_t i = 2;
while (i <= N) {
if (sieve[i] == 0) {
primes[pc] = ((int32_t)(i));
pc = (pc + 1);
int64_t j = (i * i);
while (j <= N) {
sieve[j] = 1;
j = (j + i);
}
}
i = (i + 1);
}
int32_t* vpow = (int32_t*)(calloc((N + 1), 4));
int64_t baseline = 1;
int64_t pi = 0;
while (pi < pc) {
int64_t p = ((int64_t)(primes[pi]));
int64_t x = p;
while ((x * p) <= N) {
x = (x * p);
}
vpow[p] = ((int32_t)(x));
baseline = (baseline + x);
pi = (pi + 1);
}
int64_t sq = isqrt_i64(N);
int32_t* small = (int32_t*)(calloc(pc, 4));
int32_t* big = (int32_t*)(calloc(pc, 4));
int64_t sc = 0;
int64_t bc = 0;
pi = 0;
while (pi < pc) {
int64_t p = ((int64_t)(primes[pi]));
if (p <= sq) {
small[sc] = ((int32_t)(p));
sc = (sc + 1);
} else if (p <= FLOW_CHECKED_DIV((N), (2))) {
big[bc] = ((int32_t)(p));
bc = (bc + 1);
}
pi = (pi + 1);
}
if ((sc == 0 || bc == 0)) {
printf("%lld\n", baseline);
return 0;
}
int32_t* spow_start = (int32_t*)(calloc((sc + 1), 4));
int32_t* spow_vals = (int32_t*)(calloc((sc * 20), 4));
int64_t spow_n = 0;
int64_t si = 0;
while (si < sc) {
spow_start[si] = ((int32_t)(spow_n));
int64_t p = ((int64_t)(small[si]));
int64_t x = p;
while (1) {
spow_vals[spow_n] = ((int32_t)(x));
spow_n = (spow_n + 1);
if (x > FLOW_CHECKED_DIV((N), (p))) {
break;
}
x = (x * p);
}
si = (si + 1);
}
spow_start[sc] = ((int32_t)(spow_n));
int32_t* e_i = (int32_t*)(calloc(((sc * bc) + 1), 4));
int32_t* e_j = (int32_t*)(calloc(((sc * bc) + 1), 4));
int32_t* e_g = (int32_t*)(calloc(((sc * bc) + 1), 4));
int64_t ec = 0;
int64_t max_gain = 0;
int64_t j = 0;
while (j < bc) {
int64_t q = ((int64_t)(big[j]));
int64_t limit = FLOW_CHECKED_DIV((N), (q));
si = 0;
while (si < sc) {
int64_t p = ((int64_t)(small[si]));
if (p > limit) {
break;
}
int64_t a0 = ((int64_t)(spow_start[si]));
int64_t a1 = ((int64_t)(spow_start[(si + 1)]));
int64_t pa = ((int64_t)(spow_vals[(a1 - 1)]));
if (pa > limit) {
int64_t t = (a1 - 1);
while (t >= a0) {
int64_t val = ((int64_t)(spow_vals[t]));
if (val <= limit) {
pa = val;
break;
}
t = (t - 1);
}
}
int64_t m = (pa * q);
int64_t gain = ((m - ((int64_t)(vpow[p]))) - q);
if (gain > 0) {
e_i[ec] = ((int32_t)(si));
e_j[ec] = ((int32_t)(j));
e_g[ec] = ((int32_t)(gain));
ec = (ec + 1);
if (gain > max_gain) {
max_gain = gain;
}
}
si = (si + 1);
}
j = (j + 1);
}
if (max_gain == 0) {
printf("%lld\n", baseline);
return 0;
}
int64_t C = max_gain;
int64_t SRC = 0;
int64_t off_s = 1;
int64_t off_b = (off_s + sc);
int64_t SNK = (off_b + bc);
int64_t nn = (SNK + 1);
int64_t max_edges = (((((sc * 2) + bc) + ec) * 2) + 10);
int32_t* eto = (int32_t*)(calloc(max_edges, 4));
int32_t* ecap = (int32_t*)(calloc(max_edges, 4));
int32_t* ecost = (int32_t*)(calloc(max_edges, 4));
int32_t* erev = (int32_t*)(calloc(max_edges, 4));
int32_t* enext = (int32_t*)(calloc(max_edges, 4));
int32_t* head = (int32_t*)(calloc(nn, 4));
int64_t ei = 0;
int64_t u = 0;
while (u < nn) {
head[u] = (-1);
u = (u + 1);
}
si = 0;
while (si < sc) {
int64_t fr = SRC;
int64_t dst = (off_s + si);
eto[ei] = ((int32_t)(dst));
ecap[ei] = 1;
ecost[ei] = 0;
erev[ei] = ((int32_t)((ei + 1)));
enext[ei] = head[fr];
head[fr] = ((int32_t)(ei));
ei = (ei + 1);
eto[ei] = ((int32_t)(fr));
ecap[ei] = 0;
ecost[ei] = 0;
erev[ei] = ((int32_t)((ei - 1)));
enext[ei] = head[dst];
head[dst] = ((int32_t)(ei));
ei = (ei + 1);
int64_t fr2 = dst;
int64_t dst2 = SNK;
eto[ei] = ((int32_t)(dst2));
ecap[ei] = 1;
ecost[ei] = ((int32_t)(C));
erev[ei] = ((int32_t)((ei + 1)));
enext[ei] = head[fr2];
head[fr2] = ((int32_t)(ei));
ei = (ei + 1);
eto[ei] = ((int32_t)(fr2));
ecap[ei] = 0;
ecost[ei] = ((int32_t)((0 - C)));
erev[ei] = ((int32_t)((ei - 1)));
enext[ei] = head[dst2];
head[dst2] = ((int32_t)(ei));
ei = (ei + 1);
si = (si + 1);
}
j = 0;
while (j < bc) {
int64_t fr = (off_b + j);
int64_t dst = SNK;
eto[ei] = ((int32_t)(dst));
ecap[ei] = 1;
ecost[ei] = 0;
erev[ei] = ((int32_t)((ei + 1)));
enext[ei] = head[fr];
head[fr] = ((int32_t)(ei));
ei = (ei + 1);
eto[ei] = ((int32_t)(fr));
ecap[ei] = 0;
ecost[ei] = 0;
erev[ei] = ((int32_t)((ei - 1)));
enext[ei] = head[dst];
head[dst] = ((int32_t)(ei));
ei = (ei + 1);
j = (j + 1);
}
int64_t e = 0;
while (e < ec) {
int64_t fr = (off_s + ((int64_t)(e_i[e])));
int64_t dst = (off_b + ((int64_t)(e_j[e])));
int64_t cost = (C - ((int64_t)(e_g[e])));
eto[ei] = ((int32_t)(dst));
ecap[ei] = 1;
ecost[ei] = ((int32_t)(cost));
erev[ei] = ((int32_t)((ei + 1)));
enext[ei] = head[fr];
head[fr] = ((int32_t)(ei));
ei = (ei + 1);
eto[ei] = ((int32_t)(fr));
ecap[ei] = 0;
ecost[ei] = ((int32_t)((0 - cost)));
erev[ei] = ((int32_t)((ei - 1)));
enext[ei] = head[dst];
head[dst] = ((int32_t)(ei));
ei = (ei + 1);
e = (e + 1);
}
int64_t* pot = (int64_t*)(calloc(nn, 8));
int64_t* dist = (int64_t*)(calloc(nn, 8));
int32_t* prev_v = (int32_t*)(calloc(nn, 4));
int32_t* prev_e = (int32_t*)(calloc(nn, 4));
int64_t* heap_d = (int64_t*)(calloc((nn * 4), 8));
int32_t* heap_v = (int32_t*)(calloc((nn * 4), 4));
int64_t INF = 1000000000000000;
int64_t flow = 0;
int64_t cost_total = 0;
int64_t need = sc;
while (flow < need) {
u = 0;
while (u < nn) {
dist[u] = INF;
u = (u + 1);
}
dist[SRC] = 0;
heap_d[0] = 0;
heap_v[0] = ((int32_t)(SRC));
int64_t hs = 1;
while (hs > 0) {
int64_t dcur = heap_d[0];
int64_t v = ((int64_t)(heap_v[0]));
hs = (hs - 1);
if (hs > 0) {
heap_d[0] = heap_d[hs];
heap_v[0] = heap_v[hs];
int64_t idx = 0;
while (1) {
int64_t l = ((2 * idx) + 1);
int64_t r = (l + 1);
int64_t smallest = idx;
if ((l < hs && heap_d[l] < heap_d[smallest])) {
smallest = l;
}
if ((r < hs && heap_d[r] < heap_d[smallest])) {
smallest = r;
}
if (smallest == idx) {
break;
}
int64_t td = heap_d[idx];
int32_t tv = heap_v[idx];
heap_d[idx] = heap_d[smallest];
heap_v[idx] = heap_v[smallest];
heap_d[smallest] = td;
heap_v[smallest] = tv;
idx = smallest;
}
}
if (dcur != dist[v]) {
continue;
}
int32_t ed = head[v];
while (ed != (-1)) {
if (ecap[ed] > 0) {
int64_t w = ((int64_t)(eto[ed]));
int64_t nd = (((dcur + ((int64_t)(ecost[ed]))) + pot[v]) - pot[w]);
if (nd < dist[w]) {
dist[w] = nd;
prev_v[w] = ((int32_t)(v));
prev_e[w] = ed;
int64_t idx = hs;
heap_d[idx] = nd;
heap_v[idx] = ((int32_t)(w));
hs = (hs + 1);
while (idx > 0) {
int64_t par = FLOW_CHECKED_DIV(((idx - 1)), (2));
if (heap_d[par] <= heap_d[idx]) {
break;
}
int64_t td = heap_d[par];
int32_t tv = heap_v[par];
heap_d[par] = heap_d[idx];
heap_v[par] = heap_v[idx];
heap_d[idx] = td;
heap_v[idx] = tv;
idx = par;
}
}
}
ed = enext[ed];
}
}
if (dist[SNK] >= INF) {
break;
}
u = 0;
while (u < nn) {
if (dist[u] < INF) {
pot[u] = (pot[u] + dist[u]);
}
u = (u + 1);
}
int64_t add = (need - flow);
int64_t v = SNK;
while (v != SRC) {
int64_t pv = ((int64_t)(prev_v[v]));
int64_t pe = ((int64_t)(prev_e[v]));
if (((int64_t)(ecap[pe])) < add) {
add = ((int64_t)(ecap[pe]));
}
v = pv;
}
v = SNK;
while (v != SRC) {
int64_t pv = ((int64_t)(prev_v[v]));
int64_t pe = ((int64_t)(prev_e[v]));
ecap[pe] = ((int32_t)((((int64_t)(ecap[pe])) - add)));
int64_t rv = ((int64_t)(erev[pe]));
ecap[rv] = ((int32_t)((((int64_t)(ecap[rv])) + add)));
cost_total = (cost_total + (add * ((int64_t)(ecost[pe]))));
v = pv;
}
flow = (flow + add);
}
int64_t total_gain = ((C * sc) - cost_total);
printf("%lld\n", (baseline + total_gain));
return 0;
}
Generated MLIR
module {
llvm.func @printf(!llvm.ptr, ...) -> i32
llvm.mlir.global internal constant @str_0("%lld\n\00") {addr_space = 0 : i32} : !llvm.array<6 x i8>
func.func @gcd(%arg0: i64, %arg1: i64) -> i64 {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i64 : (i64) -> !llvm.ptr
llvm.store %arg0, %1 : i64, !llvm.ptr
%2 = llvm.mlir.constant(1 : i64) : i64
%3 = llvm.alloca %2 x i64 : (i64) -> !llvm.ptr
llvm.store %arg1, %3 : i64, !llvm.ptr
cf.br ^bb0
^bb0:
%4 = llvm.load %3 : !llvm.ptr -> i64
%5 = arith.constant 0 : i32
%7 = arith.extsi %5 : i32 to i64
%6 = arith.cmpi ne, %4, %7 : i64
cf.cond_br %6, ^bb1, ^bb2
^bb1:
%8 = llvm.load %1 : !llvm.ptr -> i64
%9 = llvm.load %3 : !llvm.ptr -> i64
%10 = arith.remsi %8, %9 : i64
%11 = llvm.load %3 : !llvm.ptr -> i64
llvm.store %11, %1 : i64, !llvm.ptr
llvm.store %10, %3 : i64, !llvm.ptr
cf.br ^bb0
^bb2:
%12 = llvm.load %1 : !llvm.ptr -> i64
func.return %12 : i64
}
func.func @lcm(%arg0: i64, %arg1: i64) -> i64 {
%13 = arith.constant 0 : i32
%15 = arith.extsi %13 : i32 to i64
%14 = arith.cmpi eq, %arg0, %15 : i64
%16 = scf.if %14 -> (i1) {
%17 = arith.constant true
scf.yield %17 : i1
} else {
%18 = arith.constant 0 : i32
%20 = arith.extsi %18 : i32 to i64
%19 = arith.cmpi eq, %arg1, %20 : i64
scf.yield %19 : i1
}
cf.cond_br %16, ^bb3, ^bb4
^bb3:
%21 = arith.constant 0 : i32
%22 = arith.extsi %21 : i32 to i64
func.return %22 : i64
^bb4:
cf.br ^bb5
^bb5:
%23 = func.call @gcd(%arg0, %arg1) : (i64, i64) -> i64
%24 = arith.divsi %arg0, %23 : i64
%25 = arith.muli %24, %arg1 : i64
func.return %25 : i64
}
func.func @isqrt(%arg0: i64) -> i64 {
%26 = arith.constant 2 : i32
%28 = arith.extsi %26 : i32 to i64
%27 = arith.cmpi slt, %arg0, %28 : i64
cf.cond_br %27, ^bb6, ^bb7
^bb6:
func.return %arg0 : i64
^bb7:
cf.br ^bb8
^bb8:
%29 = llvm.mlir.constant(1 : i64) : i64
%30 = llvm.alloca %29 x i64 : (i64) -> !llvm.ptr
llvm.store %arg0, %30 : i64, !llvm.ptr
%31 = llvm.load %30 : !llvm.ptr -> i64
%32 = arith.constant 1 : i32
%34 = arith.extsi %32 : i32 to i64
%33 = arith.addi %31, %34 : i64
%35 = arith.constant 2 : i32
%37 = arith.extsi %35 : i32 to i64
%36 = arith.divsi %33, %37 : i64
%38 = llvm.mlir.constant(1 : i64) : i64
%39 = llvm.alloca %38 x i64 : (i64) -> !llvm.ptr
llvm.store %36, %39 : i64, !llvm.ptr
cf.br ^bb9
^bb9:
%40 = llvm.load %39 : !llvm.ptr -> i64
%41 = llvm.load %30 : !llvm.ptr -> i64
%42 = arith.cmpi slt, %40, %41 : i64
cf.cond_br %42, ^bb10, ^bb11
^bb10:
%43 = llvm.load %39 : !llvm.ptr -> i64
llvm.store %43, %30 : i64, !llvm.ptr
%44 = llvm.load %30 : !llvm.ptr -> i64
%45 = llvm.load %30 : !llvm.ptr -> i64
%46 = arith.divsi %arg0, %45 : i64
%47 = arith.addi %44, %46 : i64
%48 = arith.constant 2 : i32
%50 = arith.extsi %48 : i32 to i64
%49 = arith.divsi %47, %50 : i64
llvm.store %49, %39 : i64, !llvm.ptr
cf.br ^bb9
^bb11:
%51 = llvm.load %30 : !llvm.ptr -> i64
func.return %51 : i64
}
func.func @mulmod(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
%52 = arith.remsi %arg0, %arg2 : i64
%53 = llvm.mlir.constant(1 : i64) : i64
%54 = llvm.alloca %53 x i64 : (i64) -> !llvm.ptr
llvm.store %52, %54 : i64, !llvm.ptr
%55 = arith.remsi %arg1, %arg2 : i64
%56 = llvm.mlir.constant(1 : i64) : i64
%57 = llvm.alloca %56 x i64 : (i64) -> !llvm.ptr
llvm.store %55, %57 : i64, !llvm.ptr
%58 = arith.constant 0 : i32
%59 = arith.extsi %58 : i32 to i64
%60 = llvm.mlir.constant(1 : i64) : i64
%61 = llvm.alloca %60 x i64 : (i64) -> !llvm.ptr
llvm.store %59, %61 : i64, !llvm.ptr
cf.br ^bb12
^bb12:
%62 = llvm.load %57 : !llvm.ptr -> i64
%63 = arith.constant 0 : i32
%65 = arith.extsi %63 : i32 to i64
%64 = arith.cmpi sgt, %62, %65 : i64
cf.cond_br %64, ^bb13, ^bb14
^bb13:
%66 = llvm.load %57 : !llvm.ptr -> i64
%67 = arith.constant 2 : i32
%69 = arith.extsi %67 : i32 to i64
%68 = arith.remsi %66, %69 : i64
%70 = arith.constant 1 : i32
%72 = arith.extsi %70 : i32 to i64
%71 = arith.cmpi eq, %68, %72 : i64
cf.cond_br %71, ^bb15, ^bb16
^bb15:
%73 = llvm.load %61 : !llvm.ptr -> i64
%74 = llvm.load %54 : !llvm.ptr -> i64
%75 = arith.addi %73, %74 : i64
%76 = arith.remsi %75, %arg2 : i64
llvm.store %76, %61 : i64, !llvm.ptr
cf.br ^bb17
^bb16:
cf.br ^bb17
^bb17:
%77 = llvm.load %54 : !llvm.ptr -> i64
%78 = arith.constant 2 : i32
%80 = arith.extsi %78 : i32 to i64
%79 = arith.muli %77, %80 : i64
%81 = arith.remsi %79, %arg2 : i64
llvm.store %81, %54 : i64, !llvm.ptr
%82 = llvm.load %57 : !llvm.ptr -> i64
%83 = arith.constant 2 : i32
%85 = arith.extsi %83 : i32 to i64
%84 = arith.divsi %82, %85 : i64
llvm.store %84, %57 : i64, !llvm.ptr
cf.br ^bb12
^bb14:
%86 = llvm.load %61 : !llvm.ptr -> i64
func.return %86 : i64
}
func.func @mod_pow(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 {
%87 = arith.constant 1 : i32
%89 = arith.extsi %87 : i32 to i64
%88 = arith.cmpi eq, %arg2, %89 : i64
cf.cond_br %88, ^bb18, ^bb19
^bb18:
%90 = arith.constant 0 : i32
%91 = arith.extsi %90 : i32 to i64
func.return %91 : i64
^bb19:
cf.br ^bb20
^bb20:
%92 = arith.constant 1 : i32
%93 = arith.extsi %92 : i32 to i64
%94 = llvm.mlir.constant(1 : i64) : i64
%95 = llvm.alloca %94 x i64 : (i64) -> !llvm.ptr
llvm.store %93, %95 : i64, !llvm.ptr
%96 = arith.remsi %arg0, %arg2 : i64
%97 = llvm.mlir.constant(1 : i64) : i64
%98 = llvm.alloca %97 x i64 : (i64) -> !llvm.ptr
llvm.store %96, %98 : i64, !llvm.ptr
%99 = llvm.mlir.constant(1 : i64) : i64
%100 = llvm.alloca %99 x i64 : (i64) -> !llvm.ptr
llvm.store %arg1, %100 : i64, !llvm.ptr
cf.br ^bb21
^bb21:
%101 = llvm.load %100 : !llvm.ptr -> i64
%102 = arith.constant 0 : i32
%104 = arith.extsi %102 : i32 to i64
%103 = arith.cmpi sgt, %101, %104 : i64
cf.cond_br %103, ^bb22, ^bb23
^bb22:
%105 = llvm.load %100 : !llvm.ptr -> i64
%106 = arith.constant 2 : i32
%108 = arith.extsi %106 : i32 to i64
%107 = arith.remsi %105, %108 : i64
%109 = arith.constant 1 : i32
%111 = arith.extsi %109 : i32 to i64
%110 = arith.cmpi eq, %107, %111 : i64
cf.cond_br %110, ^bb24, ^bb25
^bb24:
%113 = llvm.load %95 : !llvm.ptr -> i64
%114 = llvm.load %98 : !llvm.ptr -> i64
%112 = func.call @mulmod(%113, %114, %arg2) : (i64, i64, i64) -> i64
llvm.store %112, %95 : i64, !llvm.ptr
cf.br ^bb26
^bb25:
cf.br ^bb26
^bb26:
%116 = llvm.load %98 : !llvm.ptr -> i64
%117 = llvm.load %98 : !llvm.ptr -> i64
%115 = func.call @mulmod(%116, %117, %arg2) : (i64, i64, i64) -> i64
llvm.store %115, %98 : i64, !llvm.ptr
%118 = llvm.load %100 : !llvm.ptr -> i64
%119 = arith.constant 2 : i32
%121 = arith.extsi %119 : i32 to i64
%120 = arith.divsi %118, %121 : i64
llvm.store %120, %100 : i64, !llvm.ptr
cf.br ^bb21
^bb23:
%122 = llvm.load %95 : !llvm.ptr -> i64
func.return %122 : i64
}
func.func @is_prime(%arg0: i64) -> i1 {
%123 = arith.constant 2 : i32
%125 = arith.extsi %123 : i32 to i64
%124 = arith.cmpi slt, %arg0, %125 : i64
cf.cond_br %124, ^bb27, ^bb28
^bb27:
%126 = arith.constant 0 : i1
func.return %126 : i1
^bb28:
cf.br ^bb29
^bb29:
%127 = arith.constant 4 : i32
%129 = arith.extsi %127 : i32 to i64
%128 = arith.cmpi slt, %arg0, %129 : i64
cf.cond_br %128, ^bb30, ^bb31
^bb30:
%130 = arith.constant 1 : i1
func.return %130 : i1
^bb31:
cf.br ^bb32
^bb32:
%131 = arith.constant 2 : i32
%133 = arith.extsi %131 : i32 to i64
%132 = arith.remsi %arg0, %133 : i64
%134 = arith.constant 0 : i32
%136 = arith.extsi %134 : i32 to i64
%135 = arith.cmpi eq, %132, %136 : i64
%137 = scf.if %135 -> (i1) {
%138 = arith.constant true
scf.yield %138 : i1
} else {
%139 = arith.constant 3 : i32
%141 = arith.extsi %139 : i32 to i64
%140 = arith.remsi %arg0, %141 : i64
%142 = arith.constant 0 : i32
%144 = arith.extsi %142 : i32 to i64
%143 = arith.cmpi eq, %140, %144 : i64
scf.yield %143 : i1
}
cf.cond_br %137, ^bb33, ^bb34
^bb33:
%145 = arith.constant 0 : i1
func.return %145 : i1
^bb34:
cf.br ^bb35
^bb35:
%146 = arith.constant 5 : i32
%147 = arith.extsi %146 : i32 to i64
%148 = llvm.mlir.constant(1 : i64) : i64
%149 = llvm.alloca %148 x i64 : (i64) -> !llvm.ptr
llvm.store %147, %149 : i64, !llvm.ptr
cf.br ^bb36
^bb36:
%150 = llvm.load %149 : !llvm.ptr -> i64
%151 = llvm.load %149 : !llvm.ptr -> i64
%152 = arith.muli %150, %151 : i64
%153 = arith.cmpi sle, %152, %arg0 : i64
cf.cond_br %153, ^bb37, ^bb38
^bb37:
%154 = llvm.load %149 : !llvm.ptr -> i64
%155 = arith.remsi %arg0, %154 : i64
%156 = arith.constant 0 : i32
%158 = arith.extsi %156 : i32 to i64
%157 = arith.cmpi eq, %155, %158 : i64
%159 = scf.if %157 -> (i1) {
%160 = arith.constant true
scf.yield %160 : i1
} else {
%161 = llvm.load %149 : !llvm.ptr -> i64
%162 = arith.constant 2 : i32
%164 = arith.extsi %162 : i32 to i64
%163 = arith.addi %161, %164 : i64
%165 = arith.remsi %arg0, %163 : i64
%166 = arith.constant 0 : i32
%168 = arith.extsi %166 : i32 to i64
%167 = arith.cmpi eq, %165, %168 : i64
scf.yield %167 : i1
}
cf.cond_br %159, ^bb39, ^bb40
^bb39:
%169 = arith.constant 0 : i1
func.return %169 : i1
^bb40:
cf.br ^bb41
^bb41:
%170 = llvm.load %149 : !llvm.ptr -> i64
%171 = arith.constant 6 : i32
%173 = arith.extsi %171 : i32 to i64
%172 = arith.addi %170, %173 : i64
llvm.store %172, %149 : i64, !llvm.ptr
cf.br ^bb36
^bb38:
%174 = arith.constant 1 : i1
func.return %174 : i1
}
func.func private @calloc(i64, i64) -> !llvm.ptr
func.func private @free(!llvm.ptr) -> ()
func.func @main() -> i32 {
%175 = arith.constant 200000 : i32
%176 = arith.extsi %175 : i32 to i64
%178 = arith.constant 1 : i32
%180 = arith.extsi %178 : i32 to i64
%179 = arith.addi %176, %180 : i64
%181 = arith.constant 1 : i32
%182 = arith.extsi %181 : i32 to i64
%177 = func.call @calloc(%179, %182) : (i64, i64) -> !llvm.ptr
%184 = arith.constant 5 : i32
%186 = arith.extsi %184 : i32 to i64
%185 = arith.divsi %176, %186 : i64
%187 = arith.constant 10 : i32
%189 = arith.extsi %187 : i32 to i64
%188 = arith.addi %185, %189 : i64
%190 = arith.constant 4 : i32
%191 = arith.extsi %190 : i32 to i64
%183 = func.call @calloc(%188, %191) : (i64, i64) -> !llvm.ptr
%192 = arith.constant 0 : i32
%193 = arith.extsi %192 : i32 to i64
%194 = llvm.mlir.constant(1 : i64) : i64
%195 = llvm.alloca %194 x i64 : (i64) -> !llvm.ptr
llvm.store %193, %195 : i64, !llvm.ptr
%196 = arith.constant 1 : i32
%197 = arith.constant 0 : i32
%198 = arith.trunci %196 : i32 to i8
%199 = arith.extsi %197 : i32 to i64
%200 = llvm.getelementptr %177[%199] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %198, %200 : i8, !llvm.ptr
%201 = arith.constant 1 : i32
%202 = arith.constant 1 : i32
%203 = arith.trunci %201 : i32 to i8
%204 = arith.extsi %202 : i32 to i64
%205 = llvm.getelementptr %177[%204] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %203, %205 : i8, !llvm.ptr
%206 = arith.constant 2 : i32
%207 = arith.extsi %206 : i32 to i64
%208 = llvm.mlir.constant(1 : i64) : i64
%209 = llvm.alloca %208 x i64 : (i64) -> !llvm.ptr
llvm.store %207, %209 : i64, !llvm.ptr
cf.br ^bb42
^bb42:
%210 = llvm.load %209 : !llvm.ptr -> i64
%211 = arith.cmpi sle, %210, %176 : i64
cf.cond_br %211, ^bb43, ^bb44
^bb43:
%213 = llvm.load %209 : !llvm.ptr -> i64
%214 = llvm.getelementptr %177[%213] : (!llvm.ptr, i64) -> !llvm.ptr, i8
%212 = llvm.load %214 : !llvm.ptr -> i8
%215 = arith.constant 0 : i32
%217 = arith.extsi %212 : i8 to i32
%216 = arith.cmpi eq, %217, %215 : i32
cf.cond_br %216, ^bb45, ^bb46
^bb45:
%218 = llvm.load %209 : !llvm.ptr -> i64
%219 = arith.trunci %218 : i64 to i32
%220 = llvm.load %195 : !llvm.ptr -> i64
%221 = llvm.getelementptr %183[%220] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %219, %221 : i32, !llvm.ptr
%222 = llvm.load %195 : !llvm.ptr -> i64
%223 = arith.constant 1 : i32
%225 = arith.extsi %223 : i32 to i64
%224 = arith.addi %222, %225 : i64
llvm.store %224, %195 : i64, !llvm.ptr
%226 = llvm.load %209 : !llvm.ptr -> i64
%227 = llvm.load %209 : !llvm.ptr -> i64
%228 = arith.muli %226, %227 : i64
%229 = llvm.mlir.constant(1 : i64) : i64
%230 = llvm.alloca %229 x i64 : (i64) -> !llvm.ptr
llvm.store %228, %230 : i64, !llvm.ptr
cf.br ^bb48
^bb48:
%231 = llvm.load %230 : !llvm.ptr -> i64
%232 = arith.cmpi sle, %231, %176 : i64
cf.cond_br %232, ^bb49, ^bb50
^bb49:
%233 = arith.constant 1 : i32
%234 = llvm.load %230 : !llvm.ptr -> i64
%235 = arith.trunci %233 : i32 to i8
%236 = llvm.getelementptr %177[%234] : (!llvm.ptr, i64) -> !llvm.ptr, i8
llvm.store %235, %236 : i8, !llvm.ptr
%237 = llvm.load %230 : !llvm.ptr -> i64
%238 = llvm.load %209 : !llvm.ptr -> i64
%239 = arith.addi %237, %238 : i64
llvm.store %239, %230 : i64, !llvm.ptr
cf.br ^bb48
^bb50:
cf.br ^bb47
^bb46:
cf.br ^bb47
^bb47:
%240 = llvm.load %209 : !llvm.ptr -> i64
%241 = arith.constant 1 : i32
%243 = arith.extsi %241 : i32 to i64
%242 = arith.addi %240, %243 : i64
llvm.store %242, %209 : i64, !llvm.ptr
cf.br ^bb42
^bb44:
%245 = arith.constant 1 : i32
%247 = arith.extsi %245 : i32 to i64
%246 = arith.addi %176, %247 : i64
%248 = arith.constant 4 : i32
%249 = arith.extsi %248 : i32 to i64
%244 = func.call @calloc(%246, %249) : (i64, i64) -> !llvm.ptr
%250 = arith.constant 1 : i32
%251 = arith.extsi %250 : i32 to i64
%252 = llvm.mlir.constant(1 : i64) : i64
%253 = llvm.alloca %252 x i64 : (i64) -> !llvm.ptr
llvm.store %251, %253 : i64, !llvm.ptr
%254 = arith.constant 0 : i32
%255 = arith.extsi %254 : i32 to i64
%256 = llvm.mlir.constant(1 : i64) : i64
%257 = llvm.alloca %256 x i64 : (i64) -> !llvm.ptr
llvm.store %255, %257 : i64, !llvm.ptr
cf.br ^bb51
^bb51:
%258 = llvm.load %257 : !llvm.ptr -> i64
%259 = llvm.load %195 : !llvm.ptr -> i64
%260 = arith.cmpi slt, %258, %259 : i64
cf.cond_br %260, ^bb52, ^bb53
^bb52:
%262 = llvm.load %257 : !llvm.ptr -> i64
%263 = llvm.getelementptr %183[%262] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%261 = llvm.load %263 : !llvm.ptr -> i32
%264 = arith.extsi %261 : i32 to i64
%265 = llvm.mlir.constant(1 : i64) : i64
%266 = llvm.alloca %265 x i64 : (i64) -> !llvm.ptr
llvm.store %264, %266 : i64, !llvm.ptr
cf.br ^bb54
^bb54:
%267 = llvm.load %266 : !llvm.ptr -> i64
%268 = arith.muli %267, %264 : i64
%269 = arith.cmpi sle, %268, %176 : i64
cf.cond_br %269, ^bb55, ^bb56
^bb55:
%270 = llvm.load %266 : !llvm.ptr -> i64
%271 = arith.muli %270, %264 : i64
llvm.store %271, %266 : i64, !llvm.ptr
cf.br ^bb54
^bb56:
%272 = llvm.load %266 : !llvm.ptr -> i64
%273 = arith.trunci %272 : i64 to i32
%274 = llvm.getelementptr %244[%264] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %273, %274 : i32, !llvm.ptr
%275 = llvm.load %253 : !llvm.ptr -> i64
%276 = llvm.load %266 : !llvm.ptr -> i64
%277 = arith.addi %275, %276 : i64
llvm.store %277, %253 : i64, !llvm.ptr
%278 = llvm.load %257 : !llvm.ptr -> i64
%279 = arith.constant 1 : i32
%281 = arith.extsi %279 : i32 to i64
%280 = arith.addi %278, %281 : i64
llvm.store %280, %257 : i64, !llvm.ptr
cf.br ^bb51
^bb53:
%282 = func.call @isqrt(%176) : (i64) -> i64
%284 = llvm.load %195 : !llvm.ptr -> i64
%285 = arith.constant 4 : i32
%286 = arith.extsi %285 : i32 to i64
%283 = func.call @calloc(%284, %286) : (i64, i64) -> !llvm.ptr
%288 = llvm.load %195 : !llvm.ptr -> i64
%289 = arith.constant 4 : i32
%290 = arith.extsi %289 : i32 to i64
%287 = func.call @calloc(%288, %290) : (i64, i64) -> !llvm.ptr
%291 = arith.constant 0 : i32
%292 = arith.extsi %291 : i32 to i64
%293 = llvm.mlir.constant(1 : i64) : i64
%294 = llvm.alloca %293 x i64 : (i64) -> !llvm.ptr
llvm.store %292, %294 : i64, !llvm.ptr
%295 = arith.constant 0 : i32
%296 = arith.extsi %295 : i32 to i64
%297 = llvm.mlir.constant(1 : i64) : i64
%298 = llvm.alloca %297 x i64 : (i64) -> !llvm.ptr
llvm.store %296, %298 : i64, !llvm.ptr
%299 = arith.constant 0 : i32
%300 = arith.extsi %299 : i32 to i64
llvm.store %300, %257 : i64, !llvm.ptr
cf.br ^bb57
^bb57:
%301 = llvm.load %257 : !llvm.ptr -> i64
%302 = llvm.load %195 : !llvm.ptr -> i64
%303 = arith.cmpi slt, %301, %302 : i64
cf.cond_br %303, ^bb58, ^bb59
^bb58:
%305 = llvm.load %257 : !llvm.ptr -> i64
%306 = llvm.getelementptr %183[%305] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%304 = llvm.load %306 : !llvm.ptr -> i32
%307 = arith.extsi %304 : i32 to i64
%308 = arith.cmpi sle, %307, %282 : i64
cf.cond_br %308, ^bb60, ^bb61
^bb60:
%309 = arith.trunci %307 : i64 to i32
%310 = llvm.load %294 : !llvm.ptr -> i64
%311 = llvm.getelementptr %283[%310] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %309, %311 : i32, !llvm.ptr
%312 = llvm.load %294 : !llvm.ptr -> i64
%313 = arith.constant 1 : i32
%315 = arith.extsi %313 : i32 to i64
%314 = arith.addi %312, %315 : i64
llvm.store %314, %294 : i64, !llvm.ptr
cf.br ^bb62
^bb61:
%316 = arith.constant 2 : i32
%318 = arith.extsi %316 : i32 to i64
%317 = arith.divsi %176, %318 : i64
%319 = arith.cmpi sle, %307, %317 : i64
cf.cond_br %319, ^bb63, ^bb62
^bb63:
%320 = arith.trunci %307 : i64 to i32
%321 = llvm.load %298 : !llvm.ptr -> i64
%322 = llvm.getelementptr %287[%321] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %320, %322 : i32, !llvm.ptr
%323 = llvm.load %298 : !llvm.ptr -> i64
%324 = arith.constant 1 : i32
%326 = arith.extsi %324 : i32 to i64
%325 = arith.addi %323, %326 : i64
llvm.store %325, %298 : i64, !llvm.ptr
cf.br ^bb62
^bb62:
%327 = llvm.load %257 : !llvm.ptr -> i64
%328 = arith.constant 1 : i32
%330 = arith.extsi %328 : i32 to i64
%329 = arith.addi %327, %330 : i64
llvm.store %329, %257 : i64, !llvm.ptr
cf.br ^bb57
^bb59:
%331 = llvm.load %294 : !llvm.ptr -> i64
%332 = arith.constant 0 : i32
%334 = arith.extsi %332 : i32 to i64
%333 = arith.cmpi eq, %331, %334 : i64
%335 = scf.if %333 -> (i1) {
%336 = arith.constant true
scf.yield %336 : i1
} else {
%337 = llvm.load %298 : !llvm.ptr -> i64
%338 = arith.constant 0 : i32
%340 = arith.extsi %338 : i32 to i64
%339 = arith.cmpi eq, %337, %340 : i64
scf.yield %339 : i1
}
cf.cond_br %335, ^bb64, ^bb65
^bb64:
%341 = llvm.mlir.addressof @str_0 : !llvm.ptr
%342 = llvm.load %253 : !llvm.ptr -> i64
%343 = llvm.call @printf(%341, %342) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
%344 = arith.constant 0 : i32
func.return %344 : i32
^bb65:
cf.br ^bb66
^bb66:
%346 = llvm.load %294 : !llvm.ptr -> i64
%347 = arith.constant 1 : i32
%349 = arith.extsi %347 : i32 to i64
%348 = arith.addi %346, %349 : i64
%350 = arith.constant 4 : i32
%351 = arith.extsi %350 : i32 to i64
%345 = func.call @calloc(%348, %351) : (i64, i64) -> !llvm.ptr
%353 = llvm.load %294 : !llvm.ptr -> i64
%354 = arith.constant 20 : i32
%356 = arith.extsi %354 : i32 to i64
%355 = arith.muli %353, %356 : i64
%357 = arith.constant 4 : i32
%358 = arith.extsi %357 : i32 to i64
%352 = func.call @calloc(%355, %358) : (i64, i64) -> !llvm.ptr
%359 = arith.constant 0 : i32
%360 = arith.extsi %359 : i32 to i64
%361 = llvm.mlir.constant(1 : i64) : i64
%362 = llvm.alloca %361 x i64 : (i64) -> !llvm.ptr
llvm.store %360, %362 : i64, !llvm.ptr
%363 = arith.constant 0 : i32
%364 = arith.extsi %363 : i32 to i64
%365 = llvm.mlir.constant(1 : i64) : i64
%366 = llvm.alloca %365 x i64 : (i64) -> !llvm.ptr
llvm.store %364, %366 : i64, !llvm.ptr
cf.br ^bb67
^bb67:
%367 = llvm.load %366 : !llvm.ptr -> i64
%368 = llvm.load %294 : !llvm.ptr -> i64
%369 = arith.cmpi slt, %367, %368 : i64
cf.cond_br %369, ^bb68, ^bb69
^bb68:
%370 = llvm.load %362 : !llvm.ptr -> i64
%371 = arith.trunci %370 : i64 to i32
%372 = llvm.load %366 : !llvm.ptr -> i64
%373 = llvm.getelementptr %345[%372] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %371, %373 : i32, !llvm.ptr
%375 = llvm.load %366 : !llvm.ptr -> i64
%376 = llvm.getelementptr %283[%375] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%374 = llvm.load %376 : !llvm.ptr -> i32
%377 = arith.extsi %374 : i32 to i64
%378 = llvm.mlir.constant(1 : i64) : i64
%379 = llvm.alloca %378 x i64 : (i64) -> !llvm.ptr
llvm.store %377, %379 : i64, !llvm.ptr
cf.br ^bb70
^bb70:
%380 = arith.constant 1 : i1
cf.cond_br %380, ^bb71, ^bb72
^bb71:
%381 = llvm.load %379 : !llvm.ptr -> i64
%382 = arith.trunci %381 : i64 to i32
%383 = llvm.load %362 : !llvm.ptr -> i64
%384 = llvm.getelementptr %352[%383] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %382, %384 : i32, !llvm.ptr
%385 = llvm.load %362 : !llvm.ptr -> i64
%386 = arith.constant 1 : i32
%388 = arith.extsi %386 : i32 to i64
%387 = arith.addi %385, %388 : i64
llvm.store %387, %362 : i64, !llvm.ptr
%389 = llvm.load %379 : !llvm.ptr -> i64
%390 = arith.divsi %176, %377 : i64
%391 = arith.cmpi sgt, %389, %390 : i64
cf.cond_br %391, ^bb73, ^bb74
^bb73:
cf.br ^bb72
^bb74:
cf.br ^bb75
^bb75:
%392 = llvm.load %379 : !llvm.ptr -> i64
%393 = arith.muli %392, %377 : i64
llvm.store %393, %379 : i64, !llvm.ptr
cf.br ^bb70
^bb72:
%394 = llvm.load %366 : !llvm.ptr -> i64
%395 = arith.constant 1 : i32
%397 = arith.extsi %395 : i32 to i64
%396 = arith.addi %394, %397 : i64
llvm.store %396, %366 : i64, !llvm.ptr
cf.br ^bb67
^bb69:
%398 = llvm.load %362 : !llvm.ptr -> i64
%399 = arith.trunci %398 : i64 to i32
%400 = llvm.load %294 : !llvm.ptr -> i64
%401 = llvm.getelementptr %345[%400] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %399, %401 : i32, !llvm.ptr
%403 = llvm.load %294 : !llvm.ptr -> i64
%404 = llvm.load %298 : !llvm.ptr -> i64
%405 = arith.muli %403, %404 : i64
%406 = arith.constant 1 : i32
%408 = arith.extsi %406 : i32 to i64
%407 = arith.addi %405, %408 : i64
%409 = arith.constant 4 : i32
%410 = arith.extsi %409 : i32 to i64
%402 = func.call @calloc(%407, %410) : (i64, i64) -> !llvm.ptr
%412 = llvm.load %294 : !llvm.ptr -> i64
%413 = llvm.load %298 : !llvm.ptr -> i64
%414 = arith.muli %412, %413 : i64
%415 = arith.constant 1 : i32
%417 = arith.extsi %415 : i32 to i64
%416 = arith.addi %414, %417 : i64
%418 = arith.constant 4 : i32
%419 = arith.extsi %418 : i32 to i64
%411 = func.call @calloc(%416, %419) : (i64, i64) -> !llvm.ptr
%421 = llvm.load %294 : !llvm.ptr -> i64
%422 = llvm.load %298 : !llvm.ptr -> i64
%423 = arith.muli %421, %422 : i64
%424 = arith.constant 1 : i32
%426 = arith.extsi %424 : i32 to i64
%425 = arith.addi %423, %426 : i64
%427 = arith.constant 4 : i32
%428 = arith.extsi %427 : i32 to i64
%420 = func.call @calloc(%425, %428) : (i64, i64) -> !llvm.ptr
%429 = arith.constant 0 : i32
%430 = arith.extsi %429 : i32 to i64
%431 = llvm.mlir.constant(1 : i64) : i64
%432 = llvm.alloca %431 x i64 : (i64) -> !llvm.ptr
llvm.store %430, %432 : i64, !llvm.ptr
%433 = arith.constant 0 : i32
%434 = arith.extsi %433 : i32 to i64
%435 = llvm.mlir.constant(1 : i64) : i64
%436 = llvm.alloca %435 x i64 : (i64) -> !llvm.ptr
llvm.store %434, %436 : i64, !llvm.ptr
%437 = arith.constant 0 : i32
%438 = arith.extsi %437 : i32 to i64
%439 = llvm.mlir.constant(1 : i64) : i64
%440 = llvm.alloca %439 x i64 : (i64) -> !llvm.ptr
llvm.store %438, %440 : i64, !llvm.ptr
cf.br ^bb76
^bb76:
%441 = llvm.load %440 : !llvm.ptr -> i64
%442 = llvm.load %298 : !llvm.ptr -> i64
%443 = arith.cmpi slt, %441, %442 : i64
cf.cond_br %443, ^bb77, ^bb78
^bb77:
%445 = llvm.load %440 : !llvm.ptr -> i64
%446 = llvm.getelementptr %287[%445] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%444 = llvm.load %446 : !llvm.ptr -> i32
%447 = arith.extsi %444 : i32 to i64
%448 = arith.divsi %176, %447 : i64
%449 = arith.constant 0 : i32
%450 = arith.extsi %449 : i32 to i64
llvm.store %450, %366 : i64, !llvm.ptr
cf.br ^bb79
^bb79:
%451 = llvm.load %366 : !llvm.ptr -> i64
%452 = llvm.load %294 : !llvm.ptr -> i64
%453 = arith.cmpi slt, %451, %452 : i64
cf.cond_br %453, ^bb80, ^bb81
^bb80:
%455 = llvm.load %366 : !llvm.ptr -> i64
%456 = llvm.getelementptr %283[%455] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%454 = llvm.load %456 : !llvm.ptr -> i32
%457 = arith.extsi %454 : i32 to i64
%458 = arith.cmpi sgt, %457, %448 : i64
cf.cond_br %458, ^bb82, ^bb83
^bb82:
cf.br ^bb81
^bb83:
cf.br ^bb84
^bb84:
%460 = llvm.load %366 : !llvm.ptr -> i64
%461 = llvm.getelementptr %345[%460] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%459 = llvm.load %461 : !llvm.ptr -> i32
%462 = arith.extsi %459 : i32 to i64
%464 = llvm.load %366 : !llvm.ptr -> i64
%465 = arith.constant 1 : i32
%467 = arith.extsi %465 : i32 to i64
%466 = arith.addi %464, %467 : i64
%468 = llvm.getelementptr %345[%466] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%463 = llvm.load %468 : !llvm.ptr -> i32
%469 = arith.extsi %463 : i32 to i64
%471 = arith.constant 1 : i32
%473 = arith.extsi %471 : i32 to i64
%472 = arith.subi %469, %473 : i64
%474 = llvm.getelementptr %352[%472] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%470 = llvm.load %474 : !llvm.ptr -> i32
%475 = arith.extsi %470 : i32 to i64
%476 = llvm.mlir.constant(1 : i64) : i64
%477 = llvm.alloca %476 x i64 : (i64) -> !llvm.ptr
llvm.store %475, %477 : i64, !llvm.ptr
%478 = llvm.load %477 : !llvm.ptr -> i64
%479 = arith.cmpi sgt, %478, %448 : i64
cf.cond_br %479, ^bb85, ^bb86
^bb85:
%480 = arith.constant 1 : i32
%482 = arith.extsi %480 : i32 to i64
%481 = arith.subi %469, %482 : i64
%483 = llvm.mlir.constant(1 : i64) : i64
%484 = llvm.alloca %483 x i64 : (i64) -> !llvm.ptr
llvm.store %481, %484 : i64, !llvm.ptr
cf.br ^bb88
^bb88:
%485 = llvm.load %484 : !llvm.ptr -> i64
%486 = arith.cmpi sge, %485, %462 : i64
cf.cond_br %486, ^bb89, ^bb90
^bb89:
%488 = llvm.load %484 : !llvm.ptr -> i64
%489 = llvm.getelementptr %352[%488] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%487 = llvm.load %489 : !llvm.ptr -> i32
%490 = arith.extsi %487 : i32 to i64
%491 = arith.cmpi sle, %490, %448 : i64
cf.cond_br %491, ^bb91, ^bb92
^bb91:
llvm.store %490, %477 : i64, !llvm.ptr
cf.br ^bb90
^bb92:
cf.br ^bb93
^bb93:
%492 = llvm.load %484 : !llvm.ptr -> i64
%493 = arith.constant 1 : i32
%495 = arith.extsi %493 : i32 to i64
%494 = arith.subi %492, %495 : i64
llvm.store %494, %484 : i64, !llvm.ptr
cf.br ^bb88
^bb90:
cf.br ^bb87
^bb86:
cf.br ^bb87
^bb87:
%496 = llvm.load %477 : !llvm.ptr -> i64
%497 = arith.muli %496, %447 : i64
%499 = llvm.getelementptr %244[%457] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%498 = llvm.load %499 : !llvm.ptr -> i32
%500 = arith.extsi %498 : i32 to i64
%501 = arith.subi %497, %500 : i64
%502 = arith.subi %501, %447 : i64
%503 = arith.constant 0 : i32
%505 = arith.extsi %503 : i32 to i64
%504 = arith.cmpi sgt, %502, %505 : i64
cf.cond_br %504, ^bb94, ^bb95
^bb94:
%506 = llvm.load %366 : !llvm.ptr -> i64
%507 = arith.trunci %506 : i64 to i32
%508 = llvm.load %432 : !llvm.ptr -> i64
%509 = llvm.getelementptr %402[%508] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %507, %509 : i32, !llvm.ptr
%510 = llvm.load %440 : !llvm.ptr -> i64
%511 = arith.trunci %510 : i64 to i32
%512 = llvm.load %432 : !llvm.ptr -> i64
%513 = llvm.getelementptr %411[%512] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %511, %513 : i32, !llvm.ptr
%514 = arith.trunci %502 : i64 to i32
%515 = llvm.load %432 : !llvm.ptr -> i64
%516 = llvm.getelementptr %420[%515] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %514, %516 : i32, !llvm.ptr
%517 = llvm.load %432 : !llvm.ptr -> i64
%518 = arith.constant 1 : i32
%520 = arith.extsi %518 : i32 to i64
%519 = arith.addi %517, %520 : i64
llvm.store %519, %432 : i64, !llvm.ptr
%521 = llvm.load %436 : !llvm.ptr -> i64
%522 = arith.cmpi sgt, %502, %521 : i64
cf.cond_br %522, ^bb97, ^bb98
^bb97:
llvm.store %502, %436 : i64, !llvm.ptr
cf.br ^bb99
^bb98:
cf.br ^bb99
^bb99:
cf.br ^bb96
^bb95:
cf.br ^bb96
^bb96:
%523 = llvm.load %366 : !llvm.ptr -> i64
%524 = arith.constant 1 : i32
%526 = arith.extsi %524 : i32 to i64
%525 = arith.addi %523, %526 : i64
llvm.store %525, %366 : i64, !llvm.ptr
cf.br ^bb79
^bb81:
%527 = llvm.load %440 : !llvm.ptr -> i64
%528 = arith.constant 1 : i32
%530 = arith.extsi %528 : i32 to i64
%529 = arith.addi %527, %530 : i64
llvm.store %529, %440 : i64, !llvm.ptr
cf.br ^bb76
^bb78:
%531 = llvm.load %436 : !llvm.ptr -> i64
%532 = arith.constant 0 : i32
%534 = arith.extsi %532 : i32 to i64
%533 = arith.cmpi eq, %531, %534 : i64
cf.cond_br %533, ^bb100, ^bb101
^bb100:
%535 = llvm.mlir.addressof @str_0 : !llvm.ptr
%536 = llvm.load %253 : !llvm.ptr -> i64
%537 = llvm.call @printf(%535, %536) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
%538 = arith.constant 0 : i32
func.return %538 : i32
^bb101:
cf.br ^bb102
^bb102:
%539 = llvm.load %436 : !llvm.ptr -> i64
%540 = arith.constant 0 : i32
%541 = arith.extsi %540 : i32 to i64
%542 = arith.constant 1 : i32
%543 = arith.extsi %542 : i32 to i64
%544 = llvm.load %294 : !llvm.ptr -> i64
%545 = arith.addi %543, %544 : i64
%546 = llvm.load %298 : !llvm.ptr -> i64
%547 = arith.addi %545, %546 : i64
%548 = arith.constant 1 : i32
%550 = arith.extsi %548 : i32 to i64
%549 = arith.addi %547, %550 : i64
%551 = llvm.load %294 : !llvm.ptr -> i64
%552 = arith.constant 2 : i32
%554 = arith.extsi %552 : i32 to i64
%553 = arith.muli %551, %554 : i64
%555 = llvm.load %298 : !llvm.ptr -> i64
%556 = arith.addi %553, %555 : i64
%557 = llvm.load %432 : !llvm.ptr -> i64
%558 = arith.addi %556, %557 : i64
%559 = arith.constant 2 : i32
%561 = arith.extsi %559 : i32 to i64
%560 = arith.muli %558, %561 : i64
%562 = arith.constant 10 : i32
%564 = arith.extsi %562 : i32 to i64
%563 = arith.addi %560, %564 : i64
%566 = arith.constant 4 : i32
%567 = arith.extsi %566 : i32 to i64
%565 = func.call @calloc(%563, %567) : (i64, i64) -> !llvm.ptr
%569 = arith.constant 4 : i32
%570 = arith.extsi %569 : i32 to i64
%568 = func.call @calloc(%563, %570) : (i64, i64) -> !llvm.ptr
%572 = arith.constant 4 : i32
%573 = arith.extsi %572 : i32 to i64
%571 = func.call @calloc(%563, %573) : (i64, i64) -> !llvm.ptr
%575 = arith.constant 4 : i32
%576 = arith.extsi %575 : i32 to i64
%574 = func.call @calloc(%563, %576) : (i64, i64) -> !llvm.ptr
%578 = arith.constant 4 : i32
%579 = arith.extsi %578 : i32 to i64
%577 = func.call @calloc(%563, %579) : (i64, i64) -> !llvm.ptr
%581 = arith.constant 4 : i32
%582 = arith.extsi %581 : i32 to i64
%580 = func.call @calloc(%549, %582) : (i64, i64) -> !llvm.ptr
%583 = arith.constant 0 : i32
%584 = arith.extsi %583 : i32 to i64
%585 = llvm.mlir.constant(1 : i64) : i64
%586 = llvm.alloca %585 x i64 : (i64) -> !llvm.ptr
llvm.store %584, %586 : i64, !llvm.ptr
%587 = arith.constant 0 : i32
%588 = arith.extsi %587 : i32 to i64
%589 = llvm.mlir.constant(1 : i64) : i64
%590 = llvm.alloca %589 x i64 : (i64) -> !llvm.ptr
llvm.store %588, %590 : i64, !llvm.ptr
cf.br ^bb103
^bb103:
%591 = llvm.load %590 : !llvm.ptr -> i64
%592 = arith.cmpi slt, %591, %549 : i64
cf.cond_br %592, ^bb104, ^bb105
^bb104:
%593 = arith.constant 1 : i32
%595 = arith.constant 0 : i32
%594 = arith.subi %595, %593 : i32
%596 = llvm.load %590 : !llvm.ptr -> i64
%597 = llvm.getelementptr %580[%596] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %594, %597 : i32, !llvm.ptr
%598 = llvm.load %590 : !llvm.ptr -> i64
%599 = arith.constant 1 : i32
%601 = arith.extsi %599 : i32 to i64
%600 = arith.addi %598, %601 : i64
llvm.store %600, %590 : i64, !llvm.ptr
cf.br ^bb103
^bb105:
%602 = arith.constant 0 : i32
%603 = arith.extsi %602 : i32 to i64
llvm.store %603, %366 : i64, !llvm.ptr
cf.br ^bb106
^bb106:
%604 = llvm.load %366 : !llvm.ptr -> i64
%605 = llvm.load %294 : !llvm.ptr -> i64
%606 = arith.cmpi slt, %604, %605 : i64
cf.cond_br %606, ^bb107, ^bb108
^bb107:
%607 = llvm.load %366 : !llvm.ptr -> i64
%608 = arith.addi %543, %607 : i64
%609 = arith.trunci %608 : i64 to i32
%610 = llvm.load %586 : !llvm.ptr -> i64
%611 = llvm.getelementptr %565[%610] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %609, %611 : i32, !llvm.ptr
%612 = arith.constant 1 : i32
%613 = llvm.load %586 : !llvm.ptr -> i64
%614 = llvm.getelementptr %568[%613] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %612, %614 : i32, !llvm.ptr
%615 = arith.constant 0 : i32
%616 = llvm.load %586 : !llvm.ptr -> i64
%617 = llvm.getelementptr %571[%616] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %615, %617 : i32, !llvm.ptr
%618 = llvm.load %586 : !llvm.ptr -> i64
%619 = arith.constant 1 : i32
%621 = arith.extsi %619 : i32 to i64
%620 = arith.addi %618, %621 : i64
%622 = arith.trunci %620 : i64 to i32
%623 = llvm.load %586 : !llvm.ptr -> i64
%624 = llvm.getelementptr %574[%623] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %622, %624 : i32, !llvm.ptr
%626 = llvm.getelementptr %580[%541] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%625 = llvm.load %626 : !llvm.ptr -> i32
%627 = llvm.load %586 : !llvm.ptr -> i64
%628 = llvm.getelementptr %577[%627] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %625, %628 : i32, !llvm.ptr
%629 = llvm.load %586 : !llvm.ptr -> i64
%630 = arith.trunci %629 : i64 to i32
%631 = llvm.getelementptr %580[%541] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %630, %631 : i32, !llvm.ptr
%632 = llvm.load %586 : !llvm.ptr -> i64
%633 = arith.constant 1 : i32
%635 = arith.extsi %633 : i32 to i64
%634 = arith.addi %632, %635 : i64
llvm.store %634, %586 : i64, !llvm.ptr
%636 = arith.trunci %541 : i64 to i32
%637 = llvm.load %586 : !llvm.ptr -> i64
%638 = llvm.getelementptr %565[%637] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %636, %638 : i32, !llvm.ptr
%639 = arith.constant 0 : i32
%640 = llvm.load %586 : !llvm.ptr -> i64
%641 = llvm.getelementptr %568[%640] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %639, %641 : i32, !llvm.ptr
%642 = arith.constant 0 : i32
%643 = llvm.load %586 : !llvm.ptr -> i64
%644 = llvm.getelementptr %571[%643] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %642, %644 : i32, !llvm.ptr
%645 = llvm.load %586 : !llvm.ptr -> i64
%646 = arith.constant 1 : i32
%648 = arith.extsi %646 : i32 to i64
%647 = arith.subi %645, %648 : i64
%649 = arith.trunci %647 : i64 to i32
%650 = llvm.load %586 : !llvm.ptr -> i64
%651 = llvm.getelementptr %574[%650] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %649, %651 : i32, !llvm.ptr
%653 = llvm.getelementptr %580[%608] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%652 = llvm.load %653 : !llvm.ptr -> i32
%654 = llvm.load %586 : !llvm.ptr -> i64
%655 = llvm.getelementptr %577[%654] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %652, %655 : i32, !llvm.ptr
%656 = llvm.load %586 : !llvm.ptr -> i64
%657 = arith.trunci %656 : i64 to i32
%658 = llvm.getelementptr %580[%608] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %657, %658 : i32, !llvm.ptr
%659 = llvm.load %586 : !llvm.ptr -> i64
%660 = arith.constant 1 : i32
%662 = arith.extsi %660 : i32 to i64
%661 = arith.addi %659, %662 : i64
llvm.store %661, %586 : i64, !llvm.ptr
%663 = arith.trunci %547 : i64 to i32
%664 = llvm.load %586 : !llvm.ptr -> i64
%665 = llvm.getelementptr %565[%664] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %663, %665 : i32, !llvm.ptr
%666 = arith.constant 1 : i32
%667 = llvm.load %586 : !llvm.ptr -> i64
%668 = llvm.getelementptr %568[%667] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %666, %668 : i32, !llvm.ptr
%669 = arith.trunci %539 : i64 to i32
%670 = llvm.load %586 : !llvm.ptr -> i64
%671 = llvm.getelementptr %571[%670] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %669, %671 : i32, !llvm.ptr
%672 = llvm.load %586 : !llvm.ptr -> i64
%673 = arith.constant 1 : i32
%675 = arith.extsi %673 : i32 to i64
%674 = arith.addi %672, %675 : i64
%676 = arith.trunci %674 : i64 to i32
%677 = llvm.load %586 : !llvm.ptr -> i64
%678 = llvm.getelementptr %574[%677] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %676, %678 : i32, !llvm.ptr
%680 = llvm.getelementptr %580[%608] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%679 = llvm.load %680 : !llvm.ptr -> i32
%681 = llvm.load %586 : !llvm.ptr -> i64
%682 = llvm.getelementptr %577[%681] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %679, %682 : i32, !llvm.ptr
%683 = llvm.load %586 : !llvm.ptr -> i64
%684 = arith.trunci %683 : i64 to i32
%685 = llvm.getelementptr %580[%608] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %684, %685 : i32, !llvm.ptr
%686 = llvm.load %586 : !llvm.ptr -> i64
%687 = arith.constant 1 : i32
%689 = arith.extsi %687 : i32 to i64
%688 = arith.addi %686, %689 : i64
llvm.store %688, %586 : i64, !llvm.ptr
%690 = arith.trunci %608 : i64 to i32
%691 = llvm.load %586 : !llvm.ptr -> i64
%692 = llvm.getelementptr %565[%691] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %690, %692 : i32, !llvm.ptr
%693 = arith.constant 0 : i32
%694 = llvm.load %586 : !llvm.ptr -> i64
%695 = llvm.getelementptr %568[%694] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %693, %695 : i32, !llvm.ptr
%696 = arith.constant 0 : i32
%698 = arith.extsi %696 : i32 to i64
%697 = arith.subi %698, %539 : i64
%699 = arith.trunci %697 : i64 to i32
%700 = llvm.load %586 : !llvm.ptr -> i64
%701 = llvm.getelementptr %571[%700] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %699, %701 : i32, !llvm.ptr
%702 = llvm.load %586 : !llvm.ptr -> i64
%703 = arith.constant 1 : i32
%705 = arith.extsi %703 : i32 to i64
%704 = arith.subi %702, %705 : i64
%706 = arith.trunci %704 : i64 to i32
%707 = llvm.load %586 : !llvm.ptr -> i64
%708 = llvm.getelementptr %574[%707] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %706, %708 : i32, !llvm.ptr
%710 = llvm.getelementptr %580[%547] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%709 = llvm.load %710 : !llvm.ptr -> i32
%711 = llvm.load %586 : !llvm.ptr -> i64
%712 = llvm.getelementptr %577[%711] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %709, %712 : i32, !llvm.ptr
%713 = llvm.load %586 : !llvm.ptr -> i64
%714 = arith.trunci %713 : i64 to i32
%715 = llvm.getelementptr %580[%547] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %714, %715 : i32, !llvm.ptr
%716 = llvm.load %586 : !llvm.ptr -> i64
%717 = arith.constant 1 : i32
%719 = arith.extsi %717 : i32 to i64
%718 = arith.addi %716, %719 : i64
llvm.store %718, %586 : i64, !llvm.ptr
%720 = llvm.load %366 : !llvm.ptr -> i64
%721 = arith.constant 1 : i32
%723 = arith.extsi %721 : i32 to i64
%722 = arith.addi %720, %723 : i64
llvm.store %722, %366 : i64, !llvm.ptr
cf.br ^bb106
^bb108:
%724 = arith.constant 0 : i32
%725 = arith.extsi %724 : i32 to i64
llvm.store %725, %440 : i64, !llvm.ptr
cf.br ^bb109
^bb109:
%726 = llvm.load %440 : !llvm.ptr -> i64
%727 = llvm.load %298 : !llvm.ptr -> i64
%728 = arith.cmpi slt, %726, %727 : i64
cf.cond_br %728, ^bb110, ^bb111
^bb110:
%729 = llvm.load %440 : !llvm.ptr -> i64
%730 = arith.addi %545, %729 : i64
%731 = arith.trunci %547 : i64 to i32
%732 = llvm.load %586 : !llvm.ptr -> i64
%733 = llvm.getelementptr %565[%732] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %731, %733 : i32, !llvm.ptr
%734 = arith.constant 1 : i32
%735 = llvm.load %586 : !llvm.ptr -> i64
%736 = llvm.getelementptr %568[%735] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %734, %736 : i32, !llvm.ptr
%737 = arith.constant 0 : i32
%738 = llvm.load %586 : !llvm.ptr -> i64
%739 = llvm.getelementptr %571[%738] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %737, %739 : i32, !llvm.ptr
%740 = llvm.load %586 : !llvm.ptr -> i64
%741 = arith.constant 1 : i32
%743 = arith.extsi %741 : i32 to i64
%742 = arith.addi %740, %743 : i64
%744 = arith.trunci %742 : i64 to i32
%745 = llvm.load %586 : !llvm.ptr -> i64
%746 = llvm.getelementptr %574[%745] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %744, %746 : i32, !llvm.ptr
%748 = llvm.getelementptr %580[%730] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%747 = llvm.load %748 : !llvm.ptr -> i32
%749 = llvm.load %586 : !llvm.ptr -> i64
%750 = llvm.getelementptr %577[%749] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %747, %750 : i32, !llvm.ptr
%751 = llvm.load %586 : !llvm.ptr -> i64
%752 = arith.trunci %751 : i64 to i32
%753 = llvm.getelementptr %580[%730] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %752, %753 : i32, !llvm.ptr
%754 = llvm.load %586 : !llvm.ptr -> i64
%755 = arith.constant 1 : i32
%757 = arith.extsi %755 : i32 to i64
%756 = arith.addi %754, %757 : i64
llvm.store %756, %586 : i64, !llvm.ptr
%758 = arith.trunci %730 : i64 to i32
%759 = llvm.load %586 : !llvm.ptr -> i64
%760 = llvm.getelementptr %565[%759] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %758, %760 : i32, !llvm.ptr
%761 = arith.constant 0 : i32
%762 = llvm.load %586 : !llvm.ptr -> i64
%763 = llvm.getelementptr %568[%762] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %761, %763 : i32, !llvm.ptr
%764 = arith.constant 0 : i32
%765 = llvm.load %586 : !llvm.ptr -> i64
%766 = llvm.getelementptr %571[%765] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %764, %766 : i32, !llvm.ptr
%767 = llvm.load %586 : !llvm.ptr -> i64
%768 = arith.constant 1 : i32
%770 = arith.extsi %768 : i32 to i64
%769 = arith.subi %767, %770 : i64
%771 = arith.trunci %769 : i64 to i32
%772 = llvm.load %586 : !llvm.ptr -> i64
%773 = llvm.getelementptr %574[%772] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %771, %773 : i32, !llvm.ptr
%775 = llvm.getelementptr %580[%547] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%774 = llvm.load %775 : !llvm.ptr -> i32
%776 = llvm.load %586 : !llvm.ptr -> i64
%777 = llvm.getelementptr %577[%776] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %774, %777 : i32, !llvm.ptr
%778 = llvm.load %586 : !llvm.ptr -> i64
%779 = arith.trunci %778 : i64 to i32
%780 = llvm.getelementptr %580[%547] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %779, %780 : i32, !llvm.ptr
%781 = llvm.load %586 : !llvm.ptr -> i64
%782 = arith.constant 1 : i32
%784 = arith.extsi %782 : i32 to i64
%783 = arith.addi %781, %784 : i64
llvm.store %783, %586 : i64, !llvm.ptr
%785 = llvm.load %440 : !llvm.ptr -> i64
%786 = arith.constant 1 : i32
%788 = arith.extsi %786 : i32 to i64
%787 = arith.addi %785, %788 : i64
llvm.store %787, %440 : i64, !llvm.ptr
cf.br ^bb109
^bb111:
%789 = arith.constant 0 : i32
%790 = arith.extsi %789 : i32 to i64
%791 = llvm.mlir.constant(1 : i64) : i64
%792 = llvm.alloca %791 x i64 : (i64) -> !llvm.ptr
llvm.store %790, %792 : i64, !llvm.ptr
cf.br ^bb112
^bb112:
%793 = llvm.load %792 : !llvm.ptr -> i64
%794 = llvm.load %432 : !llvm.ptr -> i64
%795 = arith.cmpi slt, %793, %794 : i64
cf.cond_br %795, ^bb113, ^bb114
^bb113:
%797 = llvm.load %792 : !llvm.ptr -> i64
%798 = llvm.getelementptr %402[%797] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%796 = llvm.load %798 : !llvm.ptr -> i32
%799 = arith.extsi %796 : i32 to i64
%800 = arith.addi %543, %799 : i64
%802 = llvm.load %792 : !llvm.ptr -> i64
%803 = llvm.getelementptr %411[%802] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%801 = llvm.load %803 : !llvm.ptr -> i32
%804 = arith.extsi %801 : i32 to i64
%805 = arith.addi %545, %804 : i64
%807 = llvm.load %792 : !llvm.ptr -> i64
%808 = llvm.getelementptr %420[%807] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%806 = llvm.load %808 : !llvm.ptr -> i32
%809 = arith.extsi %806 : i32 to i64
%810 = arith.subi %539, %809 : i64
%811 = arith.trunci %805 : i64 to i32
%812 = llvm.load %586 : !llvm.ptr -> i64
%813 = llvm.getelementptr %565[%812] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %811, %813 : i32, !llvm.ptr
%814 = arith.constant 1 : i32
%815 = llvm.load %586 : !llvm.ptr -> i64
%816 = llvm.getelementptr %568[%815] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %814, %816 : i32, !llvm.ptr
%817 = arith.trunci %810 : i64 to i32
%818 = llvm.load %586 : !llvm.ptr -> i64
%819 = llvm.getelementptr %571[%818] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %817, %819 : i32, !llvm.ptr
%820 = llvm.load %586 : !llvm.ptr -> i64
%821 = arith.constant 1 : i32
%823 = arith.extsi %821 : i32 to i64
%822 = arith.addi %820, %823 : i64
%824 = arith.trunci %822 : i64 to i32
%825 = llvm.load %586 : !llvm.ptr -> i64
%826 = llvm.getelementptr %574[%825] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %824, %826 : i32, !llvm.ptr
%828 = llvm.getelementptr %580[%800] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%827 = llvm.load %828 : !llvm.ptr -> i32
%829 = llvm.load %586 : !llvm.ptr -> i64
%830 = llvm.getelementptr %577[%829] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %827, %830 : i32, !llvm.ptr
%831 = llvm.load %586 : !llvm.ptr -> i64
%832 = arith.trunci %831 : i64 to i32
%833 = llvm.getelementptr %580[%800] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %832, %833 : i32, !llvm.ptr
%834 = llvm.load %586 : !llvm.ptr -> i64
%835 = arith.constant 1 : i32
%837 = arith.extsi %835 : i32 to i64
%836 = arith.addi %834, %837 : i64
llvm.store %836, %586 : i64, !llvm.ptr
%838 = arith.trunci %800 : i64 to i32
%839 = llvm.load %586 : !llvm.ptr -> i64
%840 = llvm.getelementptr %565[%839] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %838, %840 : i32, !llvm.ptr
%841 = arith.constant 0 : i32
%842 = llvm.load %586 : !llvm.ptr -> i64
%843 = llvm.getelementptr %568[%842] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %841, %843 : i32, !llvm.ptr
%844 = arith.constant 0 : i32
%846 = arith.extsi %844 : i32 to i64
%845 = arith.subi %846, %810 : i64
%847 = arith.trunci %845 : i64 to i32
%848 = llvm.load %586 : !llvm.ptr -> i64
%849 = llvm.getelementptr %571[%848] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %847, %849 : i32, !llvm.ptr
%850 = llvm.load %586 : !llvm.ptr -> i64
%851 = arith.constant 1 : i32
%853 = arith.extsi %851 : i32 to i64
%852 = arith.subi %850, %853 : i64
%854 = arith.trunci %852 : i64 to i32
%855 = llvm.load %586 : !llvm.ptr -> i64
%856 = llvm.getelementptr %574[%855] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %854, %856 : i32, !llvm.ptr
%858 = llvm.getelementptr %580[%805] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%857 = llvm.load %858 : !llvm.ptr -> i32
%859 = llvm.load %586 : !llvm.ptr -> i64
%860 = llvm.getelementptr %577[%859] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %857, %860 : i32, !llvm.ptr
%861 = llvm.load %586 : !llvm.ptr -> i64
%862 = arith.trunci %861 : i64 to i32
%863 = llvm.getelementptr %580[%805] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %862, %863 : i32, !llvm.ptr
%864 = llvm.load %586 : !llvm.ptr -> i64
%865 = arith.constant 1 : i32
%867 = arith.extsi %865 : i32 to i64
%866 = arith.addi %864, %867 : i64
llvm.store %866, %586 : i64, !llvm.ptr
%868 = llvm.load %792 : !llvm.ptr -> i64
%869 = arith.constant 1 : i32
%871 = arith.extsi %869 : i32 to i64
%870 = arith.addi %868, %871 : i64
llvm.store %870, %792 : i64, !llvm.ptr
cf.br ^bb112
^bb114:
%873 = arith.constant 8 : i32
%874 = arith.extsi %873 : i32 to i64
%872 = func.call @calloc(%549, %874) : (i64, i64) -> !llvm.ptr
%876 = arith.constant 8 : i32
%877 = arith.extsi %876 : i32 to i64
%875 = func.call @calloc(%549, %877) : (i64, i64) -> !llvm.ptr
%879 = arith.constant 4 : i32
%880 = arith.extsi %879 : i32 to i64
%878 = func.call @calloc(%549, %880) : (i64, i64) -> !llvm.ptr
%882 = arith.constant 4 : i32
%883 = arith.extsi %882 : i32 to i64
%881 = func.call @calloc(%549, %883) : (i64, i64) -> !llvm.ptr
%885 = arith.constant 4 : i32
%887 = arith.extsi %885 : i32 to i64
%886 = arith.muli %549, %887 : i64
%888 = arith.constant 8 : i32
%889 = arith.extsi %888 : i32 to i64
%884 = func.call @calloc(%886, %889) : (i64, i64) -> !llvm.ptr
%891 = arith.constant 4 : i32
%893 = arith.extsi %891 : i32 to i64
%892 = arith.muli %549, %893 : i64
%894 = arith.constant 4 : i32
%895 = arith.extsi %894 : i32 to i64
%890 = func.call @calloc(%892, %895) : (i64, i64) -> !llvm.ptr
%896 = arith.constant 999995705032704 : i32
%897 = arith.extsi %896 : i32 to i64
%898 = arith.constant 0 : i32
%899 = arith.extsi %898 : i32 to i64
%900 = llvm.mlir.constant(1 : i64) : i64
%901 = llvm.alloca %900 x i64 : (i64) -> !llvm.ptr
llvm.store %899, %901 : i64, !llvm.ptr
%902 = arith.constant 0 : i32
%903 = arith.extsi %902 : i32 to i64
%904 = llvm.mlir.constant(1 : i64) : i64
%905 = llvm.alloca %904 x i64 : (i64) -> !llvm.ptr
llvm.store %903, %905 : i64, !llvm.ptr
%906 = llvm.load %294 : !llvm.ptr -> i64
cf.br ^bb115
^bb115:
%907 = llvm.load %901 : !llvm.ptr -> i64
%908 = arith.cmpi slt, %907, %906 : i64
cf.cond_br %908, ^bb116, ^bb117
^bb116:
%909 = arith.constant 0 : i32
%910 = arith.extsi %909 : i32 to i64
llvm.store %910, %590 : i64, !llvm.ptr
cf.br ^bb118
^bb118:
%911 = llvm.load %590 : !llvm.ptr -> i64
%912 = arith.cmpi slt, %911, %549 : i64
cf.cond_br %912, ^bb119, ^bb120
^bb119:
%913 = llvm.load %590 : !llvm.ptr -> i64
%914 = llvm.getelementptr %875[%913] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %897, %914 : i64, !llvm.ptr
%915 = llvm.load %590 : !llvm.ptr -> i64
%916 = arith.constant 1 : i32
%918 = arith.extsi %916 : i32 to i64
%917 = arith.addi %915, %918 : i64
llvm.store %917, %590 : i64, !llvm.ptr
cf.br ^bb118
^bb120:
%919 = arith.constant 0 : i32
%920 = arith.extsi %919 : i32 to i64
%921 = llvm.getelementptr %875[%541] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %920, %921 : i64, !llvm.ptr
%922 = arith.constant 0 : i32
%923 = arith.constant 0 : i32
%924 = arith.extsi %922 : i32 to i64
%925 = arith.extsi %923 : i32 to i64
%926 = llvm.getelementptr %884[%925] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %924, %926 : i64, !llvm.ptr
%927 = arith.trunci %541 : i64 to i32
%928 = arith.constant 0 : i32
%929 = arith.extsi %928 : i32 to i64
%930 = llvm.getelementptr %890[%929] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %927, %930 : i32, !llvm.ptr
%931 = arith.constant 1 : i32
%932 = arith.extsi %931 : i32 to i64
%933 = llvm.mlir.constant(1 : i64) : i64
%934 = llvm.alloca %933 x i64 : (i64) -> !llvm.ptr
llvm.store %932, %934 : i64, !llvm.ptr
cf.br ^bb121
^bb121:
%935 = llvm.load %934 : !llvm.ptr -> i64
%936 = arith.constant 0 : i32
%938 = arith.extsi %936 : i32 to i64
%937 = arith.cmpi sgt, %935, %938 : i64
cf.cond_br %937, ^bb122, ^bb123
^bb122:
%940 = arith.constant 0 : i32
%941 = arith.extsi %940 : i32 to i64
%942 = llvm.getelementptr %884[%941] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%939 = llvm.load %942 : !llvm.ptr -> i64
%944 = arith.constant 0 : i32
%945 = arith.extsi %944 : i32 to i64
%946 = llvm.getelementptr %890[%945] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%943 = llvm.load %946 : !llvm.ptr -> i32
%947 = arith.extsi %943 : i32 to i64
%948 = llvm.load %934 : !llvm.ptr -> i64
%949 = arith.constant 1 : i32
%951 = arith.extsi %949 : i32 to i64
%950 = arith.subi %948, %951 : i64
llvm.store %950, %934 : i64, !llvm.ptr
%952 = llvm.load %934 : !llvm.ptr -> i64
%953 = arith.constant 0 : i32
%955 = arith.extsi %953 : i32 to i64
%954 = arith.cmpi sgt, %952, %955 : i64
cf.cond_br %954, ^bb124, ^bb125
^bb124:
%957 = llvm.load %934 : !llvm.ptr -> i64
%958 = llvm.getelementptr %884[%957] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%956 = llvm.load %958 : !llvm.ptr -> i64
%959 = arith.constant 0 : i32
%960 = arith.extsi %959 : i32 to i64
%961 = llvm.getelementptr %884[%960] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %956, %961 : i64, !llvm.ptr
%963 = llvm.load %934 : !llvm.ptr -> i64
%964 = llvm.getelementptr %890[%963] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%962 = llvm.load %964 : !llvm.ptr -> i32
%965 = arith.constant 0 : i32
%966 = arith.extsi %965 : i32 to i64
%967 = llvm.getelementptr %890[%966] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %962, %967 : i32, !llvm.ptr
%968 = arith.constant 0 : i32
%969 = arith.extsi %968 : i32 to i64
%970 = llvm.mlir.constant(1 : i64) : i64
%971 = llvm.alloca %970 x i64 : (i64) -> !llvm.ptr
llvm.store %969, %971 : i64, !llvm.ptr
cf.br ^bb127
^bb127:
%972 = arith.constant 1 : i1
cf.cond_br %972, ^bb128, ^bb129
^bb128:
%973 = arith.constant 2 : i32
%974 = llvm.load %971 : !llvm.ptr -> i64
%976 = arith.extsi %973 : i32 to i64
%975 = arith.muli %976, %974 : i64
%977 = arith.constant 1 : i32
%979 = arith.extsi %977 : i32 to i64
%978 = arith.addi %975, %979 : i64
%980 = arith.constant 1 : i32
%982 = arith.extsi %980 : i32 to i64
%981 = arith.addi %978, %982 : i64
%983 = llvm.load %971 : !llvm.ptr -> i64
%984 = llvm.mlir.constant(1 : i64) : i64
%985 = llvm.alloca %984 x i64 : (i64) -> !llvm.ptr
llvm.store %983, %985 : i64, !llvm.ptr
%986 = llvm.load %934 : !llvm.ptr -> i64
%987 = arith.cmpi slt, %978, %986 : i64
%988 = scf.if %987 -> (i1) {
%990 = llvm.getelementptr %884[%978] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%989 = llvm.load %990 : !llvm.ptr -> i64
%992 = llvm.load %985 : !llvm.ptr -> i64
%993 = llvm.getelementptr %884[%992] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%991 = llvm.load %993 : !llvm.ptr -> i64
%994 = arith.cmpi slt, %989, %991 : i64
scf.yield %994 : i1
} else {
%995 = arith.constant false
scf.yield %995 : i1
}
cf.cond_br %988, ^bb130, ^bb131
^bb130:
llvm.store %978, %985 : i64, !llvm.ptr
cf.br ^bb132
^bb131:
cf.br ^bb132
^bb132:
%996 = llvm.load %934 : !llvm.ptr -> i64
%997 = arith.cmpi slt, %981, %996 : i64
%998 = scf.if %997 -> (i1) {
%1000 = llvm.getelementptr %884[%981] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%999 = llvm.load %1000 : !llvm.ptr -> i64
%1002 = llvm.load %985 : !llvm.ptr -> i64
%1003 = llvm.getelementptr %884[%1002] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1001 = llvm.load %1003 : !llvm.ptr -> i64
%1004 = arith.cmpi slt, %999, %1001 : i64
scf.yield %1004 : i1
} else {
%1005 = arith.constant false
scf.yield %1005 : i1
}
cf.cond_br %998, ^bb133, ^bb134
^bb133:
llvm.store %981, %985 : i64, !llvm.ptr
cf.br ^bb135
^bb134:
cf.br ^bb135
^bb135:
%1006 = llvm.load %985 : !llvm.ptr -> i64
%1007 = llvm.load %971 : !llvm.ptr -> i64
%1008 = arith.cmpi eq, %1006, %1007 : i64
cf.cond_br %1008, ^bb136, ^bb137
^bb136:
cf.br ^bb129
^bb137:
cf.br ^bb138
^bb138:
%1010 = llvm.load %971 : !llvm.ptr -> i64
%1011 = llvm.getelementptr %884[%1010] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1009 = llvm.load %1011 : !llvm.ptr -> i64
%1013 = llvm.load %971 : !llvm.ptr -> i64
%1014 = llvm.getelementptr %890[%1013] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1012 = llvm.load %1014 : !llvm.ptr -> i32
%1016 = llvm.load %985 : !llvm.ptr -> i64
%1017 = llvm.getelementptr %884[%1016] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1015 = llvm.load %1017 : !llvm.ptr -> i64
%1018 = llvm.load %971 : !llvm.ptr -> i64
%1019 = llvm.getelementptr %884[%1018] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1015, %1019 : i64, !llvm.ptr
%1021 = llvm.load %985 : !llvm.ptr -> i64
%1022 = llvm.getelementptr %890[%1021] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1020 = llvm.load %1022 : !llvm.ptr -> i32
%1023 = llvm.load %971 : !llvm.ptr -> i64
%1024 = llvm.getelementptr %890[%1023] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1020, %1024 : i32, !llvm.ptr
%1025 = llvm.load %985 : !llvm.ptr -> i64
%1026 = llvm.getelementptr %884[%1025] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1009, %1026 : i64, !llvm.ptr
%1027 = llvm.load %985 : !llvm.ptr -> i64
%1028 = llvm.getelementptr %890[%1027] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1012, %1028 : i32, !llvm.ptr
%1029 = llvm.load %985 : !llvm.ptr -> i64
llvm.store %1029, %971 : i64, !llvm.ptr
cf.br ^bb127
^bb129:
cf.br ^bb126
^bb125:
cf.br ^bb126
^bb126:
%1031 = llvm.getelementptr %875[%947] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1030 = llvm.load %1031 : !llvm.ptr -> i64
%1032 = arith.cmpi ne, %939, %1030 : i64
cf.cond_br %1032, ^bb139, ^bb140
^bb139:
cf.br ^bb121
^bb140:
cf.br ^bb141
^bb141:
%1034 = llvm.getelementptr %580[%947] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1033 = llvm.load %1034 : !llvm.ptr -> i32
%1035 = llvm.mlir.constant(1 : i64) : i64
%1036 = llvm.alloca %1035 x i32 : (i64) -> !llvm.ptr
llvm.store %1033, %1036 : i32, !llvm.ptr
cf.br ^bb142
^bb142:
%1037 = llvm.load %1036 : !llvm.ptr -> i32
%1038 = arith.constant 1 : i32
%1040 = arith.constant 0 : i32
%1039 = arith.subi %1040, %1038 : i32
%1041 = arith.cmpi ne, %1037, %1039 : i32
cf.cond_br %1041, ^bb143, ^bb144
^bb143:
%1043 = llvm.load %1036 : !llvm.ptr -> i32
%1044 = arith.extsi %1043 : i32 to i64
%1045 = llvm.getelementptr %568[%1044] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1042 = llvm.load %1045 : !llvm.ptr -> i32
%1046 = arith.constant 0 : i32
%1047 = arith.cmpi sgt, %1042, %1046 : i32
cf.cond_br %1047, ^bb145, ^bb146
^bb145:
%1049 = llvm.load %1036 : !llvm.ptr -> i32
%1050 = arith.extsi %1049 : i32 to i64
%1051 = llvm.getelementptr %565[%1050] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1048 = llvm.load %1051 : !llvm.ptr -> i32
%1052 = arith.extsi %1048 : i32 to i64
%1054 = llvm.load %1036 : !llvm.ptr -> i32
%1055 = arith.extsi %1054 : i32 to i64
%1056 = llvm.getelementptr %571[%1055] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1053 = llvm.load %1056 : !llvm.ptr -> i32
%1057 = arith.extsi %1053 : i32 to i64
%1058 = arith.addi %939, %1057 : i64
%1060 = llvm.getelementptr %872[%947] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1059 = llvm.load %1060 : !llvm.ptr -> i64
%1061 = arith.addi %1058, %1059 : i64
%1063 = llvm.getelementptr %872[%1052] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1062 = llvm.load %1063 : !llvm.ptr -> i64
%1064 = arith.subi %1061, %1062 : i64
%1066 = llvm.getelementptr %875[%1052] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1065 = llvm.load %1066 : !llvm.ptr -> i64
%1067 = arith.cmpi slt, %1064, %1065 : i64
cf.cond_br %1067, ^bb148, ^bb149
^bb148:
%1068 = llvm.getelementptr %875[%1052] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1064, %1068 : i64, !llvm.ptr
%1069 = arith.trunci %947 : i64 to i32
%1070 = llvm.getelementptr %878[%1052] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1069, %1070 : i32, !llvm.ptr
%1071 = llvm.load %1036 : !llvm.ptr -> i32
%1072 = llvm.getelementptr %881[%1052] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1071, %1072 : i32, !llvm.ptr
%1073 = llvm.load %934 : !llvm.ptr -> i64
%1074 = llvm.mlir.constant(1 : i64) : i64
%1075 = llvm.alloca %1074 x i64 : (i64) -> !llvm.ptr
llvm.store %1073, %1075 : i64, !llvm.ptr
%1076 = llvm.load %1075 : !llvm.ptr -> i64
%1077 = llvm.getelementptr %884[%1076] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1064, %1077 : i64, !llvm.ptr
%1078 = arith.trunci %1052 : i64 to i32
%1079 = llvm.load %1075 : !llvm.ptr -> i64
%1080 = llvm.getelementptr %890[%1079] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1078, %1080 : i32, !llvm.ptr
%1081 = llvm.load %934 : !llvm.ptr -> i64
%1082 = arith.constant 1 : i32
%1084 = arith.extsi %1082 : i32 to i64
%1083 = arith.addi %1081, %1084 : i64
llvm.store %1083, %934 : i64, !llvm.ptr
cf.br ^bb151
^bb151:
%1085 = llvm.load %1075 : !llvm.ptr -> i64
%1086 = arith.constant 0 : i32
%1088 = arith.extsi %1086 : i32 to i64
%1087 = arith.cmpi sgt, %1085, %1088 : i64
cf.cond_br %1087, ^bb152, ^bb153
^bb152:
%1089 = llvm.load %1075 : !llvm.ptr -> i64
%1090 = arith.constant 1 : i32
%1092 = arith.extsi %1090 : i32 to i64
%1091 = arith.subi %1089, %1092 : i64
%1093 = arith.constant 2 : i32
%1095 = arith.extsi %1093 : i32 to i64
%1094 = arith.divsi %1091, %1095 : i64
%1097 = llvm.getelementptr %884[%1094] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1096 = llvm.load %1097 : !llvm.ptr -> i64
%1099 = llvm.load %1075 : !llvm.ptr -> i64
%1100 = llvm.getelementptr %884[%1099] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1098 = llvm.load %1100 : !llvm.ptr -> i64
%1101 = arith.cmpi sle, %1096, %1098 : i64
cf.cond_br %1101, ^bb154, ^bb155
^bb154:
cf.br ^bb153
^bb155:
cf.br ^bb156
^bb156:
%1103 = llvm.getelementptr %884[%1094] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1102 = llvm.load %1103 : !llvm.ptr -> i64
%1105 = llvm.getelementptr %890[%1094] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1104 = llvm.load %1105 : !llvm.ptr -> i32
%1107 = llvm.load %1075 : !llvm.ptr -> i64
%1108 = llvm.getelementptr %884[%1107] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1106 = llvm.load %1108 : !llvm.ptr -> i64
%1109 = llvm.getelementptr %884[%1094] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1106, %1109 : i64, !llvm.ptr
%1111 = llvm.load %1075 : !llvm.ptr -> i64
%1112 = llvm.getelementptr %890[%1111] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1110 = llvm.load %1112 : !llvm.ptr -> i32
%1113 = llvm.getelementptr %890[%1094] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1110, %1113 : i32, !llvm.ptr
%1114 = llvm.load %1075 : !llvm.ptr -> i64
%1115 = llvm.getelementptr %884[%1114] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1102, %1115 : i64, !llvm.ptr
%1116 = llvm.load %1075 : !llvm.ptr -> i64
%1117 = llvm.getelementptr %890[%1116] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1104, %1117 : i32, !llvm.ptr
llvm.store %1094, %1075 : i64, !llvm.ptr
cf.br ^bb151
^bb153:
cf.br ^bb150
^bb149:
cf.br ^bb150
^bb150:
cf.br ^bb147
^bb146:
cf.br ^bb147
^bb147:
%1119 = llvm.load %1036 : !llvm.ptr -> i32
%1120 = arith.extsi %1119 : i32 to i64
%1121 = llvm.getelementptr %577[%1120] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1118 = llvm.load %1121 : !llvm.ptr -> i32
llvm.store %1118, %1036 : i32, !llvm.ptr
cf.br ^bb142
^bb144:
cf.br ^bb121
^bb123:
%1123 = llvm.getelementptr %875[%547] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1122 = llvm.load %1123 : !llvm.ptr -> i64
%1124 = arith.cmpi sge, %1122, %897 : i64
cf.cond_br %1124, ^bb157, ^bb158
^bb157:
cf.br ^bb117
^bb158:
cf.br ^bb159
^bb159:
%1125 = arith.constant 0 : i32
%1126 = arith.extsi %1125 : i32 to i64
llvm.store %1126, %590 : i64, !llvm.ptr
cf.br ^bb160
^bb160:
%1127 = llvm.load %590 : !llvm.ptr -> i64
%1128 = arith.cmpi slt, %1127, %549 : i64
cf.cond_br %1128, ^bb161, ^bb162
^bb161:
%1130 = llvm.load %590 : !llvm.ptr -> i64
%1131 = llvm.getelementptr %875[%1130] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1129 = llvm.load %1131 : !llvm.ptr -> i64
%1132 = arith.cmpi slt, %1129, %897 : i64
cf.cond_br %1132, ^bb163, ^bb164
^bb163:
%1134 = llvm.load %590 : !llvm.ptr -> i64
%1135 = llvm.getelementptr %872[%1134] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1133 = llvm.load %1135 : !llvm.ptr -> i64
%1137 = llvm.load %590 : !llvm.ptr -> i64
%1138 = llvm.getelementptr %875[%1137] : (!llvm.ptr, i64) -> !llvm.ptr, i64
%1136 = llvm.load %1138 : !llvm.ptr -> i64
%1139 = arith.addi %1133, %1136 : i64
%1140 = llvm.load %590 : !llvm.ptr -> i64
%1141 = llvm.getelementptr %872[%1140] : (!llvm.ptr, i64) -> !llvm.ptr, i64
llvm.store %1139, %1141 : i64, !llvm.ptr
cf.br ^bb165
^bb164:
cf.br ^bb165
^bb165:
%1142 = llvm.load %590 : !llvm.ptr -> i64
%1143 = arith.constant 1 : i32
%1145 = arith.extsi %1143 : i32 to i64
%1144 = arith.addi %1142, %1145 : i64
llvm.store %1144, %590 : i64, !llvm.ptr
cf.br ^bb160
^bb162:
%1146 = llvm.load %901 : !llvm.ptr -> i64
%1147 = arith.subi %906, %1146 : i64
%1148 = llvm.mlir.constant(1 : i64) : i64
%1149 = llvm.alloca %1148 x i64 : (i64) -> !llvm.ptr
llvm.store %1147, %1149 : i64, !llvm.ptr
%1150 = llvm.mlir.constant(1 : i64) : i64
%1151 = llvm.alloca %1150 x i64 : (i64) -> !llvm.ptr
llvm.store %547, %1151 : i64, !llvm.ptr
cf.br ^bb166
^bb166:
%1152 = llvm.load %1151 : !llvm.ptr -> i64
%1153 = arith.cmpi ne, %1152, %541 : i64
cf.cond_br %1153, ^bb167, ^bb168
^bb167:
%1155 = llvm.load %1151 : !llvm.ptr -> i64
%1156 = llvm.getelementptr %878[%1155] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1154 = llvm.load %1156 : !llvm.ptr -> i32
%1157 = arith.extsi %1154 : i32 to i64
%1159 = llvm.load %1151 : !llvm.ptr -> i64
%1160 = llvm.getelementptr %881[%1159] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1158 = llvm.load %1160 : !llvm.ptr -> i32
%1161 = arith.extsi %1158 : i32 to i64
%1163 = llvm.getelementptr %568[%1161] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1162 = llvm.load %1163 : !llvm.ptr -> i32
%1164 = arith.extsi %1162 : i32 to i64
%1165 = llvm.load %1149 : !llvm.ptr -> i64
%1166 = arith.cmpi slt, %1164, %1165 : i64
cf.cond_br %1166, ^bb169, ^bb170
^bb169:
%1168 = llvm.getelementptr %568[%1161] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1167 = llvm.load %1168 : !llvm.ptr -> i32
%1169 = arith.extsi %1167 : i32 to i64
llvm.store %1169, %1149 : i64, !llvm.ptr
cf.br ^bb171
^bb170:
cf.br ^bb171
^bb171:
llvm.store %1157, %1151 : i64, !llvm.ptr
cf.br ^bb166
^bb168:
llvm.store %547, %1151 : i64, !llvm.ptr
cf.br ^bb172
^bb172:
%1170 = llvm.load %1151 : !llvm.ptr -> i64
%1171 = arith.cmpi ne, %1170, %541 : i64
cf.cond_br %1171, ^bb173, ^bb174
^bb173:
%1173 = llvm.load %1151 : !llvm.ptr -> i64
%1174 = llvm.getelementptr %878[%1173] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1172 = llvm.load %1174 : !llvm.ptr -> i32
%1175 = arith.extsi %1172 : i32 to i64
%1177 = llvm.load %1151 : !llvm.ptr -> i64
%1178 = llvm.getelementptr %881[%1177] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1176 = llvm.load %1178 : !llvm.ptr -> i32
%1179 = arith.extsi %1176 : i32 to i64
%1181 = llvm.getelementptr %568[%1179] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1180 = llvm.load %1181 : !llvm.ptr -> i32
%1182 = arith.extsi %1180 : i32 to i64
%1183 = llvm.load %1149 : !llvm.ptr -> i64
%1184 = arith.subi %1182, %1183 : i64
%1185 = arith.trunci %1184 : i64 to i32
%1186 = llvm.getelementptr %568[%1179] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1185, %1186 : i32, !llvm.ptr
%1188 = llvm.getelementptr %574[%1179] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1187 = llvm.load %1188 : !llvm.ptr -> i32
%1189 = arith.extsi %1187 : i32 to i64
%1191 = llvm.getelementptr %568[%1189] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1190 = llvm.load %1191 : !llvm.ptr -> i32
%1192 = arith.extsi %1190 : i32 to i64
%1193 = llvm.load %1149 : !llvm.ptr -> i64
%1194 = arith.addi %1192, %1193 : i64
%1195 = arith.trunci %1194 : i64 to i32
%1196 = llvm.getelementptr %568[%1189] : (!llvm.ptr, i64) -> !llvm.ptr, i32
llvm.store %1195, %1196 : i32, !llvm.ptr
%1197 = llvm.load %905 : !llvm.ptr -> i64
%1198 = llvm.load %1149 : !llvm.ptr -> i64
%1200 = llvm.getelementptr %571[%1179] : (!llvm.ptr, i64) -> !llvm.ptr, i32
%1199 = llvm.load %1200 : !llvm.ptr -> i32
%1201 = arith.extsi %1199 : i32 to i64
%1202 = arith.muli %1198, %1201 : i64
%1203 = arith.addi %1197, %1202 : i64
llvm.store %1203, %905 : i64, !llvm.ptr
llvm.store %1175, %1151 : i64, !llvm.ptr
cf.br ^bb172
^bb174:
%1204 = llvm.load %901 : !llvm.ptr -> i64
%1205 = llvm.load %1149 : !llvm.ptr -> i64
%1206 = arith.addi %1204, %1205 : i64
llvm.store %1206, %901 : i64, !llvm.ptr
cf.br ^bb115
^bb117:
%1207 = llvm.load %294 : !llvm.ptr -> i64
%1208 = arith.muli %539, %1207 : i64
%1209 = llvm.load %905 : !llvm.ptr -> i64
%1210 = arith.subi %1208, %1209 : i64
%1211 = llvm.mlir.addressof @str_0 : !llvm.ptr
%1212 = llvm.load %253 : !llvm.ptr -> i64
%1213 = arith.addi %1212, %1210 : i64
%1214 = llvm.call @printf(%1211, %1213) vararg(!llvm.func<i32 (ptr, ...)>) : (!llvm.ptr, i64) -> i32
%1215 = arith.constant 0 : i32
func.return %1215 : i32
}
}